diff --git a/Dockerfile b/Dockerfile index f5a1f4b..74b87c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,6 @@ RUN go mod download # Build the executables RUN go build -o rove -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=$(git describe --always --long --dirty --tags)'" cmd/rove/main.go RUN go build -o rove-server -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=$(git describe --always --long --dirty --tags)'" cmd/rove-server/main.go -RUN go build -o rove-server-rest-proxy cmd/rove-server-rest-proxy/main.go CMD [ "./rove-server" ] diff --git a/Dockerfile.docs b/Dockerfile.docs deleted file mode 100644 index c74f94b..0000000 --- a/Dockerfile.docs +++ /dev/null @@ -1,8 +0,0 @@ -FROM quay.io/goswagger/swagger:latest -LABEL maintainer="Marc Di Luzio " - -WORKDIR /app -COPY . . - -CMD [ "serve", "pkg/rove/rove.swagger.json", "--no-open" ] - diff --git a/Makefile b/Makefile index cf7f33b..0ef8cd7 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,6 @@ gen: @echo Generating rove server gRPC and gateway protoc --proto_path proto --go_out=plugins=grpc,paths=source_relative:pkg/ proto/rove/rove.proto protoc --proto_path proto --grpc-gateway_out=paths=source_relative:pkg/ proto/rove/rove.proto - @echo Generating rove server swagger - protoc --proto_path proto --swagger_out=logtostderr=true:pkg/ proto/rove/rove.proto test: @echo Unit tests diff --git a/cmd/rove-server-rest-proxy/http_test.go b/cmd/rove-server-rest-proxy/http_test.go deleted file mode 100644 index f590f74..0000000 --- a/cmd/rove-server-rest-proxy/http_test.go +++ /dev/null @@ -1,150 +0,0 @@ -// +build integration - -package main - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "log" - "net/http" - "net/url" - "os" - "testing" - - "github.com/google/uuid" - "github.com/mdiluz/rove/pkg/rove" - "github.com/stretchr/testify/assert" -) - -// Server is a simple wrapper to a server path -type Server string - -// Request performs a HTTP -func (s Server) Request(method, path string, in, out interface{}) error { - u := url.URL{ - Scheme: "http", - Host: fmt.Sprintf("%s:8080", string(s)), - Path: path, - } - client := &http.Client{} - - // Marshal the input - marshalled, err := json.Marshal(in) - if err != nil { - return err - } - - // Set up the request - req, err := http.NewRequest(method, u.String(), bytes.NewReader(marshalled)) - if err != nil { - return err - } - - // Do the POST - req.Header.Set("Content-Type", "application/json") - if resp, err := client.Do(req); err != nil { - return err - - } else if resp.StatusCode != http.StatusOK { - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return fmt.Errorf("failed to read response body to code %d", resp.StatusCode) - } - return fmt.Errorf("http returned status %d: %s", resp.StatusCode, string(body)) - - } else { - return json.NewDecoder(resp.Body).Decode(out) - } -} - -var serv = Server(os.Getenv("ROVE_HTTP")) - -func TestServer_ServerStatus(t *testing.T) { - req := &rove.ServerStatusRequest{} - resp := &rove.ServerStatusResponse{} - if err := serv.Request("GET", "server-status", req, resp); err != nil { - log.Fatal(err) - } -} - -func TestServer_Register(t *testing.T) { - req := &rove.RegisterRequest{Name: uuid.New().String()} - resp := &rove.RegisterResponse{} - err := serv.Request("POST", "register", req, resp) - assert.NoError(t, err, "First register attempt should pass") - err = serv.Request("POST", "register", req, resp) - assert.Error(t, err, "Second identical register attempt should fail") -} - -func TestServer_Command(t *testing.T) { - acc := uuid.New().String() - var resp rove.RegisterResponse - err := serv.Request("POST", "register", &rove.RegisterRequest{Name: acc}, &resp) - assert.NoError(t, err, "First register attempt should pass") - - req := &rove.CommandRequest{ - Account: &rove.Account{ - Name: resp.Account.Name, - }, - Commands: []*rove.Command{ - { - Command: "move", - Bearing: "NE", - }, - }, - } - - assert.Error(t, serv.Request("POST", "command", req, &rove.CommandResponse{}), "Commands should fail with no secret") - - req.Account.Secret = resp.Account.Secret - assert.NoError(t, serv.Request("POST", "command", req, &rove.CommandResponse{}), "Commands should pass") -} - -func TestServer_Radar(t *testing.T) { - acc := uuid.New().String() - var reg rove.RegisterResponse - err := serv.Request("POST", "register", &rove.RegisterRequest{Name: acc}, ®) - assert.NoError(t, err, "First register attempt should pass") - - resp := &rove.RadarResponse{} - req := &rove.RadarRequest{ - Account: &rove.Account{ - Name: reg.Account.Name, - }, - } - - assert.Error(t, serv.Request("POST", "radar", req, resp), "Radar should fail without secret") - req.Account.Secret = reg.Account.Secret - - assert.NoError(t, serv.Request("POST", "radar", req, resp), "Radar should pass") - assert.NotZero(t, resp.Range, "Radar should return valid range") - - w := int(resp.Range*2 + 1) - assert.Equal(t, w*w, len(resp.Tiles), "radar should return correct number of tiles") - assert.Equal(t, w*w, len(resp.Objects), "radar should return correct number of objects") -} - -func TestServer_Status(t *testing.T) { - acc := uuid.New().String() - var reg rove.RegisterResponse - err := serv.Request("POST", "register", &rove.RegisterRequest{Name: acc}, ®) - assert.NoError(t, err, "First register attempt should pass") - - resp := &rove.StatusResponse{} - req := &rove.StatusRequest{ - Account: &rove.Account{ - Name: reg.Account.Name, - }, - } - - assert.Error(t, serv.Request("POST", "status", req, resp), "Status should fail without secret") - req.Account.Secret = reg.Account.Secret - - assert.NoError(t, serv.Request("POST", "status", req, resp), "Status should pass") - assert.NotZero(t, resp.Range, "Rover should return valid range") - assert.NotZero(t, len(resp.Name), "Rover should return valid name") - assert.NotZero(t, resp.Position, "Rover should return valid position") - assert.NotZero(t, resp.Integrity, "Rover should have positive integrity") -} diff --git a/cmd/rove-server-rest-proxy/main.go b/cmd/rove-server-rest-proxy/main.go deleted file mode 100644 index 06653b6..0000000 --- a/cmd/rove-server-rest-proxy/main.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "context" - "fmt" - "log" - "net/http" - "os" - "strconv" - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "google.golang.org/grpc" - - "github.com/mdiluz/rove/pkg/rove" -) - -func main() { - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - var endpoint = os.Getenv("ROVE_GRPC") - if len(endpoint) == 0 { - endpoint = "localhost:9090" - } - - var iport int - var port = os.Getenv("PORT") - if len(port) == 0 { - iport = 8080 - } else { - var err error - iport, err = strconv.Atoi(port) - if err != nil { - log.Fatal("$PORT not valid int") - } - } - - // Create a new mux and register it with the gRPC endpoint - fmt.Printf("Hosting reverse-proxy on %d for %s\n", iport, endpoint) - mux := runtime.NewServeMux() - opts := []grpc.DialOption{grpc.WithInsecure()} - if err := rove.RegisterRoveHandlerFromEndpoint(ctx, mux, endpoint, opts); err != nil { - log.Fatal(err) - } - - // Start the HTTP server and proxy calls to gRPC endpoint when needed - if err := http.ListenAndServe(fmt.Sprintf(":%d", iport), mux); err != nil { - log.Fatal(err) - } -} diff --git a/cmd/rove-server/internal/routes.go b/cmd/rove-server/internal/routes.go index 702d227..e533cbf 100644 --- a/cmd/rove-server/internal/routes.go +++ b/cmd/rove-server/internal/routes.go @@ -79,18 +79,36 @@ func (s *Server) Status(ctx context.Context, req *rove.StatusRequest) (response i, q := s.world.RoverCommands(resp) var incoming, queued []*rove.Command for _, i := range i { - incoming = append(incoming, &rove.Command{ + c := &rove.Command{ Command: i.Command, - Bearing: i.Bearing, - Message: i.Message, - }) + } + switch i.Command { + case rove.CommandType_move: + c.Data = &rove.Command_Bearing{ + Bearing: i.Bearing, + } + case rove.CommandType_broadcast: + c.Data = &rove.Command_Message{ + Message: i.Message, + } + } + incoming = append(incoming, c) } for _, q := range q { - queued = append(queued, &rove.Command{ + c := &rove.Command{ Command: q.Command, - Bearing: q.Bearing, - Message: q.Message, - }) + } + switch q.Command { + case rove.CommandType_move: + c.Data = &rove.Command_Bearing{ + Bearing: q.Bearing, + } + case rove.CommandType_broadcast: + c.Data = &rove.Command_Message{ + Message: q.Message, + } + } + queued = append(queued, c) } var logs []*rove.Log for _, log := range rover.Logs { @@ -171,9 +189,16 @@ func (s *Server) Command(ctx context.Context, req *rove.CommandRequest) (*rove.C var cmds []game.Command for _, c := range req.Commands { - cmds = append(cmds, game.Command{ - Bearing: c.Bearing, - Command: c.Command}) + n := game.Command{ + Command: c.Command, + } + switch c.Command { + case rove.CommandType_move: + n.Bearing = c.GetBearing() + case rove.CommandType_broadcast: + n.Message = c.GetMessage() + } + cmds = append(cmds, n) } if err := s.world.Enqueue(resp, cmds...); err != nil { diff --git a/cmd/rove/main.go b/cmd/rove/main.go index 059052d..5f51e32 100644 --- a/cmd/rove/main.go +++ b/cmd/rove/main.go @@ -12,7 +12,6 @@ import ( "github.com/mdiluz/rove/pkg/atlas" "github.com/mdiluz/rove/pkg/bearing" - "github.com/mdiluz/rove/pkg/game" "github.com/mdiluz/rove/pkg/objects" "github.com/mdiluz/rove/pkg/rove" "github.com/mdiluz/rove/pkg/version" @@ -222,8 +221,8 @@ func InnerMain(command string, args ...string) error { } commands = append(commands, &rove.Command{ - Command: game.CommandMove, - Bearing: args[i], + Command: rove.CommandType_move, + Data: &rove.Command_Bearing{Bearing: args[i]}, }, ) case "broadcast": @@ -235,15 +234,15 @@ func InnerMain(command string, args ...string) error { } commands = append(commands, &rove.Command{ - Command: game.CommandBroadcast, - Message: []byte(args[i]), + Command: rove.CommandType_broadcast, + Data: &rove.Command_Message{Message: []byte(args[i])}, }, ) default: // By default just use the command literally commands = append(commands, &rove.Command{ - Command: args[i], + Command: rove.CommandType(rove.CommandType_value[args[i]]), }, ) } diff --git a/docker-compose.yml b/docker-compose.yml index 7109118..71013b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,16 +4,6 @@ volumes: persistent-data: services: - rove-docs: - build: - context: . - dockerfile: Dockerfile.docs - image: rove-docs:latest - ports: - - "80:80" - environment: - - PORT=80 - rove-server: build: context: . @@ -30,29 +20,15 @@ services: - persistent-data:/mnt/rove-server:rw command: [ "./rove-server"] - rove: - depends_on: [ rove-server, rove-docs ] - build: - context: . - dockerfile: Dockerfile - image: rove:latest - ports: - - "8080:8080" - environment: - - PORT=8080 - - ROVE_GRPC=rove-server:9090 - command: [ "./script/wait-for-it.sh", "rove-server:9090", "--", "./rove-server-rest-proxy" ] - rove-tests: - depends_on: [ rove ] + depends_on: [ rove-server ] build: context: . dockerfile: Dockerfile image: rove:latest environment: - - ROVE_HTTP=rove - ROVE_GRPC=rove-server - command: [ "./script/wait-for-it.sh", "rove:8080", "--", "go", "test", "-v", "./...", "--tags=integration", "-cover", "-coverprofile=/mnt/coverage-data/c.out", "-count", "1" ] + command: [ "./script/wait-for-it.sh", "rove-server:9090", "--", "go", "test", "-v", "./...", "--tags=integration", "-cover", "-coverprofile=/mnt/coverage-data/c.out", "-count", "1" ] volumes: - /tmp/coverage-data:/mnt/coverage-data:rw diff --git a/pkg/game/command.go b/pkg/game/command.go index 96f95d8..b57f678 100644 --- a/pkg/game/command.go +++ b/pkg/game/command.go @@ -1,25 +1,10 @@ package game -const ( - // CommandMove Moves the rover in the chosen bearing - CommandMove = "move" - - // CommandStash Will attempt to stash the object at the current location - CommandStash = "stash" - - // CommandRepair Will attempt to repair the rover with an inventory object - CommandRepair = "repair" - - // CommandRecharge Will use one tick to charge the rover - CommandRecharge = "recharge" - - // CommandBroadcast will broadcast a message to nearby rovers within range - CommandBroadcast = "broadcast" -) +import "github.com/mdiluz/rove/pkg/rove" // Command represends a single command to execute type Command struct { - Command string `json:"command"` + Command rove.CommandType `json:"command"` // Used in the move command Bearing string `json:"bearing,omitempty"` diff --git a/pkg/game/command_test.go b/pkg/game/command_test.go index 45cb182..10ccbe5 100644 --- a/pkg/game/command_test.go +++ b/pkg/game/command_test.go @@ -3,6 +3,7 @@ package game import ( "testing" + "github.com/mdiluz/rove/pkg/rove" "github.com/mdiluz/rove/pkg/vector" "github.com/stretchr/testify/assert" ) @@ -20,7 +21,7 @@ func TestCommand_Move(t *testing.T) { assert.NoError(t, err, "Failed to set position for rover") // Try the move command - moveCommand := Command{Command: CommandMove, Bearing: "N"} + moveCommand := Command{Command: rove.CommandType_move, Bearing: "N"} assert.NoError(t, world.Enqueue(a, moveCommand), "Failed to execute move command") // Tick the world @@ -46,7 +47,7 @@ func TestCommand_Recharge(t *testing.T) { assert.NoError(t, err, "Failed to set position for rover") // Move to use up some charge - moveCommand := Command{Command: CommandMove, Bearing: "N"} + moveCommand := Command{Command: rove.CommandType_move, Bearing: "N"} assert.NoError(t, world.Enqueue(a, moveCommand), "Failed to queue move command") // Tick the world @@ -56,7 +57,7 @@ func TestCommand_Recharge(t *testing.T) { rover, _ := world.GetRover(a) assert.Equal(t, rover.MaximumCharge-1, rover.Charge) - chargeCommand := Command{Command: CommandRecharge} + chargeCommand := Command{Command: rove.CommandType_recharge} assert.NoError(t, world.Enqueue(a, chargeCommand), "Failed to queue recharge command") // Tick the world diff --git a/pkg/game/world.go b/pkg/game/world.go index a48bea0..19183f5 100644 --- a/pkg/game/world.go +++ b/pkg/game/world.go @@ -12,6 +12,7 @@ import ( "github.com/mdiluz/rove/pkg/atlas" "github.com/mdiluz/rove/pkg/bearing" "github.com/mdiluz/rove/pkg/objects" + "github.com/mdiluz/rove/pkg/rove" "github.com/mdiluz/rove/pkg/vector" ) @@ -429,11 +430,11 @@ func (w *World) Enqueue(rover string, commands ...Command) error { // First validate the commands for _, c := range commands { switch c.Command { - case CommandMove: + case rove.CommandType_move: if _, err := bearing.FromString(c.Bearing); err != nil { return fmt.Errorf("unknown bearing: %s", c.Bearing) } - case CommandBroadcast: + case rove.CommandType_broadcast: if len(c.Message) > 3 { return fmt.Errorf("too many characters in message (limit 3): %d", len(c.Message)) } @@ -442,9 +443,9 @@ func (w *World) Enqueue(rover string, commands ...Command) error { return fmt.Errorf("invalid message character: %c", b) } } - case CommandStash: - case CommandRepair: - case CommandRecharge: + case rove.CommandType_stash: + case rove.CommandType_repair: + case rove.CommandType_recharge: // Nothing to verify default: return fmt.Errorf("unknown command: %s", c.Command) @@ -508,19 +509,19 @@ func (w *World) ExecuteCommand(c *Command, rover string) (err error) { log.Printf("Executing command: %+v for %s\n", *c, rover) switch c.Command { - case CommandMove: + case rove.CommandType_move: if dir, err := bearing.FromString(c.Bearing); err != nil { return err } else if _, err := w.MoveRover(rover, dir); err != nil { return err } - case CommandStash: + case rove.CommandType_stash: if _, err := w.RoverStash(rover); err != nil { return err } - case CommandRepair: + case rove.CommandType_repair: r, err := w.GetRover(rover) if err != nil { return err @@ -532,12 +533,12 @@ func (w *World) ExecuteCommand(c *Command, rover string) (err error) { r.AddLogEntryf("repaired self to %d", r.Integrity) w.Rovers[rover] = r } - case CommandRecharge: + case rove.CommandType_recharge: _, err := w.RoverRecharge(rover) if err != nil { return err } - case CommandBroadcast: + case rove.CommandType_broadcast: if err := w.RoverBroadcast(rover, c.Message); err != nil { return err } diff --git a/pkg/game/world_test.go b/pkg/game/world_test.go index c9654c5..35c0a22 100644 --- a/pkg/game/world_test.go +++ b/pkg/game/world_test.go @@ -6,6 +6,7 @@ import ( "github.com/mdiluz/rove/pkg/atlas" "github.com/mdiluz/rove/pkg/bearing" "github.com/mdiluz/rove/pkg/objects" + "github.com/mdiluz/rove/pkg/rove" "github.com/mdiluz/rove/pkg/vector" "github.com/stretchr/testify/assert" ) @@ -272,7 +273,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: CommandRepair}, a) + err = world.ExecuteCommand(&Command{Command: rove.CommandType_repair}, a) assert.NoError(t, err, "Failed to repair rover") newinfo, err = world.GetRover(a) @@ -286,7 +287,7 @@ func TestWorld_RoverRepair(t *testing.T) { assert.NoError(t, err, "Failed to stash") assert.Equal(t, objects.SmallRock, o, "Failed to get correct object") - err = world.ExecuteCommand(&Command{Command: CommandRepair}, a) + err = world.ExecuteCommand(&Command{Command: rove.CommandType_repair}, a) assert.NoError(t, err, "Failed to repair rover") newinfo, err = world.GetRover(a) diff --git a/pkg/rove/rove.pb.go b/pkg/rove/rove.pb.go index 19fa01d..2186fd9 100644 --- a/pkg/rove/rove.pb.go +++ b/pkg/rove/rove.pb.go @@ -6,14 +6,14 @@ // Rove // -// Rove is an asychronous nomadic game about exploring a planet as part of a loose community +// Rove is an asychronous nomadic game about exploring a planet as part of a +// loose community package rove import ( context "context" proto "github.com/golang/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -34,29 +34,368 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 +// CommandType defines the type of a command to give to the rover +type CommandType int32 + +const ( + CommandType_none CommandType = 0 + // Move the rover in a direction, requires bearing + CommandType_move CommandType = 1 + // Stashes item at current location in rover inventory + CommandType_stash CommandType = 2 + // Repairs the rover using an inventory object + CommandType_repair CommandType = 3 + // Waits a tick to add more charge to the rover + CommandType_recharge CommandType = 4 + // Broadcasts a message to nearby rovers + CommandType_broadcast CommandType = 5 +) + +// Enum value maps for CommandType. +var ( + CommandType_name = map[int32]string{ + 0: "none", + 1: "move", + 2: "stash", + 3: "repair", + 4: "recharge", + 5: "broadcast", + } + CommandType_value = map[string]int32{ + "none": 0, + "move": 1, + "stash": 2, + "repair": 3, + "recharge": 4, + "broadcast": 5, + } +) + +func (x CommandType) Enum() *CommandType { + p := new(CommandType) + *p = x + return p +} + +func (x CommandType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommandType) Descriptor() protoreflect.EnumDescriptor { + return file_rove_rove_proto_enumTypes[0].Descriptor() +} + +func (CommandType) Type() protoreflect.EnumType { + return &file_rove_rove_proto_enumTypes[0] +} + +func (x CommandType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CommandType.Descriptor instead. +func (CommandType) EnumDescriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{0} +} + +// ServerStatusRequest is an empty placeholder +type ServerStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ServerStatusRequest) Reset() { + *x = ServerStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerStatusRequest) ProtoMessage() {} + +func (x *ServerStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerStatusRequest.ProtoReflect.Descriptor instead. +func (*ServerStatusRequest) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{0} +} + +// ServerStatusResponse is a response with useful server information +type ServerStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The version of the server in v{major}.{minor}-{delta}-{sha} form + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Whether the server is ready to accept requests + Ready bool `protobuf:"varint,2,opt,name=ready,proto3" json:"ready,omitempty"` + // The tick rate of the server in minutes (how many minutes per tick) + TickRate int32 `protobuf:"varint,3,opt,name=tickRate,proto3" json:"tickRate,omitempty"` + // The current tick of the server + CurrentTick int32 `protobuf:"varint,4,opt,name=currentTick,proto3" json:"currentTick,omitempty"` + // The time the next tick will occur + NextTick string `protobuf:"bytes,5,opt,name=next_tick,json=nextTick,proto3" json:"next_tick,omitempty"` +} + +func (x *ServerStatusResponse) Reset() { + *x = ServerStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerStatusResponse) ProtoMessage() {} + +func (x *ServerStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerStatusResponse.ProtoReflect.Descriptor instead. +func (*ServerStatusResponse) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{1} +} + +func (x *ServerStatusResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ServerStatusResponse) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +func (x *ServerStatusResponse) GetTickRate() int32 { + if x != nil { + return x.TickRate + } + return 0 +} + +func (x *ServerStatusResponse) GetCurrentTick() int32 { + if x != nil { + return x.CurrentTick + } + return 0 +} + +func (x *ServerStatusResponse) GetNextTick() string { + if x != nil { + return x.NextTick + } + return "" +} + +// RegisterRequest contains data to register an account +type RegisterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The desired account name + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *RegisterRequest) Reset() { + *x = RegisterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterRequest) ProtoMessage() {} + +func (x *RegisterRequest) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead. +func (*RegisterRequest) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{2} +} + +func (x *RegisterRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Account describes a registered account +type Account struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The account name + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The account secret value, given when creating the account + Secret string `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"` +} + +func (x *Account) Reset() { + *x = Account{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Account) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Account) ProtoMessage() {} + +func (x *Account) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{3} +} + +func (x *Account) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Account) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +// RegisterResponse is the response given to registering an account +type RegisterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The registered account information + Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` +} + +func (x *RegisterResponse) Reset() { + *x = RegisterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterResponse) ProtoMessage() {} + +func (x *RegisterResponse) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead. +func (*RegisterResponse) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{4} +} + +func (x *RegisterResponse) GetAccount() *Account { + if x != nil { + return x.Account + } + return nil +} + +// Command is a single command for a rover type Command struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The command to execute - // "move" - Move the rover in a direction, requires bearing - // "stash" - Stashes item at current location in rover inventory - // "repair" - Repairs the rover using an inventory object - // "recharge" - Waits a tick to add more charge to the rover - // "broadcast" - Broadcasts a message to nearby rovers - Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` - // A bearing, example: NE - Bearing string `protobuf:"bytes,2,opt,name=bearing,proto3" json:"bearing,omitempty"` - // A simple message, must be composed of printable ASCII glyphs (32-126) - // maximum of three characters - Message []byte `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + // The command type + Command CommandType `protobuf:"varint,1,opt,name=command,proto3,enum=rove.CommandType" json:"command,omitempty"` + // Types that are assignable to Data: + // *Command_Bearing + // *Command_Message + Data isCommand_Data `protobuf_oneof:"data"` } func (x *Command) Reset() { *x = Command{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[0] + mi := &file_rove_rove_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -69,7 +408,7 @@ func (x *Command) String() string { func (*Command) ProtoMessage() {} func (x *Command) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[0] + mi := &file_rove_rove_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -82,30 +421,59 @@ func (x *Command) ProtoReflect() protoreflect.Message { // Deprecated: Use Command.ProtoReflect.Descriptor instead. func (*Command) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{0} + return file_rove_rove_proto_rawDescGZIP(), []int{5} } -func (x *Command) GetCommand() string { +func (x *Command) GetCommand() CommandType { if x != nil { return x.Command } - return "" + return CommandType_none +} + +func (m *Command) GetData() isCommand_Data { + if m != nil { + return m.Data + } + return nil } func (x *Command) GetBearing() string { - if x != nil { + if x, ok := x.GetData().(*Command_Bearing); ok { return x.Bearing } return "" } func (x *Command) GetMessage() []byte { - if x != nil { + if x, ok := x.GetData().(*Command_Message); ok { return x.Message } return nil } +type isCommand_Data interface { + isCommand_Data() +} + +type Command_Bearing struct { + // A bearing, example: NE + // Used with MOVE + Bearing string `protobuf:"bytes,2,opt,name=bearing,proto3,oneof"` +} + +type Command_Message struct { + // A simple message, must be composed of printable ASCII glyphs (32-126) + // maximum of three characters + // Used with BROADCAST + Message []byte `protobuf:"bytes,3,opt,name=message,proto3,oneof"` +} + +func (*Command_Bearing) isCommand_Data() {} + +func (*Command_Message) isCommand_Data() {} + +// CommandRequest describes a set of commands to be requested for the rover type CommandRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -120,7 +488,7 @@ type CommandRequest struct { func (x *CommandRequest) Reset() { *x = CommandRequest{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[1] + mi := &file_rove_rove_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -133,7 +501,7 @@ func (x *CommandRequest) String() string { func (*CommandRequest) ProtoMessage() {} func (x *CommandRequest) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[1] + mi := &file_rove_rove_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -146,7 +514,7 @@ func (x *CommandRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CommandRequest.ProtoReflect.Descriptor instead. func (*CommandRequest) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{1} + return file_rove_rove_proto_rawDescGZIP(), []int{6} } func (x *CommandRequest) GetAccount() *Account { @@ -163,7 +531,7 @@ func (x *CommandRequest) GetCommands() []*Command { return nil } -// Empty placeholder +// CommandResponse is an empty placeholder type CommandResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -173,7 +541,7 @@ type CommandResponse struct { func (x *CommandResponse) Reset() { *x = CommandResponse{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[2] + mi := &file_rove_rove_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -186,7 +554,7 @@ func (x *CommandResponse) String() string { func (*CommandResponse) ProtoMessage() {} func (x *CommandResponse) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[2] + mi := &file_rove_rove_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -199,57 +567,10 @@ func (x *CommandResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CommandResponse.ProtoReflect.Descriptor instead. func (*CommandResponse) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{2} -} - -type Error struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // An explanation for the HTTP error returned - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (x *Error) Reset() { - *x = Error{} - if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Error) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Error) ProtoMessage() {} - -func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Error.ProtoReflect.Descriptor instead. -func (*Error) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{3} -} - -func (x *Error) GetError() string { - if x != nil { - return x.Error - } - return "" + return file_rove_rove_proto_rawDescGZIP(), []int{7} } +// RadarRequest is the data needed to request the radar for a rover type RadarRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -262,7 +583,7 @@ type RadarRequest struct { func (x *RadarRequest) Reset() { *x = RadarRequest{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[4] + mi := &file_rove_rove_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -275,7 +596,7 @@ func (x *RadarRequest) String() string { func (*RadarRequest) ProtoMessage() {} func (x *RadarRequest) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[4] + mi := &file_rove_rove_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -288,7 +609,7 @@ func (x *RadarRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RadarRequest.ProtoReflect.Descriptor instead. func (*RadarRequest) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{4} + return file_rove_rove_proto_rawDescGZIP(), []int{8} } func (x *RadarRequest) GetAccount() *Account { @@ -298,6 +619,7 @@ func (x *RadarRequest) GetAccount() *Account { return nil } +// RadarResponse describes radar information type RadarResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -305,7 +627,8 @@ type RadarResponse struct { // The range in tiles from the rover of the radar data Range int32 `protobuf:"varint,1,opt,name=range,proto3" json:"range,omitempty"` - // A 1D array representing range*2 + 1 squared set of tiles, origin bottom left and in row->column order + // A 1D array representing range*2 + 1 squared set of tiles, origin bottom + // left and in row->column order Tiles []byte `protobuf:"bytes,2,opt,name=tiles,proto3" json:"tiles,omitempty"` // A similar array to the tile array, but containing objects Objects []byte `protobuf:"bytes,3,opt,name=objects,proto3" json:"objects,omitempty"` @@ -314,7 +637,7 @@ type RadarResponse struct { func (x *RadarResponse) Reset() { *x = RadarResponse{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[5] + mi := &file_rove_rove_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -327,7 +650,7 @@ func (x *RadarResponse) String() string { func (*RadarResponse) ProtoMessage() {} func (x *RadarResponse) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[5] + mi := &file_rove_rove_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -340,7 +663,7 @@ func (x *RadarResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RadarResponse.ProtoReflect.Descriptor instead. func (*RadarResponse) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{5} + return file_rove_rove_proto_rawDescGZIP(), []int{9} } func (x *RadarResponse) GetRange() int32 { @@ -364,103 +687,7 @@ func (x *RadarResponse) GetObjects() []byte { return nil } -type RegisterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The desired account name - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *RegisterRequest) Reset() { - *x = RegisterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterRequest) ProtoMessage() {} - -func (x *RegisterRequest) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead. -func (*RegisterRequest) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{6} -} - -func (x *RegisterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Empty placeholder -type RegisterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The registered account information - Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` -} - -func (x *RegisterResponse) Reset() { - *x = RegisterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterResponse) ProtoMessage() {} - -func (x *RegisterResponse) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead. -func (*RegisterResponse) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{7} -} - -func (x *RegisterResponse) GetAccount() *Account { - if x != nil { - return x.Account - } - return nil -} - +// StatusRequest is information needed to request rover status type StatusRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -473,7 +700,7 @@ type StatusRequest struct { func (x *StatusRequest) Reset() { *x = StatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[8] + mi := &file_rove_rove_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -486,7 +713,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[8] + mi := &file_rove_rove_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -499,7 +726,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{8} + return file_rove_rove_proto_rawDescGZIP(), []int{10} } func (x *StatusRequest) GetAccount() *Account { @@ -509,6 +736,7 @@ func (x *StatusRequest) GetAccount() *Account { return nil } +// Log is a single log item type Log struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -523,7 +751,7 @@ type Log struct { func (x *Log) Reset() { *x = Log{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[9] + mi := &file_rove_rove_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -536,7 +764,7 @@ func (x *Log) String() string { func (*Log) ProtoMessage() {} func (x *Log) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[9] + mi := &file_rove_rove_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -549,7 +777,7 @@ func (x *Log) ProtoReflect() protoreflect.Message { // Deprecated: Use Log.ProtoReflect.Descriptor instead. func (*Log) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{9} + return file_rove_rove_proto_rawDescGZIP(), []int{11} } func (x *Log) GetTime() string { @@ -566,6 +794,63 @@ func (x *Log) GetText() string { return "" } +// Vector describes a point or vector in 2D space +type Vector struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + Y int32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"` +} + +func (x *Vector) Reset() { + *x = Vector{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Vector) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Vector) ProtoMessage() {} + +func (x *Vector) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Vector.ProtoReflect.Descriptor instead. +func (*Vector) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{12} +} + +func (x *Vector) GetX() int32 { + if x != nil { + return x.X + } + return 0 +} + +func (x *Vector) GetY() int32 { + if x != nil { + return x.Y + } + return 0 +} + +// StatusResponse is the response given to a status request type StatusResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -600,7 +885,7 @@ type StatusResponse struct { func (x *StatusResponse) Reset() { *x = StatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[10] + mi := &file_rove_rove_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -613,7 +898,7 @@ func (x *StatusResponse) String() string { func (*StatusResponse) ProtoMessage() {} func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[10] + mi := &file_rove_rove_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -626,7 +911,7 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{10} + return file_rove_rove_proto_rawDescGZIP(), []int{13} } func (x *StatusResponse) GetName() string { @@ -713,356 +998,120 @@ func (x *StatusResponse) GetLogs() []*Log { return nil } -// Empty placeholder -type ServerStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ServerStatusRequest) Reset() { - *x = ServerStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerStatusRequest) ProtoMessage() {} - -func (x *ServerStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerStatusRequest.ProtoReflect.Descriptor instead. -func (*ServerStatusRequest) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{11} -} - -type ServerStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The version of the server in v{major}.{minor}-{delta}-{sha} form - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Whether the server is ready to accept requests - Ready bool `protobuf:"varint,2,opt,name=ready,proto3" json:"ready,omitempty"` - // The tick rate of the server in minutes (how many minutes per tick) - TickRate int32 `protobuf:"varint,3,opt,name=tickRate,proto3" json:"tickRate,omitempty"` - // The current tick of the server - CurrentTick int32 `protobuf:"varint,4,opt,name=currentTick,proto3" json:"currentTick,omitempty"` - // The time the next tick will occur - NextTick string `protobuf:"bytes,5,opt,name=next_tick,json=nextTick,proto3" json:"next_tick,omitempty"` -} - -func (x *ServerStatusResponse) Reset() { - *x = ServerStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerStatusResponse) ProtoMessage() {} - -func (x *ServerStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerStatusResponse.ProtoReflect.Descriptor instead. -func (*ServerStatusResponse) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{12} -} - -func (x *ServerStatusResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *ServerStatusResponse) GetReady() bool { - if x != nil { - return x.Ready - } - return false -} - -func (x *ServerStatusResponse) GetTickRate() int32 { - if x != nil { - return x.TickRate - } - return 0 -} - -func (x *ServerStatusResponse) GetCurrentTick() int32 { - if x != nil { - return x.CurrentTick - } - return 0 -} - -func (x *ServerStatusResponse) GetNextTick() string { - if x != nil { - return x.NextTick - } - return "" -} - -type Vector struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - Y int32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"` -} - -func (x *Vector) Reset() { - *x = Vector{} - if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Vector) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Vector) ProtoMessage() {} - -func (x *Vector) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Vector.ProtoReflect.Descriptor instead. -func (*Vector) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{13} -} - -func (x *Vector) GetX() int32 { - if x != nil { - return x.X - } - return 0 -} - -func (x *Vector) GetY() int32 { - if x != nil { - return x.Y - } - return 0 -} - -type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Secret string `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"` -} - -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{14} -} - -func (x *Account) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Account) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - var File_rove_rove_proto protoreflect.FileDescriptor var file_rove_rove_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x04, 0x72, 0x6f, 0x76, 0x65, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x65, - 0x61, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x65, 0x61, - 0x72, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x64, - 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, - 0x76, 0x65, 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, 0x1d, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x37, 0x0a, 0x0c, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x55, 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, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x25, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3b, 0x0a, - 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x38, 0x0a, 0x0d, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x07, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, - 0x6f, 0x76, 0x65, 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, 0xb7, 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, 0x28, 0x0a, 0x08, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, - 0x6f, 0x76, 0x65, 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, 0x39, 0x0a, 0x10, - 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, - 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 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, 0x35, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, - 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 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, 0x1d, - 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x72, - 0x6f, 0x76, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0x15, 0x0a, - 0x13, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0xa1, 0x01, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x1a, 0x0a, - 0x08, 0x74, 0x69, 0x63, 0x6b, 0x52, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x74, 0x69, 0x63, 0x6b, 0x52, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x6e, - 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 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, 0x35, - 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x32, 0x91, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x5d, - 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, - 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x6f, 0x76, 0x65, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, - 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, - 0x22, 0x09, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4b, - 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x22, 0x08, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52, - 0x61, 0x64, 0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, - 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x3a, 0x01, 0x2a, - 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, + 0x6f, 0x12, 0x04, 0x72, 0x6f, 0x76, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa1, + 0x01, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x63, 0x6b, 0x52, + 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x69, 0x63, 0x6b, 0x52, + 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, + 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, + 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, + 0x63, 0x6b, 0x22, 0x25, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x22, 0x3b, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x76, 0x0a, + 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2b, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x72, 0x6f, 0x76, 0x65, + 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, 0x62, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x62, 0x65, 0x61, 0x72, 0x69, 0x6e, + 0x67, 0x12, 0x1a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x64, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x29, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 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, 0x37, + 0x0a, 0x0c, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, + 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x55, 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, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, + 0x69, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x38, + 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x27, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 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, 0xb7, 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, 0x28, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x6f, 0x76, 0x65, 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, 0x39, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, + 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 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, 0x35, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, + 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, 0x1d, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, + 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x4c, 0x6f, + 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x2a, 0x55, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x6d, 0x6f, 0x76, 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, 0x0c, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x10, 0x04, 0x12, + 0x0d, 0x0a, 0x09, 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x10, 0x05, 0x32, 0xb1, + 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x47, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x3b, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, + 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, + 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, + 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, + 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 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, 0x00, 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 ( @@ -1077,49 +1126,51 @@ func file_rove_rove_proto_rawDescGZIP() []byte { return file_rove_rove_proto_rawDescData } -var file_rove_rove_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_rove_rove_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_rove_rove_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_rove_rove_proto_goTypes = []interface{}{ - (*Command)(nil), // 0: rove.Command - (*CommandRequest)(nil), // 1: rove.CommandRequest - (*CommandResponse)(nil), // 2: rove.CommandResponse - (*Error)(nil), // 3: rove.Error - (*RadarRequest)(nil), // 4: rove.RadarRequest - (*RadarResponse)(nil), // 5: rove.RadarResponse - (*RegisterRequest)(nil), // 6: rove.RegisterRequest - (*RegisterResponse)(nil), // 7: rove.RegisterResponse - (*StatusRequest)(nil), // 8: rove.StatusRequest - (*Log)(nil), // 9: rove.Log - (*StatusResponse)(nil), // 10: rove.StatusResponse - (*ServerStatusRequest)(nil), // 11: rove.ServerStatusRequest - (*ServerStatusResponse)(nil), // 12: rove.ServerStatusResponse + (CommandType)(0), // 0: rove.CommandType + (*ServerStatusRequest)(nil), // 1: rove.ServerStatusRequest + (*ServerStatusResponse)(nil), // 2: rove.ServerStatusResponse + (*RegisterRequest)(nil), // 3: rove.RegisterRequest + (*Account)(nil), // 4: rove.Account + (*RegisterResponse)(nil), // 5: rove.RegisterResponse + (*Command)(nil), // 6: rove.Command + (*CommandRequest)(nil), // 7: rove.CommandRequest + (*CommandResponse)(nil), // 8: rove.CommandResponse + (*RadarRequest)(nil), // 9: rove.RadarRequest + (*RadarResponse)(nil), // 10: rove.RadarResponse + (*StatusRequest)(nil), // 11: rove.StatusRequest + (*Log)(nil), // 12: rove.Log (*Vector)(nil), // 13: rove.Vector - (*Account)(nil), // 14: rove.Account + (*StatusResponse)(nil), // 14: rove.StatusResponse } var file_rove_rove_proto_depIdxs = []int32{ - 14, // 0: rove.CommandRequest.account:type_name -> rove.Account - 0, // 1: rove.CommandRequest.commands:type_name -> rove.Command - 14, // 2: rove.RadarRequest.account:type_name -> rove.Account - 14, // 3: rove.RegisterResponse.account:type_name -> rove.Account - 14, // 4: rove.StatusRequest.account:type_name -> rove.Account - 13, // 5: rove.StatusResponse.position:type_name -> rove.Vector - 0, // 6: rove.StatusResponse.incomingCommands:type_name -> rove.Command - 0, // 7: rove.StatusResponse.queuedCommands:type_name -> rove.Command - 9, // 8: rove.StatusResponse.logs:type_name -> rove.Log - 11, // 9: rove.Rove.ServerStatus:input_type -> rove.ServerStatusRequest - 6, // 10: rove.Rove.Register:input_type -> rove.RegisterRequest - 1, // 11: rove.Rove.Command:input_type -> rove.CommandRequest - 4, // 12: rove.Rove.Radar:input_type -> rove.RadarRequest - 8, // 13: rove.Rove.Status:input_type -> rove.StatusRequest - 12, // 14: rove.Rove.ServerStatus:output_type -> rove.ServerStatusResponse - 7, // 15: rove.Rove.Register:output_type -> rove.RegisterResponse - 2, // 16: rove.Rove.Command:output_type -> rove.CommandResponse - 5, // 17: rove.Rove.Radar:output_type -> rove.RadarResponse - 10, // 18: rove.Rove.Status:output_type -> rove.StatusResponse - 14, // [14:19] is the sub-list for method output_type - 9, // [9:14] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 4, // 0: rove.RegisterResponse.account:type_name -> rove.Account + 0, // 1: rove.Command.command:type_name -> rove.CommandType + 4, // 2: rove.CommandRequest.account:type_name -> rove.Account + 6, // 3: rove.CommandRequest.commands:type_name -> rove.Command + 4, // 4: rove.RadarRequest.account:type_name -> rove.Account + 4, // 5: rove.StatusRequest.account:type_name -> rove.Account + 13, // 6: rove.StatusResponse.position:type_name -> rove.Vector + 6, // 7: rove.StatusResponse.incomingCommands:type_name -> rove.Command + 6, // 8: rove.StatusResponse.queuedCommands:type_name -> rove.Command + 12, // 9: rove.StatusResponse.logs:type_name -> rove.Log + 1, // 10: rove.Rove.ServerStatus:input_type -> rove.ServerStatusRequest + 3, // 11: rove.Rove.Register:input_type -> rove.RegisterRequest + 7, // 12: rove.Rove.Command:input_type -> rove.CommandRequest + 9, // 13: rove.Rove.Radar:input_type -> rove.RadarRequest + 11, // 14: rove.Rove.Status:input_type -> rove.StatusRequest + 2, // 15: rove.Rove.ServerStatus:output_type -> rove.ServerStatusResponse + 5, // 16: rove.Rove.Register:output_type -> rove.RegisterResponse + 8, // 17: rove.Rove.Command:output_type -> rove.CommandResponse + 10, // 18: rove.Rove.Radar:output_type -> rove.RadarResponse + 14, // 19: rove.Rove.Status:output_type -> rove.StatusResponse + 15, // [15:20] is the sub-list for method output_type + 10, // [10:15] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_rove_rove_proto_init() } @@ -1129,138 +1180,6 @@ func file_rove_rove_proto_init() { } if !protoimpl.UnsafeEnabled { file_rove_rove_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Command); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Error); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RadarRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RadarResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Log); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rove_rove_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerStatusRequest); i { case 0: return &v.state @@ -1272,7 +1191,7 @@ func file_rove_rove_proto_init() { return nil } } - file_rove_rove_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_rove_rove_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerStatusResponse); i { case 0: return &v.state @@ -1284,8 +1203,8 @@ func file_rove_rove_proto_init() { return nil } } - file_rove_rove_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Vector); i { + file_rove_rove_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterRequest); i { case 0: return &v.state case 1: @@ -1296,7 +1215,7 @@ func file_rove_rove_proto_init() { return nil } } - file_rove_rove_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_rove_rove_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Account); i { case 0: return &v.state @@ -1308,19 +1227,144 @@ func file_rove_rove_proto_init() { return nil } } + file_rove_rove_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RadarRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RadarResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Log); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Vector); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_rove_rove_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*Command_Bearing)(nil), + (*Command_Message)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_rove_rove_proto_rawDesc, - NumEnums: 0, - NumMessages: 15, + NumEnums: 1, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, GoTypes: file_rove_rove_proto_goTypes, DependencyIndexes: file_rove_rove_proto_depIdxs, + EnumInfos: file_rove_rove_proto_enumTypes, MessageInfos: file_rove_rove_proto_msgTypes, }.Build() File_rove_rove_proto = out.File @@ -1342,23 +1386,20 @@ const _ = grpc.SupportPackageIsVersion6 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type RoveClient interface { // Server status - // // Responds with various details about the current server status ServerStatus(ctx context.Context, in *ServerStatusRequest, opts ...grpc.CallOption) (*ServerStatusResponse, error) // Register an account - // // Tries to register an account with the given name Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) // Send commands to rover - // - // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent + // Sending commands to this endpoint will queue them to be executed during the + // following ticks, in the order sent. Commands sent within the same tick will + // overwrite until the tick has finished and the commands are queued Command(ctx context.Context, in *CommandRequest, opts ...grpc.CallOption) (*CommandResponse, error) // Get radar information - // // Gets the radar output for the given rover Radar(ctx context.Context, in *RadarRequest, opts ...grpc.CallOption) (*RadarResponse, error) // Get rover information - // // Gets information for the account's rover Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) } @@ -1419,23 +1460,20 @@ func (c *roveClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc // RoveServer is the server API for Rove service. type RoveServer interface { // Server status - // // Responds with various details about the current server status ServerStatus(context.Context, *ServerStatusRequest) (*ServerStatusResponse, error) // Register an account - // // Tries to register an account with the given name Register(context.Context, *RegisterRequest) (*RegisterResponse, error) // Send commands to rover - // - // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent + // Sending commands to this endpoint will queue them to be executed during the + // following ticks, in the order sent. Commands sent within the same tick will + // overwrite until the tick has finished and the commands are queued Command(context.Context, *CommandRequest) (*CommandResponse, error) // Get radar information - // // Gets the radar output for the given rover Radar(context.Context, *RadarRequest) (*RadarResponse, error) // Get rover information - // // Gets information for the account's rover Status(context.Context, *StatusRequest) (*StatusResponse, error) } diff --git a/pkg/rove/rove.pb.gw.go b/pkg/rove/rove.pb.gw.go deleted file mode 100644 index db3d25e..0000000 --- a/pkg/rove/rove.pb.gw.go +++ /dev/null @@ -1,459 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: rove/rove.proto - -/* -Package rove is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package rove - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_Rove_ServerStatus_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ServerStatusRequest - var metadata runtime.ServerMetadata - - msg, err := client.ServerStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Rove_ServerStatus_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ServerStatusRequest - var metadata runtime.ServerMetadata - - msg, err := server.ServerStatus(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Rove_Register_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RegisterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Register(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Rove_Register_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RegisterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Register(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Rove_Command_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CommandRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Command(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Rove_Command_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CommandRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Command(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Rove_Radar_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RadarRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Radar(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Rove_Radar_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RadarRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Radar(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Rove_Status_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StatusRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Rove_Status_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StatusRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Status(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterRoveHandlerServer registers the http handlers for service Rove to "mux". -// UnaryRPC :call RoveServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterRoveHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RoveServer) error { - - mux.Handle("GET", pattern_Rove_ServerStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rove_ServerStatus_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_ServerStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Rove_Register_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rove_Register_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_Register_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Rove_Command_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rove_Command_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_Command_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Rove_Radar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rove_Radar_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_Radar_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Rove_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rove_Status_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterRoveHandlerFromEndpoint is same as RegisterRoveHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterRoveHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterRoveHandler(ctx, mux, conn) -} - -// RegisterRoveHandler registers the http handlers for service Rove to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterRoveHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterRoveHandlerClient(ctx, mux, NewRoveClient(conn)) -} - -// RegisterRoveHandlerClient registers the http handlers for service Rove -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RoveClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RoveClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "RoveClient" to call the correct interceptors. -func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RoveClient) error { - - mux.Handle("GET", pattern_Rove_ServerStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rove_ServerStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_ServerStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Rove_Register_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rove_Register_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_Register_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Rove_Command_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rove_Command_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_Command_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Rove_Radar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rove_Radar_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_Radar_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Rove_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rove_Status_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rove_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Rove_ServerStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"server-status"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Rove_Register_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"register"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Rove_Command_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"command"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Rove_Radar_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"radar"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Rove_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"status"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Rove_ServerStatus_0 = runtime.ForwardResponseMessage - - forward_Rove_Register_0 = runtime.ForwardResponseMessage - - forward_Rove_Command_0 = runtime.ForwardResponseMessage - - forward_Rove_Radar_0 = runtime.ForwardResponseMessage - - forward_Rove_Status_0 = runtime.ForwardResponseMessage -) diff --git a/pkg/rove/rove.swagger.json b/pkg/rove/rove.swagger.json deleted file mode 100644 index e4dcbee..0000000 --- a/pkg/rove/rove.swagger.json +++ /dev/null @@ -1,440 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Rove", - "description": "Rove is an asychronous nomadic game about exploring a planet as part of a loose community", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/command": { - "post": { - "summary": "Send commands to rover", - "description": "Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent", - "operationId": "Rove_Command", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/roveCommandResponse" - } - }, - "default": { - "description": "An unexpected error response", - "schema": { - "$ref": "#/definitions/gatewayruntimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/roveCommandRequest" - } - } - ], - "tags": [ - "Rove" - ] - } - }, - "/radar": { - "post": { - "summary": "Get radar information", - "description": "Gets the radar output for the given rover", - "operationId": "Rove_Radar", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/roveRadarResponse" - } - }, - "default": { - "description": "An unexpected error response", - "schema": { - "$ref": "#/definitions/gatewayruntimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/roveRadarRequest" - } - } - ], - "tags": [ - "Rove" - ] - } - }, - "/register": { - "post": { - "summary": "Register an account", - "description": "Tries to register an account with the given name", - "operationId": "Rove_Register", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/roveRegisterResponse" - } - }, - "default": { - "description": "An unexpected error response", - "schema": { - "$ref": "#/definitions/gatewayruntimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/roveRegisterRequest" - } - } - ], - "tags": [ - "Rove" - ] - } - }, - "/server-status": { - "get": { - "summary": "Server status", - "description": "Responds with various details about the current server status", - "operationId": "Rove_ServerStatus", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/roveServerStatusResponse" - } - }, - "default": { - "description": "An unexpected error response", - "schema": { - "$ref": "#/definitions/gatewayruntimeError" - } - } - }, - "tags": [ - "Rove" - ] - } - }, - "/status": { - "post": { - "summary": "Get rover information", - "description": "Gets information for the account's rover", - "operationId": "Rove_Status", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/roveStatusResponse" - } - }, - "default": { - "description": "An unexpected error response", - "schema": { - "$ref": "#/definitions/gatewayruntimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/roveStatusRequest" - } - } - ], - "tags": [ - "Rove" - ] - } - } - }, - "definitions": { - "gatewayruntimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "type_url": { - "type": "string" - }, - "value": { - "type": "string", - "format": "byte" - } - } - }, - "roveAccount": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "secret": { - "type": "string" - } - } - }, - "roveCommand": { - "type": "object", - "properties": { - "command": { - "type": "string", - "title": "The command to execute\n\"move\" - Move the rover in a direction, requires bearing\n\"stash\" - Stashes item at current location in rover inventory\n\"repair\" - Repairs the rover using an inventory object\n\"recharge\" - Waits a tick to add more charge to the rover\n\"broadcast\" - Broadcasts a message to nearby rovers" - }, - "bearing": { - "type": "string", - "title": "A bearing, example: NE" - }, - "message": { - "type": "string", - "format": "byte", - "title": "A simple message, must be composed of printable ASCII glyphs (32-126)\nmaximum of three characters" - } - } - }, - "roveCommandRequest": { - "type": "object", - "properties": { - "account": { - "$ref": "#/definitions/roveAccount", - "title": "The account to execute these commands" - }, - "commands": { - "type": "array", - "items": { - "$ref": "#/definitions/roveCommand" - }, - "title": "The set of desired commands" - } - } - }, - "roveCommandResponse": { - "type": "object", - "title": "Empty placeholder" - }, - "roveLog": { - "type": "object", - "properties": { - "time": { - "type": "string", - "title": "The unix timestamp of the log" - }, - "text": { - "type": "string", - "title": "The text of the log" - } - } - }, - "roveRadarRequest": { - "type": "object", - "properties": { - "account": { - "$ref": "#/definitions/roveAccount", - "title": "The account for this request" - } - } - }, - "roveRadarResponse": { - "type": "object", - "properties": { - "range": { - "type": "integer", - "format": "int32", - "title": "The range in tiles from the rover of the radar data" - }, - "tiles": { - "type": "string", - "format": "byte", - "title": "A 1D array representing range*2 + 1 squared set of tiles, origin bottom left and in row-\u003ecolumn order" - }, - "objects": { - "type": "string", - "format": "byte", - "title": "A similar array to the tile array, but containing objects" - } - } - }, - "roveRegisterRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "The desired account name" - } - } - }, - "roveRegisterResponse": { - "type": "object", - "properties": { - "account": { - "$ref": "#/definitions/roveAccount", - "title": "The registered account information" - } - }, - "title": "Empty placeholder" - }, - "roveServerStatusResponse": { - "type": "object", - "properties": { - "version": { - "type": "string", - "title": "The version of the server in v{major}.{minor}-{delta}-{sha} form" - }, - "ready": { - "type": "boolean", - "format": "boolean", - "title": "Whether the server is ready to accept requests" - }, - "tickRate": { - "type": "integer", - "format": "int32", - "title": "The tick rate of the server in minutes (how many minutes per tick)" - }, - "currentTick": { - "type": "integer", - "format": "int32", - "title": "The current tick of the server" - }, - "next_tick": { - "type": "string", - "title": "The time the next tick will occur" - } - } - }, - "roveStatusRequest": { - "type": "object", - "properties": { - "account": { - "$ref": "#/definitions/roveAccount", - "title": "The account for this request" - } - } - }, - "roveStatusResponse": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "The name of the rover" - }, - "position": { - "$ref": "#/definitions/roveVector", - "title": "Position of the rover in world coordinates" - }, - "range": { - "type": "integer", - "format": "int32", - "title": "The range of this rover's radar and broadcasting" - }, - "inventory": { - "type": "string", - "format": "byte", - "title": "The items in the rover inventory" - }, - "capacity": { - "type": "integer", - "format": "int32", - "title": "The capacity of the inventory" - }, - "integrity": { - "type": "integer", - "format": "int32", - "title": "The current health of the rover" - }, - "maximumIntegrity": { - "type": "integer", - "format": "int32", - "title": "The maximum health of the rover" - }, - "charge": { - "type": "integer", - "format": "int32", - "title": "The energy stored in the rover" - }, - "maximumCharge": { - "type": "integer", - "format": "int32", - "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" - }, - "logs": { - "type": "array", - "items": { - "$ref": "#/definitions/roveLog" - }, - "title": "The most recent logs" - } - } - }, - "roveVector": { - "type": "object", - "properties": { - "x": { - "type": "integer", - "format": "int32" - }, - "y": { - "type": "integer", - "format": "int32" - } - } - } - } -} diff --git a/proto/rove/rove.proto b/proto/rove/rove.proto index d643e9c..ab0160e 100644 --- a/proto/rove/rove.proto +++ b/proto/rove/rove.proto @@ -2,201 +2,217 @@ syntax = "proto3"; // Rove // -// Rove is an asychronous nomadic game about exploring a planet as part of a loose community +// Rove is an asychronous nomadic game about exploring a planet as part of a +// loose community package rove; - option go_package = "github.com/mdiluz/rove/pkg/rove"; -import "google/api/annotations.proto"; - +// The Rove server hosts a single game session and world with multiple players service Rove { - // Server status - // - // Responds with various details about the current server status - rpc ServerStatus(ServerStatusRequest) returns (ServerStatusResponse) { - option (google.api.http) = { - get: "/server-status" - }; - } + // Server status + // Responds with various details about the current server status + rpc ServerStatus(ServerStatusRequest) returns (ServerStatusResponse) {} - // Register an account - // - // Tries to register an account with the given name - rpc Register(RegisterRequest) returns (RegisterResponse) { - option (google.api.http) = { - post: "/register" - body: "*" - }; - } + // Register an account + // Tries to register an account with the given name + rpc Register(RegisterRequest) returns (RegisterResponse) {} - // Send commands to rover - // - // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent - rpc Command(CommandRequest) returns (CommandResponse) { - option (google.api.http) = { - post: "/command" - body: "*" - }; - } + // Send commands to rover + // Sending commands to this endpoint will queue them to be executed during the + // following ticks, in the order sent. Commands sent within the same tick will + // overwrite until the tick has finished and the commands are queued + rpc Command(CommandRequest) returns (CommandResponse) {} - // Get radar information - // - // Gets the radar output for the given rover - rpc Radar(RadarRequest) returns (RadarResponse) { - option (google.api.http) = { - post: "/radar" - body: "*" - }; - } + // Get radar information + // Gets the radar output for the given rover + rpc Radar(RadarRequest) returns (RadarResponse) {} - // Get rover information - // - // Gets information for the account's rover - rpc Status(StatusRequest) returns (StatusResponse) { - option (google.api.http) = { - post: "/status" - body: "*" - }; - } + // Get rover information + // Gets information for the account's rover + rpc Status(StatusRequest) returns (StatusResponse) {} } -message Command { - // The command to execute - // "move" - Move the rover in a direction, requires bearing - // "stash" - Stashes item at current location in rover inventory - // "repair" - Repairs the rover using an inventory object - // "recharge" - Waits a tick to add more charge to the rover - // "broadcast" - Broadcasts a message to nearby rovers - string command = 1; +// +// ServerStatus +// +// ServerStatusRequest is an empty placeholder +message ServerStatusRequest {} + +// ServerStatusResponse is a response with useful server information +message ServerStatusResponse { + // The version of the server in v{major}.{minor}-{delta}-{sha} form + string version = 1; + + // Whether the server is ready to accept requests + bool ready = 2; + + // The tick rate of the server in minutes (how many minutes per tick) + int32 tickRate = 3; + + // The current tick of the server + int32 currentTick = 4; + + // The time the next tick will occur + string next_tick = 5; +} + +// +// Register +// + +// RegisterRequest contains data to register an account +message RegisterRequest { + // The desired account name + string name = 1; +} + +// Account describes a registered account +message Account { + // The account name + string name = 1; + + // The account secret value, given when creating the account + string secret = 2; +} + +// RegisterResponse is the response given to registering an account +message RegisterResponse { + // The registered account information + Account account = 1; +} + +// +// Command +// + +// CommandType defines the type of a command to give to the rover +enum CommandType { + none = 0; + // Move the rover in a direction, requires bearing + move = 1; + // Stashes item at current location in rover inventory + stash = 2; + // Repairs the rover using an inventory object + repair = 3; + // Waits a tick to add more charge to the rover + recharge = 4; + // Broadcasts a message to nearby rovers + broadcast = 5; +} + +// Command is a single command for a rover +message Command { + // The command type + CommandType command = 1; + + oneof data { // A bearing, example: NE + // Used with MOVE string bearing = 2; // A simple message, must be composed of printable ASCII glyphs (32-126) // maximum of three characters + // Used with BROADCAST bytes message = 3; + } } +// CommandRequest describes a set of commands to be requested for the rover message CommandRequest { - // The account to execute these commands - Account account = 1; + // The account to execute these commands + Account account = 1; - // The set of desired commands - repeated Command commands = 2; + // The set of desired commands + repeated Command commands = 2; } -// Empty placeholder +// CommandResponse is an empty placeholder message CommandResponse {} -message Error { - // An explanation for the HTTP error returned - string error = 1; -} +// +// Radar +// +// RadarRequest is the data needed to request the radar for a rover message RadarRequest { - // The account for this request - Account account = 1; + // The account for this request + Account account = 1; } +// RadarResponse describes radar information message RadarResponse { - // The range in tiles from the rover of the radar data - int32 range = 1; + // The range in tiles from the rover of the radar data + int32 range = 1; - // A 1D array representing range*2 + 1 squared set of tiles, origin bottom left and in row->column order - bytes tiles = 2; + // A 1D array representing range*2 + 1 squared set of tiles, origin bottom + // left and in row->column order + bytes tiles = 2; - // A similar array to the tile array, but containing objects - bytes objects = 3; + // A similar array to the tile array, but containing objects + bytes objects = 3; } -message RegisterRequest { - // The desired account name - string name = 1; -} - -// Empty placeholder -message RegisterResponse{ - // The registered account information - Account account = 1; -} +// +// Status +// +// StatusRequest is information needed to request rover status message StatusRequest { - // The account for this request - Account account = 1; + // The account for this request + Account account = 1; } +// Log is a single log item message Log { - // The unix timestamp of the log - string time = 1; + // The unix timestamp of the log + string time = 1; - // The text of the log - string text = 2; -} - -message StatusResponse { - // The name of the rover - string name = 1; - - // Position of the rover in world coordinates - Vector position = 2; - - // The range of this rover's radar and broadcasting - int32 range = 3; - - // The items in the rover inventory - bytes inventory = 4; - - // The capacity of the inventory - int32 capacity = 5; - - // The current health of the rover - int32 integrity = 6; - - // The maximum health of the rover - int32 maximumIntegrity = 7; - - // The energy stored in the rover - int32 charge = 8; - - // The max energy the rover can store - 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; - - // The most recent logs - repeated Log logs = 12; -} - -// Empty placeholder -message ServerStatusRequest {} - -message ServerStatusResponse { - // The version of the server in v{major}.{minor}-{delta}-{sha} form - string version = 1; - - // Whether the server is ready to accept requests - bool ready = 2; - - // The tick rate of the server in minutes (how many minutes per tick) - int32 tickRate = 3; - - // The current tick of the server - int32 currentTick = 4; - - // The time the next tick will occur - string next_tick = 5; + // The text of the log + string text = 2; } +// Vector describes a point or vector in 2D space message Vector { - int32 x = 1; - int32 y = 2; + int32 x = 1; + int32 y = 2; } -message Account { - string name = 1; - string secret = 2; +// StatusResponse is the response given to a status request +message StatusResponse { + // The name of the rover + string name = 1; + + // Position of the rover in world coordinates + Vector position = 2; + + // The range of this rover's radar and broadcasting + int32 range = 3; + + // The items in the rover inventory + bytes inventory = 4; + + // The capacity of the inventory + int32 capacity = 5; + + // The current health of the rover + int32 integrity = 6; + + // The maximum health of the rover + int32 maximumIntegrity = 7; + + // The energy stored in the rover + int32 charge = 8; + + // The max energy the rover can store + 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; + + // The most recent logs + repeated Log logs = 12; } \ No newline at end of file diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index fb83f33..86a2118 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -27,15 +27,7 @@ apps: environment: WORDS_FILE : "$SNAP/data/words_alpha.txt" DATA_PATH : $SNAP_USER_DATA - - rove-rest-server: - command: bin/rove-server-rest-proxy - plugs: - - network - - network-bind - environment: - DATA_PATH : $SNAP_USER_DATA - + parts: go-rove: plugin: go