Refactor accounts to store a data map rather than just a rover ID

This commit is contained in:
Marc Di Luzio 2020-06-10 22:48:45 +01:00
parent 7749854eb7
commit 8f25f55658
4 changed files with 33 additions and 31 deletions

View file

@ -289,7 +289,7 @@ func (s *Server) SpawnRoverForAccount(account string) (game.RoverAttributes, uui
return game.RoverAttributes{}, uuid.UUID{}, fmt.Errorf("No attributes found for created rover: %s", err)
} else {
if err := s.accountant.AssignRover(account, inst); err != nil {
if err := s.accountant.AssignData(account, "rover", inst.String()); err != nil {
// Try and clear up the rover
if err := s.world.DestroyRover(inst); err != nil {
fmt.Printf("Failed to destroy rover after failed rover assign: %s", err)