Add SailPosition to the rover and implement toggle command

This also converts the commands to use the proto type for simplicity
This commit is contained in:
Marc Di Luzio 2020-07-21 23:12:50 +01:00
parent 6f30b665c7
commit f78efd1223
10 changed files with 490 additions and 267 deletions

View file

@ -5,7 +5,6 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/mdiluz/rove/pkg/rove"
"github.com/mdiluz/rove/pkg/version" "github.com/mdiluz/rove/pkg/version"
"github.com/mdiluz/rove/proto/roveapi" "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)) inv = append(inv, byte(i.Type))
} }
i, q := s.world.RoverCommands(resp) in, qu := s.world.RoverCommands(resp)
var incoming, queued []*roveapi.Command var incoming, queued []*roveapi.Command
for _, i := range i { for i := range in {
c := &roveapi.Command{ incoming = append(incoming, &in[i])
Command: i.Command,
}
switch i.Command {
case roveapi.CommandType_broadcast:
c.Data = &roveapi.Command_Message{
Message: i.Message,
}
}
incoming = append(incoming, c)
} }
for _, q := range q { for i := range qu {
c := &roveapi.Command{ queued = append(queued, &qu[i])
Command: q.Command,
}
switch q.Command {
case roveapi.CommandType_broadcast:
c.Data = &roveapi.Command_Message{
Message: q.Message,
}
}
queued = append(queued, c)
} }
var logs []*roveapi.Log var logs []*roveapi.Log
for _, log := range rover.Logs { 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), X: int32(rover.Pos.X),
Y: int32(rover.Pos.Y), Y: int32(rover.Pos.Y),
}, },
Bearing: rover.Bearing,
Range: int32(rover.Range), Range: int32(rover.Range),
Inventory: inv, Inventory: inv,
Capacity: int32(rover.Capacity), Capacity: int32(rover.Capacity),
@ -125,6 +107,7 @@ func (s *Server) Status(ctx context.Context, req *roveapi.StatusRequest) (respon
MaximumCharge: int32(rover.MaximumCharge), MaximumCharge: int32(rover.MaximumCharge),
IncomingCommands: incoming, IncomingCommands: incoming,
QueuedCommands: queued, QueuedCommands: queued,
SailPosition: rover.SailPosition,
Logs: logs, Logs: logs,
} }
} }
@ -179,19 +162,7 @@ func (s *Server) Command(ctx context.Context, req *roveapi.CommandRequest) (*rov
return nil, err return nil, err
} }
var cmds []rove.Command if err := s.world.Enqueue(resp, req.Commands...); err != nil {
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 {
return nil, err return nil, err
} }

View file

