diff --git a/cmd/rove-server/internal/routes.go b/cmd/rove-server/internal/routes.go index 393bf93..19a5fef 100644 --- a/cmd/rove-server/internal/routes.go +++ b/cmd/rove-server/internal/routes.go @@ -5,7 +5,6 @@ import ( "fmt" "log" - "github.com/mdiluz/rove/pkg/rove" "github.com/mdiluz/rove/pkg/version" "github.com/mdiluz/rove/proto/roveapi" ) @@ -76,31 +75,13 @@ func (s *Server) Status(ctx context.Context, req *roveapi.StatusRequest) (respon inv = append(inv, byte(i.Type)) } - i, q := s.world.RoverCommands(resp) + in, qu := s.world.RoverCommands(resp) var incoming, queued []*roveapi.Command - for _, i := range i { - c := &roveapi.Command{ - Command: i.Command, - } - switch i.Command { - case roveapi.CommandType_broadcast: - c.Data = &roveapi.Command_Message{ - Message: i.Message, - } - } - incoming = append(incoming, c) + for i := range in { + incoming = append(incoming, &in[i]) } - for _, q := range q { - c := &roveapi.Command{ - Command: q.Command, - } - switch q.Command { - case roveapi.CommandType_broadcast: - c.Data = &roveapi.Command_Message{ - Message: q.Message, - } - } - queued = append(queued, c) + for i := range qu { + queued = append(queued, &qu[i]) } var logs []*roveapi.Log for _, log := range rover.Logs { @@ -116,6 +97,7 @@ func (s *Server) Status(ctx context.Context, req *roveapi.StatusRequest) (respon X: int32(rover.Pos.X), Y: int32(rover.Pos.Y), }, + Bearing: rover.Bearing, Range: int32(rover.Range), Inventory: inv, Capacity: int32(rover.Capacity), @@ -125,6 +107,7 @@ func (s *Server) Status(ctx context.Context, req *roveapi.StatusRequest) (respon MaximumCharge: int32(rover.MaximumCharge), IncomingCommands: incoming, QueuedCommands: queued, + SailPosition: rover.SailPosition, Logs: logs, } } @@ -179,19 +162,7 @@ func (s *Server) Command(ctx context.Context, req *roveapi.CommandRequest) (*rov return nil, err } - var cmds []rove.Command - for _, c := range req.Commands { - n := rove.Command{ - Command: c.Command, - } - switch c.Command { - case roveapi.CommandType_broadcast: - n.Message = c.GetMessage() - } - cmds = append(cmds, n) - } - - if err := s.world.Enqueue(resp, cmds...); err != nil { + if err := s.world.Enqueue(resp, req.Commands...); err != nil { return nil, err } diff --git a/cmd/rove/main.go b/cmd/rove/main.go index 8d94106..51038a7 100644 --- a/cmd/rove/main.go +++ b/cmd/rove/main.go @@ -127,12 +127,20 @@ func BearingFromString(s string) roveapi.Bearing { switch s { case "N": return roveapi.Bearing_North + case "NE": + return roveapi.Bearing_NorthEast case "E": return roveapi.Bearing_East + case "SE": + return roveapi.Bearing_SouthEast case "S": return roveapi.Bearing_South + case "SW": + return roveapi.Bearing_SouthWest case "W": return roveapi.Bearing_West + case "NW": + return roveapi.Bearing_NorthWest } return roveapi.Bearing_BearingUnknown } @@ -224,6 +232,21 @@ func InnerMain(command string, args ...string) error { var commands []*roveapi.Command for i := 0; i < len(args); i++ { switch args[i] { + case "turn": + i++ + if len(args) == i { + return fmt.Errorf("turn command must be passed a compass bearing") + } + b := BearingFromString(args[i]) + if b == roveapi.Bearing_BearingUnknown { + return fmt.Errorf("turn command must be given a valid bearing %s", args[i]) + } + commands = append(commands, + &roveapi.Command{ + Command: roveapi.CommandType_broadcast, + Data: &roveapi.Command_Broadcast{Broadcast: []byte(args[i])}, + }, + ) case "broadcast": i++ if len(args) == i { @@ -234,7 +257,7 @@ func InnerMain(command string, args ...string) error { commands = append(commands, &roveapi.Command{ Command: roveapi.CommandType_broadcast, - Data: &roveapi.Command_Message{Message: []byte(args[i])}, + Data: &roveapi.Command_Broadcast{Broadcast: []byte(args[i])}, }, ) default: diff --git a/pkg/maths/vector.go b/pkg/maths/vector.go index 8a63708..92305cc 100644 --- a/pkg/maths/vector.go +++ b/pkg/maths/vector.go @@ -89,12 +89,20 @@ func BearingToVector(b roveapi.Bearing) Vector { switch b { case roveapi.Bearing_North: return Vector{Y: 1} + case roveapi.Bearing_NorthEast: + return Vector{X: 1, Y: 1} case roveapi.Bearing_East: return Vector{X: 1} + case roveapi.Bearing_SouthEast: + return Vector{X: 1, Y: -1} case roveapi.Bearing_South: return Vector{Y: -1} + case roveapi.Bearing_SouthWest: + return Vector{X: -1, Y: -1} case roveapi.Bearing_West: return Vector{X: -1} + case roveapi.Bearing_NorthWest: + return Vector{X: -1, Y: 1} } return Vector{} diff --git a/pkg/rove/command.go b/pkg/rove/command.go deleted file mode 100644 index df49bea..0000000 --- a/pkg/rove/command.go +++ /dev/null @@ -1,14 +0,0 @@ -package rove - -import "github.com/mdiluz/rove/proto/roveapi" - -// Command represends a single command to execute -type Command struct { - Command roveapi.CommandType `json:"command"` - - // Used in the broadcast command - Message []byte `json:"message,omitempty"` -} - -// CommandStream is a list of commands to execute in order -type CommandStream []Command diff --git a/pkg/rove/command_test.go b/pkg/rove/command_test.go index 7506cd6..c7990d1 100644 --- a/pkg/rove/command_test.go +++ b/pkg/rove/command_test.go @@ -2,14 +2,49 @@ package rove import ( "testing" + + "github.com/mdiluz/rove/proto/roveapi" + "github.com/stretchr/testify/assert" ) -func TestCommand_Raise(t *testing.T) { - // TODO: Test the raise command +func TestCommand_Toggle(t *testing.T) { + w := NewWorld(8) + a, err := w.SpawnRover() + assert.NoError(t, err) + + r, err := w.GetRover(a) + assert.NoError(t, err) + assert.Equal(t, roveapi.SailPosition_SolarCharging, r.SailPosition) + + w.Enqueue(a, &roveapi.Command{Command: roveapi.CommandType_toggle}) + w.EnqueueAllIncoming() + w.ExecuteCommandQueues() + + r, err = w.GetRover(a) + assert.NoError(t, err) + assert.Equal(t, roveapi.SailPosition_CatchingWind, r.SailPosition) + + w.Enqueue(a, &roveapi.Command{Command: roveapi.CommandType_toggle}) + w.EnqueueAllIncoming() + w.ExecuteCommandQueues() + + r, err = w.GetRover(a) + assert.NoError(t, err) + assert.Equal(t, roveapi.SailPosition_SolarCharging, r.SailPosition) } -func TestCommand_Lower(t *testing.T) { - // TODO: Test the lower command +func TestCommand_Turn(t *testing.T) { + w := NewWorld(8) + a, err := w.SpawnRover() + assert.NoError(t, err) + + w.Enqueue(a, &roveapi.Command{Command: roveapi.CommandType_turn, Data: &roveapi.Command_Turn{Turn: roveapi.Bearing_NorthWest}}) + w.EnqueueAllIncoming() + w.ExecuteCommandQueues() + + r, err := w.GetRover(a) + assert.NoError(t, err) + assert.Equal(t, roveapi.Bearing_NorthWest, r.Bearing) } func TestCommand_Stash(t *testing.T) { diff --git a/pkg/rove/rover.go b/pkg/rove/rover.go index 6968c57..36b875f 100644 --- a/pkg/rove/rover.go +++ b/pkg/rove/rover.go @@ -10,6 +10,7 @@ import ( "github.com/google/uuid" "github.com/mdiluz/rove/pkg/maths" + "github.com/mdiluz/rove/proto/roveapi" ) // RoverLogEntry describes a single log entry for the rover @@ -29,6 +30,9 @@ type Rover struct { // Pos represents where this rover is in the world Pos maths.Vector `json:"pos"` + // Bearing is the current direction the rover is facing + Bearing roveapi.Bearing `json:"bearing"` + // Range represents the distance the unit's radar can see Range int `json:"range"` @@ -48,7 +52,10 @@ type Rover struct { Charge int `json:"charge"` // MaximumCharge is the maximum charge able to be stored - MaximumCharge int `json:"maximum-Charge"` + MaximumCharge int `json:"maximum-charge"` + + // SailPosition is the current position of the sails + SailPosition roveapi.SailPosition `json:"sail-position"` // Logs Stores log of information Logs []RoverLogEntry `json:"logs"` @@ -63,6 +70,8 @@ func DefaultRover() Rover { Capacity: 10, Charge: 10, MaximumCharge: 10, + Bearing: roveapi.Bearing_North, + SailPosition: roveapi.SailPosition_SolarCharging, Name: GenerateRoverName(), } } diff --git a/pkg/rove/world.go b/pkg/rove/world.go index 6658417..43fbe83 100644 --- a/pkg/rove/world.go +++ b/pkg/rove/world.go @@ -10,6 +10,9 @@ import ( "github.com/mdiluz/rove/proto/roveapi" ) +// CommandStream is a list of commands to execute in order +type CommandStream []roveapi.Command + // World describes a self contained universe and everything in it type World struct { // TicksPerDay is the amount of ticks in a single day @@ -305,6 +308,45 @@ func (w *World) RoverStash(rover string) (roveapi.Object, error) { return obj.Type, nil } +// RoverToggle will toggle the sail position +func (w *World) RoverToggle(rover string) (roveapi.SailPosition, error) { + w.worldMutex.Lock() + defer w.worldMutex.Unlock() + + r, ok := w.Rovers[rover] + if !ok { + return roveapi.SailPosition_UnknownSailPosition, fmt.Errorf("no rover matching id") + } + + // Swap the sail position + switch r.SailPosition { + case roveapi.SailPosition_CatchingWind: + r.SailPosition = roveapi.SailPosition_SolarCharging + case roveapi.SailPosition_SolarCharging: + r.SailPosition = roveapi.SailPosition_CatchingWind + } + + w.Rovers[rover] = r + return r.SailPosition, nil +} + +// RoverTurn will turn the rover +func (w *World) RoverTurn(rover string, bearing roveapi.Bearing) (roveapi.Bearing, error) { + w.worldMutex.Lock() + defer w.worldMutex.Unlock() + + r, ok := w.Rovers[rover] + if !ok { + return roveapi.Bearing_BearingUnknown, fmt.Errorf("no rover matching id") + } + + // Set the new bearing + r.Bearing = bearing + + w.Rovers[rover] = r + return r.Bearing, nil +} + // RadarFromRover can be used to query what a rover can currently see func (w *World) RadarFromRover(rover string) (radar []roveapi.Tile, objs []roveapi.Object, err error) { w.worldMutex.RLock() @@ -364,7 +406,7 @@ func (w *World) RadarFromRover(rover string) (radar []roveapi.Tile, objs []rovea } // RoverCommands returns current commands for the given rover -func (w *World) RoverCommands(rover string) (incoming []Command, queued []Command) { +func (w *World) RoverCommands(rover string) (incoming []roveapi.Command, queued []roveapi.Command) { if c, ok := w.CommandIncoming[rover]; ok { incoming = c } @@ -375,20 +417,24 @@ func (w *World) RoverCommands(rover string) (incoming []Command, queued []Comman } // Enqueue will queue the commands given -func (w *World) Enqueue(rover string, commands ...Command) error { +func (w *World) Enqueue(rover string, commands ...*roveapi.Command) error { // First validate the commands for _, c := range commands { switch c.Command { case roveapi.CommandType_broadcast: - if len(c.Message) > 3 { - return fmt.Errorf("too many characters in message (limit 3): %d", len(c.Message)) + if len(c.GetBroadcast()) > 3 { + return fmt.Errorf("too many characters in message (limit 3): %d", len(c.GetBroadcast())) } - for _, b := range c.Message { + for _, b := range c.GetBroadcast() { if b < 37 || b > 126 { return fmt.Errorf("invalid message character: %c", b) } } + case roveapi.CommandType_turn: + if c.GetTurn() == roveapi.Bearing_BearingUnknown { + return fmt.Errorf("turn command given unknown bearing") + } case roveapi.CommandType_toggle: case roveapi.CommandType_stash: case roveapi.CommandType_repair: @@ -403,7 +449,17 @@ func (w *World) Enqueue(rover string, commands ...Command) error { defer w.cmdMutex.Unlock() // Override the incoming command set - w.CommandIncoming[rover] = commands + var cmds []roveapi.Command + for _, c := range commands { + // Copy the command and data but none of the locks or internals + cmds = append(cmds, + roveapi.Command{ + Command: c.Command, + Data: c.Data, + }) + } + + w.CommandIncoming[rover] = cmds return nil } @@ -427,16 +483,16 @@ func (w *World) ExecuteCommandQueues() { // Iterate through all the current commands for rover, cmds := range w.CommandQueue { if len(cmds) != 0 { - // Extract the first command in the queue - c := cmds[0] - w.CommandQueue[rover] = cmds[1:] // Execute the command - if err := w.ExecuteCommand(&c, rover); err != nil { + if err := w.ExecuteCommand(&cmds[0], rover); err != nil { log.Println(err) // TODO: Report this error somehow } + // Extract the first command in the queue + w.CommandQueue[rover] = cmds[1:] + } else { // Clean out the empty entry delete(w.CommandQueue, rover) @@ -451,13 +507,14 @@ func (w *World) ExecuteCommandQueues() { } // ExecuteCommand will execute a single command -func (w *World) ExecuteCommand(c *Command, rover string) (err error) { - log.Printf("Executing command: %+v for %s\n", *c, rover) +func (w *World) ExecuteCommand(c *roveapi.Command, rover string) (err error) { + log.Printf("Executing command: %+v for %s\n", c.Command, rover) switch c.Command { case roveapi.CommandType_toggle: - // TODO: Toggle the sails - + if _, err := w.RoverToggle(rover); err != nil { + return err + } case roveapi.CommandType_stash: if _, err := w.RoverStash(rover); err != nil { return err @@ -477,7 +534,12 @@ func (w *World) ExecuteCommand(c *Command, rover string) (err error) { } case roveapi.CommandType_broadcast: - if err := w.RoverBroadcast(rover, c.Message); err != nil { + if err := w.RoverBroadcast(rover, c.GetBroadcast()); err != nil { + return err + } + + case roveapi.CommandType_turn: + if _, err := w.RoverTurn(rover, c.GetTurn()); err != nil { return err } diff --git a/pkg/rove/world_test.go b/pkg/rove/world_test.go index f393f3d..ffac1af 100644 --- a/pkg/rove/world_test.go +++ b/pkg/rove/world_test.go @@ -269,7 +269,7 @@ func TestWorld_RoverRepair(t *testing.T) { assert.NoError(t, err, "couldn't get rover info") assert.Equal(t, originalInfo.Integrity-1, newinfo.Integrity, "rover should have lost integrity") - err = world.ExecuteCommand(&Command{Command: roveapi.CommandType_repair}, a) + err = world.ExecuteCommand(&roveapi.Command{Command: roveapi.CommandType_repair}, a) assert.NoError(t, err, "Failed to repair rover") newinfo, err = world.GetRover(a) @@ -283,7 +283,7 @@ func TestWorld_RoverRepair(t *testing.T) { assert.NoError(t, err, "Failed to stash") assert.Equal(t, roveapi.Object_RockSmall, o, "Failed to get correct object") - err = world.ExecuteCommand(&Command{Command: roveapi.CommandType_repair}, a) + err = world.ExecuteCommand(&roveapi.Command{Command: roveapi.CommandType_repair}, a) assert.NoError(t, err, "Failed to repair rover") newinfo, err = world.GetRover(a) diff --git a/proto/roveapi/roveapi.pb.go b/proto/roveapi/roveapi.pb.go index 9717407..cee8615 100644 --- a/proto/roveapi/roveapi.pb.go +++ b/proto/roveapi/roveapi.pb.go @@ -41,12 +41,14 @@ const ( CommandType_none CommandType = 0 // Toggles the sails, either catching the wind, or charging from the sun CommandType_toggle CommandType = 1 + // Turns the rover in the specified bearing, requires data + CommandType_turn CommandType = 2 // Stashes item at current location in rover inventory - CommandType_stash CommandType = 2 + CommandType_stash CommandType = 3 // Repairs the rover using an inventory object - CommandType_repair CommandType = 3 - // Broadcasts a message to nearby rovers - CommandType_broadcast CommandType = 4 + CommandType_repair CommandType = 4 + // Broadcasts a message to nearby rovers, requires data + CommandType_broadcast CommandType = 5 ) // Enum value maps for CommandType. @@ -54,16 +56,18 @@ var ( CommandType_name = map[int32]string{ 0: "none", 1: "toggle", - 2: "stash", - 3: "repair", - 4: "broadcast", + 2: "turn", + 3: "stash", + 4: "repair", + 5: "broadcast", } CommandType_value = map[string]int32{ "none": 0, "toggle": 1, - "stash": 2, - "repair": 3, - "broadcast": 4, + "turn": 2, + "stash": 3, + "repair": 4, + "broadcast": 5, } ) @@ -280,6 +284,58 @@ func (Tile) EnumDescriptor() ([]byte, []int) { return file_roveapi_roveapi_proto_rawDescGZIP(), []int{3} } +// SailPosition represents the position of the sola sail +type SailPosition int32 + +const ( + SailPosition_UnknownSailPosition SailPosition = 0 + // CatchingWind means the sail is catching the wind and moving the rover + SailPosition_CatchingWind SailPosition = 1 + // SolarCharging means the sail is facing the sun and charging + SailPosition_SolarCharging SailPosition = 2 +) + +// Enum value maps for SailPosition. +var ( + SailPosition_name = map[int32]string{ + 0: "UnknownSailPosition", + 1: "CatchingWind", + 2: "SolarCharging", + } + SailPosition_value = map[string]int32{ + "UnknownSailPosition": 0, + "CatchingWind": 1, + "SolarCharging": 2, + } +) + +func (x SailPosition) Enum() *SailPosition { + p := new(SailPosition) + *p = x + return p +} + +func (x SailPosition) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SailPosition) Descriptor() protoreflect.EnumDescriptor { + return file_roveapi_roveapi_proto_enumTypes[4].Descriptor() +} + +func (SailPosition) Type() protoreflect.EnumType { + return &file_roveapi_roveapi_proto_enumTypes[4] +} + +func (x SailPosition) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SailPosition.Descriptor instead. +func (SailPosition) EnumDescriptor() ([]byte, []int) { + return file_roveapi_roveapi_proto_rawDescGZIP(), []int{4} +} + // ServerStatusRequest is an empty placeholder type ServerStatusRequest struct { state protoimpl.MessageState @@ -569,7 +625,8 @@ type Command struct { // The command type Command CommandType `protobuf:"varint,1,opt,name=command,proto3,enum=roveapi.CommandType" json:"command,omitempty"` // Types that are assignable to Data: - // *Command_Message + // *Command_Broadcast + // *Command_Turn Data isCommand_Data `protobuf_oneof:"data"` } @@ -619,25 +676,38 @@ func (m *Command) GetData() isCommand_Data { return nil } -func (x *Command) GetMessage() []byte { - if x, ok := x.GetData().(*Command_Message); ok { - return x.Message +func (x *Command) GetBroadcast() []byte { + if x, ok := x.GetData().(*Command_Broadcast); ok { + return x.Broadcast } return nil } +func (x *Command) GetTurn() Bearing { + if x, ok := x.GetData().(*Command_Turn); ok { + return x.Turn + } + return Bearing_BearingUnknown +} + type isCommand_Data interface { isCommand_Data() } -type Command_Message struct { +type Command_Broadcast struct { // A simple message, must be composed of printable ASCII glyphs (32-126) // maximum of three characters - // Used with BROADCAST - Message []byte `protobuf:"bytes,2,opt,name=message,proto3,oneof"` + Broadcast []byte `protobuf:"bytes,2,opt,name=broadcast,proto3,oneof"` } -func (*Command_Message) isCommand_Data() {} +type Command_Turn struct { + // The bearing for the rover to turn to + Turn Bearing `protobuf:"varint,3,opt,name=turn,proto3,enum=roveapi.Bearing,oneof"` +} + +func (*Command_Broadcast) isCommand_Data() {} + +func (*Command_Turn) isCommand_Data() {} // CommandRequest describes a set of commands to be requested for the rover type CommandRequest struct { @@ -1026,26 +1096,30 @@ type StatusResponse struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Position of the rover in world coordinates Position *Vector `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"` + // The current direction of the rover + Bearing Bearing `protobuf:"varint,3,opt,name=bearing,proto3,enum=roveapi.Bearing" json:"bearing,omitempty"` // The range of this rover's radar and broadcasting - Range int32 `protobuf:"varint,3,opt,name=range,proto3" json:"range,omitempty"` + Range int32 `protobuf:"varint,4,opt,name=range,proto3" json:"range,omitempty"` // The items in the rover inventory - Inventory []byte `protobuf:"bytes,4,opt,name=inventory,proto3" json:"inventory,omitempty"` + Inventory []byte `protobuf:"bytes,5,opt,name=inventory,proto3" json:"inventory,omitempty"` // The capacity of the inventory - Capacity int32 `protobuf:"varint,5,opt,name=capacity,proto3" json:"capacity,omitempty"` + Capacity int32 `protobuf:"varint,6,opt,name=capacity,proto3" json:"capacity,omitempty"` // The current health of the rover - Integrity int32 `protobuf:"varint,6,opt,name=integrity,proto3" json:"integrity,omitempty"` + Integrity int32 `protobuf:"varint,7,opt,name=integrity,proto3" json:"integrity,omitempty"` // The maximum health of the rover - MaximumIntegrity int32 `protobuf:"varint,7,opt,name=maximumIntegrity,proto3" json:"maximumIntegrity,omitempty"` + MaximumIntegrity int32 `protobuf:"varint,8,opt,name=maximumIntegrity,proto3" json:"maximumIntegrity,omitempty"` // The energy stored in the rover - Charge int32 `protobuf:"varint,8,opt,name=charge,proto3" json:"charge,omitempty"` + Charge int32 `protobuf:"varint,9,opt,name=charge,proto3" json:"charge,omitempty"` // The max energy the rover can store - MaximumCharge int32 `protobuf:"varint,9,opt,name=maximumCharge,proto3" json:"maximumCharge,omitempty"` + MaximumCharge int32 `protobuf:"varint,10,opt,name=maximumCharge,proto3" json:"maximumCharge,omitempty"` + // The current position of the sails + SailPosition SailPosition `protobuf:"varint,11,opt,name=sailPosition,proto3,enum=roveapi.SailPosition" json:"sailPosition,omitempty"` // The set of currently incoming commands for this tick - IncomingCommands []*Command `protobuf:"bytes,10,rep,name=incomingCommands,proto3" json:"incomingCommands,omitempty"` + IncomingCommands []*Command `protobuf:"bytes,12,rep,name=incomingCommands,proto3" json:"incomingCommands,omitempty"` // The set of currently queued commands - QueuedCommands []*Command `protobuf:"bytes,11,rep,name=queuedCommands,proto3" json:"queuedCommands,omitempty"` + QueuedCommands []*Command `protobuf:"bytes,13,rep,name=queuedCommands,proto3" json:"queuedCommands,omitempty"` // The most recent logs - Logs []*Log `protobuf:"bytes,12,rep,name=logs,proto3" json:"logs,omitempty"` + Logs []*Log `protobuf:"bytes,14,rep,name=logs,proto3" json:"logs,omitempty"` } func (x *StatusResponse) Reset() { @@ -1094,6 +1168,13 @@ func (x *StatusResponse) GetPosition() *Vector { return nil } +func (x *StatusResponse) GetBearing() Bearing { + if x != nil { + return x.Bearing + } + return Bearing_BearingUnknown +} + func (x *StatusResponse) GetRange() int32 { if x != nil { return x.Range @@ -1143,6 +1224,13 @@ func (x *StatusResponse) GetMaximumCharge() int32 { return 0 } +func (x *StatusResponse) GetSailPosition() SailPosition { + if x != nil { + return x.SailPosition + } + return SailPosition_UnknownSailPosition +} + func (x *StatusResponse) GetIncomingCommands() []*Command { if x != nil { return x.IncomingCommands @@ -1190,116 +1278,131 @@ var file_roveapi_roveapi_proto_rawDesc = []byte{ 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x5d, 0x0a, 0x07, 0x43, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x6a, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, - 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, - 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x0a, 0x0c, 0x52, 0x61, 0x64, 0x61, 0x72, + 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x07, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x09, 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, + 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x09, 0x62, 0x72, 0x6f, 0x61, + 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x65, + 0x61, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x42, 0x06, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x6a, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x22, 0x75, 0x0a, 0x0d, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x69, - 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, - 0x61, 0x70, 0x69, 0x2e, 0x54, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, - 0x29, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, - 0x32, 0x0f, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x3b, 0x0a, 0x0d, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, - 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x12, - 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, - 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, - 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x22, 0xc3, 0x03, 0x0a, - 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, - 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, - 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2a, - 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, - 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, - 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, - 0x61, 0x72, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, - 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, - 0x72, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x69, 0x6d, - 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6f, - 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x03, + 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x0a, 0x0c, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x75, 0x0a, 0x0d, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, + 0x2e, 0x54, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x07, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0f, 0x2e, + 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x3b, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, + 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x65, 0x78, 0x74, 0x22, 0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, + 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x22, 0xaa, 0x04, 0x0a, 0x0e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x2b, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, + 0x07, 0x62, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x07, 0x62, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, + 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, + 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, + 0x75, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, + 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, + 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x73, 0x61, 0x69, 0x6c, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, + 0x69, 0x2e, 0x53, 0x61, 0x69, 0x6c, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x73, 0x61, 0x69, 0x6c, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x10, + 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, + 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, + 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x38, 0x0a, 0x0e, 0x71, 0x75, + 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x38, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x52, 0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, - 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, - 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, - 0x67, 0x73, 0x2a, 0x49, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x08, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x74, - 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x73, 0x68, - 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x61, 0x69, 0x72, 0x10, 0x03, 0x12, 0x0d, - 0x0a, 0x09, 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x10, 0x04, 0x2a, 0x83, 0x01, - 0x0a, 0x07, 0x42, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x65, 0x61, - 0x72, 0x69, 0x6e, 0x67, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, - 0x05, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x6f, 0x72, 0x74, - 0x68, 0x45, 0x61, 0x73, 0x74, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x45, 0x61, 0x73, 0x74, 0x10, - 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x45, 0x61, 0x73, 0x74, 0x10, 0x04, - 0x12, 0x09, 0x0a, 0x05, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x53, - 0x6f, 0x75, 0x74, 0x68, 0x57, 0x65, 0x73, 0x74, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x65, - 0x73, 0x74, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x57, 0x65, 0x73, - 0x74, 0x10, 0x08, 0x2a, 0x5a, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, - 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, - 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x4c, 0x69, 0x76, 0x65, 0x10, 0x01, 0x12, - 0x10, 0x0a, 0x0c, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x44, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x74, 0x10, - 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x6f, 0x63, 0x6b, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x10, 0x03, - 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x6f, 0x63, 0x6b, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x10, 0x04, 0x2a, - 0x37, 0x0a, 0x04, 0x54, 0x69, 0x6c, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x69, 0x6c, 0x65, 0x55, - 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x6f, 0x63, 0x6b, - 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x10, 0x02, 0x12, 0x08, - 0x0a, 0x04, 0x53, 0x61, 0x6e, 0x64, 0x10, 0x03, 0x32, 0xcf, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x76, - 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x1c, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x41, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x72, - 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x17, - 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, - 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, 0x12, 0x15, 0x2e, 0x72, - 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x61, - 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, - 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, - 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x17, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, 0x2f, - 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x61, - 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x0e, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, + 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x2a, 0x53, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x74, + 0x75, 0x72, 0x6e, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x73, 0x68, 0x10, 0x03, + 0x12, 0x0a, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x61, 0x69, 0x72, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, + 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x10, 0x05, 0x2a, 0x83, 0x01, 0x0a, 0x07, + 0x42, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x65, 0x61, 0x72, 0x69, + 0x6e, 0x67, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4e, + 0x6f, 0x72, 0x74, 0x68, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x45, + 0x61, 0x73, 0x74, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x45, 0x61, 0x73, 0x74, 0x10, 0x03, 0x12, + 0x0d, 0x0a, 0x09, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x45, 0x61, 0x73, 0x74, 0x10, 0x04, 0x12, 0x09, + 0x0a, 0x05, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x6f, 0x75, + 0x74, 0x68, 0x57, 0x65, 0x73, 0x74, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x65, 0x73, 0x74, + 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x57, 0x65, 0x73, 0x74, 0x10, + 0x08, 0x2a, 0x5a, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0d, + 0x0a, 0x09, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x4c, 0x69, 0x76, 0x65, 0x10, 0x01, 0x12, 0x10, 0x0a, + 0x0c, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x44, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x74, 0x10, 0x02, 0x12, + 0x0d, 0x0a, 0x09, 0x52, 0x6f, 0x63, 0x6b, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x10, 0x03, 0x12, 0x0d, + 0x0a, 0x09, 0x52, 0x6f, 0x63, 0x6b, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x10, 0x04, 0x2a, 0x37, 0x0a, + 0x04, 0x54, 0x69, 0x6c, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x69, 0x6c, 0x65, 0x55, 0x6e, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x6f, 0x63, 0x6b, 0x10, 0x01, + 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, + 0x53, 0x61, 0x6e, 0x64, 0x10, 0x03, 0x2a, 0x4c, 0x0a, 0x0c, 0x53, 0x61, 0x69, 0x6c, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, + 0x6e, 0x53, 0x61, 0x69, 0x6c, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x00, 0x12, + 0x10, 0x0a, 0x0c, 0x43, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x10, + 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x6f, 0x6c, 0x61, 0x72, 0x43, 0x68, 0x61, 0x72, 0x67, 0x69, + 0x6e, 0x67, 0x10, 0x02, 0x32, 0xcf, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x4d, 0x0a, + 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, + 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x6f, + 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x08, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, + 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x3e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x17, 0x2e, 0x72, 0x6f, 0x76, + 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x38, 0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, + 0x70, 0x69, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x06, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x6f, + 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, 0x2f, 0x72, 0x6f, 0x76, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1314,56 +1417,60 @@ func file_roveapi_roveapi_proto_rawDescGZIP() []byte { return file_roveapi_roveapi_proto_rawDescData } -var file_roveapi_roveapi_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_roveapi_roveapi_proto_enumTypes = make([]protoimpl.EnumInfo, 5) var file_roveapi_roveapi_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_roveapi_roveapi_proto_goTypes = []interface{}{ (CommandType)(0), // 0: roveapi.CommandType (Bearing)(0), // 1: roveapi.Bearing (Object)(0), // 2: roveapi.Object (Tile)(0), // 3: roveapi.Tile - (*ServerStatusRequest)(nil), // 4: roveapi.ServerStatusRequest - (*ServerStatusResponse)(nil), // 5: roveapi.ServerStatusResponse - (*RegisterRequest)(nil), // 6: roveapi.RegisterRequest - (*Account)(nil), // 7: roveapi.Account - (*RegisterResponse)(nil), // 8: roveapi.RegisterResponse - (*Command)(nil), // 9: roveapi.Command - (*CommandRequest)(nil), // 10: roveapi.CommandRequest - (*CommandResponse)(nil), // 11: roveapi.CommandResponse - (*RadarRequest)(nil), // 12: roveapi.RadarRequest - (*RadarResponse)(nil), // 13: roveapi.RadarResponse - (*StatusRequest)(nil), // 14: roveapi.StatusRequest - (*Log)(nil), // 15: roveapi.Log - (*Vector)(nil), // 16: roveapi.Vector - (*StatusResponse)(nil), // 17: roveapi.StatusResponse + (SailPosition)(0), // 4: roveapi.SailPosition + (*ServerStatusRequest)(nil), // 5: roveapi.ServerStatusRequest + (*ServerStatusResponse)(nil), // 6: roveapi.ServerStatusResponse + (*RegisterRequest)(nil), // 7: roveapi.RegisterRequest + (*Account)(nil), // 8: roveapi.Account + (*RegisterResponse)(nil), // 9: roveapi.RegisterResponse + (*Command)(nil), // 10: roveapi.Command + (*CommandRequest)(nil), // 11: roveapi.CommandRequest + (*CommandResponse)(nil), // 12: roveapi.CommandResponse + (*RadarRequest)(nil), // 13: roveapi.RadarRequest + (*RadarResponse)(nil), // 14: roveapi.RadarResponse + (*StatusRequest)(nil), // 15: roveapi.StatusRequest + (*Log)(nil), // 16: roveapi.Log + (*Vector)(nil), // 17: roveapi.Vector + (*StatusResponse)(nil), // 18: roveapi.StatusResponse } var file_roveapi_roveapi_proto_depIdxs = []int32{ - 7, // 0: roveapi.RegisterResponse.account:type_name -> roveapi.Account + 8, // 0: roveapi.RegisterResponse.account:type_name -> roveapi.Account 0, // 1: roveapi.Command.command:type_name -> roveapi.CommandType - 7, // 2: roveapi.CommandRequest.account:type_name -> roveapi.Account - 9, // 3: roveapi.CommandRequest.commands:type_name -> roveapi.Command - 7, // 4: roveapi.RadarRequest.account:type_name -> roveapi.Account - 3, // 5: roveapi.RadarResponse.tiles:type_name -> roveapi.Tile - 2, // 6: roveapi.RadarResponse.objects:type_name -> roveapi.Object - 7, // 7: roveapi.StatusRequest.account:type_name -> roveapi.Account - 16, // 8: roveapi.StatusResponse.position:type_name -> roveapi.Vector - 9, // 9: roveapi.StatusResponse.incomingCommands:type_name -> roveapi.Command - 9, // 10: roveapi.StatusResponse.queuedCommands:type_name -> roveapi.Command - 15, // 11: roveapi.StatusResponse.logs:type_name -> roveapi.Log - 4, // 12: roveapi.Rove.ServerStatus:input_type -> roveapi.ServerStatusRequest - 6, // 13: roveapi.Rove.Register:input_type -> roveapi.RegisterRequest - 10, // 14: roveapi.Rove.Command:input_type -> roveapi.CommandRequest - 12, // 15: roveapi.Rove.Radar:input_type -> roveapi.RadarRequest - 14, // 16: roveapi.Rove.Status:input_type -> roveapi.StatusRequest - 5, // 17: roveapi.Rove.ServerStatus:output_type -> roveapi.ServerStatusResponse - 8, // 18: roveapi.Rove.Register:output_type -> roveapi.RegisterResponse - 11, // 19: roveapi.Rove.Command:output_type -> roveapi.CommandResponse - 13, // 20: roveapi.Rove.Radar:output_type -> roveapi.RadarResponse - 17, // 21: roveapi.Rove.Status:output_type -> roveapi.StatusResponse - 17, // [17:22] is the sub-list for method output_type - 12, // [12:17] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 1, // 2: roveapi.Command.turn:type_name -> roveapi.Bearing + 8, // 3: roveapi.CommandRequest.account:type_name -> roveapi.Account + 10, // 4: roveapi.CommandRequest.commands:type_name -> roveapi.Command + 8, // 5: roveapi.RadarRequest.account:type_name -> roveapi.Account + 3, // 6: roveapi.RadarResponse.tiles:type_name -> roveapi.Tile + 2, // 7: roveapi.RadarResponse.objects:type_name -> roveapi.Object + 8, // 8: roveapi.StatusRequest.account:type_name -> roveapi.Account + 17, // 9: roveapi.StatusResponse.position:type_name -> roveapi.Vector + 1, // 10: roveapi.StatusResponse.bearing:type_name -> roveapi.Bearing + 4, // 11: roveapi.StatusResponse.sailPosition:type_name -> roveapi.SailPosition + 10, // 12: roveapi.StatusResponse.incomingCommands:type_name -> roveapi.Command + 10, // 13: roveapi.StatusResponse.queuedCommands:type_name -> roveapi.Command + 16, // 14: roveapi.StatusResponse.logs:type_name -> roveapi.Log + 5, // 15: roveapi.Rove.ServerStatus:input_type -> roveapi.ServerStatusRequest + 7, // 16: roveapi.Rove.Register:input_type -> roveapi.RegisterRequest + 11, // 17: roveapi.Rove.Command:input_type -> roveapi.CommandRequest + 13, // 18: roveapi.Rove.Radar:input_type -> roveapi.RadarRequest + 15, // 19: roveapi.Rove.Status:input_type -> roveapi.StatusRequest + 6, // 20: roveapi.Rove.ServerStatus:output_type -> roveapi.ServerStatusResponse + 9, // 21: roveapi.Rove.Register:output_type -> roveapi.RegisterResponse + 12, // 22: roveapi.Rove.Command:output_type -> roveapi.CommandResponse + 14, // 23: roveapi.Rove.Radar:output_type -> roveapi.RadarResponse + 18, // 24: roveapi.Rove.Status:output_type -> roveapi.StatusResponse + 20, // [20:25] is the sub-list for method output_type + 15, // [15:20] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_roveapi_roveapi_proto_init() } @@ -1542,14 +1649,15 @@ func file_roveapi_roveapi_proto_init() { } } file_roveapi_roveapi_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*Command_Message)(nil), + (*Command_Broadcast)(nil), + (*Command_Turn)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_roveapi_roveapi_proto_rawDesc, - NumEnums: 4, + NumEnums: 5, NumMessages: 14, NumExtensions: 0, NumServices: 1, diff --git a/proto/roveapi/roveapi.proto b/proto/roveapi/roveapi.proto index 033fcf3..9f13a17 100644 --- a/proto/roveapi/roveapi.proto +++ b/proto/roveapi/roveapi.proto @@ -91,12 +91,14 @@ enum CommandType { none = 0; // Toggles the sails, either catching the wind, or charging from the sun toggle = 1; + // Turns the rover in the specified bearing, requires data + turn = 2; // Stashes item at current location in rover inventory - stash = 2; + stash = 3; // Repairs the rover using an inventory object - repair = 3; - // Broadcasts a message to nearby rovers - broadcast = 4; + repair = 4; + // Broadcasts a message to nearby rovers, requires data + broadcast = 5; } // Bearing represents a compass direction @@ -121,8 +123,10 @@ message Command { oneof data { // A simple message, must be composed of printable ASCII glyphs (32-126) // maximum of three characters - // Used with BROADCAST - bytes message = 2; + bytes broadcast = 2; + + // The bearing for the rover to turn to + Bearing turn = 3; } } @@ -218,6 +222,17 @@ message Vector { int32 y = 2; } +// SailPosition represents the position of the sola sail +enum SailPosition { + UnknownSailPosition = 0; + + // CatchingWind means the sail is catching the wind and moving the rover + CatchingWind = 1; + + // SolarCharging means the sail is facing the sun and charging + SolarCharging = 2; +} + // StatusResponse is the response given to a status request message StatusResponse { // The name of the rover @@ -226,33 +241,39 @@ message StatusResponse { // Position of the rover in world coordinates Vector position = 2; + // The current direction of the rover + Bearing bearing = 3; + // The range of this rover's radar and broadcasting - int32 range = 3; + int32 range = 4; // The items in the rover inventory - bytes inventory = 4; + bytes inventory = 5; // The capacity of the inventory - int32 capacity = 5; + int32 capacity = 6; // The current health of the rover - int32 integrity = 6; + int32 integrity = 7; // The maximum health of the rover - int32 maximumIntegrity = 7; + int32 maximumIntegrity = 8; // The energy stored in the rover - int32 charge = 8; + int32 charge = 9; // The max energy the rover can store - int32 maximumCharge = 9; + int32 maximumCharge = 10; + + // The current position of the sails + SailPosition sailPosition = 11; // The set of currently incoming commands for this tick - repeated Command incomingCommands = 10; + repeated Command incomingCommands = 12; // The set of currently queued commands - repeated Command queuedCommands = 11; + repeated Command queuedCommands = 13; // The most recent logs - repeated Log logs = 12; + repeated Log logs = 14; } \ No newline at end of file