Skip to content

Manual packet fragmentation #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 63 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a9ee35a
Early draft [skip ci]
Shatur Dec 4, 2023
fb8ce9f
Fix tests
Shatur Dec 4, 2023
56fb26c
Update changelog
Shatur Dec 5, 2023
77e8e18
Remove trackers
Shatur Dec 5, 2023
388a542
Apply formatting
Shatur Dec 5, 2023
c204fb0
Add test and fix discovered issues
Shatur Dec 5, 2023
b1d4265
Refactor working with ticks
Shatur Dec 5, 2023
1a39f0f
Fix clippy
Shatur Dec 5, 2023
86bd689
Fix splitting logic
Shatur Dec 5, 2023
7a99595
Undo diagnostics changes
Shatur Dec 5, 2023
689cacd
Update deny.toml
Shatur Dec 5, 2023
9ec9ef2
Update docs
Shatur Dec 5, 2023
9bf14bc
Trigger change detection to fully cover diagnostics
Shatur Dec 6, 2023
34cff3f
Add test for update replication buffering and fix the discovered bug
Shatur Dec 6, 2023
cbf0116
Refactor event queue test in similar way to test more
Shatur Dec 6, 2023
7408bf9
Use tick from the message when apply an update from buffer
Shatur Dec 6, 2023
58b6592
Store replicon tick inside update message too
Shatur Dec 7, 2023
bbf5db4
Do not store position in buffered update
Shatur Dec 7, 2023
8014108
Drop extra retain buffer
Shatur Dec 8, 2023
ce9e7e4
Remove wrong comment
Shatur Dec 8, 2023
33669b3
Hide `ServerEntityTicks` from public API
Shatur Dec 9, 2023
6a0d92b
If there is any insertion, include all updates into init message
Shatur Dec 9, 2023
61d8d46
Properly disconnect the client to cover this case
Shatur Dec 9, 2023
9af3e8c
Remove extra check
Shatur Dec 9, 2023
1566c3a
Update tracing messages
Shatur Dec 9, 2023
6939114
Panic if update references a non-spawned entity
Shatur Dec 9, 2023
d2bed64
Fix comment
Shatur Dec 9, 2023
b711ab6
Reverse condition
Shatur Dec 9, 2023
af8ec14
Fix replication buffer slicing
Shatur Dec 9, 2023
6aeed9f
Update docks
Shatur Dec 9, 2023
ccf9c9c
Compare ticks before acknowledgment
Shatur Dec 11, 2023
0c5c3e7
Simplify logic
Shatur Dec 11, 2023
6e440e2
Rephrase panic message
Shatur Dec 11, 2023
169296d
Apply suggested docs
Shatur Dec 13, 2023
ab3387b
Use while instead of loop
Shatur Dec 13, 2023
1b2c7c4
Move buffered updates into resource to be able to reset them
Shatur Dec 13, 2023
7a5510f
Remove extra map lookup
Shatur Dec 13, 2023
c21f454
Use more correct check
Shatur Dec 13, 2023
e5f428c
Add debug assertion
Shatur Dec 13, 2023
d961f36
Fix wrong condition
Shatur Dec 13, 2023
9e24aba
Apply docs suggestion
Shatur Dec 15, 2023
b262977
Get messages for fist client instead of last
Shatur Dec 15, 2023
a706c4b
Move replication buffer into a server submodule
Shatur Dec 15, 2023
65240e3
Improve group strategy and test it properly
Shatur Dec 15, 2023
16e3c18
Add `is_sendable` helpers
Shatur Dec 15, 2023
ded251e
Apply clippy suggestion and update description
Shatur Dec 15, 2023
d0a2459
bug fix: client should skip component updates that aren't needed
UkoeHB Dec 16, 2023
9268d99
Refactor component writing
Shatur Dec 16, 2023
e396693
Refactor applying on client
Shatur Dec 16, 2023
e215ba2
Add test
Shatur Dec 16, 2023
eba3366
Fix message packing
Shatur Dec 16, 2023
bef9b1a
Refactor connection handling
Shatur Dec 16, 2023
9a5a349
Apply docs suggestions
Shatur Dec 16, 2023
0fde075
Reuse memory for entities
Shatur Dec 16, 2023
305569b
Clarify events despawned entities
Shatur Dec 16, 2023
d7b27e3
Fix old entities replication
Shatur Dec 16, 2023
a06da4e
Move update replication tests after init tests
Shatur Dec 16, 2023
5e58ac0
Move clients info into a separate module
Shatur Dec 16, 2023
9becc14
Apply doc suggestion
Shatur Dec 16, 2023
4612fea
Make systems dependent
Shatur Dec 16, 2023
7f923a3
Improve docs
Shatur Dec 16, 2023
6d2e80b
Keep memory for `ClientInfo`
Shatur Dec 16, 2023
7834cd8
fix typo
UkoeHB Dec 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- `TicksMap` with mapping from server ticks to system change ticks.

### Changed

- Send all component mappings, inserts, removals and despawns over reliable channel in form of deltas and component updates over unreliable channel packed by packet size. This significantly reduces the possibility of packet loss.
- Replace `REPLICATION_CHANNEL_ID` with `ReplicationChannel` enum. The previous constant corresponded to the unreliable channel.
- Server events use tick with the last change instead of waiting for replication message without changes.
- `TickPolicy::EveryFrame` and `TickPolicy::MaxTickRate` now increment tick only if `RenetServer` exists.
- `ServerSet::Send` now always runs. Replication sending system still runs on `RepliconTick` change.
- `ClientMapping` no longer contains `tick` field.
- Use `EntityHashMap` instead of `HashMap` with entities as keys.
- Use `Cursor<&[u8]>` instead of `Cursor<Bytes>`.
- Replace `LastRepliconTick` with `RepliconTick` on client.
- `AckedTicks` now returns the map via `deref` instead of via separate method.
- Fix missing reset of `RepliconTick` on server disconnect.
- Rename `replicate_into_scene` into `replicate_into` and move it to `scene` module.

### Removed

- `AckedTicks` resource.
- `TicksMap` resource.

## [0.17.0] - 2023-11-13

### Added
Expand Down
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ include = ["/benches", "/src", "/tests", "/LICENSE*"]

[dependencies]
bevy_renet = "0.0.10"
bevy = { version = "0.12", default-features = false, features = ["bevy_scene"] }
bevy = { version = "0.12.1", default-features = false, features = [
"bevy_scene",
] }
bincode = "1.3"
serde = "1.0"
varint-rs = "2.2"
Expand Down
5 changes: 5 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ allow-osi-fsf-free = "either"
multiple-versions = "deny"
wildcards = "allow"
skip = [
{ name = "async-channel", version = "1.9" },
{ name = "async-lock", version = "2.8" },
{ name = "bitflags", version = "2.0" },
{ name = "event-listener", version = "2.5" },
{ name = "fastrand", version = "1.9" },
{ name = "foreign-types", version = "0.3" },
{ name = "foreign-types-shared", version = "0.1" },
{ name = "futures-lite", version = "1.13" },
{ name = "hashbrown", version = "0.12" },
{ name = "indexmap", version = "1.0" },
{ name = "libloading", version = "0.7" },
Expand All @@ -26,6 +30,7 @@ skip = [
{ name = "regex-syntax", version = "0.7" },
{ name = "syn", version = "1.0" },
{ name = "toml_edit", version = "0.19" },
{ name = "tracing-log", version = "0.1" },
{ name = "windows", version = "0.44" },
{ name = "windows-sys", version = "0.45" },
{ name = "windows-targets", version = "0.42" },
Expand Down
Loading