mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 07:52:28 +00:00
feat(multiplayer): harden ranked arena admission
This commit is contained in:
@@ -53,16 +53,16 @@ func TestPrepareProposalRejectsInvalidRankedMetadataAndAcceptsVerifiedSix(t *tes
|
||||
for i, player := range formation.Selection.Players {
|
||||
participants[i] = RankedParticipant{PlayerID: player.PlayerID, SteamID: "steam-" + player.PlayerID}
|
||||
}
|
||||
if _, err := PrepareProposal("proposal-ranked-123456", Ranked, formation, participants, RankedArena{RandomEnabled: true}, time.Unix(1000, 0)); err != nil {
|
||||
if _, err := PrepareProposal("proposal-ranked-123456", Ranked, formation, participants, DefaultRankedArena(), time.Unix(1000, 0)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
participants[0].IsBot = true
|
||||
if _, err := PrepareProposal("proposal-ranked-654321", Ranked, formation, participants, RankedArena{RandomEnabled: true}, time.Unix(1000, 0)); err == nil {
|
||||
if _, err := PrepareProposal("proposal-ranked-654321", Ranked, formation, participants, DefaultRankedArena(), time.Unix(1000, 0)); err == nil {
|
||||
t.Fatal("ranked bot metadata accepted")
|
||||
}
|
||||
participants[0].IsBot = false
|
||||
participants[0].PlayerID = "unknown"
|
||||
if _, err := PrepareProposal("proposal-ranked-000000", Ranked, formation, participants, RankedArena{RandomEnabled: true}, time.Unix(1000, 0)); err == nil {
|
||||
if _, err := PrepareProposal("proposal-ranked-000000", Ranked, formation, participants, DefaultRankedArena(), time.Unix(1000, 0)); err == nil {
|
||||
t.Fatal("ranked unknown player metadata accepted")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user