Skip to content

Commit

Permalink
Update readmes for v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwonz committed Oct 28, 2024
1 parent 32ded61 commit 07d805e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pesde add caveful_games/handynet
```

### Differences from ByteNet
- (From `v0.3.0`) Don't have to write a function when defining namespace.
- (From `v0.2.0`) Due to the dynamic typing of `HandyNet.send`, it can theoretically be slightly slower than `ByteNet.sendTo` and `ByteNet.sendToAll` on the server. (It is more simple and more type-safe and removes the need for `Namespace.server` and `Namespace.client`, except in cases where the player argument is used on the client.)
- (From `v0.2.0`) `Packet`s are one directional.
- (From `v0.2.1`) Packet definitions can be nested for labeling purpose.
Expand All @@ -30,20 +31,18 @@ pesde add caveful_games/handynet
```lua
-- packets.luau

return HandyNet.defineNamespace("example", function()
return {
hello = HandyNet.definePacket(
"client->server",
HandyNet.struct({
message = HandyNet.string(HandyNet.u8), -- Customizable string size (defaults to u16)
cf = HandyNet.CFrame, -- Uses quaternion to compress!
enum = HandyNet.Enum.KeyCode :: Enum.KeyCode -- Weird type error with enums..
})
-- default: "reliable"
),
countUp = HandyNet.defineEvent("unreliable")
}
end)
return HandyNet.defineNamespace("example", {
hello = HandyNet.definePacket(
"client->server",
HandyNet.struct({
message = HandyNet.string(HandyNet.u8), -- Customizable string size (defaults to u16)
cf = HandyNet.CFrame, -- Uses quaternion to compress!
enum = HandyNet.Enum.KeyCode :: Enum.KeyCode -- Weird type error with enums..
})
-- default: "reliable"
),
countUp = HandyNet.defineEvent("unreliable")
})
```

```lua
Expand Down
1 change: 1 addition & 0 deletions README_kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pesde add caveful_games/handynet
```

### ByteNet과 차이점
- (`v0.3.0` 부터) 네임스페이스를 정의할 때 더 이상 함수를 작성하지 않아도 됩니다.
- (`v0.2.0` 부터) `HandyNet.send`의 다이나믹 타입으로 인하여 이론적으로 서버에서의 `ByteNet.sendTo``ByteNet.sendToAll`보다 조금 느릴 수 있습니다. (대신 심플하고 클라이언트에서 플레이어 인수를 사용하는 상황 제외 조금 더 타입에 안전하며 `Namespace.server`, `Namespace.client`가 필요없어졌습니다. -> 적어진 메모리 사용량)
- (`v0.2.0` 부터) 패킷은 단방향으로 보내야합니다. (`"server->client"`, `"client->server"`)
- (`v0.2.1` 부터) 네스팅된 패킷 정의가 가능합니다.
Expand Down
2 changes: 1 addition & 1 deletion pesde.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#:schema https://raw.githubusercontent.com/jiwonz/pesde-schema/refs/heads/0.5/schema/generated/pesde.json
name = "caveful_games/handynet"
version = "0.2.4"
version = "0.3.0"
description = "ByteNet fork made more handy"
authors = ["ffrostfall", "jiwonz"]
repository = "https://github.com/CavefulGames/HandyNet"
Expand Down

0 comments on commit 07d805e

Please sign in to comment.