From 99616b4eed3d052d218d943cdc1b96950dace158 Mon Sep 17 00:00:00 2001 From: lotodore Date: Sat, 17 Dec 2011 23:34:34 +0000 Subject: [PATCH] Send player state with each player action. autofold/disconnect timeout now depends on player action timeout. --- docs/pokerth.asn1 | 6 + pokerth_protocol.pro | 2 + src/net/common/clientstate.cpp | 1 + src/net/common/servergamestate.cpp | 20 ++- .../asn1/AfterHandShowCardsMessage.c | 2 +- src/third_party/asn1/AllInShowCardsMessage.c | 4 +- src/third_party/asn1/AskKickDeniedMessage.c | 6 +- src/third_party/asn1/AskKickPlayerMessage.c | 4 +- src/third_party/asn1/ChatMessage.c | 22 +-- src/third_party/asn1/ChatRejectMessage.c | 2 +- src/third_party/asn1/ChatRequestMessage.c | 14 +- src/third_party/asn1/ChatRequestTypeGame.c | 2 +- src/third_party/asn1/ChatRequestTypePrivate.c | 2 +- src/third_party/asn1/ChatTypeGame.c | 4 +- src/third_party/asn1/ChatTypeLobby.c | 2 +- src/third_party/asn1/ChatTypePrivate.c | 2 +- src/third_party/asn1/DealFlopCardsMessage.c | 8 +- src/third_party/asn1/DealRiverCardMessage.c | 4 +- src/third_party/asn1/DealTurnCardMessage.c | 4 +- src/third_party/asn1/DialogMessage.c | 2 +- src/third_party/asn1/EndKickPetitionMessage.c | 12 +- src/third_party/asn1/EndOfGameMessage.c | 4 +- src/third_party/asn1/EndOfHandHideCards.c | 6 +- src/third_party/asn1/EndOfHandMessage.c | 10 +- src/third_party/asn1/EndOfHandShowCards.c | 2 +- src/third_party/asn1/ErrorMessage.c | 2 +- .../asn1/KickPetitionUpdateMessage.c | 10 +- src/third_party/asn1/NetPlayerState.c | 125 ++++++++++++++++++ src/third_party/asn1/NetPlayerState.h | 46 +++++++ src/third_party/asn1/PlayerAllIn.c | 6 +- src/third_party/asn1/PlayerIdChangedMessage.c | 4 +- src/third_party/asn1/PlayerResult.c | 14 +- .../asn1/PlayersActionDoneMessage.c | 30 +++-- .../asn1/PlayersActionDoneMessage.h | 2 + src/third_party/asn1/ReportAvatarAckMessage.c | 4 +- src/third_party/asn1/ReportAvatarMessage.c | 4 +- .../asn1/StartKickPetitionMessage.c | 12 +- src/third_party/asn1/StatisticsData.c | 4 +- src/third_party/asn1/StatisticsMessage.c | 2 +- src/third_party/asn1/TimeoutWarningMessage.c | 4 +- src/third_party/asn1/VoteKickDenied.c | 2 +- src/third_party/asn1/VoteKickReplyMessage.c | 12 +- src/third_party/asn1/VoteKickRequestMessage.c | 6 +- .../src/pokerth_protocol/NetPlayerState.java | 60 +++++++++ .../PlayersActionDoneMessage.java | 17 +++ 45 files changed, 394 insertions(+), 119 deletions(-) create mode 100644 src/third_party/asn1/NetPlayerState.c create mode 100644 src/third_party/asn1/NetPlayerState.h create mode 100644 tests/src/pokerth_protocol/NetPlayerState.java diff --git a/docs/pokerth.asn1 b/docs/pokerth.asn1 index 37867d4f..5454a1bf 100644 --- a/docs/pokerth.asn1 +++ b/docs/pokerth.asn1 @@ -523,6 +523,7 @@ PlayersActionDoneMessage ::= [APPLICATION 27] SEQUENCE { playerId NonZeroId, gameState NetGameState, playerAction NetPlayerAction, + playerState NetPlayerState, totalPlayerBet AmountOfMoney, playerMoney AmountOfMoney, highestSet AmountOfMoney, @@ -808,6 +809,11 @@ NetPlayerAction ::= ENUMERATED { actionAllIn (6) } +NetPlayerState ::= ENUMERATED { + playerStateNormal (0), + playerStateSessionInactive (1) +} + NonZeroId ::= INTEGER(1..4294967295) Id ::= INTEGER(0..4294967295) diff --git a/pokerth_protocol.pro b/pokerth_protocol.pro index 06a80067..ace3a3db 100644 --- a/pokerth_protocol.pro +++ b/pokerth_protocol.pro @@ -124,6 +124,7 @@ HEADERS += src/third_party/asn1/AllInShowCardsMessage.h \ src/third_party/asn1/NetGameMode.h \ src/third_party/asn1/NetGameState.h \ src/third_party/asn1/NetPlayerAction.h \ + src/third_party/asn1/NetPlayerState.h \ src/third_party/asn1/NonZeroId.h \ src/third_party/asn1/OCTET_STRING.h \ src/third_party/asn1/per_decoder.h \ @@ -236,6 +237,7 @@ SOURCES += src/third_party/asn1/ChatCleanerMessage.c \ src/third_party/asn1/OCTET_STRING.c \ src/third_party/asn1/NonZeroId.c \ src/third_party/asn1/NetPlayerAction.c \ + src/third_party/asn1/NetPlayerState.c \ src/third_party/asn1/NetGameState.c \ src/third_party/asn1/NetGameMode.c \ src/third_party/asn1/NetGameInfo.c \ diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index a06f51cf..e57b79cc 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -1785,6 +1785,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, } tmpPlayer->setMyAction(PlayerAction(netActionDone->playerAction)); + tmpPlayer->setIsSessionActive(netActionDone->playerState == NetPlayerState_playerStateNormal); tmpPlayer->setMySetAbsolute(netActionDone->totalPlayerBet); tmpPlayer->setMyCash(netActionDone->playerMoney); curGame->getCurrentHand()->getCurrentBeRo()->setHighestSet(netActionDone->highestSet); diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index e1e2f91e..6f4a5ac4 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -65,8 +65,8 @@ using namespace std; #define SERVER_AUTOSTART_GAME_DELAY_SEC 6 #define SERVER_GAME_ADMIN_WARNING_REMAINING_SEC 60 #define SERVER_GAME_ADMIN_TIMEOUT_SEC 300 // 5 min, MUST be > SERVER_GAME_ADMIN_WARNING_REMAINING_SEC -#define SERVER_GAME_AUTOFOLD_TIMEOUT_SEC 60 -#define SERVER_GAME_FORCED_TIMEOUT_SEC 120 +#define SERVER_GAME_AUTOFOLD_TIMEOUT_FACTOR 20 +#define SERVER_GAME_FORCED_TIMEOUT_FACTOR 60 #define SERVER_VOTE_KICK_TIMEOUT_SEC 30 #define SERVER_LOOP_DELAY_MSEC 50 @@ -85,7 +85,8 @@ static void SendPlayerAction(ServerGame &server, boost::shared_ptrgameState = server.GetCurRound(); netActionDone->highestSet = server.GetGame().getCurrentHand()->getCurrentBeRo()->getHighestSet(); netActionDone->minimumRaise = server.GetGame().getCurrentHand()->getCurrentBeRo()->getMinimumRaise(); - netActionDone->playerAction = static_cast(player->getMyAction()); + netActionDone->playerAction = player->getMyAction(); + netActionDone->playerState = player->isSessionActive() ? NetPlayerState_playerStateNormal : NetPlayerState_playerStateSessionInactive; netActionDone->playerId = player->getMyUniqueID(); netActionDone->playerMoney = player->getMyCash(); netActionDone->totalPlayerBet = player->getMySet(); @@ -184,10 +185,13 @@ static void PerformPlayerAction(ServerGame &server, boost::shared_ptrgetTimeSecSinceLastRemoteAction() >= SERVER_GAME_AUTOFOLD_TIMEOUT_SEC) { - player->setIsSessionActive(false); - if (player->getTimeSecSinceLastRemoteAction() >= SERVER_GAME_FORCED_TIMEOUT_SEC) { - server.KickPlayer(player->getMyUniqueID()); + int actionTimeout = server.GetGameData().playerActionTimeoutSec; + if (actionTimeout) { + if (player->getTimeSecSinceLastRemoteAction() >= actionTimeout * SERVER_GAME_AUTOFOLD_TIMEOUT_FACTOR) { + player->setIsSessionActive(false); + if (player->getTimeSecSinceLastRemoteAction() >= actionTimeout * SERVER_GAME_FORCED_TIMEOUT_FACTOR) { + server.KickPlayer(player->getMyUniqueID()); + } } } } @@ -1219,6 +1223,7 @@ ServerGameStateHand::StartNewHand(boost::shared_ptr server) netSmallBlind->gameState = NetGameState_statePreflopSmallBlind; netSmallBlind->playerId = tmpPlayer->getMyUniqueID(); netSmallBlind->playerAction = tmpPlayer->getMyAction(); + netSmallBlind->playerState = tmpPlayer->isSessionActive() ? NetPlayerState_playerStateNormal : NetPlayerState_playerStateSessionInactive; netSmallBlind->totalPlayerBet = tmpPlayer->getMySet(); netSmallBlind->playerMoney = tmpPlayer->getMyCash(); netSmallBlind->highestSet = server->GetGame().getCurrentHand()->getCurrentBeRo()->getHighestSet(); @@ -1241,6 +1246,7 @@ ServerGameStateHand::StartNewHand(boost::shared_ptr server) netBigBlind->gameState = NetGameState_statePreflopBigBlind; netBigBlind->playerId = tmpPlayer->getMyUniqueID(); netBigBlind->playerAction = tmpPlayer->getMyAction(); + netBigBlind->playerState = tmpPlayer->isSessionActive() ? NetPlayerState_playerStateNormal : NetPlayerState_playerStateSessionInactive; netBigBlind->totalPlayerBet = tmpPlayer->getMySet(); netBigBlind->playerMoney = tmpPlayer->getMyCash(); netBigBlind->highestSet = server->GetGame().getCurrentHand()->getCurrentBeRo()->getHighestSet(); diff --git a/src/third_party/asn1/AfterHandShowCardsMessage.c b/src/third_party/asn1/AfterHandShowCardsMessage.c index edd39ab8..6dac63ec 100644 --- a/src/third_party/asn1/AfterHandShowCardsMessage.c +++ b/src/third_party/asn1/AfterHandShowCardsMessage.c @@ -23,7 +23,7 @@ static ber_tlv_tag_t asn_DEF_AfterHandShowCardsMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AfterHandShowCardsMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerResult at 593 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerResult at 594 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AfterHandShowCardsMessage_specs_1 = { sizeof(struct AfterHandShowCardsMessage), diff --git a/src/third_party/asn1/AllInShowCardsMessage.c b/src/third_party/asn1/AllInShowCardsMessage.c index a7304888..f02e21ef 100644 --- a/src/third_party/asn1/AllInShowCardsMessage.c +++ b/src/third_party/asn1/AllInShowCardsMessage.c @@ -102,8 +102,8 @@ static ber_tlv_tag_t asn_DEF_AllInShowCardsMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AllInShowCardsMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 550 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* playersAllIn at 552 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 551 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* playersAllIn at 553 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AllInShowCardsMessage_specs_1 = { sizeof(struct AllInShowCardsMessage), diff --git a/src/third_party/asn1/AskKickDeniedMessage.c b/src/third_party/asn1/AskKickDeniedMessage.c index dc766449..90c41624 100644 --- a/src/third_party/asn1/AskKickDeniedMessage.c +++ b/src/third_party/asn1/AskKickDeniedMessage.c @@ -164,9 +164,9 @@ static ber_tlv_tag_t asn_DEF_AskKickDeniedMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AskKickDeniedMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 611 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* playerId at 612 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 } /* kickDeniedReason at 614 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 612 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* playerId at 613 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 } /* kickDeniedReason at 615 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AskKickDeniedMessage_specs_1 = { sizeof(struct AskKickDeniedMessage), diff --git a/src/third_party/asn1/AskKickPlayerMessage.c b/src/third_party/asn1/AskKickPlayerMessage.c index 814f71f2..52a13708 100644 --- a/src/third_party/asn1/AskKickPlayerMessage.c +++ b/src/third_party/asn1/AskKickPlayerMessage.c @@ -32,8 +32,8 @@ static ber_tlv_tag_t asn_DEF_AskKickPlayerMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AskKickPlayerMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 606 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 608 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 607 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 609 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AskKickPlayerMessage_specs_1 = { sizeof(struct AskKickPlayerMessage), diff --git a/src/third_party/asn1/ChatMessage.c b/src/third_party/asn1/ChatMessage.c index 188d7c6d..e82b803e 100644 --- a/src/third_party/asn1/ChatMessage.c +++ b/src/third_party/asn1/ChatMessage.c @@ -87,11 +87,11 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = { }, }; static asn_TYPE_tag2member_t asn_MAP_chatType_tag2el_2[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 711 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 712 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* chatTypeBot at 713 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* chatTypeBroadcast at 714 */ - { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* chatTypePrivate at 716 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 712 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 713 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* chatTypeBot at 714 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* chatTypeBroadcast at 715 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* chatTypePrivate at 717 */ }; static asn_CHOICE_specifics_t asn_SPC_chatType_specs_2 = { sizeof(struct chatType), @@ -151,12 +151,12 @@ static ber_tlv_tag_t asn_DEF_ChatMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 717 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 711 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 712 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* chatTypeBot at 713 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* chatTypeBroadcast at 714 */ - { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* chatTypePrivate at 716 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 718 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 712 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 713 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* chatTypeBot at 714 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* chatTypeBroadcast at 715 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* chatTypePrivate at 717 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatMessage_specs_1 = { sizeof(struct ChatMessage), diff --git a/src/third_party/asn1/ChatRejectMessage.c b/src/third_party/asn1/ChatRejectMessage.c index fc7b9d6e..8a3f11e7 100644 --- a/src/third_party/asn1/ChatRejectMessage.c +++ b/src/third_party/asn1/ChatRejectMessage.c @@ -55,7 +55,7 @@ static ber_tlv_tag_t asn_DEF_ChatRejectMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatRejectMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* chatText at 740 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* chatText at 741 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatRejectMessage_specs_1 = { sizeof(struct ChatRejectMessage), diff --git a/src/third_party/asn1/ChatRequestMessage.c b/src/third_party/asn1/ChatRequestMessage.c index c19e1713..c5f2f906 100644 --- a/src/third_party/asn1/ChatRequestMessage.c +++ b/src/third_party/asn1/ChatRequestMessage.c @@ -69,9 +69,9 @@ static asn_TYPE_member_t asn_MBR_chatRequestType_2[] = { }, }; static asn_TYPE_tag2member_t asn_MAP_chatRequestType_tag2el_2[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatRequestTypeLobby at 691 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatRequestTypeGame at 692 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* chatRequestTypePrivate at 694 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatRequestTypeLobby at 692 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatRequestTypeGame at 693 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* chatRequestTypePrivate at 695 */ }; static asn_CHOICE_specifics_t asn_SPC_chatRequestType_specs_2 = { sizeof(struct chatRequestType), @@ -131,10 +131,10 @@ static ber_tlv_tag_t asn_DEF_ChatRequestMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 695 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatRequestTypeLobby at 691 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatRequestTypeGame at 692 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 } /* chatRequestTypePrivate at 694 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 696 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatRequestTypeLobby at 692 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatRequestTypeGame at 693 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 } /* chatRequestTypePrivate at 695 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatRequestMessage_specs_1 = { sizeof(struct ChatRequestMessage), diff --git a/src/third_party/asn1/ChatRequestTypeGame.c b/src/third_party/asn1/ChatRequestTypeGame.c index 6105fe7a..12da1829 100644 --- a/src/third_party/asn1/ChatRequestTypeGame.c +++ b/src/third_party/asn1/ChatRequestTypeGame.c @@ -22,7 +22,7 @@ static ber_tlv_tag_t asn_DEF_ChatRequestTypeGame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatRequestTypeGame_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 703 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 704 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatRequestTypeGame_specs_1 = { sizeof(struct ChatRequestTypeGame), diff --git a/src/third_party/asn1/ChatRequestTypePrivate.c b/src/third_party/asn1/ChatRequestTypePrivate.c index f981d8ac..1ecfca6e 100644 --- a/src/third_party/asn1/ChatRequestTypePrivate.c +++ b/src/third_party/asn1/ChatRequestTypePrivate.c @@ -22,7 +22,7 @@ static ber_tlv_tag_t asn_DEF_ChatRequestTypePrivate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatRequestTypePrivate_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* targetPlayerId at 707 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* targetPlayerId at 708 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatRequestTypePrivate_specs_1 = { sizeof(struct ChatRequestTypePrivate), diff --git a/src/third_party/asn1/ChatTypeGame.c b/src/third_party/asn1/ChatTypeGame.c index aa2c3adc..490bc019 100644 --- a/src/third_party/asn1/ChatTypeGame.c +++ b/src/third_party/asn1/ChatTypeGame.c @@ -31,8 +31,8 @@ static ber_tlv_tag_t asn_DEF_ChatTypeGame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatTypeGame_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 725 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 727 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 726 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 728 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeGame_specs_1 = { sizeof(struct ChatTypeGame), diff --git a/src/third_party/asn1/ChatTypeLobby.c b/src/third_party/asn1/ChatTypeLobby.c index 143504cf..9e517da9 100644 --- a/src/third_party/asn1/ChatTypeLobby.c +++ b/src/third_party/asn1/ChatTypeLobby.c @@ -22,7 +22,7 @@ static ber_tlv_tag_t asn_DEF_ChatTypeLobby_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatTypeLobby_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 722 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 723 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeLobby_specs_1 = { sizeof(struct ChatTypeLobby), diff --git a/src/third_party/asn1/ChatTypePrivate.c b/src/third_party/asn1/ChatTypePrivate.c index e4d286b1..9f6185a6 100644 --- a/src/third_party/asn1/ChatTypePrivate.c +++ b/src/third_party/asn1/ChatTypePrivate.c @@ -22,7 +22,7 @@ static ber_tlv_tag_t asn_DEF_ChatTypePrivate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatTypePrivate_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 737 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 738 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatTypePrivate_specs_1 = { sizeof(struct ChatTypePrivate), diff --git a/src/third_party/asn1/DealFlopCardsMessage.c b/src/third_party/asn1/DealFlopCardsMessage.c index c2758fc4..9624d76e 100644 --- a/src/third_party/asn1/DealFlopCardsMessage.c +++ b/src/third_party/asn1/DealFlopCardsMessage.c @@ -50,10 +50,10 @@ static ber_tlv_tag_t asn_DEF_DealFlopCardsMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_DealFlopCardsMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 3 }, /* gameId at 533 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 2 }, /* flopCard1 at 534 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 1 }, /* flopCard2 at 535 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 0 } /* flopCard3 at 537 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 3 }, /* gameId at 534 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 2 }, /* flopCard1 at 535 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 1 }, /* flopCard2 at 536 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 0 } /* flopCard3 at 538 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DealFlopCardsMessage_specs_1 = { sizeof(struct DealFlopCardsMessage), diff --git a/src/third_party/asn1/DealRiverCardMessage.c b/src/third_party/asn1/DealRiverCardMessage.c index 0aae4952..7407dcd6 100644 --- a/src/third_party/asn1/DealRiverCardMessage.c +++ b/src/third_party/asn1/DealRiverCardMessage.c @@ -32,8 +32,8 @@ static ber_tlv_tag_t asn_DEF_DealRiverCardMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_DealRiverCardMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 545 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* riverCard at 547 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 546 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* riverCard at 548 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DealRiverCardMessage_specs_1 = { sizeof(struct DealRiverCardMessage), diff --git a/src/third_party/asn1/DealTurnCardMessage.c b/src/third_party/asn1/DealTurnCardMessage.c index 7db01f83..d148abbb 100644 --- a/src/third_party/asn1/DealTurnCardMessage.c +++ b/src/third_party/asn1/DealTurnCardMessage.c @@ -32,8 +32,8 @@ static ber_tlv_tag_t asn_DEF_DealTurnCardMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_DealTurnCardMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 540 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* turnCard at 542 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 541 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* turnCard at 543 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DealTurnCardMessage_specs_1 = { sizeof(struct DealTurnCardMessage), diff --git a/src/third_party/asn1/DialogMessage.c b/src/third_party/asn1/DialogMessage.c index d6d3439d..ae657f5e 100644 --- a/src/third_party/asn1/DialogMessage.c +++ b/src/third_party/asn1/DialogMessage.c @@ -55,7 +55,7 @@ static ber_tlv_tag_t asn_DEF_DialogMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_DialogMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* notificationText at 744 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* notificationText at 745 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DialogMessage_specs_1 = { sizeof(struct DialogMessage), diff --git a/src/third_party/asn1/EndKickPetitionMessage.c b/src/third_party/asn1/EndKickPetitionMessage.c index 72171dd9..dc5fda44 100644 --- a/src/third_party/asn1/EndKickPetitionMessage.c +++ b/src/third_party/asn1/EndKickPetitionMessage.c @@ -239,12 +239,12 @@ static ber_tlv_tag_t asn_DEF_EndKickPetitionMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndKickPetitionMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 4, 0, 0 }, /* resultPlayerKicked at 669 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 3 }, /* gameId at 665 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 2 }, /* petitionId at 666 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 1 }, /* numVotesAgainstKicking at 667 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 0 }, /* numVotesInFavourOfKicking at 668 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 5, 0, 0 } /* petitionEndReason at 671 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 4, 0, 0 }, /* resultPlayerKicked at 670 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 3 }, /* gameId at 666 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 2 }, /* petitionId at 667 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 1 }, /* numVotesAgainstKicking at 668 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 0 }, /* numVotesInFavourOfKicking at 669 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 5, 0, 0 } /* petitionEndReason at 672 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndKickPetitionMessage_specs_1 = { sizeof(struct EndKickPetitionMessage), diff --git a/src/third_party/asn1/EndOfGameMessage.c b/src/third_party/asn1/EndOfGameMessage.c index acea4146..e475c106 100644 --- a/src/third_party/asn1/EndOfGameMessage.c +++ b/src/third_party/asn1/EndOfGameMessage.c @@ -32,8 +32,8 @@ static ber_tlv_tag_t asn_DEF_EndOfGameMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndOfGameMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 596 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* winnerPlayerId at 598 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 597 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* winnerPlayerId at 599 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndOfGameMessage_specs_1 = { sizeof(struct EndOfGameMessage), diff --git a/src/third_party/asn1/EndOfHandHideCards.c b/src/third_party/asn1/EndOfHandHideCards.c index da976147..4c309b00 100644 --- a/src/third_party/asn1/EndOfHandHideCards.c +++ b/src/third_party/asn1/EndOfHandHideCards.c @@ -40,9 +40,9 @@ static ber_tlv_tag_t asn_DEF_EndOfHandHideCards_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndOfHandHideCards_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 583 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* moneyWon at 584 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* playerMoney at 586 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 584 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* moneyWon at 585 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* playerMoney at 587 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndOfHandHideCards_specs_1 = { sizeof(struct EndOfHandHideCards), diff --git a/src/third_party/asn1/EndOfHandMessage.c b/src/third_party/asn1/EndOfHandMessage.c index dac67e44..cab4c48d 100644 --- a/src/third_party/asn1/EndOfHandMessage.c +++ b/src/third_party/asn1/EndOfHandMessage.c @@ -28,8 +28,8 @@ static asn_TYPE_member_t asn_MBR_endOfHandType_3[] = { }, }; static asn_TYPE_tag2member_t asn_MAP_endOfHandType_tag2el_3[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* endOfHandShowCards at 563 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endOfHandHideCards at 565 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* endOfHandShowCards at 564 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endOfHandHideCards at 566 */ }; static asn_CHOICE_specifics_t asn_SPC_endOfHandType_specs_3 = { sizeof(struct endOfHandType), @@ -89,9 +89,9 @@ static ber_tlv_tag_t asn_DEF_EndOfHandMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndOfHandMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 561 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* endOfHandShowCards at 563 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endOfHandHideCards at 565 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 562 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* endOfHandShowCards at 564 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endOfHandHideCards at 566 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndOfHandMessage_specs_1 = { sizeof(struct EndOfHandMessage), diff --git a/src/third_party/asn1/EndOfHandShowCards.c b/src/third_party/asn1/EndOfHandShowCards.c index d82318d3..969c2832 100644 --- a/src/third_party/asn1/EndOfHandShowCards.c +++ b/src/third_party/asn1/EndOfHandShowCards.c @@ -92,7 +92,7 @@ static ber_tlv_tag_t asn_DEF_EndOfHandShowCards_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndOfHandShowCards_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerResults at 570 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerResults at 571 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndOfHandShowCards_specs_1 = { sizeof(struct EndOfHandShowCards), diff --git a/src/third_party/asn1/ErrorMessage.c b/src/third_party/asn1/ErrorMessage.c index 07384135..b92f0fc2 100644 --- a/src/third_party/asn1/ErrorMessage.c +++ b/src/third_party/asn1/ErrorMessage.c @@ -166,7 +166,7 @@ static ber_tlv_tag_t asn_DEF_ErrorMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ErrorMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* errorReason at 774 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* errorReason at 775 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ErrorMessage_specs_1 = { sizeof(struct ErrorMessage), diff --git a/src/third_party/asn1/KickPetitionUpdateMessage.c b/src/third_party/asn1/KickPetitionUpdateMessage.c index bed0b657..cf7abdcb 100644 --- a/src/third_party/asn1/KickPetitionUpdateMessage.c +++ b/src/third_party/asn1/KickPetitionUpdateMessage.c @@ -134,11 +134,11 @@ static ber_tlv_tag_t asn_DEF_KickPetitionUpdateMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_KickPetitionUpdateMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 4 }, /* gameId at 657 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 3 }, /* petitionId at 658 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 2 }, /* numVotesAgainstKicking at 659 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 1 }, /* numVotesInFavourOfKicking at 660 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -4, 0 } /* numVotesNeededToKick at 661 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 4 }, /* gameId at 658 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 3 }, /* petitionId at 659 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 2 }, /* numVotesAgainstKicking at 660 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 1 }, /* numVotesInFavourOfKicking at 661 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -4, 0 } /* numVotesNeededToKick at 662 */ }; static asn_SEQUENCE_specifics_t asn_SPC_KickPetitionUpdateMessage_specs_1 = { sizeof(struct KickPetitionUpdateMessage), diff --git a/src/third_party/asn1/NetPlayerState.c b/src/third_party/asn1/NetPlayerState.c new file mode 100644 index 00000000..5d7a052f --- /dev/null +++ b/src/third_party/asn1/NetPlayerState.c @@ -0,0 +1,125 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#include "NetPlayerState.h" + +int +NetPlayerState_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + /* Replace with underlying type checker */ + td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; + return td->check_constraints(td, sptr, ctfailcb, app_key); +} + +/* + * This type is implemented using NativeEnumerated, + * so here we adjust the DEF accordingly. + */ +static void +NetPlayerState_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { + td->free_struct = asn_DEF_NativeEnumerated.free_struct; + td->print_struct = asn_DEF_NativeEnumerated.print_struct; + td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; + td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; + td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; + td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; + td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; + td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; + if(!td->per_constraints) + td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; + td->elements = asn_DEF_NativeEnumerated.elements; + td->elements_count = asn_DEF_NativeEnumerated.elements_count; + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ +} + +void +NetPlayerState_free(asn_TYPE_descriptor_t *td, + void *struct_ptr, int contents_only) { + NetPlayerState_1_inherit_TYPE_descriptor(td); + td->free_struct(td, struct_ptr, contents_only); +} + +int +NetPlayerState_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + NetPlayerState_1_inherit_TYPE_descriptor(td); + return td->print_struct(td, struct_ptr, ilevel, cb, app_key); +} + +asn_dec_rval_t +NetPlayerState_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const void *bufptr, size_t size, int tag_mode) { + NetPlayerState_1_inherit_TYPE_descriptor(td); + return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); +} + +asn_enc_rval_t +NetPlayerState_encode_der(asn_TYPE_descriptor_t *td, + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + NetPlayerState_1_inherit_TYPE_descriptor(td); + return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); +} + +asn_dec_rval_t +NetPlayerState_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const char *opt_mname, const void *bufptr, size_t size) { + NetPlayerState_1_inherit_TYPE_descriptor(td); + return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); +} + +asn_enc_rval_t +NetPlayerState_encode_xer(asn_TYPE_descriptor_t *td, void *structure, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + NetPlayerState_1_inherit_TYPE_descriptor(td); + return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); +} + +static asn_INTEGER_enum_map_t asn_MAP_NetPlayerState_value2enum_1[] = { + { 0, 17, "playerStateNormal" }, + { 1, 26, "playerStateSessionInactive" } +}; +static unsigned int asn_MAP_NetPlayerState_enum2value_1[] = { + 0, /* playerStateNormal(0) */ + 1 /* playerStateSessionInactive(1) */ +}; +static asn_INTEGER_specifics_t asn_SPC_NetPlayerState_specs_1 = { + asn_MAP_NetPlayerState_value2enum_1, /* "tag" => N; sorted by tag */ + asn_MAP_NetPlayerState_enum2value_1, /* N => "tag"; sorted by N */ + 2, /* Number of elements in the maps */ + 0, /* Enumeration is not extensible */ + 1, /* Strict enumeration */ + 0, /* Native long size */ + 0 +}; +static ber_tlv_tag_t asn_DEF_NetPlayerState_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_NetPlayerState = { + "NetPlayerState", + "NetPlayerState", + NetPlayerState_free, + NetPlayerState_print, + NetPlayerState_constraint, + NetPlayerState_decode_ber, + NetPlayerState_encode_der, + NetPlayerState_decode_xer, + NetPlayerState_encode_xer, + 0, 0, /* No PER support, use "-gen-PER" to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_NetPlayerState_tags_1, + sizeof(asn_DEF_NetPlayerState_tags_1) + /sizeof(asn_DEF_NetPlayerState_tags_1[0]), /* 1 */ + asn_DEF_NetPlayerState_tags_1, /* Same as above */ + sizeof(asn_DEF_NetPlayerState_tags_1) + /sizeof(asn_DEF_NetPlayerState_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + 0, 0, /* Defined elsewhere */ + &asn_SPC_NetPlayerState_specs_1 /* Additional specs */ +}; + diff --git a/src/third_party/asn1/NetPlayerState.h b/src/third_party/asn1/NetPlayerState.h new file mode 100644 index 00000000..1a8974fe --- /dev/null +++ b/src/third_party/asn1/NetPlayerState.h @@ -0,0 +1,46 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#ifndef _NetPlayerState_H_ +#define _NetPlayerState_H_ + + +#include + +/* Including external dependencies */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + + /* Dependencies */ + typedef enum NetPlayerState { + NetPlayerState_playerStateNormal = 0, + NetPlayerState_playerStateSessionInactive = 1 + } + e_NetPlayerState; + + /* NetPlayerState */ + typedef long NetPlayerState_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NetPlayerState; + asn_struct_free_f NetPlayerState_free; + asn_struct_print_f NetPlayerState_print; + asn_constr_check_f NetPlayerState_constraint; + ber_type_decoder_f NetPlayerState_decode_ber; + der_type_encoder_f NetPlayerState_encode_der; + xer_type_decoder_f NetPlayerState_decode_xer; + xer_type_encoder_f NetPlayerState_encode_xer; + +#ifdef __cplusplus +} +#endif + +#endif /* _NetPlayerState_H_ */ +#include diff --git a/src/third_party/asn1/PlayerAllIn.c b/src/third_party/asn1/PlayerAllIn.c index d8e51cbb..298cc6d1 100644 --- a/src/third_party/asn1/PlayerAllIn.c +++ b/src/third_party/asn1/PlayerAllIn.c @@ -40,9 +40,9 @@ static ber_tlv_tag_t asn_DEF_PlayerAllIn_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerAllIn_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 555 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* allInCard1 at 556 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* allInCard2 at 558 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 556 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* allInCard1 at 557 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* allInCard2 at 559 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerAllIn_specs_1 = { sizeof(struct PlayerAllIn), diff --git a/src/third_party/asn1/PlayerIdChangedMessage.c b/src/third_party/asn1/PlayerIdChangedMessage.c index 4cb28368..7fb9e52c 100644 --- a/src/third_party/asn1/PlayerIdChangedMessage.c +++ b/src/third_party/asn1/PlayerIdChangedMessage.c @@ -32,8 +32,8 @@ static ber_tlv_tag_t asn_DEF_PlayerIdChangedMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerIdChangedMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* oldPlayerId at 601 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* newPlayerId at 603 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* oldPlayerId at 602 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* newPlayerId at 604 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerIdChangedMessage_specs_1 = { sizeof(struct PlayerIdChangedMessage), diff --git a/src/third_party/asn1/PlayerResult.c b/src/third_party/asn1/PlayerResult.c index 39de1824..0ad2059c 100644 --- a/src/third_party/asn1/PlayerResult.c +++ b/src/third_party/asn1/PlayerResult.c @@ -146,13 +146,13 @@ static ber_tlv_tag_t asn_DEF_PlayerResult_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerResult_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* playerId at 573 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* resultCard1 at 574 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* resultCard2 at 575 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -3, 2 }, /* moneyWon at 577 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -4, 1 }, /* playerMoney at 578 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -5, 0 }, /* cardsValue at 579 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, 0, 0 } /* bestHandPosition at 576 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* playerId at 574 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* resultCard1 at 575 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* resultCard2 at 576 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -3, 2 }, /* moneyWon at 578 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -4, 1 }, /* playerMoney at 579 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -5, 0 }, /* cardsValue at 580 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, 0, 0 } /* bestHandPosition at 577 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerResult_specs_1 = { sizeof(struct PlayerResult), diff --git a/src/third_party/asn1/PlayersActionDoneMessage.c b/src/third_party/asn1/PlayersActionDoneMessage.c index 00aa7cf5..0f48e9d7 100644 --- a/src/third_party/asn1/PlayersActionDoneMessage.c +++ b/src/third_party/asn1/PlayersActionDoneMessage.c @@ -44,6 +44,15 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, "playerAction" }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerState), + (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), + 0, + &asn_DEF_NetPlayerState, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "playerState" + }, { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, totalPlayerBet), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, @@ -88,21 +97,22 @@ static ber_tlv_tag_t asn_DEF_PlayersActionDoneMessage_tags_1[] = { static asn_TYPE_tag2member_t asn_MAP_PlayersActionDoneMessage_tag2el_1[] = { { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* gameId at 522 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* playerId at 523 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 3 }, /* totalPlayerBet at 526 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -3, 2 }, /* playerMoney at 527 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -4, 1 }, /* highestSet at 528 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 7, -5, 0 }, /* minimumRaise at 530 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 524 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* playerAction at 525 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -2, 3 }, /* totalPlayerBet at 527 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -3, 2 }, /* playerMoney at 528 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 7, -4, 1 }, /* highestSet at 529 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 8, -5, 0 }, /* minimumRaise at 531 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 2 }, /* gameState at 524 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 1 }, /* playerAction at 525 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, -2, 0 } /* playerState at 526 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayersActionDoneMessage_specs_1 = { sizeof(struct PlayersActionDoneMessage), offsetof(struct PlayersActionDoneMessage, _asn_ctx), asn_MAP_PlayersActionDoneMessage_tag2el_1, - 8, /* Count of tags in the map */ + 9, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ - 7, /* Start extensions */ - 9 /* Stop extensions */ + 8, /* Start extensions */ + 10 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_PlayersActionDoneMessage = { "PlayersActionDoneMessage", @@ -124,7 +134,7 @@ asn_TYPE_descriptor_t asn_DEF_PlayersActionDoneMessage = { /sizeof(asn_DEF_PlayersActionDoneMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_PlayersActionDoneMessage_1, - 8, /* Elements count */ + 9, /* Elements count */ &asn_SPC_PlayersActionDoneMessage_specs_1 /* Additional specs */ }; diff --git a/src/third_party/asn1/PlayersActionDoneMessage.h b/src/third_party/asn1/PlayersActionDoneMessage.h index bf6f76f6..6984a149 100644 --- a/src/third_party/asn1/PlayersActionDoneMessage.h +++ b/src/third_party/asn1/PlayersActionDoneMessage.h @@ -15,6 +15,7 @@ #include "NonZeroId.h" #include "NetGameState.h" #include "NetPlayerAction.h" +#include "NetPlayerState.h" #include "AmountOfMoney.h" #include @@ -28,6 +29,7 @@ extern "C" { NonZeroId_t playerId; NetGameState_t gameState; NetPlayerAction_t playerAction; + NetPlayerState_t playerState; AmountOfMoney_t totalPlayerBet; AmountOfMoney_t playerMoney; AmountOfMoney_t highestSet; diff --git a/src/third_party/asn1/ReportAvatarAckMessage.c b/src/third_party/asn1/ReportAvatarAckMessage.c index 1ddee647..21a07d71 100644 --- a/src/third_party/asn1/ReportAvatarAckMessage.c +++ b/src/third_party/asn1/ReportAvatarAckMessage.c @@ -151,8 +151,8 @@ static ber_tlv_tag_t asn_DEF_ReportAvatarAckMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ReportAvatarAckMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 764 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 766 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 765 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 767 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarAckMessage_specs_1 = { sizeof(struct ReportAvatarAckMessage), diff --git a/src/third_party/asn1/ReportAvatarMessage.c b/src/third_party/asn1/ReportAvatarMessage.c index 5762b8ac..3e85ff3e 100644 --- a/src/third_party/asn1/ReportAvatarMessage.c +++ b/src/third_party/asn1/ReportAvatarMessage.c @@ -32,8 +32,8 @@ static ber_tlv_tag_t asn_DEF_ReportAvatarMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ReportAvatarMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 759 */ - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 761 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 760 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 762 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarMessage_specs_1 = { sizeof(struct ReportAvatarMessage), diff --git a/src/third_party/asn1/StartKickPetitionMessage.c b/src/third_party/asn1/StartKickPetitionMessage.c index 09d326c1..28278bcc 100644 --- a/src/third_party/asn1/StartKickPetitionMessage.c +++ b/src/third_party/asn1/StartKickPetitionMessage.c @@ -118,12 +118,12 @@ static ber_tlv_tag_t asn_DEF_StartKickPetitionMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_StartKickPetitionMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* gameId at 623 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* petitionId at 624 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* proposingPlayerId at 625 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 2 }, /* kickPlayerId at 626 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -4, 1 }, /* kickTimeoutSec at 627 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -5, 0 } /* numVotesNeededToKick at 628 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* gameId at 624 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* petitionId at 625 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* proposingPlayerId at 626 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 2 }, /* kickPlayerId at 627 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -4, 1 }, /* kickTimeoutSec at 628 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -5, 0 } /* numVotesNeededToKick at 629 */ }; static asn_SEQUENCE_specifics_t asn_SPC_StartKickPetitionMessage_specs_1 = { sizeof(struct StartKickPetitionMessage), diff --git a/src/third_party/asn1/StatisticsData.c b/src/third_party/asn1/StatisticsData.c index 57167e8d..10d78602 100644 --- a/src/third_party/asn1/StatisticsData.c +++ b/src/third_party/asn1/StatisticsData.c @@ -146,8 +146,8 @@ static ber_tlv_tag_t asn_DEF_StatisticsData_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_StatisticsData_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* statisticsValue at 687 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* statisticsType at 684 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* statisticsValue at 688 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* statisticsType at 685 */ }; static asn_SEQUENCE_specifics_t asn_SPC_StatisticsData_specs_1 = { sizeof(struct StatisticsData), diff --git a/src/third_party/asn1/StatisticsMessage.c b/src/third_party/asn1/StatisticsMessage.c index 71b409a0..9cc57189 100644 --- a/src/third_party/asn1/StatisticsMessage.c +++ b/src/third_party/asn1/StatisticsMessage.c @@ -93,7 +93,7 @@ static ber_tlv_tag_t asn_DEF_StatisticsMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_StatisticsMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* statisticsData at 680 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* statisticsData at 681 */ }; static asn_SEQUENCE_specifics_t asn_SPC_StatisticsMessage_specs_1 = { sizeof(struct StatisticsMessage), diff --git a/src/third_party/asn1/TimeoutWarningMessage.c b/src/third_party/asn1/TimeoutWarningMessage.c index e4b35621..69111850 100644 --- a/src/third_party/asn1/TimeoutWarningMessage.c +++ b/src/third_party/asn1/TimeoutWarningMessage.c @@ -149,8 +149,8 @@ static ber_tlv_tag_t asn_DEF_TimeoutWarningMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_TimeoutWarningMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 753 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 749 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 754 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 750 */ }; static asn_SEQUENCE_specifics_t asn_SPC_TimeoutWarningMessage_specs_1 = { sizeof(struct TimeoutWarningMessage), diff --git a/src/third_party/asn1/VoteKickDenied.c b/src/third_party/asn1/VoteKickDenied.c index 6344a540..8b0a2c9c 100644 --- a/src/third_party/asn1/VoteKickDenied.c +++ b/src/third_party/asn1/VoteKickDenied.c @@ -139,7 +139,7 @@ static ber_tlv_tag_t asn_DEF_VoteKickDenied_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VoteKickDenied_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* voteKickDeniedReason at 651 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* voteKickDeniedReason at 652 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VoteKickDenied_specs_1 = { sizeof(struct VoteKickDenied), diff --git a/src/third_party/asn1/VoteKickReplyMessage.c b/src/third_party/asn1/VoteKickReplyMessage.c index c4c236eb..efff4390 100644 --- a/src/third_party/asn1/VoteKickReplyMessage.c +++ b/src/third_party/asn1/VoteKickReplyMessage.c @@ -28,8 +28,8 @@ static asn_TYPE_member_t asn_MBR_voteKickReplyType_4[] = { }, }; static asn_TYPE_tag2member_t asn_MAP_voteKickReplyType_tag2el_4[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* voteKickAck at 641 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* voteKickDenied at 643 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* voteKickAck at 642 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* voteKickDenied at 644 */ }; static asn_CHOICE_specifics_t asn_SPC_voteKickReplyType_specs_4 = { sizeof(struct voteKickReplyType), @@ -98,10 +98,10 @@ static ber_tlv_tag_t asn_DEF_VoteKickReplyMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VoteKickReplyMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 638 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* petitionId at 639 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* voteKickAck at 641 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* voteKickDenied at 643 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 639 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* petitionId at 640 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* voteKickAck at 642 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* voteKickDenied at 644 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VoteKickReplyMessage_specs_1 = { sizeof(struct VoteKickReplyMessage), diff --git a/src/third_party/asn1/VoteKickRequestMessage.c b/src/third_party/asn1/VoteKickRequestMessage.c index f272d673..3c27141f 100644 --- a/src/third_party/asn1/VoteKickRequestMessage.c +++ b/src/third_party/asn1/VoteKickRequestMessage.c @@ -41,9 +41,9 @@ static ber_tlv_tag_t asn_DEF_VoteKickRequestMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VoteKickRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 2, 0, 0 }, /* voteKick at 634 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 632 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* petitionId at 633 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 2, 0, 0 }, /* voteKick at 635 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 633 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* petitionId at 634 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VoteKickRequestMessage_specs_1 = { sizeof(struct VoteKickRequestMessage), diff --git a/tests/src/pokerth_protocol/NetPlayerState.java b/tests/src/pokerth_protocol/NetPlayerState.java new file mode 100644 index 00000000..bd318533 --- /dev/null +++ b/tests/src/pokerth_protocol/NetPlayerState.java @@ -0,0 +1,60 @@ + +package pokerth_protocol; +// +// This file was generated by the BinaryNotes compiler. +// See http://bnotes.sourceforge.net +// Any modifications to this file will be lost upon recompilation of the source ASN.1. +// + +import org.bn.*; +import org.bn.annotations.*; +import org.bn.annotations.constraints.*; +import org.bn.coders.*; +import org.bn.types.*; + + + + + @ASN1PreparedElement + @ASN1Enum ( + name = "NetPlayerState" + ) + public class NetPlayerState implements IASN1PreparedElement { + public enum EnumType { + + @ASN1EnumItem ( name = "playerStateNormal", hasTag = true , tag = 0 ) + playerStateNormal , + @ASN1EnumItem ( name = "playerStateSessionInactive", hasTag = true , tag = 1 ) + playerStateSessionInactive , + } + + private EnumType value; + private Integer integerForm; + + public EnumType getValue() { + return this.value; + } + + public void setValue(EnumType value) { + this.value = value; + } + + public Integer getIntegerForm() { + return integerForm; + } + + public void setIntegerForm(Integer value) { + integerForm = value; + } + + public void initWithDefaults() { + } + + private static IASN1PreparedElementData preparedData = CoderFactory.getInstance().newPreparedElementData(NetPlayerState.class); + public IASN1PreparedElementData getPreparedData() { + return preparedData; + } + + + } + \ No newline at end of file diff --git a/tests/src/pokerth_protocol/PlayersActionDoneMessage.java b/tests/src/pokerth_protocol/PlayersActionDoneMessage.java index 021ae642..de9c9a88 100644 --- a/tests/src/pokerth_protocol/PlayersActionDoneMessage.java +++ b/tests/src/pokerth_protocol/PlayersActionDoneMessage.java @@ -45,6 +45,11 @@ import org.bn.types.*; private NetPlayerAction playerAction = null; + @ASN1Element ( name = "playerState", isOptional = false , hasTag = false , hasDefaultValue = false ) + + private NetPlayerState playerState = null; + + @ASN1Element ( name = "totalPlayerBet", isOptional = false , hasTag = false , hasDefaultValue = false ) private AmountOfMoney totalPlayerBet = null; @@ -114,6 +119,18 @@ import org.bn.types.*; + public NetPlayerState getPlayerState () { + return this.playerState; + } + + + + public void setPlayerState (NetPlayerState value) { + this.playerState = value; + } + + + public AmountOfMoney getTotalPlayerBet () { return this.totalPlayerBet; }