mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(multiplayer): fence roster topology at persistence
This commit is contained in:
@@ -57,4 +57,14 @@ func TestSignedRosterRequiresCryptographicVerification(t *testing.T) {
|
||||
}); err != nil {
|
||||
t.Fatalf("valid signature rejected: %v", err)
|
||||
}
|
||||
wrongTeam := signed
|
||||
wrongTeam.Authorisation.Slot = 3
|
||||
wrongTeam.Authorisation.Team = 0
|
||||
if err := validateSignedRosterEntry(assignment, wrongTeam, func([]byte, []byte) bool { return true }); err == nil {
|
||||
t.Fatal("team/slot mismatch accepted")
|
||||
}
|
||||
duplicate := signed
|
||||
if err := SaveVerifiedAssignmentRoster(nil, nil, assignment, []domain.SignedJoinAuthorisation{signed, duplicate}, func([]byte, []byte) bool { return true }); err == nil {
|
||||
t.Fatal("duplicate roster player accepted")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user