Remove /spawn POST endpoint

This was increasing complexity for no added benefit

	/register now performs the spawn in 4 lines of code
This commit is contained in:
Marc Di Luzio 2020-06-10 18:48:56 +01:00
parent 6fb7ee598d
commit b3b369f608
6 changed files with 4 additions and 147 deletions

View file

@ -21,7 +21,6 @@ func Usage() {
fmt.Fprintln(os.Stderr, "\nCommands:")
fmt.Fprintln(os.Stderr, "\tstatus \tprints the server status")
fmt.Fprintln(os.Stderr, "\tregister\tregisters an account and stores it (use with -name)")
fmt.Fprintln(os.Stderr, "\tspawn \tspawns a rover for the current account")
fmt.Fprintln(os.Stderr, "\tmove \tissues move command to rover")
fmt.Fprintln(os.Stderr, "\tradar \tgathers radar data for the current rover")
fmt.Fprintln(os.Stderr, "\trover \tgets data for current rover")
@ -129,23 +128,6 @@ func InnerMain(command string) error {
fmt.Printf("Registered account with id: %s\n", response.Id)
config.Accounts[config.Host] = response.Id
}
case "spawn":
d := rove.SpawnData{}
if err := verifyId(account); err != nil {
return err
}
response, err := server.Spawn(account, d)
switch {
case err != nil:
return err
case !response.Success:
return fmt.Errorf("Server returned failure: %s", response.Error)
default:
fmt.Printf("Spawned rover with attributes %+v\n", response.Attributes)
}
case "move":
d := rove.CommandData{