|
@@ -254,6 +254,45 @@ func (m *Stats) GetMove() uint32 {
|
|
|
return 0
|
|
|
}
|
|
|
|
|
|
+type Speed struct {
|
|
|
+ Speed uint32 `protobuf:"varint,1,opt,name=speed,proto3" json:"speed,omitempty"`
|
|
|
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
+ XXX_unrecognized []byte `json:"-"`
|
|
|
+ XXX_sizecache int32 `json:"-"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *Speed) Reset() { *m = Speed{} }
|
|
|
+func (m *Speed) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*Speed) ProtoMessage() {}
|
|
|
+func (*Speed) Descriptor() ([]byte, []int) {
|
|
|
+ return fileDescriptor_b704e55df18a3970, []int{4}
|
|
|
+}
|
|
|
+
|
|
|
+func (m *Speed) XXX_Unmarshal(b []byte) error {
|
|
|
+ return xxx_messageInfo_Speed.Unmarshal(m, b)
|
|
|
+}
|
|
|
+func (m *Speed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
+ return xxx_messageInfo_Speed.Marshal(b, m, deterministic)
|
|
|
+}
|
|
|
+func (m *Speed) XXX_Merge(src proto.Message) {
|
|
|
+ xxx_messageInfo_Speed.Merge(m, src)
|
|
|
+}
|
|
|
+func (m *Speed) XXX_Size() int {
|
|
|
+ return xxx_messageInfo_Speed.Size(m)
|
|
|
+}
|
|
|
+func (m *Speed) XXX_DiscardUnknown() {
|
|
|
+ xxx_messageInfo_Speed.DiscardUnknown(m)
|
|
|
+}
|
|
|
+
|
|
|
+var xxx_messageInfo_Speed proto.InternalMessageInfo
|
|
|
+
|
|
|
+func (m *Speed) GetSpeed() uint32 {
|
|
|
+ if m != nil {
|
|
|
+ return m.Speed
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
type None struct {
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
@@ -264,7 +303,7 @@ func (m *None) Reset() { *m = None{} }
|
|
|
func (m *None) String() string { return proto.CompactTextString(m) }
|
|
|
func (*None) ProtoMessage() {}
|
|
|
func (*None) Descriptor() ([]byte, []int) {
|
|
|
- return fileDescriptor_b704e55df18a3970, []int{4}
|
|
|
+ return fileDescriptor_b704e55df18a3970, []int{5}
|
|
|
}
|
|
|
|
|
|
func (m *None) XXX_Unmarshal(b []byte) error {
|
|
@@ -291,34 +330,37 @@ func init() {
|
|
|
proto.RegisterType((*Snake)(nil), "snakesimulator.Snake")
|
|
|
proto.RegisterType((*Field)(nil), "snakesimulator.Field")
|
|
|
proto.RegisterType((*Stats)(nil), "snakesimulator.Stats")
|
|
|
+ proto.RegisterType((*Speed)(nil), "snakesimulator.Speed")
|
|
|
proto.RegisterType((*None)(nil), "snakesimulator.None")
|
|
|
}
|
|
|
|
|
|
func init() { proto.RegisterFile("snakesimulator.proto", fileDescriptor_b704e55df18a3970) }
|
|
|
|
|
|
var fileDescriptor_b704e55df18a3970 = []byte{
|
|
|
- // 329 bytes of a gzipped FileDescriptorProto
|
|
|
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x4b, 0xfb, 0x30,
|
|
|
- 0x18, 0xc6, 0x97, 0xad, 0xe9, 0xf7, 0xbb, 0x77, 0x6e, 0x94, 0x97, 0x29, 0xc5, 0x83, 0x8c, 0x78,
|
|
|
- 0x99, 0x82, 0x43, 0x26, 0x88, 0x37, 0x2f, 0xc3, 0x93, 0x88, 0x74, 0xec, 0xe4, 0xc5, 0x6a, 0xb3,
|
|
|
- 0x35, 0xac, 0x4b, 0x4a, 0x9b, 0xfd, 0xfa, 0xe7, 0xfc, 0xdb, 0x24, 0x69, 0x06, 0x73, 0x22, 0xec,
|
|
|
- 0x96, 0xf7, 0xe9, 0xf3, 0xe4, 0xc3, 0xf3, 0x36, 0xd0, 0x2d, 0x65, 0x3c, 0xe7, 0xa5, 0x58, 0x2c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0xbc, 0x12,
|
|
|
+ 0x73, 0xa1, 0x3c, 0x4c, 0x3c, 0xc2, 0xaa, 0xe0, 0x0c, 0xec, 0xa4, 0x6c, 0xab, 0x67, 0x31, 0x32,
|
|
|
+ 0x5e, 0x85, 0xd5, 0x80, 0x06, 0x76, 0x5b, 0xcf, 0xe9, 0x7f, 0x11, 0x68, 0x62, 0xbe, 0xe1, 0x76,
|
|
|
+ 0x47, 0x76, 0x0f, 0x14, 0xb7, 0x66, 0xad, 0xfd, 0xed, 0x2d, 0xb2, 0x7d, 0x90, 0x09, 0xda, 0x79,
|
|
|
+ 0xe9, 0x86, 0x58, 0xe7, 0x28, 0xcf, 0xfc, 0x38, 0x27, 0xfe, 0xa0, 0xad, 0x33, 0xc3, 0x2c, 0x8f,
|
|
|
+ 0x65, 0x5a, 0x31, 0x3a, 0x1f, 0xa0, 0x9a, 0x09, 0x93, 0x67, 0x75, 0x28, 0xb3, 0xe3, 0xf6, 0xaf,
|
|
|
+ 0x67, 0xf2, 0xd2, 0x87, 0x8b, 0xcf, 0xf2, 0xf6, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x27, 0xde, 0x83,
|
|
|
+ 0x77, 0xae, 0x02, 0x00, 0x00,
|
|
|
}
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
@@ -336,6 +378,7 @@ type SnakeSimulatorClient interface {
|
|
|
Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error)
|
|
|
Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error)
|
|
|
Stats(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_StatsClient, error)
|
|
|
+ SetSpeed(ctx context.Context, in *Speed, opts ...grpc.CallOption) (*None, error)
|
|
|
}
|
|
|
|
|
|
type snakeSimulatorClient struct {
|
|
@@ -442,11 +485,21 @@ func (x *snakeSimulatorStatsClient) Recv() (*Stats, error) {
|
|
|
return m, nil
|
|
|
}
|
|
|
|
|
|
+func (c *snakeSimulatorClient) SetSpeed(ctx context.Context, in *Speed, opts ...grpc.CallOption) (*None, error) {
|
|
|
+ out := new(None)
|
|
|
+ err := c.cc.Invoke(ctx, "/snakesimulator.SnakeSimulator/setSpeed", in, out, opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return out, nil
|
|
|
+}
|
|
|
+
|
|
|
// SnakeSimulatorServer is the server API for SnakeSimulator service.
|
|
|
type SnakeSimulatorServer interface {
|
|
|
Snake(*None, SnakeSimulator_SnakeServer) error
|
|
|
Field(*None, SnakeSimulator_FieldServer) error
|
|
|
Stats(*None, SnakeSimulator_StatsServer) error
|
|
|
+ SetSpeed(context.Context, *Speed) (*None, error)
|
|
|
}
|
|
|
|
|
|
// UnimplementedSnakeSimulatorServer can be embedded to have forward compatible implementations.
|
|
@@ -462,6 +515,9 @@ func (*UnimplementedSnakeSimulatorServer) Field(req *None, srv SnakeSimulator_Fi
|
|
|
func (*UnimplementedSnakeSimulatorServer) Stats(req *None, srv SnakeSimulator_StatsServer) error {
|
|
|
return status.Errorf(codes.Unimplemented, "method Stats not implemented")
|
|
|
}
|
|
|
+func (*UnimplementedSnakeSimulatorServer) SetSpeed(ctx context.Context, req *Speed) (*None, error) {
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method SetSpeed not implemented")
|
|
|
+}
|
|
|
|
|
|
func RegisterSnakeSimulatorServer(s *grpc.Server, srv SnakeSimulatorServer) {
|
|
|
s.RegisterService(&_SnakeSimulator_serviceDesc, srv)
|
|
@@ -530,10 +586,33 @@ func (x *snakeSimulatorStatsServer) Send(m *Stats) error {
|
|
|
return x.ServerStream.SendMsg(m)
|
|
|
}
|
|
|
|
|
|
+func _SnakeSimulator_SetSpeed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
+ in := new(Speed)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if interceptor == nil {
|
|
|
+ return srv.(SnakeSimulatorServer).SetSpeed(ctx, in)
|
|
|
+ }
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
+ Server: srv,
|
|
|
+ FullMethod: "/snakesimulator.SnakeSimulator/SetSpeed",
|
|
|
+ }
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
+ return srv.(SnakeSimulatorServer).SetSpeed(ctx, req.(*Speed))
|
|
|
+ }
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
+}
|
|
|
+
|
|
|
var _SnakeSimulator_serviceDesc = grpc.ServiceDesc{
|
|
|
ServiceName: "snakesimulator.SnakeSimulator",
|
|
|
HandlerType: (*SnakeSimulatorServer)(nil),
|
|
|
- Methods: []grpc.MethodDesc{},
|
|
|
+ Methods: []grpc.MethodDesc{
|
|
|
+ {
|
|
|
+ MethodName: "setSpeed",
|
|
|
+ Handler: _SnakeSimulator_SetSpeed_Handler,
|
|
|
+ },
|
|
|
+ },
|
|
|
Streams: []grpc.StreamDesc{
|
|
|
{
|
|
|
StreamName: "snake",
|