Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Use unreliable events
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleitnick committed Nov 30, 2023
1 parent 6a12f89 commit 9c1fd92
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
name: Styling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: v0.18.2
version: v0.19.1
args: --check ./src
2 changes: 1 addition & 1 deletion aftman.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tools = { rojo = "rojo-rbx/[email protected]" , wally = "UpliftGames/[email protected]" , selene = "Kampfkarren/selene@0.25.0" , stylua = "JohnnyMorganz/StyLua@0.18.2" , remodel = "rojo-rbx/[email protected]" }
tools = { rojo = "rojo-rbx/[email protected]" , wally = "UpliftGames/[email protected]" , selene = "Kampfkarren/selene@0.26.1" , stylua = "JohnnyMorganz/StyLua@0.19.1" , remodel = "rojo-rbx/[email protected]" }
16 changes: 15 additions & 1 deletion src/KnitServer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ getmetatable(SIGNAL_MARKER).__tostring = function()
return "SIGNAL_MARKER"
end

local UNRELIABLE_SIGNAL_MARKER = newproxy(true)
getmetatable(UNRELIABLE_SIGNAL_MARKER).__tostring = function()
return "UNRELIABLE_SIGNAL_MARKER"
end

local PROPERTY_MARKER = newproxy(true)
getmetatable(PROPERTY_MARKER).__tostring = function()
return "PROPERTY_MARKER"
Expand Down Expand Up @@ -262,6 +267,13 @@ function KnitServer.CreateSignal()
return SIGNAL_MARKER
end

--[=[
DOCS TODO
]=]
function KnitServer.CreateUnreliableSignal()
return SIGNAL_UNRELIABLE_MARKER
end

--[=[
@return PROPERTY_MARKER
Returns a marker that will transform the current key into
Expand Down Expand Up @@ -361,7 +373,9 @@ function KnitServer.Start(options: KnitOptions?)
if type(v) == "function" then
service.KnitComm:WrapMethod(service.Client, k, inbound, outbound)
elseif v == SIGNAL_MARKER then
service.Client[k] = service.KnitComm:CreateSignal(k, inbound, outbound)
service.Client[k] = service.KnitComm:CreateSignal(k, false, inbound, outbound)
elseif v == UNRELIABLE_SIGNAL_MARKER then
service.Client[k] = service.KnitComm:CreateSignal(k, true, inbound, outbound)
elseif type(v) == "table" and v[1] == PROPERTY_MARKER then
service.Client[k] = service.KnitComm:CreateProperty(k, v[2], inbound, outbound)
end
Expand Down
4 changes: 2 additions & 2 deletions src/wally.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "sleitnick/knit"
description = "Knit is a lightweight game framework"
version = "1.5.3"
version = "1.6.0"
license = "MIT"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"

[dependencies]
Comm = "sleitnick/comm@^0.3"
Comm = "sleitnick/comm@^1"
Promise = "evaera/promise@^4"
4 changes: 2 additions & 2 deletions src/wally_bundle.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"

[dependencies]
Comm = "sleitnick/comm@^0.3"
Comm = "sleitnick/comm@^1"
Component = "sleitnick/component@^2"
EnumList = "sleitnick/enum-list@^2"
Input = "sleitnick/input@^2"
Option = "sleitnick/option@^1"
Signal = "sleitnick/signal@^1"
Signal = "sleitnick/signal@^2"
Streamable = "sleitnick/streamable@^1"
TableUtil = "sleitnick/table-util@^1"
Timer = "sleitnick/timer@^1"
Expand Down

0 comments on commit 9c1fd92

Please sign in to comment.