Implement a command queue on the world

Not currently executed
This commit is contained in:
Marc Di Luzio 2020-06-06 14:44:59 +01:00
parent e3ce87e964
commit 0a0a32cf58
6 changed files with 120 additions and 15 deletions

View file

@ -146,7 +146,7 @@ func HandleCommand(s *Server, vars map[string]string, b io.ReadCloser, w io.Writ
} else if inst, err := s.accountant.GetRover(id); err != nil {
response.Error = fmt.Sprintf("Provided account has no rover: %s", err)
} else if err := s.world.Execute(inst, data.Commands...); err != nil {
} else if err := s.world.Enqueue(inst, data.Commands...); err != nil {
response.Error = fmt.Sprintf("Failed to execute commands: %s", err)
} else {

View file

@ -114,7 +114,7 @@ func (s *Server) Initialise() (err error) {
}
// Addr will return the server address set after the listen
func (s Server) Addr() string {
func (s *Server) Addr() string {
return s.address
}