don't allow commands to be played in nil games
This commit is contained in:
parent
a4227c9728
commit
2073b4d1f0
@ -98,6 +98,13 @@ func (c *Coordinator) Coordinate(cmd *SessionCommand) *SessionCommandResult {
|
|||||||
Result: SessionRespLeft,
|
Result: SessionRespLeft,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.Game == nil {
|
||||||
|
return &SessionCommandResult{
|
||||||
|
ID: cmd.ID,
|
||||||
|
MatchID: m.ID,
|
||||||
|
Result: SessionRespError,
|
||||||
|
}
|
||||||
|
}
|
||||||
resp := m.Play(cmd.ID, cmd.GameCommand)
|
resp := m.Play(cmd.ID, cmd.GameCommand)
|
||||||
return &SessionCommandResult{
|
return &SessionCommandResult{
|
||||||
ID: cmd.ID,
|
ID: cmd.ID,
|
||||||
|
Loading…
Reference in New Issue
Block a user