| Filename | Latest commit message | Latest commit date |
|---|---|---|
R-AG. ReadLengthPrefixedFields tested pos + length > bytes.Length in int math; a length prefix near int.MaxValue overflowed the unchecked add, slipped past the guard, and Encoding.UTF8.GetString threw ArgumentOutOfRangeException instead of this method returning null the way every other malformed shape already does. Promotes to long before the add, which cannot itself overflow (both operands stay far under long's range), so the guard sees the true sum. CultNetRudpSchemaServer.DispatchAsync gains a catch around the handler invocation: HandleSnapshotRequestV1Async already answers cursor_invalid/selection_invalid/reference_outside_target for its three typed exceptions, but nothing stopped an untyped one from an unanticipated bug reaching DynamicInvoke's caller and stalling the poll loop for every other peer. Answers nothing on the wire (an exception this generic carries no typed refusal to report) and drops the one malformed dispatch, the same as an unregistered handler already does. Hostile-cursor tests (CultNetSelectionFixBatchTests.cs) feed CultNetSelectionCursor.Parse a length prefix near int.MaxValue (C#'s own proven overflow), near usize::MAX (Rust's proven overflow, fed here too per the ruling), wider than any integer type, and negative-looking - each asserted to throw the typed CultNetSelectionCursorException. R-AK. Deletes ReferenceMembers's `!member.IsReference` guard. CultCache.ReferencesOf (CultCache.cs:262-278) already searches only its own reference members for a role match and returns empty for anything else; index aliases are unique per descriptor, so a data member's own role string can never coincide with a reference member's. Verified before deleting: traced ReferencesOf's role lookup directly rather than trusting the ruling's premise. A second copy of the same exclusion here was duplicate authority, not a second decision. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
| .. | ||
| CultNetCanonicalNumberTests.cs | ||
| CultNetDocumentBindingResolverTests.cs | ||
| CultNetOperationServerTests.cs | ||
| CultNetSchemaContractTests.cs | ||
| CultNetSchemaServerGroupTests.cs | ||
| CultNetSelectionEvaluatorTests.cs | ||
| CultNetSelectionFixBatchTests.cs | ||
| CultNetSelectionPageTests.cs | ||
| CultNetSelectionSurvivorTests.cs | ||
| GameCult.Networking.Tests.csproj | ||
| MiniJsonSchemaValidator.cs | ||
| NetworkingTests.cs | ||
| README.md | ||
| SelectionParityVectorTests.cs | ||
GameCult.Networking.Tests
GameCult.Networking.Tests contains NUnit tests for the networking library.
Scope
The tests currently cover:
- AES-GCM encrypt/decrypt round-trips in
Secret - signed session-token validation
- signed session-token tamper detection
- signed session-token expiry handling
Run
dotnet test tests\GameCult.Networking.Tests\GameCult.Networking.Tests.csproj
Adding New Tests
Typical future areas to expand include:
- client reconnect and verify flows
- login and registration integration tests
- malformed message handling
- rate-limiting behavior under concurrency