diff --git a/go/connectfour/v1/gamingplatform.go b/go/connectfour/v1/gamingplatform.go index 6b6c15f..5b4a752 100644 --- a/go/connectfour/v1/gamingplatform.go +++ b/go/connectfour/v1/gamingplatform.go @@ -5,6 +5,8 @@ package connectfourv1 const GameType = "ConnectFour.Game.v1" const GetGamesByPlayerType = "ConnectFour.GetGamesByPlayer.v1" const GetGamesByPlayerResponseType = "ConnectFour.GetGamesByPlayerResponse.v1" +const GetOpenGamesType = "ConnectFour.GetOpenGames.v1" +const GetOpenGamesResponseType = "ConnectFour.GetOpenGamesResponse.v1" const JoinGameType = "ConnectFour.JoinGame.v1" const JoinGameResponseType = "ConnectFour.JoinGameResponse.v1" const MakeMoveType = "ConnectFour.MakeMove.v1" diff --git a/go/connectfour/v1/messaging.pb.go b/go/connectfour/v1/messaging.pb.go index 5b9165a..30bfa78 100644 --- a/go/connectfour/v1/messaging.pb.go +++ b/go/connectfour/v1/messaging.pb.go @@ -131,7 +131,7 @@ func (x GetGamesByPlayer_State) Number() protoreflect.EnumNumber { // Deprecated: Use GetGamesByPlayer_State.Descriptor instead. func (GetGamesByPlayer_State) EnumDescriptor() ([]byte, []int) { - return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{6, 0} + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{8, 0} } type Game_Move_Color int32 @@ -180,7 +180,7 @@ func (x Game_Move_Color) Number() protoreflect.EnumNumber { // Deprecated: Use Game_Move_Color.Descriptor instead. func (Game_Move_Color) EnumDescriptor() ([]byte, []int) { - return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{8, 0, 0} + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{10, 0, 0} } type OpenGame struct { @@ -487,6 +487,94 @@ func (*MakeMoveResponse) Descriptor() ([]byte, []int) { return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{5} } +type GetOpenGames struct { + state protoimpl.MessageState `protogen:"open.v1"` + Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOpenGames) Reset() { + *x = GetOpenGames{} + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOpenGames) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOpenGames) ProtoMessage() {} + +func (x *GetOpenGames) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_connectfour_v1_messaging_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 GetOpenGames.ProtoReflect.Descriptor instead. +func (*GetOpenGames) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{6} +} + +func (x *GetOpenGames) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 +} + +type GetOpenGamesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Games []*GetOpenGamesResponse_Game `protobuf:"bytes,1,rep,name=games,proto3" json:"games,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOpenGamesResponse) Reset() { + *x = GetOpenGamesResponse{} + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOpenGamesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOpenGamesResponse) ProtoMessage() {} + +func (x *GetOpenGamesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_connectfour_v1_messaging_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 GetOpenGamesResponse.ProtoReflect.Descriptor instead. +func (*GetOpenGamesResponse) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{7} +} + +func (x *GetOpenGamesResponse) GetGames() []*GetOpenGamesResponse_Game { + if x != nil { + return x.Games + } + return nil +} + type GetGamesByPlayer struct { state protoimpl.MessageState `protogen:"open.v1"` PlayerId string `protobuf:"bytes,1,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"` @@ -499,7 +587,7 @@ type GetGamesByPlayer struct { func (x *GetGamesByPlayer) Reset() { *x = GetGamesByPlayer{} - mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[6] + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -511,7 +599,7 @@ func (x *GetGamesByPlayer) String() string { func (*GetGamesByPlayer) ProtoMessage() {} func (x *GetGamesByPlayer) ProtoReflect() protoreflect.Message { - mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[6] + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -524,7 +612,7 @@ func (x *GetGamesByPlayer) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGamesByPlayer.ProtoReflect.Descriptor instead. func (*GetGamesByPlayer) Descriptor() ([]byte, []int) { - return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{6} + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{8} } func (x *GetGamesByPlayer) GetPlayerId() string { @@ -565,7 +653,7 @@ type GetGamesByPlayerResponse struct { func (x *GetGamesByPlayerResponse) Reset() { *x = GetGamesByPlayerResponse{} - mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[7] + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -577,7 +665,7 @@ func (x *GetGamesByPlayerResponse) String() string { func (*GetGamesByPlayerResponse) ProtoMessage() {} func (x *GetGamesByPlayerResponse) ProtoReflect() protoreflect.Message { - mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[7] + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -590,7 +678,7 @@ func (x *GetGamesByPlayerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGamesByPlayerResponse.ProtoReflect.Descriptor instead. func (*GetGamesByPlayerResponse) Descriptor() ([]byte, []int) { - return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{7} + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{9} } func (x *GetGamesByPlayerResponse) GetGames() []*Game { @@ -623,7 +711,7 @@ type Game struct { func (x *Game) Reset() { *x = Game{} - mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[8] + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -635,7 +723,7 @@ func (x *Game) String() string { func (*Game) ProtoMessage() {} func (x *Game) ProtoReflect() protoreflect.Message { - mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[8] + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -648,7 +736,7 @@ func (x *Game) ProtoReflect() protoreflect.Message { // Deprecated: Use Game.ProtoReflect.Descriptor instead. func (*Game) Descriptor() ([]byte, []int) { - return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{8} + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{10} } func (x *Game) GetGameId() string { @@ -707,6 +795,74 @@ func (x *Game) GetChatId() string { return "" } +type GetOpenGamesResponse_Game struct { + state protoimpl.MessageState `protogen:"open.v1"` + GameId string `protobuf:"bytes,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` + Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + PlayerId string `protobuf:"bytes,4,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOpenGamesResponse_Game) Reset() { + *x = GetOpenGamesResponse_Game{} + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOpenGamesResponse_Game) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOpenGamesResponse_Game) ProtoMessage() {} + +func (x *GetOpenGamesResponse_Game) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_connectfour_v1_messaging_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 GetOpenGamesResponse_Game.ProtoReflect.Descriptor instead. +func (*GetOpenGamesResponse_Game) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *GetOpenGamesResponse_Game) GetGameId() string { + if x != nil { + return x.GameId + } + return "" +} + +func (x *GetOpenGamesResponse_Game) GetWidth() int32 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *GetOpenGamesResponse_Game) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *GetOpenGamesResponse_Game) GetPlayerId() string { + if x != nil { + return x.PlayerId + } + return "" +} + type Game_Move struct { state protoimpl.MessageState `protogen:"open.v1"` X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` @@ -718,7 +874,7 @@ type Game_Move struct { func (x *Game_Move) Reset() { *x = Game_Move{} - mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[9] + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -730,7 +886,7 @@ func (x *Game_Move) String() string { func (*Game_Move) ProtoMessage() {} func (x *Game_Move) ProtoReflect() protoreflect.Message { - mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[9] + mi := &file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -743,7 +899,7 @@ func (x *Game_Move) ProtoReflect() protoreflect.Message { // Deprecated: Use Game_Move.ProtoReflect.Descriptor instead. func (*Game_Move) Descriptor() ([]byte, []int) { - return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{8, 0} + return file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP(), []int{10, 0} } func (x *Game_Move) GetX() int32 { @@ -793,7 +949,16 @@ const file_gamingplatform_api_connectfour_v1_messaging_proto_rawDesc = "" + "\agame_id\x18\x01 \x01(\tR\x06gameId\x12\x1b\n" + "\tplayer_id\x18\x02 \x01(\tR\bplayerId\x12\x16\n" + "\x06column\x18\x03 \x01(\x05R\x06column\"\x12\n" + - "\x10MakeMoveResponse\"\xad\x02\n" + + "\x10MakeMoveResponse\"$\n" + + "\fGetOpenGames\x12\x14\n" + + "\x05limit\x18\x01 \x01(\x05R\x05limit\"\xd6\x01\n" + + "\x14GetOpenGamesResponse\x12R\n" + + "\x05games\x18\x01 \x03(\v2<.gamingplatform.api.connectfour.v1.GetOpenGamesResponse.GameR\x05games\x1aj\n" + + "\x04Game\x12\x17\n" + + "\agame_id\x18\x01 \x01(\tR\x06gameId\x12\x14\n" + + "\x05width\x18\x02 \x01(\x05R\x05width\x12\x16\n" + + "\x06height\x18\x03 \x01(\x05R\x06height\x12\x1b\n" + + "\tplayer_id\x18\x04 \x01(\tR\bplayerId\"\xad\x02\n" + "\x10GetGamesByPlayer\x12\x1b\n" + "\tplayer_id\x18\x01 \x01(\tR\bplayerId\x12O\n" + "\x05state\x18\x02 \x01(\x0e29.gamingplatform.api.connectfour.v1.GetGamesByPlayer.StateR\x05state\x12\x12\n" + @@ -843,33 +1008,37 @@ func file_gamingplatform_api_connectfour_v1_messaging_proto_rawDescGZIP() []byte } var file_gamingplatform_api_connectfour_v1_messaging_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_gamingplatform_api_connectfour_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_gamingplatform_api_connectfour_v1_messaging_proto_goTypes = []any{ - (OpenGame_Stone)(0), // 0: gamingplatform.api.connectfour.v1.OpenGame.Stone - (GetGamesByPlayer_State)(0), // 1: gamingplatform.api.connectfour.v1.GetGamesByPlayer.State - (Game_Move_Color)(0), // 2: gamingplatform.api.connectfour.v1.Game.Move.Color - (*OpenGame)(nil), // 3: gamingplatform.api.connectfour.v1.OpenGame - (*OpenGameResponse)(nil), // 4: gamingplatform.api.connectfour.v1.OpenGameResponse - (*JoinGame)(nil), // 5: gamingplatform.api.connectfour.v1.JoinGame - (*JoinGameResponse)(nil), // 6: gamingplatform.api.connectfour.v1.JoinGameResponse - (*MakeMove)(nil), // 7: gamingplatform.api.connectfour.v1.MakeMove - (*MakeMoveResponse)(nil), // 8: gamingplatform.api.connectfour.v1.MakeMoveResponse - (*GetGamesByPlayer)(nil), // 9: gamingplatform.api.connectfour.v1.GetGamesByPlayer - (*GetGamesByPlayerResponse)(nil), // 10: gamingplatform.api.connectfour.v1.GetGamesByPlayerResponse - (*Game)(nil), // 11: gamingplatform.api.connectfour.v1.Game - (*Game_Move)(nil), // 12: gamingplatform.api.connectfour.v1.Game.Move + (OpenGame_Stone)(0), // 0: gamingplatform.api.connectfour.v1.OpenGame.Stone + (GetGamesByPlayer_State)(0), // 1: gamingplatform.api.connectfour.v1.GetGamesByPlayer.State + (Game_Move_Color)(0), // 2: gamingplatform.api.connectfour.v1.Game.Move.Color + (*OpenGame)(nil), // 3: gamingplatform.api.connectfour.v1.OpenGame + (*OpenGameResponse)(nil), // 4: gamingplatform.api.connectfour.v1.OpenGameResponse + (*JoinGame)(nil), // 5: gamingplatform.api.connectfour.v1.JoinGame + (*JoinGameResponse)(nil), // 6: gamingplatform.api.connectfour.v1.JoinGameResponse + (*MakeMove)(nil), // 7: gamingplatform.api.connectfour.v1.MakeMove + (*MakeMoveResponse)(nil), // 8: gamingplatform.api.connectfour.v1.MakeMoveResponse + (*GetOpenGames)(nil), // 9: gamingplatform.api.connectfour.v1.GetOpenGames + (*GetOpenGamesResponse)(nil), // 10: gamingplatform.api.connectfour.v1.GetOpenGamesResponse + (*GetGamesByPlayer)(nil), // 11: gamingplatform.api.connectfour.v1.GetGamesByPlayer + (*GetGamesByPlayerResponse)(nil), // 12: gamingplatform.api.connectfour.v1.GetGamesByPlayerResponse + (*Game)(nil), // 13: gamingplatform.api.connectfour.v1.Game + (*GetOpenGamesResponse_Game)(nil), // 14: gamingplatform.api.connectfour.v1.GetOpenGamesResponse.Game + (*Game_Move)(nil), // 15: gamingplatform.api.connectfour.v1.Game.Move } var file_gamingplatform_api_connectfour_v1_messaging_proto_depIdxs = []int32{ 0, // 0: gamingplatform.api.connectfour.v1.OpenGame.stone:type_name -> gamingplatform.api.connectfour.v1.OpenGame.Stone - 1, // 1: gamingplatform.api.connectfour.v1.GetGamesByPlayer.state:type_name -> gamingplatform.api.connectfour.v1.GetGamesByPlayer.State - 11, // 2: gamingplatform.api.connectfour.v1.GetGamesByPlayerResponse.games:type_name -> gamingplatform.api.connectfour.v1.Game - 12, // 3: gamingplatform.api.connectfour.v1.Game.moves:type_name -> gamingplatform.api.connectfour.v1.Game.Move - 2, // 4: gamingplatform.api.connectfour.v1.Game.Move.color:type_name -> gamingplatform.api.connectfour.v1.Game.Move.Color - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 14, // 1: gamingplatform.api.connectfour.v1.GetOpenGamesResponse.games:type_name -> gamingplatform.api.connectfour.v1.GetOpenGamesResponse.Game + 1, // 2: gamingplatform.api.connectfour.v1.GetGamesByPlayer.state:type_name -> gamingplatform.api.connectfour.v1.GetGamesByPlayer.State + 13, // 3: gamingplatform.api.connectfour.v1.GetGamesByPlayerResponse.games:type_name -> gamingplatform.api.connectfour.v1.Game + 15, // 4: gamingplatform.api.connectfour.v1.Game.moves:type_name -> gamingplatform.api.connectfour.v1.Game.Move + 2, // 5: gamingplatform.api.connectfour.v1.Game.Move.color:type_name -> gamingplatform.api.connectfour.v1.Game.Move.Color + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_gamingplatform_api_connectfour_v1_messaging_proto_init() } @@ -883,7 +1052,7 @@ func file_gamingplatform_api_connectfour_v1_messaging_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_gamingplatform_api_connectfour_v1_messaging_proto_rawDesc), len(file_gamingplatform_api_connectfour_v1_messaging_proto_rawDesc)), NumEnums: 3, - NumMessages: 10, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1.php b/php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1.php index 94fe9e2..67b7b82 100644 --- a/php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1.php +++ b/php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1.php @@ -47,6 +47,35 @@ public static function createGetGamesByPlayerResponse( if ($data !== null) $message->mergeFromString($data); return $message; } + public const string GetOpenGamesType = 'ConnectFour.GetOpenGames.v1'; + public static function createGetOpenGames( + ?string $data = null + ): GetOpenGames { + static $template; + $template ??= new GetOpenGames(); + $message = clone $template; + if ($data !== null) $message->mergeFromString($data); + return $message; + } + public static function createGetOpenGamesResponse_Game( + ?string $data = null + ): GetOpenGamesResponse\Game { + static $template; + $template ??= new GetOpenGamesResponse\Game(); + $message = clone $template; + if ($data !== null) $message->mergeFromString($data); + return $message; + } + public const string GetOpenGamesResponseType = 'ConnectFour.GetOpenGamesResponse.v1'; + public static function createGetOpenGamesResponse( + ?string $data = null + ): GetOpenGamesResponse { + static $template; + $template ??= new GetOpenGamesResponse(); + $message = clone $template; + if ($data !== null) $message->mergeFromString($data); + return $message; + } public const string JoinGameType = 'ConnectFour.JoinGame.v1'; public static function createJoinGame( ?string $data = null diff --git a/php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1Factory.php b/php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1Factory.php index fecd043..638e876 100644 --- a/php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1Factory.php +++ b/php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1Factory.php @@ -53,6 +53,39 @@ public static function createGetGamesByPlayerResponse( return $message; } + /** @deprecated */ + public static function createGetOpenGames( + string $data + ): \GamingPlatform\Api\ConnectFour\V1\GetOpenGames { + static $template; + $template ??= new \GamingPlatform\Api\ConnectFour\V1\GetOpenGames(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + + /** @deprecated */ + public static function createGetOpenGamesResponse_Game( + string $data + ): \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse\Game { + static $template; + $template ??= new \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse\Game(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + + /** @deprecated */ + public static function createGetOpenGamesResponse( + string $data + ): \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse { + static $template; + $template ??= new \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + /** @deprecated */ public static function createJoinGame( string $data diff --git a/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGames.php b/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGames.php new file mode 100644 index 0000000..d049495 --- /dev/null +++ b/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGames.php @@ -0,0 +1,58 @@ +gamingplatform.api.connectfour.v1.GetOpenGames + */ +class GetOpenGames extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field int32 limit = 1; + */ + protected $limit = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $limit + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\ConnectFour\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field int32 limit = 1; + * @return int + */ + public function getLimit() + { + return $this->limit; + } + + /** + * Generated from protobuf field int32 limit = 1; + * @param int $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkInt32($var); + $this->limit = $var; + + return $this; + } + +} + diff --git a/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGamesResponse.php b/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGamesResponse.php new file mode 100644 index 0000000..9991fdd --- /dev/null +++ b/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGamesResponse.php @@ -0,0 +1,58 @@ +gamingplatform.api.connectfour.v1.GetOpenGamesResponse + */ +class GetOpenGamesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .gamingplatform.api.connectfour.v1.GetOpenGamesResponse.Game games = 1; + */ + private $games; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse\Game>|\Google\Protobuf\Internal\RepeatedField $games + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\ConnectFour\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .gamingplatform.api.connectfour.v1.GetOpenGamesResponse.Game games = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGames() + { + return $this->games; + } + + /** + * Generated from protobuf field repeated .gamingplatform.api.connectfour.v1.GetOpenGamesResponse.Game games = 1; + * @param array<\GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse\Game>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse\Game::class); + $this->games = $arr; + + return $this; + } + +} + diff --git a/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGamesResponse/Game.php b/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGamesResponse/Game.php new file mode 100644 index 0000000..1faf011 --- /dev/null +++ b/php/GamingPlatform/Api/ConnectFour/V1/GetOpenGamesResponse/Game.php @@ -0,0 +1,142 @@ +gamingplatform.api.connectfour.v1.GetOpenGamesResponse.Game + */ +class Game extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string game_id = 1; + */ + protected $game_id = ''; + /** + * Generated from protobuf field int32 width = 2; + */ + protected $width = 0; + /** + * Generated from protobuf field int32 height = 3; + */ + protected $height = 0; + /** + * Generated from protobuf field string player_id = 4; + */ + protected $player_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $game_id + * @type int $width + * @type int $height + * @type string $player_id + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\ConnectFour\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string game_id = 1; + * @return string + */ + public function getGameId() + { + return $this->game_id; + } + + /** + * Generated from protobuf field string game_id = 1; + * @param string $var + * @return $this + */ + public function setGameId($var) + { + GPBUtil::checkString($var, True); + $this->game_id = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 width = 2; + * @return int + */ + public function getWidth() + { + return $this->width; + } + + /** + * Generated from protobuf field int32 width = 2; + * @param int $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkInt32($var); + $this->width = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 height = 3; + * @return int + */ + public function getHeight() + { + return $this->height; + } + + /** + * Generated from protobuf field int32 height = 3; + * @param int $var + * @return $this + */ + public function setHeight($var) + { + GPBUtil::checkInt32($var); + $this->height = $var; + + return $this; + } + + /** + * Generated from protobuf field string player_id = 4; + * @return string + */ + public function getPlayerId() + { + return $this->player_id; + } + + /** + * Generated from protobuf field string player_id = 4; + * @param string $var + * @return $this + */ + public function setPlayerId($var) + { + GPBUtil::checkString($var, True); + $this->player_id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Game::class, \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse_Game::class); + diff --git a/php/GamingPlatform/Api/GPBMetadata/ConnectFour/V1/Messaging.php b/php/GamingPlatform/Api/GPBMetadata/ConnectFour/V1/Messaging.php index d1a50fb..2a67bea 100644 Binary files a/php/GamingPlatform/Api/GPBMetadata/ConnectFour/V1/Messaging.php and b/php/GamingPlatform/Api/GPBMetadata/ConnectFour/V1/Messaging.php differ diff --git a/schema/gamingplatform/api/connectfour/v1/messaging.proto b/schema/gamingplatform/api/connectfour/v1/messaging.proto index c9f9310..46aca34 100644 --- a/schema/gamingplatform/api/connectfour/v1/messaging.proto +++ b/schema/gamingplatform/api/connectfour/v1/messaging.proto @@ -41,6 +41,20 @@ message MakeMove { message MakeMoveResponse { } +message GetOpenGames { + int32 limit = 1; +} + +message GetOpenGamesResponse { + message Game { + string game_id = 1; + int32 width = 2; + int32 height = 3; + string player_id = 4; + } + repeated Game games = 1; +} + message GetGamesByPlayer { enum State { STATE_UNSPECIFIED = 0;