@ -127,12 +127,20 @@ func BearingFromString(s string) roveapi.Bearing {
switch s { switch s {
case "N": case "N":
return roveapi.Bearing_North return roveapi.Bearing_North
case "NE":
return roveapi.Bearing_NorthEast
case "E": case "E":
return roveapi.Bearing_East return roveapi.Bearing_East
case "SE":
return roveapi.Bearing_SouthEast
case "S": case "S":
return roveapi.Bearing_South return roveapi.Bearing_South
case "SW":
return roveapi.Bearing_SouthWest
case "W": case "W":
return roveapi.Bearing_West return roveapi.Bearing_West
case "NW":
return roveapi.Bearing_NorthWest
} }
return roveapi.Bearing_BearingUnknown return roveapi.Bearing_BearingUnknown
} }
@ -224,6 +232,21 @@ func InnerMain(command string, args ...string) error {
var commands []*roveapi.Command var commands []*roveapi.Command
for i := 0; i < len(args); i++ { for i := 0; i < len(args); i++ {
switch 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": case "broadcast":
i++ i++
if len(args) == i { if len(args) == i {
@ -234,7 +257,7 @@ func InnerMain(command string, args ...string) error {
commands = append(commands, commands = append(commands,
&roveapi.Command{ &roveapi.Command{
Command: roveapi.CommandType_broadcast, Command: roveapi.CommandType_broadcast,
Data: &roveapi.Command_Message{Message: []byte(args[i])}, Data: &roveapi.Command_Broadcast{Broadcast: []byte(args[i])},
}, },
) )
default: default:

View file

@ -89,12 +89,20 @@ func BearingToVector(b roveapi.Bearing) Vector {
switch b { switch b {
case roveapi.Bearing_North: case roveapi.Bearing_North:
return Vector{Y: 1} return Vector{Y: 1}
case roveapi.Bearing_NorthEast:
return Vector{X: 1, Y: 1}
case roveapi.Bearing_East: case roveapi.Bearing_East:
return Vector{X: 1} return Vector{X: 1}
case roveapi.Bearing_SouthEast:
return Vector{X: 1, Y: -1}
case roveapi.Bearing_South: case roveapi.Bearing_South:
return Vector{Y: -1} return Vector{Y: -1}
case roveapi.Bearing_SouthWest:
return Vector{X: -1, Y: -1}
case roveapi.Bearing_West: case roveapi.Bearing_West:
return Vector{X: -1} return Vector{X: -1}
case roveapi.Bearing_NorthWest:
return Vector{X: -1, Y: 1}
} }
return Vector{} return Vector{}

View file

@ -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

View file

@ -2,14 +2,49 @@ package rove
import ( import (
"testing" "testing"
"github.com/mdiluz/rove/proto/roveapi"
"github.com/stretchr/testify/assert"
) )
func TestCommand_Raise(t *testing.T) { func TestCommand_Toggle(t *testing.T) {
// TODO: Test the raise command 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) { func TestCommand_Turn(t *testing.T) {
// TODO: Test the lower command 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) { func TestCommand_Stash(t *testing.T) {

View file

@ -10,6 +10,7 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/mdiluz/rove/pkg/maths" "github.com/mdiluz/rove/pkg/maths"
"github.com/mdiluz/rove/proto/roveapi"
) )
// RoverLogEntry describes a single log entry for the rover // 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 represents where this rover is in the world
Pos maths.Vector `json:"pos"` 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 represents the distance the unit's radar can see
Range int `json:"range"` Range int `json:"range"`
@ -48,7 +52,10 @@ type Rover struct {
Charge int `json:"charge"` Charge int `json:"charge"`
// MaximumCharge is the maximum charge able to be stored // 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 Stores log of information
Logs []RoverLogEntry `json:"logs"` Logs []RoverLogEntry `json:"logs"`
@ -63,6 +70,8 @@ func DefaultRover() Rover {
Capacity: 10, Capacity: 10,
Charge: 10, Charge: 10,
MaximumCharge: 10, MaximumCharge: 10,
Bearing: roveapi.Bearing_North,
SailPosition: roveapi.SailPosition_SolarCharging,
Name: GenerateRoverName(), Name: GenerateRoverName(),
} }
} }

View file

@ -10,6 +10,9 @@ import (
"github.com/mdiluz/rove/proto/roveapi" "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 // World describes a self contained universe and everything in it
type World struct { type World struct {
// TicksPerDay is the amount of ticks in a single day // 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 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 // 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) { func (w *World) RadarFromRover(rover string) (radar []roveapi.Tile, objs []roveapi.Object, err error) {
w.worldMutex.RLock() 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 // 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 { if c, ok := w.CommandIncoming[rover]; ok {
incoming = c incoming = c
} }
@ -375,20 +417,24 @@ func (w *World) RoverCommands(rover string) (incoming []Command, queued []Comman
} }
// Enqueue will queue the commands given // 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 // First validate the commands
for _, c := range commands { for _, c := range commands {
switch c.Command { switch c.Command {
case roveapi.CommandType_broadcast: case roveapi.CommandType_broadcast:
if len(c.Message) > 3 { if len(c.GetBroadcast()) > 3 {
return fmt.Errorf("too many characters in message (limit 3): %d", len(c.Message)) 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 { if b < 37 || b > 126 {
return fmt.Errorf("invalid message character: %c", b) 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_toggle:
case roveapi.CommandType_stash: case roveapi.CommandType_stash:
case roveapi.CommandType_repair: case roveapi.CommandType_repair:
@ -403,7 +449,17 @@ func (w *World) Enqueue(rover string, commands ...Command) error {
defer w.cmdMutex.Unlock() defer w.cmdMutex.Unlock()
// Override the incoming command set // 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 return nil
} }
@ -427,16 +483,16 @@ func (w *World) ExecuteCommandQueues() {
// Iterate through all the current commands // Iterate through all the current commands
for rover, cmds := range w.CommandQueue { for rover, cmds := range w.CommandQueue {
if len(cmds) != 0 { if len(cmds) != 0 {
// Extract the first command in the queue
c := cmds[0]
w.CommandQueue[rover] = cmds[1:]
// Execute the command // Execute the command
if err := w.ExecuteCommand(&c, rover); err != nil { if err := w.ExecuteCommand(&cmds[0], rover); err != nil {
log.Println(err) log.Println(err)
// TODO: Report this error somehow // TODO: Report this error somehow
} }
// Extract the first command in the queue
w.CommandQueue[rover] = cmds[1:]
} else { } else {
// Clean out the empty entry // Clean out the empty entry
delete(w.CommandQueue, rover) delete(w.CommandQueue, rover)
@ -451,13 +507,14 @@ func (w *World) ExecuteCommandQueues() {
} }
// ExecuteCommand will execute a single command // ExecuteCommand will execute a single command
func (w *World) ExecuteCommand(c *Command, rover string) (err error) { func (w *World) ExecuteCommand(c *roveapi.Command, rover string) (err error) {
log.Printf("Executing command: %+v for %s\n", *c, rover) log.Printf("Executing command: %+v for %s\n", c.Command, rover)
switch c.Command { switch c.Command {
case roveapi.CommandType_toggle: case roveapi.CommandType_toggle:
// TODO: Toggle the sails if _, err := w.RoverToggle(rover); err != nil {
return err
}
case roveapi.CommandType_stash: case roveapi.CommandType_stash:
if _, err := w.RoverStash(rover); err != nil { if _, err := w.RoverStash(rover); err != nil {
return err return err
@ -477,7 +534,12 @@ func (w *World) ExecuteCommand(c *Command, rover string) (err error) {
} }
case roveapi.CommandType_broadcast: 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 return err
} }

View file

@ -269,7 +269,7 @@ func TestWorld_RoverRepair(t *testing.T) {
assert.NoError(t, err, "couldn't get rover info") assert.NoError(t, err, "couldn't get rover info")
assert.Equal(t, originalInfo.Integrity-1, newinfo.Integrity, "rover should have lost integrity") 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") assert.NoError(t, err, "Failed to repair rover")
newinfo, err = world.GetRover(a) newinfo, err = world.GetRover(a)
@ -283,7 +283,7 @@ func TestWorld_RoverRepair(t *testing.T) {
assert.NoError(t, err, "Failed to stash") assert.NoError(t, err, "Failed to stash")
assert.Equal(t, roveapi.Object_RockSmall, o, "Failed to get correct object") 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") assert.NoError(t, err, "Failed to repair rover")
newinfo, err = world.GetRover(a) newinfo, err = world.GetRover(a)

View file

@ -41,12 +41,14 @@ const (
CommandType_none CommandType = 0 CommandType_none CommandType = 0
// Toggles the sails, either catching the wind, or charging from the sun // Toggles the sails, either catching the wind, or charging from the sun
CommandType_toggle CommandType = 1 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 // Stashes item at current location in rover inventory
CommandType_stash CommandType = 2 CommandType_stash CommandType = 3
// Repairs the rover using an inventory object // Repairs the rover using an inventory object
CommandType_repair CommandType = 3 CommandType_repair CommandType = 4
// Broadcasts a message to nearby rovers // Broadcasts a message to nearby rovers, requires data
CommandType_broadcast CommandType = 4 CommandType_broadcast CommandType = 5
) )
// Enum value maps for CommandType. // Enum value maps for CommandType.
@ -54,16 +56,18 @@ var (
CommandType_name = map[int32]string{ CommandType_name = map[int32]string{
0: "none", 0: "none",
1: "toggle", 1: "toggle",
2: "stash", 2: "turn",
3: "repair", 3: "stash",
4: "broadcast", 4: "repair",
5: "broadcast",
} }
CommandType_value = map[string]int32{ CommandType_value = map[string]int32{
"none": 0, "none": 0,
"toggle": 1, "toggle": 1,
"stash": 2, "turn": 2,
"repair": 3, "stash": 3,
"broadcast": 4, "repair": 4,
"broadcast": 5,
} }
) )
@ -280,6 +284,58 @@ func (Tile) EnumDescriptor() ([]byte, []int) {
return file_roveapi_roveapi_proto_rawDescGZIP(), []int{3} 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 // ServerStatusRequest is an empty placeholder
type ServerStatusRequest struct { type ServerStatusRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -569,7 +625,8 @@ type Command struct {
// The command type // The command type
Command CommandType `protobuf:"varint,1,opt,name=command,proto3,enum=roveapi.CommandType" json:"command,omitempty"` Command CommandType `protobuf:"varint,1,opt,name=command,proto3,enum=roveapi.CommandType" json:"command,omitempty"`
// Types that are assignable to Data: // Types that are assignable to Data:
// *Command_Message // *Command_Broadcast
// *Command_Turn
Data isCommand_Data `protobuf_oneof:"data"` Data isCommand_Data `protobuf_oneof:"data"`
} }
@ -619,25 +676,38 @@ func (m *Command) GetData() isCommand_Data {
return nil return nil
} }
func (x *Command) GetMessage() []byte { func (x *Command) GetBroadcast() []byte {
if x, ok := x.GetData().(*Command_Message); ok { if x, ok := x.GetData().(*Command_Broadcast); ok {
return x.Message return x.Broadcast
} }
return nil 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 { type isCommand_Data interface {
isCommand_Data() isCommand_Data()
} }
type Command_Message struct { type Command_Broadcast struct {
// A simple message, must be composed of printable ASCII glyphs (32-126) // A simple message, must be composed of printable ASCII glyphs (32-126)
// maximum of three characters // maximum of three characters
// Used with BROADCAST Broadcast []byte `protobuf:"bytes,2,opt,name=broadcast,proto3,oneof"`
Message []byte `protobuf:"bytes,2,opt,name=message,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 // CommandRequest describes a set of commands to be requested for the rover
type CommandRequest struct { type CommandRequest struct {
@ -1026,26 +1096,30 @@ type StatusResponse struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Position of the rover in world coordinates // Position of the rover in world coordinates
Position *Vector `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"` 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 // 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 // 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 // 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 // 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 // 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 // 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 // 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 // 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 // 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 // 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() { func (x *StatusResponse) Reset() {
@ -1094,6 +1168,13 @@ func (x *StatusResponse) GetPosition() *Vector {
return nil return nil
} }
func (x *StatusResponse) GetBearing() Bearing {
if x != nil {
return x.Bearing
}
return Bearing_BearingUnknown
}
func (x *StatusResponse) GetRange() int32 { func (x *StatusResponse) GetRange() int32 {
if x != nil { if x != nil {
return x.Range return x.Range
@ -1143,6 +1224,13 @@ func (x *StatusResponse) GetMaximumCharge() int32 {
return 0 return 0
} }
func (x *StatusResponse) GetSailPosition() SailPosition {
if x != nil {
return x.SailPosition
}
return SailPosition_UnknownSailPosition
}
func (x *StatusResponse) GetIncomingCommands() []*Command { func (x *StatusResponse) GetIncomingCommands() []*Command {
if x != nil { if x != nil {
return x.IncomingCommands 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, 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, 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, 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, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x07, 0x43, 0x6f,
0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x63, 0x6f,
0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x09, 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61,
0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x09, 0x62, 0x72, 0x6f, 0x61,
0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x6a, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20,
0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x65,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x42, 0x06, 0x0a,
0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x6a, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
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, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 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, 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, 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, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e,
0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x69, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70,
0x61, 0x70, 0x69, 0x2e, 0x54, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x0a, 0x0c, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71,
0x29, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x32, 0x0f, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e,
0x74, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x3b, 0x0a, 0x0d, 0x53, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x22, 0x75, 0x0a, 0x0d, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73,
0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x12, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69,
0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x2e, 0x54, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x07,
0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0f, 0x2e,
0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07,
0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x3b, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75,
0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x22, 0xc3, 0x03, 0x0a, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f,
0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x6f, 0x76, 0x65,
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63,
0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12,
0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74,
0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x65, 0x78, 0x74, 0x22, 0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a,
0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79,
0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x22, 0xaa, 0x04, 0x0a, 0x0e, 0x53, 0x74,
0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x12, 0x2b, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2a, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x65, 0x63,
0x0a, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a,
0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x07, 0x62, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10,
0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67,
0x61, 0x72, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, 0x52, 0x07, 0x62, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e,
0x67, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12,
0x72, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01,
0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6f, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a,
0x6d, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x03, 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, 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, 0x61, 0x6e, 0x64, 0x52, 0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x38, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x0e, 0x20, 0x03,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67,
0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x2a, 0x53, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x52, 0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12,
0x12, 0x20, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x0a, 0x0a, 0x06, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x74,
0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x75, 0x72, 0x6e, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x73, 0x68, 0x10, 0x03,
0x67, 0x73, 0x2a, 0x49, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x12, 0x0a, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x61, 0x69, 0x72, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09,
0x65, 0x12, 0x08, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x74, 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x10, 0x05, 0x2a, 0x83, 0x01, 0x0a, 0x07,
0x6f, 0x67, 0x67, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x73, 0x68, 0x42, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x65, 0x61, 0x72, 0x69,
0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x61, 0x69, 0x72, 0x10, 0x03, 0x12, 0x0d, 0x6e, 0x67, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4e,
0x0a, 0x09, 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x10, 0x04, 0x2a, 0x83, 0x01, 0x6f, 0x72, 0x74, 0x68, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x45,
0x0a, 0x07, 0x42, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x65, 0x61, 0x61, 0x73, 0x74, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x45, 0x61, 0x73, 0x74, 0x10, 0x03, 0x12,
0x72, 0x69, 0x6e, 0x67, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x0d, 0x0a, 0x09, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x45, 0x61, 0x73, 0x74, 0x10, 0x04, 0x12, 0x09,
0x05, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x6f, 0x72, 0x74, 0x0a, 0x05, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x6f, 0x75,
0x68, 0x45, 0x61, 0x73, 0x74, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x45, 0x61, 0x73, 0x74, 0x10, 0x74, 0x68, 0x57, 0x65, 0x73, 0x74, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x65, 0x73, 0x74,
0x03, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x45, 0x61, 0x73, 0x74, 0x10, 0x04, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x57, 0x65, 0x73, 0x74, 0x10,
0x12, 0x09, 0x0a, 0x05, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x08, 0x2a, 0x5a, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x4f,
0x6f, 0x75, 0x74, 0x68, 0x57, 0x65, 0x73, 0x74, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x65, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0d,
0x73, 0x74, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x57, 0x65, 0x73, 0x0a, 0x09, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x4c, 0x69, 0x76, 0x65, 0x10, 0x01, 0x12, 0x10, 0x0a,
0x74, 0x10, 0x08, 0x2a, 0x5a, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x44, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x74, 0x10, 0x02, 0x12,
0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x0d, 0x0a, 0x09, 0x52, 0x6f, 0x63, 0x6b, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x10, 0x03, 0x12, 0x0d,
0x12, 0x0d, 0x0a, 0x09, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x4c, 0x69, 0x76, 0x65, 0x10, 0x01, 0x12, 0x0a, 0x09, 0x52, 0x6f, 0x63, 0x6b, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x10, 0x04, 0x2a, 0x37, 0x0a,
0x10, 0x0a, 0x0c, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x44, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x74, 0x10, 0x04, 0x54, 0x69, 0x6c, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x69, 0x6c, 0x65, 0x55, 0x6e, 0x6b,
0x02, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x6f, 0x63, 0x6b, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x10, 0x03, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x6f, 0x63, 0x6b, 0x10, 0x01,
0x12, 0x0d, 0x0a, 0x09, 0x52, 0x6f, 0x63, 0x6b, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x10, 0x04, 0x2a, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04,
0x37, 0x0a, 0x04, 0x54, 0x69, 0x6c, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x69, 0x6c, 0x65, 0x55, 0x53, 0x61, 0x6e, 0x64, 0x10, 0x03, 0x2a, 0x4c, 0x0a, 0x0c, 0x53, 0x61, 0x69, 0x6c, 0x50, 0x6f,
0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x6f, 0x63, 0x6b, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77,
0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x10, 0x02, 0x12, 0x08, 0x6e, 0x53, 0x61, 0x69, 0x6c, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x00, 0x12,
0x0a, 0x04, 0x53, 0x61, 0x6e, 0x64, 0x10, 0x03, 0x32, 0xcf, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x10, 0x0a, 0x0c, 0x43, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x10,
0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x6f, 0x6c, 0x61, 0x72, 0x43, 0x68, 0x61, 0x72, 0x67, 0x69,
0x73, 0x12, 0x1c, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x6e, 0x67, 0x10, 0x02, 0x32, 0xcf, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x4d, 0x0a,
0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e,
0x1d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x6f,
0x12, 0x41, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x72, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74,
0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x08,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61,
0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x17, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67,
0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x3e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x17, 0x2e, 0x72, 0x6f, 0x76,
0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75,
0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f,
0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x61, 0x38, 0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61,
0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x70, 0x69, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52,
0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x06, 0x53, 0x74, 0x61,
0x17, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x6f,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, 0x2f, 0x76, 0x65, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70,
0x72, 0x6f, 0x76, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x61, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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 ( var (
@ -1314,56 +1417,60 @@ func file_roveapi_roveapi_proto_rawDescGZIP() []byte {
return file_roveapi_roveapi_proto_rawDescData 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_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_roveapi_roveapi_proto_goTypes = []interface{}{ var file_roveapi_roveapi_proto_goTypes = []interface{}{
(CommandType)(0), // 0: roveapi.CommandType (CommandType)(0), // 0: roveapi.CommandType
(Bearing)(0), // 1: roveapi.Bearing (Bearing)(0), // 1: roveapi.Bearing
(Object)(0), // 2: roveapi.Object (Object)(0), // 2: roveapi.Object
(Tile)(0), // 3: roveapi.Tile (Tile)(0), // 3: roveapi.Tile
(*ServerStatusRequest)(nil), // 4: roveapi.ServerStatusRequest (SailPosition)(0), // 4: roveapi.SailPosition
(*ServerStatusResponse)(nil), // 5: roveapi.ServerStatusResponse (*ServerStatusRequest)(nil), // 5: roveapi.ServerStatusRequest
(*RegisterRequest)(nil), // 6: roveapi.RegisterRequest (*ServerStatusResponse)(nil), // 6: roveapi.ServerStatusResponse
(*Account)(nil), // 7: roveapi.Account (*RegisterRequest)(nil), // 7: roveapi.RegisterRequest
(*RegisterResponse)(nil), // 8: roveapi.RegisterResponse (*Account)(nil), // 8: roveapi.Account
(*Command)(nil), // 9: roveapi.Command (*RegisterResponse)(nil), // 9: roveapi.RegisterResponse
(*CommandRequest)(nil), // 10: roveapi.CommandRequest (*Command)(nil), // 10: roveapi.Command
(*CommandResponse)(nil), // 11: roveapi.CommandResponse (*CommandRequest)(nil), // 11: roveapi.CommandRequest
(*RadarRequest)(nil), // 12: roveapi.RadarRequest (*CommandResponse)(nil), // 12: roveapi.CommandResponse
(*RadarResponse)(nil), // 13: roveapi.RadarResponse (*RadarRequest)(nil), // 13: roveapi.RadarRequest
(*StatusRequest)(nil), // 14: roveapi.StatusRequest (*RadarResponse)(nil), // 14: roveapi.RadarResponse
(*Log)(nil), // 15: roveapi.Log (*StatusRequest)(nil), // 15: roveapi.StatusRequest
(*Vector)(nil), // 16: roveapi.Vector (*Log)(nil), // 16: roveapi.Log
(*StatusResponse)(nil), // 17: roveapi.StatusResponse (*Vector)(nil), // 17: roveapi.Vector
(*StatusResponse)(nil), // 18: roveapi.StatusResponse
} }
var file_roveapi_roveapi_proto_depIdxs = []int32{ 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 0, // 1: roveapi.Command.command:type_name -> roveapi.CommandType
7, // 2: roveapi.CommandRequest.account:type_name -> roveapi.Account 1, // 2: roveapi.Command.turn:type_name -> roveapi.Bearing
9, // 3: roveapi.CommandRequest.commands:type_name -> roveapi.Command 8, // 3: roveapi.CommandRequest.account:type_name -> roveapi.Account
7, // 4: roveapi.RadarRequest.account:type_name -> roveapi.Account 10, // 4: roveapi.CommandRequest.commands:type_name -> roveapi.Command
3, // 5: roveapi.RadarResponse.tiles:type_name -> roveapi.Tile 8, // 5: roveapi.RadarRequest.account:type_name -> roveapi.Account
2, // 6: roveapi.RadarResponse.objects:type_name -> roveapi.Object 3, // 6: roveapi.RadarResponse.tiles:type_name -> roveapi.Tile
7, // 7: roveapi.StatusRequest.account:type_name -> roveapi.Account 2, // 7: roveapi.RadarResponse.objects:type_name -> roveapi.Object
16, // 8: roveapi.StatusResponse.position:type_name -> roveapi.Vector 8, // 8: roveapi.StatusRequest.account:type_name -> roveapi.Account
9, // 9: roveapi.StatusResponse.incomingCommands:type_name -> roveapi.Command 17, // 9: roveapi.StatusResponse.position:type_name -> roveapi.Vector
9, // 10: roveapi.StatusResponse.queuedCommands:type_name -> roveapi.Command 1, // 10: roveapi.StatusResponse.bearing:type_name -> roveapi.Bearing
15, // 11: roveapi.StatusResponse.logs:type_name -> roveapi.Log 4, // 11: roveapi.StatusResponse.sailPosition:type_name -> roveapi.SailPosition
4, // 12: roveapi.Rove.ServerStatus:input_type -> roveapi.ServerStatusRequest 10, // 12: roveapi.StatusResponse.incomingCommands:type_name -> roveapi.Command
6, // 13: roveapi.Rove.Register:input_type -> roveapi.RegisterRequest 10, // 13: roveapi.StatusResponse.queuedCommands:type_name -> roveapi.Command
10, // 14: roveapi.Rove.Command:input_type -> roveapi.CommandRequest 16, // 14: roveapi.StatusResponse.logs:type_name -> roveapi.Log
12, // 15: roveapi.Rove.Radar:input_type -> roveapi.RadarRequest 5, // 15: roveapi.Rove.ServerStatus:input_type -> roveapi.ServerStatusRequest
14, // 16: roveapi.Rove.Status:input_type -> roveapi.StatusRequest 7, // 16: roveapi.Rove.Register:input_type -> roveapi.RegisterRequest
5, // 17: roveapi.Rove.ServerStatus:output_type -> roveapi.ServerStatusResponse 11, // 17: roveapi.Rove.Command:input_type -> roveapi.CommandRequest
8, // 18: roveapi.Rove.Register:output_type -> roveapi.RegisterResponse 13, // 18: roveapi.Rove.Radar:input_type -> roveapi.RadarRequest
11, // 19: roveapi.Rove.Command:output_type -> roveapi.CommandResponse 15, // 19: roveapi.Rove.Status:input_type -> roveapi.StatusRequest
13, // 20: roveapi.Rove.Radar:output_type -> roveapi.RadarResponse 6, // 20: roveapi.Rove.ServerStatus:output_type -> roveapi.ServerStatusResponse
17, // 21: roveapi.Rove.Status:output_type -> roveapi.StatusResponse 9, // 21: roveapi.Rove.Register:output_type -> roveapi.RegisterResponse
17, // [17:22] is the sub-list for method output_type 12, // 22: roveapi.Rove.Command:output_type -> roveapi.CommandResponse
12, // [12:17] is the sub-list for method input_type 14, // 23: roveapi.Rove.Radar:output_type -> roveapi.RadarResponse
12, // [12:12] is the sub-list for extension type_name 18, // 24: roveapi.Rove.Status:output_type -> roveapi.StatusResponse
12, // [12:12] is the sub-list for extension extendee 20, // [20:25] is the sub-list for method output_type
0, // [0:12] is the sub-list for field type_name 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() } 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{}{ file_roveapi_roveapi_proto_msgTypes[5].OneofWrappers = []interface{}{
(*Command_Message)(nil), (*Command_Broadcast)(nil),
(*Command_Turn)(nil),
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_roveapi_roveapi_proto_rawDesc, RawDescriptor: file_roveapi_roveapi_proto_rawDesc,
NumEnums: 4, NumEnums: 5,
NumMessages: 14, NumMessages: 14,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,

View file

@ -91,12 +91,14 @@ enum CommandType {
none = 0; none = 0;
// Toggles the sails, either catching the wind, or charging from the sun // Toggles the sails, either catching the wind, or charging from the sun
toggle = 1; toggle = 1;
// Turns the rover in the specified bearing, requires data
turn = 2;
// Stashes item at current location in rover inventory // Stashes item at current location in rover inventory
stash = 2; stash = 3;
// Repairs the rover using an inventory object // Repairs the rover using an inventory object
repair = 3; repair = 4;
// Broadcasts a message to nearby rovers // Broadcasts a message to nearby rovers, requires data
broadcast = 4; broadcast = 5;
} }
// Bearing represents a compass direction // Bearing represents a compass direction
@ -121,8 +123,10 @@ message Command {
oneof data { oneof data {
// A simple message, must be composed of printable ASCII glyphs (32-126) // A simple message, must be composed of printable ASCII glyphs (32-126)
// maximum of three characters // maximum of three characters
// Used with BROADCAST bytes broadcast = 2;
bytes message = 2;
// The bearing for the rover to turn to
Bearing turn = 3;
} }
} }
@ -218,6 +222,17 @@ message Vector {
int32 y = 2; 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 // StatusResponse is the response given to a status request
message StatusResponse { message StatusResponse {
// The name of the rover // The name of the rover
@ -226,33 +241,39 @@ message StatusResponse {
// Position of the rover in world coordinates // Position of the rover in world coordinates
Vector position = 2; Vector position = 2;
// The current direction of the rover
Bearing bearing = 3;
// The range of this rover's radar and broadcasting // The range of this rover's radar and broadcasting
int32 range = 3; int32 range = 4;
// The items in the rover inventory // The items in the rover inventory
bytes inventory = 4; bytes inventory = 5;
// The capacity of the inventory // The capacity of the inventory
int32 capacity = 5; int32 capacity = 6;
// The current health of the rover // The current health of the rover
int32 integrity = 6; int32 integrity = 7;
// The maximum health of the rover // The maximum health of the rover
int32 maximumIntegrity = 7; int32 maximumIntegrity = 8;
// The energy stored in the rover // The energy stored in the rover
int32 charge = 8; int32 charge = 9;
// The max energy the rover can store // 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 // The set of currently incoming commands for this tick
repeated Command incomingCommands = 10; repeated Command incomingCommands = 12;
// The set of currently queued commands // The set of currently queued commands
repeated Command queuedCommands = 11; repeated Command queuedCommands = 13;
// The most recent logs // The most recent logs
repeated Log logs = 12; repeated Log logs = 14;
} }