Add incoming and queued commands to status output
This commit is contained in:
parent
ea4b7de4ac
commit
233a6b3281
5 changed files with 140 additions and 65 deletions
|
@ -64,6 +64,21 @@ func (s *Server) Status(ctx context.Context, req *rove.StatusRequest) (*rove.Sta
|
||||||
inv = append(inv, byte(i.Type))
|
inv = append(inv, byte(i.Type))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i, q := s.world.RoverCommands(resp)
|
||||||
|
var incoming, queued []*rove.Command
|
||||||
|
for _, i := range i {
|
||||||
|
incoming = append(incoming, &rove.Command{
|
||||||
|
Command: i.Command,
|
||||||
|
Bearing: i.Bearing,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
for _, q := range q {
|
||||||
|
queued = append(queued, &rove.Command{
|
||||||
|
Command: q.Command,
|
||||||
|
Bearing: q.Bearing,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
response = &rove.StatusResponse{
|
response = &rove.StatusResponse{
|
||||||
Name: rover.Name,
|
Name: rover.Name,
|
||||||
Position: &rove.Vector{
|
Position: &rove.Vector{
|
||||||
|
@ -77,6 +92,8 @@ func (s *Server) Status(ctx context.Context, req *rove.StatusRequest) (*rove.Sta
|
||||||
MaximumIntegrity: int32(rover.MaximumIntegrity),
|
MaximumIntegrity: int32(rover.MaximumIntegrity),
|
||||||
Charge: int32(rover.Charge),
|
Charge: int32(rover.Charge),
|
||||||
MaximumCharge: int32(rover.MaximumCharge),
|
MaximumCharge: int32(rover.MaximumCharge),
|
||||||
|
IncomingCommands: incoming,
|
||||||
|
QueuedCommands: queued,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return response, nil
|
return response, nil
|
||||||
|
|
|
@ -30,7 +30,7 @@ type World struct {
|
||||||
CommandQueue map[string]CommandStream `json:"commands"`
|
CommandQueue map[string]CommandStream `json:"commands"`
|
||||||
|
|
||||||
// Incoming represents the set of commands to add to the queue at the end of the current tick
|
// Incoming represents the set of commands to add to the queue at the end of the current tick
|
||||||
Incoming map[string]CommandStream `json:"incoming"`
|
CommandIncoming map[string]CommandStream `json:"incoming"`
|
||||||
|
|
||||||
// Mutex to lock around command operations
|
// Mutex to lock around command operations
|
||||||
cmdMutex sync.RWMutex
|
cmdMutex sync.RWMutex
|
||||||
|
@ -62,7 +62,7 @@ func NewWorld(chunkSize int) *World {
|
||||||
return &World{
|
return &World{
|
||||||
Rovers: make(map[string]Rover),
|
Rovers: make(map[string]Rover),
|
||||||
CommandQueue: make(map[string]CommandStream),
|
CommandQueue: make(map[string]CommandStream),
|
||||||
Incoming: make(map[string]CommandStream),
|
CommandIncoming: make(map[string]CommandStream),
|
||||||
Atlas: atlas.NewAtlas(chunkSize),
|
Atlas: atlas.NewAtlas(chunkSize),
|
||||||
words: lines,
|
words: lines,
|
||||||
}
|
}
|
||||||
|
@ -359,6 +359,17 @@ func (w *World) RadarFromRover(rover string) (radar []byte, objs []byte, err err
|
||||||
return radar, objs, nil
|
return radar, objs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RoverCommands returns current commands for the given rover
|
||||||
|
func (w *World) RoverCommands(rover string) (incoming []Command, queued []Command) {
|
||||||
|
if c, ok := w.CommandIncoming[rover]; ok {
|
||||||
|
incoming = c
|
||||||
|
}
|
||||||
|
if c, ok := w.CommandQueue[rover]; ok {
|
||||||
|
queued = c
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 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 ...Command) error {
|
||||||
|
|
||||||
|
@ -395,12 +406,12 @@ func (w *World) Enqueue(rover string, commands ...Command) error {
|
||||||
// EnqueueAllIncoming will enqueue the incoming commands
|
// EnqueueAllIncoming will enqueue the incoming commands
|
||||||
func (w *World) EnqueueAllIncoming() {
|
func (w *World) EnqueueAllIncoming() {
|
||||||
// Add any incoming commands from this tick and clear that queue
|
// Add any incoming commands from this tick and clear that queue
|
||||||
for id, incoming := range w.Incoming {
|
for id, incoming := range w.CommandIncoming {
|
||||||
commands := w.CommandQueue[id]
|
commands := w.CommandQueue[id]
|
||||||
commands = append(commands, incoming...)
|
commands = append(commands, incoming...)
|
||||||
w.CommandQueue[id] = commands
|
w.CommandQueue[id] = commands
|
||||||
}
|
}
|
||||||
w.Incoming = make(map[string]CommandStream)
|
w.CommandIncoming = make(map[string]CommandStream)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExecuteCommandQueues will execute any commands in the current command queue
|
// ExecuteCommandQueues will execute any commands in the current command queue
|
||||||
|
|
|
@ -511,6 +511,10 @@ type StatusResponse struct {
|
||||||
Charge int32 `protobuf:"varint,8,opt,name=charge,proto3" json:"charge,omitempty"`
|
Charge int32 `protobuf:"varint,8,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,9,opt,name=maximumCharge,proto3" json:"maximumCharge,omitempty"`
|
||||||
|
// The set of currently incoming commands for this tick
|
||||||
|
IncomingCommands []*Command `protobuf:"bytes,10,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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *StatusResponse) Reset() {
|
func (x *StatusResponse) Reset() {
|
||||||
|
@ -608,6 +612,20 @@ func (x *StatusResponse) GetMaximumCharge() int32 {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *StatusResponse) GetIncomingCommands() []*Command {
|
||||||
|
if x != nil {
|
||||||
|
return x.IncomingCommands
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *StatusResponse) GetQueuedCommands() []*Command {
|
||||||
|
if x != nil {
|
||||||
|
return x.QueuedCommands
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Empty placeholder
|
// Empty placeholder
|
||||||
type ServerStatusRequest struct {
|
type ServerStatusRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
|
@ -810,7 +828,7 @@ var file_rove_rove_proto_rawDesc = []byte{
|
||||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x0d, 0x53, 0x74, 0x61,
|
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x0d, 0x53, 0x74, 0x61,
|
||||||
0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63,
|
0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63,
|
||||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63,
|
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63,
|
||||||
0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa6, 0x02, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
|
0x6f, 0x75, 0x6e, 0x74, 0x22, 0x98, 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,
|
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, 0x28, 0x0a, 0x08, 0x70,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x70,
|
||||||
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e,
|
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e,
|
||||||
|
@ -828,47 +846,54 @@ var file_rove_rove_proto_rawDesc = []byte{
|
||||||
0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52,
|
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,
|
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,
|
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, 0x22, 0x15, 0x0a,
|
0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x39, 0x0a,
|
||||||
0x13, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71,
|
0x10, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x22, 0x77, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74,
|
0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43,
|
||||||
0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09,
|
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67,
|
||||||
0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x35, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x75,
|
||||||
0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61,
|
0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b,
|
||||||
0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12,
|
0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52,
|
||||||
0x12, 0x0a, 0x04, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74,
|
0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22,
|
||||||
0x69, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04,
|
0x15, 0x0a, 0x13, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a,
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x77, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||||
0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01,
|
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b,
|
||||||
0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x52, 0x01, 0x79, 0x32, 0x91, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x5d, 0x0a, 0x0c,
|
0x09, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72,
|
||||||
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x2e, 0x72,
|
0x65, 0x61, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64,
|
||||||
0x6f, 0x76, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53,
|
0x04, 0x74, 0x69, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22,
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x73, 0x65,
|
0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01,
|
||||||
0x72, 0x76, 0x65, 0x72, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x08, 0x52,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52,
|
0x28, 0x05, 0x52, 0x01, 0x79, 0x32, 0x91, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x5d,
|
||||||
0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
|
0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19,
|
||||||
0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65,
|
0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09,
|
0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x6f, 0x76, 0x65,
|
||||||
0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4b, 0x0a, 0x07,
|
0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73,
|
||||||
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f,
|
||||||
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e,
|
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a,
|
||||||
0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70,
|
0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x22, 0x08, 0x2f, 0x63,
|
0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52, 0x61, 0x64,
|
0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72,
|
||||||
0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61,
|
0x22, 0x09, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4b,
|
||||||
0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4,
|
0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65,
|
||||||
0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x47,
|
0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e,
|
0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65,
|
||||||
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x22, 0x08,
|
||||||
0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52,
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x22, 0x07, 0x2f, 0x73, 0x74,
|
0x61, 0x64, 0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61,
|
||||||
0x61, 0x74, 0x75, 0x73, 0x3a, 0x01, 0x2a, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75,
|
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e,
|
||||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, 0x2f, 0x72, 0x6f, 0x76,
|
0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82,
|
||||||
0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x3a, 0x01, 0x2a,
|
||||||
0x6f, 0x33,
|
0x12, 0x47, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x2e, 0x72, 0x6f, 0x76,
|
||||||
|
0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
|
0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73,
|
||||||
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x22, 0x07, 0x2f,
|
||||||
|
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x01, 0x2a, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74,
|
||||||
|
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, 0x2f, 0x72,
|
||||||
|
0x6f, 0x76, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x62, 0x06, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -902,21 +927,23 @@ var file_rove_rove_proto_goTypes = []interface{}{
|
||||||
var file_rove_rove_proto_depIdxs = []int32{
|
var file_rove_rove_proto_depIdxs = []int32{
|
||||||
0, // 0: rove.CommandRequest.commands:type_name -> rove.Command
|
0, // 0: rove.CommandRequest.commands:type_name -> rove.Command
|
||||||
12, // 1: rove.StatusResponse.position:type_name -> rove.Vector
|
12, // 1: rove.StatusResponse.position:type_name -> rove.Vector
|
||||||
10, // 2: rove.Rove.ServerStatus:input_type -> rove.ServerStatusRequest
|
0, // 2: rove.StatusResponse.incomingCommands:type_name -> rove.Command
|
||||||
7, // 3: rove.Rove.Register:input_type -> rove.RegisterRequest
|
0, // 3: rove.StatusResponse.queuedCommands:type_name -> rove.Command
|
||||||
1, // 4: rove.Rove.Command:input_type -> rove.CommandRequest
|
10, // 4: rove.Rove.ServerStatus:input_type -> rove.ServerStatusRequest
|
||||||
4, // 5: rove.Rove.Radar:input_type -> rove.RadarRequest
|
7, // 5: rove.Rove.Register:input_type -> rove.RegisterRequest
|
||||||
8, // 6: rove.Rove.Status:input_type -> rove.StatusRequest
|
1, // 6: rove.Rove.Command:input_type -> rove.CommandRequest
|
||||||
11, // 7: rove.Rove.ServerStatus:output_type -> rove.ServerStatusResponse
|
4, // 7: rove.Rove.Radar:input_type -> rove.RadarRequest
|
||||||
6, // 8: rove.Rove.Register:output_type -> rove.RegisterResponse
|
8, // 8: rove.Rove.Status:input_type -> rove.StatusRequest
|
||||||
2, // 9: rove.Rove.Command:output_type -> rove.CommandResponse
|
11, // 9: rove.Rove.ServerStatus:output_type -> rove.ServerStatusResponse
|
||||||
5, // 10: rove.Rove.Radar:output_type -> rove.RadarResponse
|
6, // 10: rove.Rove.Register:output_type -> rove.RegisterResponse
|
||||||
9, // 11: rove.Rove.Status:output_type -> rove.StatusResponse
|
2, // 11: rove.Rove.Command:output_type -> rove.CommandResponse
|
||||||
7, // [7:12] is the sub-list for method output_type
|
5, // 12: rove.Rove.Radar:output_type -> rove.RadarResponse
|
||||||
2, // [2:7] is the sub-list for method input_type
|
9, // 13: rove.Rove.Status:output_type -> rove.StatusResponse
|
||||||
2, // [2:2] is the sub-list for extension type_name
|
9, // [9:14] is the sub-list for method output_type
|
||||||
2, // [2:2] is the sub-list for extension extendee
|
4, // [4:9] is the sub-list for method input_type
|
||||||
0, // [0:2] is the sub-list for field type_name
|
4, // [4:4] is the sub-list for extension type_name
|
||||||
|
4, // [4:4] is the sub-list for extension extendee
|
||||||
|
0, // [0:4] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_rove_rove_proto_init() }
|
func init() { file_rove_rove_proto_init() }
|
||||||
|
|
|
@ -359,6 +359,20 @@
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int32",
|
"format": "int32",
|
||||||
"title": "The max energy the rover can store"
|
"title": "The max energy the rover can store"
|
||||||
|
},
|
||||||
|
"incomingCommands": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/roveCommand"
|
||||||
|
},
|
||||||
|
"title": "The set of currently incoming commands for this tick"
|
||||||
|
},
|
||||||
|
"queuedCommands": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/roveCommand"
|
||||||
|
},
|
||||||
|
"title": "The set of currently queued commands"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -144,6 +144,12 @@ message StatusResponse {
|
||||||
|
|
||||||
// The max energy the rover can store
|
// The max energy the rover can store
|
||||||
int32 maximumCharge = 9;
|
int32 maximumCharge = 9;
|
||||||
|
|
||||||
|
// The set of currently incoming commands for this tick
|
||||||
|
repeated Command incomingCommands = 10;
|
||||||
|
|
||||||
|
// The set of currently queued commands
|
||||||
|
repeated Command queuedCommands = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Empty placeholder
|
// Empty placeholder
|
||||||
|
|
Loading…
Add table
Reference in a new issue