Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterBsrServer(s grpc.ServiceRegistrar, srv BsrServer)
- type BsrClient
- type BsrServer
- type GameItem
- type GameState
- func (*GameState) Descriptor() ([]byte, []int)deprecated
- func (x *GameState) GetDone() bool
- func (x *GameState) GetPlayers() map[string]*Player
- func (x *GameState) GetRound() uint32
- func (x *GameState) GetShotgun() *Shotgun
- func (*GameState) ProtoMessage()
- func (x *GameState) ProtoReflect() protoreflect.Message
- func (x *GameState) Reset()
- func (x *GameState) String() string
- type JoinGameRequest
- func (*JoinGameRequest) Descriptor() ([]byte, []int)deprecated
- func (x *JoinGameRequest) GetGameUuid() string
- func (x *JoinGameRequest) GetMaxPlayerCount() uint32
- func (x *JoinGameRequest) GetPlayerName() string
- func (x *JoinGameRequest) GetVersion() uint32
- func (*JoinGameRequest) ProtoMessage()
- func (x *JoinGameRequest) ProtoReflect() protoreflect.Message
- func (x *JoinGameRequest) Reset()
- func (x *JoinGameRequest) String() string
- type JoinGameResponse
- func (*JoinGameResponse) Descriptor() ([]byte, []int)deprecated
- func (x *JoinGameResponse) GetGameStarted() bool
- func (x *JoinGameResponse) GetGameState() *GameState
- func (x *JoinGameResponse) GetGameUuid() string
- func (x *JoinGameResponse) GetPlayerUuid() string
- func (*JoinGameResponse) ProtoMessage()
- func (x *JoinGameResponse) ProtoReflect() protoreflect.Message
- func (x *JoinGameResponse) Reset()
- func (x *JoinGameResponse) String() string
- type Player
- type Shotgun
- type UnimplementedBsrServer
- type UnsafeBsrServer
Constants ¶
const BsrV1 = 1
const (
Bsr_JoinGame_FullMethodName = "/bsr.Bsr/JoinGame"
)
Variables ¶
var Bsr_ServiceDesc = grpc.ServiceDesc{ ServiceName: "bsr.Bsr", HandlerType: (*BsrServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "JoinGame", Handler: _Bsr_JoinGame_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "bsr.proto", }
Bsr_ServiceDesc is the grpc.ServiceDesc for Bsr service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_bsr_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBsrServer ¶
func RegisterBsrServer(s grpc.ServiceRegistrar, srv BsrServer)
Types ¶
type BsrClient ¶
type BsrClient interface {
JoinGame(ctx context.Context, in *JoinGameRequest, opts ...grpc.CallOption) (*JoinGameResponse, error)
}
BsrClient is the client API for Bsr service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewBsrClient ¶
func NewBsrClient(cc grpc.ClientConnInterface) BsrClient
type BsrServer ¶
type BsrServer interface { JoinGame(context.Context, *JoinGameRequest) (*JoinGameResponse, error) // contains filtered or unexported methods }
BsrServer is the server API for Bsr service. All implementations must embed UnimplementedBsrServer for forward compatibility.
type GameItem ¶
type GameItem struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GameItem) Descriptor
deprecated
func (*GameItem) ProtoMessage ¶
func (*GameItem) ProtoMessage()
func (*GameItem) ProtoReflect ¶
func (x *GameItem) ProtoReflect() protoreflect.Message
type GameState ¶
type GameState struct { Round uint32 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` Shotgun *Shotgun `protobuf:"bytes,2,opt,name=shotgun,proto3" json:"shotgun,omitempty"` Players map[string]*Player `` /* 155-byte string literal not displayed */ Done bool `protobuf:"varint,123,opt,name=done,proto3" json:"done,omitempty"` // contains filtered or unexported fields }
func (*GameState) Descriptor
deprecated
func (*GameState) GetPlayers ¶
func (*GameState) GetShotgun ¶
func (*GameState) ProtoMessage ¶
func (*GameState) ProtoMessage()
func (*GameState) ProtoReflect ¶
func (x *GameState) ProtoReflect() protoreflect.Message
type JoinGameRequest ¶
type JoinGameRequest struct { Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` GameUuid string `protobuf:"bytes,2,opt,name=game_uuid,json=gameUuid,proto3" json:"game_uuid,omitempty"` PlayerName string `protobuf:"bytes,4,opt,name=player_name,json=playerName,proto3" json:"player_name,omitempty"` MaxPlayerCount uint32 `protobuf:"varint,5,opt,name=max_player_count,json=maxPlayerCount,proto3" json:"max_player_count,omitempty"` // contains filtered or unexported fields }
func (*JoinGameRequest) Descriptor
deprecated
func (*JoinGameRequest) Descriptor() ([]byte, []int)
Deprecated: Use JoinGameRequest.ProtoReflect.Descriptor instead.
func (*JoinGameRequest) GetGameUuid ¶
func (x *JoinGameRequest) GetGameUuid() string
func (*JoinGameRequest) GetMaxPlayerCount ¶
func (x *JoinGameRequest) GetMaxPlayerCount() uint32
func (*JoinGameRequest) GetPlayerName ¶
func (x *JoinGameRequest) GetPlayerName() string
func (*JoinGameRequest) GetVersion ¶
func (x *JoinGameRequest) GetVersion() uint32
func (*JoinGameRequest) ProtoMessage ¶
func (*JoinGameRequest) ProtoMessage()
func (*JoinGameRequest) ProtoReflect ¶
func (x *JoinGameRequest) ProtoReflect() protoreflect.Message
func (*JoinGameRequest) Reset ¶
func (x *JoinGameRequest) Reset()
func (*JoinGameRequest) String ¶
func (x *JoinGameRequest) String() string
type JoinGameResponse ¶
type JoinGameResponse struct { GameUuid string `protobuf:"bytes,2,opt,name=game_uuid,json=gameUuid,proto3" json:"game_uuid,omitempty"` PlayerUuid string `protobuf:"bytes,3,opt,name=player_uuid,json=playerUuid,proto3" json:"player_uuid,omitempty"` GameStarted bool `protobuf:"varint,4,opt,name=game_started,json=gameStarted,proto3" json:"game_started,omitempty"` GameState *GameState `protobuf:"bytes,5,opt,name=game_state,json=gameState,proto3,oneof" json:"game_state,omitempty"` // contains filtered or unexported fields }
func (*JoinGameResponse) Descriptor
deprecated
func (*JoinGameResponse) Descriptor() ([]byte, []int)
Deprecated: Use JoinGameResponse.ProtoReflect.Descriptor instead.
func (*JoinGameResponse) GetGameStarted ¶
func (x *JoinGameResponse) GetGameStarted() bool
func (*JoinGameResponse) GetGameState ¶
func (x *JoinGameResponse) GetGameState() *GameState
func (*JoinGameResponse) GetGameUuid ¶
func (x *JoinGameResponse) GetGameUuid() string
func (*JoinGameResponse) GetPlayerUuid ¶
func (x *JoinGameResponse) GetPlayerUuid() string
func (*JoinGameResponse) ProtoMessage ¶
func (*JoinGameResponse) ProtoMessage()
func (*JoinGameResponse) ProtoReflect ¶
func (x *JoinGameResponse) ProtoReflect() protoreflect.Message
func (*JoinGameResponse) Reset ¶
func (x *JoinGameResponse) Reset()
func (*JoinGameResponse) String ¶
func (x *JoinGameResponse) String() string
type Player ¶
type Player struct { Health uint32 `protobuf:"varint,1,opt,name=health,proto3" json:"health,omitempty"` Items []*GameItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*Player) Descriptor
deprecated
func (*Player) ProtoMessage ¶
func (*Player) ProtoMessage()
func (*Player) ProtoReflect ¶
func (x *Player) ProtoReflect() protoreflect.Message
type Shotgun ¶
type Shotgun struct { ShellsLeft uint32 `protobuf:"varint,1,opt,name=shells_left,json=shellsLeft,proto3" json:"shells_left,omitempty"` Dmg uint32 `protobuf:"varint,2,opt,name=dmg,proto3" json:"dmg,omitempty"` // contains filtered or unexported fields }
func (*Shotgun) Descriptor
deprecated
func (*Shotgun) GetShellsLeft ¶
func (*Shotgun) ProtoMessage ¶
func (*Shotgun) ProtoMessage()
func (*Shotgun) ProtoReflect ¶
func (x *Shotgun) ProtoReflect() protoreflect.Message
type UnimplementedBsrServer ¶
type UnimplementedBsrServer struct{}
UnimplementedBsrServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedBsrServer) JoinGame ¶
func (UnimplementedBsrServer) JoinGame(context.Context, *JoinGameRequest) (*JoinGameResponse, error)
type UnsafeBsrServer ¶
type UnsafeBsrServer interface {
// contains filtered or unexported methods
}
UnsafeBsrServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BsrServer will result in compilation errors.