Move server package out into rove-server

This commit is contained in:
Marc Di Luzio 2020-06-10 17:39:42 +01:00
parent 62d6213c1a
commit 6fb7ee598d
9 changed files with 27 additions and 41 deletions

View file

@ -294,8 +294,11 @@ func (w *World) Enqueue(rover uuid.UUID, commands ...Command) error {
defer w.cmdMutex.Unlock()
// Append the commands to the incoming set
cmds := w.Incoming[rover]
w.Incoming[rover] = append(cmds, commands...)
if cmds, ok := w.Incoming[rover]; ok {
w.Incoming[rover] = append(cmds, commands...)
} else {
w.Incoming[rover] = commands
}
return nil
}