Move the account registration into the world
This commit is contained in:
parent
6f2d67bd7c
commit
fdfcc88540
2 changed files with 1 additions and 13 deletions
|
@ -210,17 +210,5 @@ func (s *Server) SpawnRoverForAccount(account string) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.world.Accountant.AssignData(account, "rover", inst)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("Failed to assign rover to account, %s", err)
|
|
||||||
|
|
||||||
// Try and clear up the rover
|
|
||||||
if err := s.world.DestroyRover(inst); err != nil {
|
|
||||||
log.Printf("Failed to destroy rover after failed rover assign: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
return inst, nil
|
return inst, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ func (w *World) SpawnRover(account string) (string, error) {
|
||||||
// Append the rover to the list
|
// Append the rover to the list
|
||||||
w.Rovers[rover.Name] = rover
|
w.Rovers[rover.Name] = rover
|
||||||
|
|
||||||
return rover.Name, nil
|
return rover.Name, w.Accountant.AssignData(account, "rover", rover.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRover gets a specific rover by name
|
// GetRover gets a specific rover by name
|
||||||
|
|
Loading…
Add table
Reference in a new issue