mirror of
https://github.com/tiennm99/gomoku.git
synced 2026-05-14 02:58:05 +00:00
9de0f97752
The "Start Game" button in the waiting room is gone — as soon as a second player joins a PVP room, the server flips to Playing and both clients transition into the game in lockstep. Server: - Proto: remove GameStartingRequest message + oneof field (now unused). - state/home.go handleJoinRoom: after a successful join that fills the room, call assignColors, set Status=Playing + CurrentTurn=Black, close StartCh, broadcast GameStartingResponse, return StateGamePvp for the joining player. If still only one player, return StateWaiting as before. - state/waiting.go: collapse ownerWait + joinerWait into a single unified loop. Both roles just select on StartCh (auto-start signal) and CmdCh (for ClientExit). No more GameStartingRequest handling or PlayerCount checks. - network/dispatch.go: drop Request_GameStarting from the stateful routing list. Client: - connection-service.js: remove sendGameStarting() helper. - menu-ui-rooms.js showWaiting: drop the isOwner parameter + Start Game button + owner/joiner branching. Both views show the same passive 'Waiting for opponent...' message that flips to 'Opponent joined: <name> - starting game...' when the second player arrives. - menu-scene.js: update _onRoomCreateSuccess + _onRoomJoinSuccess to call the simpler showWaiting(ownerNickname, playerCount, onLeave) signature. Tests: - Remove TestWaitingOwnerGameStartingRequiresFullRoom (obsolete). - Rewrite TestWaitingOwnerStartsWhenFull into TestWaitingOwner TransitionsOnStartCh: simulate handleJoinRoom closing StartCh, verify owner transitions to StateGamePvp. - Add TestFlow_JoinAutoStartsGame: end-to-end drive where owner is in waitingState, joiner sends JoinRoomRequest from home, and both goroutines must land in StateGamePvp with colors assigned and GameStartingResponse broadcast. Regen Go + JS proto stubs. go vet + go test ./... green. npm --prefix client run build green.
890 lines
26 KiB
Go
890 lines
26 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.11
|
|
// protoc v7.34.1
|
|
// source: request.proto
|
|
|
|
package protocol
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
// Wrapper for all client -> server messages. The oneof case IS the event code.
|
|
//
|
|
// Note: PVP games auto-start as soon as a second player joins — there is no
|
|
// explicit "Start Game" request from the owner. Room creation + join is
|
|
// enough to begin the game.
|
|
type Request struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
// Types that are valid to be assigned to Payload:
|
|
//
|
|
// *Request_Heartbeat
|
|
// *Request_SetNickname
|
|
// *Request_SetClientInfo
|
|
// *Request_CreateRoom
|
|
// *Request_CreatePveRoom
|
|
// *Request_GetRooms
|
|
// *Request_JoinRoom
|
|
// *Request_GameMove
|
|
// *Request_GameReset
|
|
// *Request_WatchGame
|
|
// *Request_WatchGameExit
|
|
// *Request_ClientExit
|
|
Payload isRequest_Payload `protobuf_oneof:"payload"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *Request) Reset() {
|
|
*x = Request{}
|
|
mi := &file_request_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *Request) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*Request) ProtoMessage() {}
|
|
|
|
func (x *Request) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use Request.ProtoReflect.Descriptor instead.
|
|
func (*Request) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *Request) GetPayload() isRequest_Payload {
|
|
if x != nil {
|
|
return x.Payload
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetHeartbeat() *HeartbeatRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_Heartbeat); ok {
|
|
return x.Heartbeat
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetSetNickname() *SetNicknameRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_SetNickname); ok {
|
|
return x.SetNickname
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetSetClientInfo() *SetClientInfoRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_SetClientInfo); ok {
|
|
return x.SetClientInfo
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetCreateRoom() *CreateRoomRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_CreateRoom); ok {
|
|
return x.CreateRoom
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetCreatePveRoom() *CreatePveRoomRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_CreatePveRoom); ok {
|
|
return x.CreatePveRoom
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetGetRooms() *GetRoomsRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_GetRooms); ok {
|
|
return x.GetRooms
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetJoinRoom() *JoinRoomRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_JoinRoom); ok {
|
|
return x.JoinRoom
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetGameMove() *GameMoveRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_GameMove); ok {
|
|
return x.GameMove
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetGameReset() *GameResetRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_GameReset); ok {
|
|
return x.GameReset
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetWatchGame() *WatchGameRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_WatchGame); ok {
|
|
return x.WatchGame
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetWatchGameExit() *WatchGameExitRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_WatchGameExit); ok {
|
|
return x.WatchGameExit
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Request) GetClientExit() *ClientExitRequest {
|
|
if x != nil {
|
|
if x, ok := x.Payload.(*Request_ClientExit); ok {
|
|
return x.ClientExit
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type isRequest_Payload interface {
|
|
isRequest_Payload()
|
|
}
|
|
|
|
type Request_Heartbeat struct {
|
|
Heartbeat *HeartbeatRequest `protobuf:"bytes,1,opt,name=heartbeat,proto3,oneof"`
|
|
}
|
|
|
|
type Request_SetNickname struct {
|
|
SetNickname *SetNicknameRequest `protobuf:"bytes,2,opt,name=set_nickname,json=setNickname,proto3,oneof"`
|
|
}
|
|
|
|
type Request_SetClientInfo struct {
|
|
SetClientInfo *SetClientInfoRequest `protobuf:"bytes,3,opt,name=set_client_info,json=setClientInfo,proto3,oneof"`
|
|
}
|
|
|
|
type Request_CreateRoom struct {
|
|
CreateRoom *CreateRoomRequest `protobuf:"bytes,4,opt,name=create_room,json=createRoom,proto3,oneof"`
|
|
}
|
|
|
|
type Request_CreatePveRoom struct {
|
|
CreatePveRoom *CreatePveRoomRequest `protobuf:"bytes,5,opt,name=create_pve_room,json=createPveRoom,proto3,oneof"`
|
|
}
|
|
|
|
type Request_GetRooms struct {
|
|
GetRooms *GetRoomsRequest `protobuf:"bytes,6,opt,name=get_rooms,json=getRooms,proto3,oneof"`
|
|
}
|
|
|
|
type Request_JoinRoom struct {
|
|
JoinRoom *JoinRoomRequest `protobuf:"bytes,7,opt,name=join_room,json=joinRoom,proto3,oneof"`
|
|
}
|
|
|
|
type Request_GameMove struct {
|
|
GameMove *GameMoveRequest `protobuf:"bytes,8,opt,name=game_move,json=gameMove,proto3,oneof"`
|
|
}
|
|
|
|
type Request_GameReset struct {
|
|
GameReset *GameResetRequest `protobuf:"bytes,9,opt,name=game_reset,json=gameReset,proto3,oneof"`
|
|
}
|
|
|
|
type Request_WatchGame struct {
|
|
WatchGame *WatchGameRequest `protobuf:"bytes,10,opt,name=watch_game,json=watchGame,proto3,oneof"`
|
|
}
|
|
|
|
type Request_WatchGameExit struct {
|
|
WatchGameExit *WatchGameExitRequest `protobuf:"bytes,11,opt,name=watch_game_exit,json=watchGameExit,proto3,oneof"`
|
|
}
|
|
|
|
type Request_ClientExit struct {
|
|
ClientExit *ClientExitRequest `protobuf:"bytes,12,opt,name=client_exit,json=clientExit,proto3,oneof"`
|
|
}
|
|
|
|
func (*Request_Heartbeat) isRequest_Payload() {}
|
|
|
|
func (*Request_SetNickname) isRequest_Payload() {}
|
|
|
|
func (*Request_SetClientInfo) isRequest_Payload() {}
|
|
|
|
func (*Request_CreateRoom) isRequest_Payload() {}
|
|
|
|
func (*Request_CreatePveRoom) isRequest_Payload() {}
|
|
|
|
func (*Request_GetRooms) isRequest_Payload() {}
|
|
|
|
func (*Request_JoinRoom) isRequest_Payload() {}
|
|
|
|
func (*Request_GameMove) isRequest_Payload() {}
|
|
|
|
func (*Request_GameReset) isRequest_Payload() {}
|
|
|
|
func (*Request_WatchGame) isRequest_Payload() {}
|
|
|
|
func (*Request_WatchGameExit) isRequest_Payload() {}
|
|
|
|
func (*Request_ClientExit) isRequest_Payload() {}
|
|
|
|
type HeartbeatRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *HeartbeatRequest) Reset() {
|
|
*x = HeartbeatRequest{}
|
|
mi := &file_request_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *HeartbeatRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*HeartbeatRequest) ProtoMessage() {}
|
|
|
|
func (x *HeartbeatRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use HeartbeatRequest.ProtoReflect.Descriptor instead.
|
|
func (*HeartbeatRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
type SetNicknameRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Nickname string `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SetNicknameRequest) Reset() {
|
|
*x = SetNicknameRequest{}
|
|
mi := &file_request_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SetNicknameRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SetNicknameRequest) ProtoMessage() {}
|
|
|
|
func (x *SetNicknameRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[2]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SetNicknameRequest.ProtoReflect.Descriptor instead.
|
|
func (*SetNicknameRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *SetNicknameRequest) GetNickname() string {
|
|
if x != nil {
|
|
return x.Nickname
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type SetClientInfoRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SetClientInfoRequest) Reset() {
|
|
*x = SetClientInfoRequest{}
|
|
mi := &file_request_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SetClientInfoRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SetClientInfoRequest) ProtoMessage() {}
|
|
|
|
func (x *SetClientInfoRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[3]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SetClientInfoRequest.ProtoReflect.Descriptor instead.
|
|
func (*SetClientInfoRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *SetClientInfoRequest) GetVersion() string {
|
|
if x != nil {
|
|
return x.Version
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type CreateRoomRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *CreateRoomRequest) Reset() {
|
|
*x = CreateRoomRequest{}
|
|
mi := &file_request_proto_msgTypes[4]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *CreateRoomRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*CreateRoomRequest) ProtoMessage() {}
|
|
|
|
func (x *CreateRoomRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[4]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use CreateRoomRequest.ProtoReflect.Descriptor instead.
|
|
func (*CreateRoomRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{4}
|
|
}
|
|
|
|
type CreatePveRoomRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Difficulty int32 `protobuf:"varint,1,opt,name=difficulty,proto3" json:"difficulty,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *CreatePveRoomRequest) Reset() {
|
|
*x = CreatePveRoomRequest{}
|
|
mi := &file_request_proto_msgTypes[5]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *CreatePveRoomRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*CreatePveRoomRequest) ProtoMessage() {}
|
|
|
|
func (x *CreatePveRoomRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[5]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use CreatePveRoomRequest.ProtoReflect.Descriptor instead.
|
|
func (*CreatePveRoomRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{5}
|
|
}
|
|
|
|
func (x *CreatePveRoomRequest) GetDifficulty() int32 {
|
|
if x != nil {
|
|
return x.Difficulty
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetRoomsRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *GetRoomsRequest) Reset() {
|
|
*x = GetRoomsRequest{}
|
|
mi := &file_request_proto_msgTypes[6]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *GetRoomsRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*GetRoomsRequest) ProtoMessage() {}
|
|
|
|
func (x *GetRoomsRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[6]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use GetRoomsRequest.ProtoReflect.Descriptor instead.
|
|
func (*GetRoomsRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{6}
|
|
}
|
|
|
|
type JoinRoomRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
RoomId int32 `protobuf:"varint,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *JoinRoomRequest) Reset() {
|
|
*x = JoinRoomRequest{}
|
|
mi := &file_request_proto_msgTypes[7]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *JoinRoomRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*JoinRoomRequest) ProtoMessage() {}
|
|
|
|
func (x *JoinRoomRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[7]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use JoinRoomRequest.ProtoReflect.Descriptor instead.
|
|
func (*JoinRoomRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{7}
|
|
}
|
|
|
|
func (x *JoinRoomRequest) GetRoomId() int32 {
|
|
if x != nil {
|
|
return x.RoomId
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GameMoveRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Row int32 `protobuf:"varint,1,opt,name=row,proto3" json:"row,omitempty"`
|
|
Col int32 `protobuf:"varint,2,opt,name=col,proto3" json:"col,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *GameMoveRequest) Reset() {
|
|
*x = GameMoveRequest{}
|
|
mi := &file_request_proto_msgTypes[8]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *GameMoveRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*GameMoveRequest) ProtoMessage() {}
|
|
|
|
func (x *GameMoveRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[8]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use GameMoveRequest.ProtoReflect.Descriptor instead.
|
|
func (*GameMoveRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{8}
|
|
}
|
|
|
|
func (x *GameMoveRequest) GetRow() int32 {
|
|
if x != nil {
|
|
return x.Row
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *GameMoveRequest) GetCol() int32 {
|
|
if x != nil {
|
|
return x.Col
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GameResetRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *GameResetRequest) Reset() {
|
|
*x = GameResetRequest{}
|
|
mi := &file_request_proto_msgTypes[9]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *GameResetRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*GameResetRequest) ProtoMessage() {}
|
|
|
|
func (x *GameResetRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[9]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use GameResetRequest.ProtoReflect.Descriptor instead.
|
|
func (*GameResetRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{9}
|
|
}
|
|
|
|
type WatchGameRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
RoomId int32 `protobuf:"varint,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *WatchGameRequest) Reset() {
|
|
*x = WatchGameRequest{}
|
|
mi := &file_request_proto_msgTypes[10]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *WatchGameRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*WatchGameRequest) ProtoMessage() {}
|
|
|
|
func (x *WatchGameRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[10]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use WatchGameRequest.ProtoReflect.Descriptor instead.
|
|
func (*WatchGameRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{10}
|
|
}
|
|
|
|
func (x *WatchGameRequest) GetRoomId() int32 {
|
|
if x != nil {
|
|
return x.RoomId
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type WatchGameExitRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *WatchGameExitRequest) Reset() {
|
|
*x = WatchGameExitRequest{}
|
|
mi := &file_request_proto_msgTypes[11]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *WatchGameExitRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*WatchGameExitRequest) ProtoMessage() {}
|
|
|
|
func (x *WatchGameExitRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[11]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use WatchGameExitRequest.ProtoReflect.Descriptor instead.
|
|
func (*WatchGameExitRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{11}
|
|
}
|
|
|
|
type ClientExitRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ClientExitRequest) Reset() {
|
|
*x = ClientExitRequest{}
|
|
mi := &file_request_proto_msgTypes[12]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ClientExitRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ClientExitRequest) ProtoMessage() {}
|
|
|
|
func (x *ClientExitRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_request_proto_msgTypes[12]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ClientExitRequest.ProtoReflect.Descriptor instead.
|
|
func (*ClientExitRequest) Descriptor() ([]byte, []int) {
|
|
return file_request_proto_rawDescGZIP(), []int{12}
|
|
}
|
|
|
|
var File_request_proto protoreflect.FileDescriptor
|
|
|
|
const file_request_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\rrequest.proto\x12\x17com.miti99.gomoku.proto\"\xcd\a\n" +
|
|
"\aRequest\x12I\n" +
|
|
"\theartbeat\x18\x01 \x01(\v2).com.miti99.gomoku.proto.HeartbeatRequestH\x00R\theartbeat\x12P\n" +
|
|
"\fset_nickname\x18\x02 \x01(\v2+.com.miti99.gomoku.proto.SetNicknameRequestH\x00R\vsetNickname\x12W\n" +
|
|
"\x0fset_client_info\x18\x03 \x01(\v2-.com.miti99.gomoku.proto.SetClientInfoRequestH\x00R\rsetClientInfo\x12M\n" +
|
|
"\vcreate_room\x18\x04 \x01(\v2*.com.miti99.gomoku.proto.CreateRoomRequestH\x00R\n" +
|
|
"createRoom\x12W\n" +
|
|
"\x0fcreate_pve_room\x18\x05 \x01(\v2-.com.miti99.gomoku.proto.CreatePveRoomRequestH\x00R\rcreatePveRoom\x12G\n" +
|
|
"\tget_rooms\x18\x06 \x01(\v2(.com.miti99.gomoku.proto.GetRoomsRequestH\x00R\bgetRooms\x12G\n" +
|
|
"\tjoin_room\x18\a \x01(\v2(.com.miti99.gomoku.proto.JoinRoomRequestH\x00R\bjoinRoom\x12G\n" +
|
|
"\tgame_move\x18\b \x01(\v2(.com.miti99.gomoku.proto.GameMoveRequestH\x00R\bgameMove\x12J\n" +
|
|
"\n" +
|
|
"game_reset\x18\t \x01(\v2).com.miti99.gomoku.proto.GameResetRequestH\x00R\tgameReset\x12J\n" +
|
|
"\n" +
|
|
"watch_game\x18\n" +
|
|
" \x01(\v2).com.miti99.gomoku.proto.WatchGameRequestH\x00R\twatchGame\x12W\n" +
|
|
"\x0fwatch_game_exit\x18\v \x01(\v2-.com.miti99.gomoku.proto.WatchGameExitRequestH\x00R\rwatchGameExit\x12M\n" +
|
|
"\vclient_exit\x18\f \x01(\v2*.com.miti99.gomoku.proto.ClientExitRequestH\x00R\n" +
|
|
"clientExitB\t\n" +
|
|
"\apayload\"\x12\n" +
|
|
"\x10HeartbeatRequest\"0\n" +
|
|
"\x12SetNicknameRequest\x12\x1a\n" +
|
|
"\bnickname\x18\x01 \x01(\tR\bnickname\"0\n" +
|
|
"\x14SetClientInfoRequest\x12\x18\n" +
|
|
"\aversion\x18\x01 \x01(\tR\aversion\"\x13\n" +
|
|
"\x11CreateRoomRequest\"6\n" +
|
|
"\x14CreatePveRoomRequest\x12\x1e\n" +
|
|
"\n" +
|
|
"difficulty\x18\x01 \x01(\x05R\n" +
|
|
"difficulty\"\x11\n" +
|
|
"\x0fGetRoomsRequest\"*\n" +
|
|
"\x0fJoinRoomRequest\x12\x17\n" +
|
|
"\aroom_id\x18\x01 \x01(\x05R\x06roomId\"5\n" +
|
|
"\x0fGameMoveRequest\x12\x10\n" +
|
|
"\x03row\x18\x01 \x01(\x05R\x03row\x12\x10\n" +
|
|
"\x03col\x18\x02 \x01(\x05R\x03col\"\x12\n" +
|
|
"\x10GameResetRequest\"+\n" +
|
|
"\x10WatchGameRequest\x12\x17\n" +
|
|
"\aroom_id\x18\x01 \x01(\x05R\x06roomId\"\x16\n" +
|
|
"\x14WatchGameExitRequest\"\x13\n" +
|
|
"\x11ClientExitRequestB5Z3github.com/tiennm99/gomoku/server/protocol;protocolb\x06proto3"
|
|
|
|
var (
|
|
file_request_proto_rawDescOnce sync.Once
|
|
file_request_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_request_proto_rawDescGZIP() []byte {
|
|
file_request_proto_rawDescOnce.Do(func() {
|
|
file_request_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_request_proto_rawDesc), len(file_request_proto_rawDesc)))
|
|
})
|
|
return file_request_proto_rawDescData
|
|
}
|
|
|
|
var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
|
var file_request_proto_goTypes = []any{
|
|
(*Request)(nil), // 0: com.miti99.gomoku.proto.Request
|
|
(*HeartbeatRequest)(nil), // 1: com.miti99.gomoku.proto.HeartbeatRequest
|
|
(*SetNicknameRequest)(nil), // 2: com.miti99.gomoku.proto.SetNicknameRequest
|
|
(*SetClientInfoRequest)(nil), // 3: com.miti99.gomoku.proto.SetClientInfoRequest
|
|
(*CreateRoomRequest)(nil), // 4: com.miti99.gomoku.proto.CreateRoomRequest
|
|
(*CreatePveRoomRequest)(nil), // 5: com.miti99.gomoku.proto.CreatePveRoomRequest
|
|
(*GetRoomsRequest)(nil), // 6: com.miti99.gomoku.proto.GetRoomsRequest
|
|
(*JoinRoomRequest)(nil), // 7: com.miti99.gomoku.proto.JoinRoomRequest
|
|
(*GameMoveRequest)(nil), // 8: com.miti99.gomoku.proto.GameMoveRequest
|
|
(*GameResetRequest)(nil), // 9: com.miti99.gomoku.proto.GameResetRequest
|
|
(*WatchGameRequest)(nil), // 10: com.miti99.gomoku.proto.WatchGameRequest
|
|
(*WatchGameExitRequest)(nil), // 11: com.miti99.gomoku.proto.WatchGameExitRequest
|
|
(*ClientExitRequest)(nil), // 12: com.miti99.gomoku.proto.ClientExitRequest
|
|
}
|
|
var file_request_proto_depIdxs = []int32{
|
|
1, // 0: com.miti99.gomoku.proto.Request.heartbeat:type_name -> com.miti99.gomoku.proto.HeartbeatRequest
|
|
2, // 1: com.miti99.gomoku.proto.Request.set_nickname:type_name -> com.miti99.gomoku.proto.SetNicknameRequest
|
|
3, // 2: com.miti99.gomoku.proto.Request.set_client_info:type_name -> com.miti99.gomoku.proto.SetClientInfoRequest
|
|
4, // 3: com.miti99.gomoku.proto.Request.create_room:type_name -> com.miti99.gomoku.proto.CreateRoomRequest
|
|
5, // 4: com.miti99.gomoku.proto.Request.create_pve_room:type_name -> com.miti99.gomoku.proto.CreatePveRoomRequest
|
|
6, // 5: com.miti99.gomoku.proto.Request.get_rooms:type_name -> com.miti99.gomoku.proto.GetRoomsRequest
|
|
7, // 6: com.miti99.gomoku.proto.Request.join_room:type_name -> com.miti99.gomoku.proto.JoinRoomRequest
|
|
8, // 7: com.miti99.gomoku.proto.Request.game_move:type_name -> com.miti99.gomoku.proto.GameMoveRequest
|
|
9, // 8: com.miti99.gomoku.proto.Request.game_reset:type_name -> com.miti99.gomoku.proto.GameResetRequest
|
|
10, // 9: com.miti99.gomoku.proto.Request.watch_game:type_name -> com.miti99.gomoku.proto.WatchGameRequest
|
|
11, // 10: com.miti99.gomoku.proto.Request.watch_game_exit:type_name -> com.miti99.gomoku.proto.WatchGameExitRequest
|
|
12, // 11: com.miti99.gomoku.proto.Request.client_exit:type_name -> com.miti99.gomoku.proto.ClientExitRequest
|
|
12, // [12:12] is the sub-list for method output_type
|
|
12, // [12:12] is the sub-list for method input_type
|
|
12, // [12:12] is the sub-list for extension type_name
|
|
12, // [12:12] is the sub-list for extension extendee
|
|
0, // [0:12] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_request_proto_init() }
|
|
func file_request_proto_init() {
|
|
if File_request_proto != nil {
|
|
return
|
|
}
|
|
file_request_proto_msgTypes[0].OneofWrappers = []any{
|
|
(*Request_Heartbeat)(nil),
|
|
(*Request_SetNickname)(nil),
|
|
(*Request_SetClientInfo)(nil),
|
|
(*Request_CreateRoom)(nil),
|
|
(*Request_CreatePveRoom)(nil),
|
|
(*Request_GetRooms)(nil),
|
|
(*Request_JoinRoom)(nil),
|
|
(*Request_GameMove)(nil),
|
|
(*Request_GameReset)(nil),
|
|
(*Request_WatchGame)(nil),
|
|
(*Request_WatchGameExit)(nil),
|
|
(*Request_ClientExit)(nil),
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_request_proto_rawDesc), len(file_request_proto_rawDesc)),
|
|
NumEnums: 0,
|
|
NumMessages: 13,
|
|
NumExtensions: 0,
|
|
NumServices: 0,
|
|
},
|
|
GoTypes: file_request_proto_goTypes,
|
|
DependencyIndexes: file_request_proto_depIdxs,
|
|
MessageInfos: file_request_proto_msgTypes,
|
|
}.Build()
|
|
File_request_proto = out.File
|
|
file_request_proto_goTypes = nil
|
|
file_request_proto_depIdxs = nil
|
|
}
|