From c4b8e567ed0a26a0cd75cf3e5fba2f870714f150 Mon Sep 17 00:00:00 2001 From: lotodore Date: Fri, 11 Feb 2011 23:02:29 +0000 Subject: [PATCH] Implementing private messages in lobby chat, ticket #12. Some cosmetic improvements are still missing. --- docs/pokerth.asn1 | 7 ++- pokerth_protocol.pro | 6 +- src/gui/generic/serverguiwrapper.cpp | 4 ++ src/gui/generic/serverguiwrapper.h | 1 + src/gui/qt/chattools/chattools.cpp | 52 +++++++++++++++- src/gui/qt/chattools/chattools.h | 4 ++ src/gui/qt/guiwrapper.cpp | 4 ++ src/gui/qt/guiwrapper.h | 1 + src/gui/qt/startwindow/startwindowimpl.cpp | 2 + src/gui/qt/startwindow/startwindowimpl.h | 1 + src/net/clientcallback.h | 1 + src/net/common/clientstate.cpp | 5 ++ src/net/common/serverlobbythread.cpp | 6 +- src/third_party/asn1/AfkWarningMessage.c | 2 +- src/third_party/asn1/ChatMessage.c | 25 +++++--- src/third_party/asn1/ChatMessage.h | 3 + src/third_party/asn1/ChatTypeGame.c | 4 +- src/third_party/asn1/ChatTypeLobby.c | 2 +- src/third_party/asn1/ChatTypePrivate.c | 59 +++++++++++++++++++ src/third_party/asn1/ChatTypePrivate.h | 42 +++++++++++++ src/third_party/asn1/DialogMessage.c | 2 +- src/third_party/asn1/ErrorMessage.c | 2 +- src/third_party/asn1/ReportAvatarAckMessage.c | 4 +- src/third_party/asn1/ReportAvatarMessage.c | 4 +- src/third_party/asn1/TimeoutWarningMessage.c | 4 +- 25 files changed, 220 insertions(+), 27 deletions(-) create mode 100644 src/third_party/asn1/ChatTypePrivate.c create mode 100644 src/third_party/asn1/ChatTypePrivate.h diff --git a/docs/pokerth.asn1 b/docs/pokerth.asn1 index 2d52fbc1..5395bbd9 100644 --- a/docs/pokerth.asn1 +++ b/docs/pokerth.asn1 @@ -669,7 +669,8 @@ ChatMessage ::= [APPLICATION 130] SEQUENCE { chatTypeLobby [0] ChatTypeLobby, chatTypeGame [1] ChatTypeGame, chatTypeBot [2] ChatTypeBot, - chatTypeBroadcast [3] ChatTypeBroadcast + chatTypeBroadcast [3] ChatTypeBroadcast, + chatTypePrivate [4] ChatTypePrivate }, chatText UTF8String (SIZE(1..128)) } @@ -689,6 +690,10 @@ ChatTypeBroadcast ::= SEQUENCE { ChatTypeBot ::= SEQUENCE { } +ChatTypePrivate ::= SEQUENCE { + playerId NonZeroId +} + DialogMessage ::= [APPLICATION 131] SEQUENCE { notificationText UTF8String (SIZE(1..128)) } diff --git a/pokerth_protocol.pro b/pokerth_protocol.pro index b96674e3..ffdc35f3 100644 --- a/pokerth_protocol.pro +++ b/pokerth_protocol.pro @@ -170,7 +170,8 @@ HEADERS += src/third_party/asn1/AllInShowCardsMessage.h \ src/third_party/asn1/ReportAvatarAckMessage.h \ src/third_party/asn1/CleanerChatTypeLobby.h \ src/third_party/asn1/CleanerChatTypeGame.h \ - src/third_party/asn1/CleanerChatType.h + src/third_party/asn1/CleanerChatType.h \ + src/third_party/asn1/ChatTypePrivate.h SOURCES += src/third_party/asn1/ChatCleanerMessage.c \ src/third_party/asn1/CleanerInitMessage.c \ src/third_party/asn1/CleanerInitAckMessage.c \ @@ -313,7 +314,8 @@ SOURCES += src/third_party/asn1/ChatCleanerMessage.c \ src/third_party/asn1/ReportAvatarAckMessage.c \ src/third_party/asn1/CleanerChatTypeLobby.c \ src/third_party/asn1/CleanerChatTypeGame.c \ - src/third_party/asn1/CleanerChatType.c + src/third_party/asn1/CleanerChatType.c \ + src/third_party/asn1/ChatTypePrivate.c win32 { DEFINES += CURL_STATICLIB DEFINES += _WIN32_WINNT=0x0501 diff --git a/src/gui/generic/serverguiwrapper.cpp b/src/gui/generic/serverguiwrapper.cpp index 4d9ec777..96b91301 100644 --- a/src/gui/generic/serverguiwrapper.cpp +++ b/src/gui/generic/serverguiwrapper.cpp @@ -223,6 +223,10 @@ void ServerGuiWrapper::SignalNetClientLobbyChatMsg(const string &playerName, con { if (myClientcb) myClientcb->SignalNetClientLobbyChatMsg(playerName, msg); } +void ServerGuiWrapper::SignalNetClientPrivateChatMsg(const string &playerName, const string &msg) +{ + if (myClientcb) myClientcb->SignalNetClientPrivateChatMsg(playerName, msg); +} void ServerGuiWrapper::SignalNetClientMsgBox(const string &msg) { if (myClientcb) myClientcb->SignalNetClientMsgBox(msg); diff --git a/src/gui/generic/serverguiwrapper.h b/src/gui/generic/serverguiwrapper.h index 81860276..23adf712 100644 --- a/src/gui/generic/serverguiwrapper.h +++ b/src/gui/generic/serverguiwrapper.h @@ -123,6 +123,7 @@ public: void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName); void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg); void SignalNetClientLobbyChatMsg(const std::string &playerName, const std::string &msg); + void SignalNetClientPrivateChatMsg(const std::string &playerName, const std::string &msg); void SignalNetClientWaitDialog(); void SignalNetClientWarningAutoFoldInRankingGame(unsigned remainingAutoFolds); diff --git a/src/gui/qt/chattools/chattools.cpp b/src/gui/qt/chattools/chattools.cpp index 1d591116..03ef45e4 100644 --- a/src/gui/qt/chattools/chattools.cpp +++ b/src/gui/qt/chattools/chattools.cpp @@ -44,10 +44,19 @@ void ChatTools::sendMessage() if(myLineEdit->text().size() && mySession) { fillChatLinesHistory(myLineEdit->text()); + QString chatText(myLineEdit->text()); if(myChatType == INGAME_CHAT) { - mySession->sendGameChatMessage(myLineEdit->text().toUtf8().constData()); + mySession->sendGameChatMessage(chatText.toUtf8().constData()); } else { - mySession->sendLobbyChatMessage(myLineEdit->text().toUtf8().constData()); + // Parse user name for private messages. + if(chatText.indexOf(QString("/msg ")) == 0) { + chatText.remove(0, 5); + unsigned playerId = parsePrivateMessageTarget(chatText); + if (playerId) + mySession->sendPrivateChatMessage(playerId, chatText.toUtf8().constData()); + } else { + mySession->sendLobbyChatMessage(chatText.toUtf8().constData()); + } } myLineEdit->setText(""); } @@ -145,6 +154,11 @@ void ChatTools::receiveMessage(QString playerName, QString message) } } +void ChatTools::privateMessage(QString playerName, QString message) +{ + receiveMessage(playerName, "->" + message); +} + void ChatTools::clearChat() { @@ -247,3 +261,37 @@ void ChatTools::refreshIgnoreList() { ignoreList = myConfig->readConfigStringList("PlayerIgnoreList"); } + +unsigned ChatTools::parsePrivateMessageTarget(QString &chatText) +{ + QString playerName; + int endPosName = -1; + // Target player is either in the format "this is a user" or singlename. + if (chatText.startsWith('"')) { + chatText.remove(0, 1); + endPosName = chatText.indexOf('"'); + } else { + endPosName = chatText.indexOf(' '); + } + if (endPosName > 0) { + playerName = chatText.left(endPosName); + chatText.remove(0, endPosName + 1); + } + chatText = chatText.trimmed(); + unsigned playerId = 0; + if (!playerName.isEmpty() && !chatText.isEmpty()) { + if(myNickListModel) { + int it = 0; + while (myNickListModel->item(it)) { + QString text = myNickListModel->item(it, 0)->data(Qt::DisplayRole).toString(); + if(text == playerName) { + playerId = myNickListModel->item(it, 0)->data(Qt::UserRole).toUInt(); + break; + } + ++it; + } + } + } + return playerId; +} + diff --git a/src/gui/qt/chattools/chattools.h b/src/gui/qt/chattools/chattools.h index 187d44ed..ce32842d 100644 --- a/src/gui/qt/chattools/chattools.h +++ b/src/gui/qt/chattools/chattools.h @@ -49,6 +49,7 @@ public slots: void sendMessage(); void receiveMessage(QString playerName, QString message); + void privateMessage(QString playerName, QString message); void clearChat(); void checkInputLength(QString string); @@ -76,6 +77,9 @@ public slots: } void refreshIgnoreList(); +protected: + + unsigned parsePrivateMessageTarget(QString &chatText); private: diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index 0fcdc8fe..52dfb212 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -404,6 +404,10 @@ void GuiWrapper::SignalNetClientLobbyChatMsg(const string &playerName, const str { myStartWindow->signalNetClientLobbyChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); } +void GuiWrapper::SignalNetClientPrivateChatMsg(const std::string &playerName, const std::string &msg) +{ + myStartWindow->signalNetClientPrivateChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); +} void GuiWrapper::SignalNetClientMsgBox(const string &msg) { myStartWindow->signalNetClientMsgBox(QString::fromUtf8(msg.c_str())); diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index 2f37e0f5..f4c1e522 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -135,6 +135,7 @@ public: void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName); void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg); void SignalNetClientLobbyChatMsg(const std::string &playerName, const std::string &msg); + void SignalNetClientPrivateChatMsg(const std::string &playerName, const std::string &msg); void SignalNetClientMsgBox(const std::string &msg); void SignalNetClientMsgBox(unsigned msgId); diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 67e5a1ae..57f55a64 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -146,6 +146,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c) connect(this, SIGNAL(signalNetClientGameChatMsg(QString, QString)), myGuiInterface->getMyW()->getMyChat(), SLOT(receiveMessage(QString, QString))); connect(this, SIGNAL(signalNetClientLobbyChatMsg(QString, QString)), myStartNetworkGameDialog->getMyChat(), SLOT(receiveMessage(QString, QString))); connect(this, SIGNAL(signalNetClientLobbyChatMsg(QString, QString)), myGameLobbyDialog->getMyChat(), SLOT(receiveMessage(QString, QString))); + connect(this, SIGNAL(signalNetClientPrivateChatMsg(QString, QString)), myStartNetworkGameDialog->getMyChat(), SLOT(privateMessage(QString, QString))); + connect(this, SIGNAL(signalNetClientPrivateChatMsg(QString, QString)), myGameLobbyDialog->getMyChat(), SLOT(privateMessage(QString, QString))); connect(this, SIGNAL(signalNetClientMsgBox(QString)), this, SLOT(networkMessage(QString))); connect(this, SIGNAL(signalNetClientMsgBox(unsigned)), this, SLOT(networkMessage(unsigned))); connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, unsigned)), this, SLOT(showTimeoutDialog(int, unsigned))); diff --git a/src/gui/qt/startwindow/startwindowimpl.h b/src/gui/qt/startwindow/startwindowimpl.h index ed4a54b8..e58bfc98 100644 --- a/src/gui/qt/startwindow/startwindowimpl.h +++ b/src/gui/qt/startwindow/startwindowimpl.h @@ -100,6 +100,7 @@ signals: void signalNetClientGameStart(boost::shared_ptr game); void signalNetClientGameChatMsg(QString nickName, QString msg); void signalNetClientLobbyChatMsg(QString nickName, QString msg); + void signalNetClientPrivateChatMsg(QString nickName, QString msg); void signalNetClientMsgBox(QString msg); void signalNetClientMsgBox(unsigned msgId); diff --git a/src/net/clientcallback.h b/src/net/clientcallback.h index abfc6bbd..44149797 100644 --- a/src/net/clientcallback.h +++ b/src/net/clientcallback.h @@ -58,6 +58,7 @@ public: virtual void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg) = 0; virtual void SignalNetClientLobbyChatMsg(const std::string &playerName, const std::string &msg) = 0; + virtual void SignalNetClientPrivateChatMsg(const std::string &playerName, const std::string &msg) = 0; virtual void SignalNetClientMsgBox(const std::string &msg) = 0; virtual void SignalNetClientMsgBox(unsigned msgId) = 0; virtual void SignalNetClientWaitDialog() = 0; diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 09a478c4..71d1c2bc 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -715,6 +715,11 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr clien PlayerInfo info; if (client->GetCachedPlayerInfo(playerId, info)) client->GetCallback().SignalNetClientLobbyChatMsg(info.playerName, STL_STRING_FROM_OCTET_STRING(netMessage->chatText)); + } else if (netMessage->chatType.present == chatType_PR_chatTypePrivate) { + unsigned playerId = netMessage->chatType.choice.chatTypeLobby.playerId; + PlayerInfo info; + if (client->GetCachedPlayerInfo(playerId, info)) + client->GetCallback().SignalNetClientPrivateChatMsg(info.playerName, STL_STRING_FROM_OCTET_STRING(netMessage->chatText)); } } else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_dialogMessage) { // Message box - display it in the GUI. diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 19c85f3e..22cb2656 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -1396,9 +1396,9 @@ ServerLobbyThread::HandleNetPacketChatRequest(SessionWrapper session, const Chat boost::shared_ptr packet(new NetPacket(NetPacket::Alloc)); packet->GetMsg()->present = PokerTHMessage_PR_chatMessage; ChatMessage_t *netChat = &packet->GetMsg()->choice.chatMessage; - netChat->chatType.present = chatType_PR_chatTypeLobby; - ChatTypeLobby_t *netLobbyChat = &netChat->chatType.choice.chatTypeLobby; - netLobbyChat->playerId = session.playerData->GetUniqueId(); + netChat->chatType.present = chatType_PR_chatTypePrivate; + ChatTypePrivate_t *netPrivateChat = &netChat->chatType.choice.chatTypePrivate; + netPrivateChat->playerId = session.playerData->GetUniqueId(); OCTET_STRING_fromBuf( &netChat->chatText, (char *)chatRequest.chatText.buf, diff --git a/src/third_party/asn1/AfkWarningMessage.c b/src/third_party/asn1/AfkWarningMessage.c index 14fe14af..a39e465e 100644 --- a/src/third_party/asn1/AfkWarningMessage.c +++ b/src/third_party/asn1/AfkWarningMessage.c @@ -23,7 +23,7 @@ static ber_tlv_tag_t asn_DEF_AfkWarningMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AfkWarningMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* remainingTimeouts at 709 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* remainingTimeouts at 714 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AfkWarningMessage_specs_1 = { sizeof(struct AfkWarningMessage), diff --git a/src/third_party/asn1/ChatMessage.c b/src/third_party/asn1/ChatMessage.c index 5e79ba1a..40d204e0 100644 --- a/src/third_party/asn1/ChatMessage.c +++ b/src/third_party/asn1/ChatMessage.c @@ -76,12 +76,22 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = { 0, "chatTypeBroadcast" }, + { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypePrivate), + (ASN_TAG_CLASS_CONTEXT | (4 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_ChatTypePrivate, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "chatTypePrivate" + }, }; static asn_TYPE_tag2member_t asn_MAP_chatType_tag2el_2[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 669 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 670 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* chatTypeBot at 671 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* chatTypeBroadcast at 673 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* chatTypeBroadcast at 672 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* chatTypePrivate at 674 */ }; static asn_CHOICE_specifics_t asn_SPC_chatType_specs_2 = { sizeof(struct chatType), @@ -89,9 +99,9 @@ static asn_CHOICE_specifics_t asn_SPC_chatType_specs_2 = { offsetof(struct chatType, present), sizeof(((struct chatType *)0)->present), asn_MAP_chatType_tag2el_2, - 4, /* Count of tags in the map */ + 5, /* Count of tags in the map */ 0, - 4 /* Extensions start */ + 5 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_chatType_2 = { @@ -112,7 +122,7 @@ asn_TYPE_descriptor_t asn_DEF_chatType_2 = { 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_chatType_2, - 4, /* Elements count */ + 5, /* Elements count */ &asn_SPC_chatType_specs_2 /* Additional specs */ }; @@ -141,17 +151,18 @@ 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 674 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 675 */ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 669 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 670 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* chatTypeBot at 671 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* chatTypeBroadcast at 673 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* chatTypeBroadcast at 672 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* chatTypePrivate at 674 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatMessage_specs_1 = { sizeof(struct ChatMessage), offsetof(struct ChatMessage, _asn_ctx), asn_MAP_ChatMessage_tag2el_1, - 5, /* Count of tags in the map */ + 6, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 1, /* Start extensions */ 3 /* Stop extensions */ diff --git a/src/third_party/asn1/ChatMessage.h b/src/third_party/asn1/ChatMessage.h index 65060efd..39d16155 100644 --- a/src/third_party/asn1/ChatMessage.h +++ b/src/third_party/asn1/ChatMessage.h @@ -17,6 +17,7 @@ #include "ChatTypeGame.h" #include "ChatTypeBot.h" #include "ChatTypeBroadcast.h" +#include "ChatTypePrivate.h" #include #include @@ -31,6 +32,7 @@ typedef enum chatType_PR { chatType_PR_chatTypeGame, chatType_PR_chatTypeBot, chatType_PR_chatTypeBroadcast, + chatType_PR_chatTypePrivate, /* Extensions may appear below */ } chatType_PR; @@ -44,6 +46,7 @@ typedef struct ChatMessage { ChatTypeGame_t chatTypeGame; ChatTypeBot_t chatTypeBot; ChatTypeBroadcast_t chatTypeBroadcast; + ChatTypePrivate_t chatTypePrivate; /* * This type is extensible, * possible extensions are below. diff --git a/src/third_party/asn1/ChatTypeGame.c b/src/third_party/asn1/ChatTypeGame.c index 68198d25..ba06cfa1 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 682 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 684 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 683 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 685 */ }; 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 cd6ea5a7..fd207660 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 679 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 680 */ }; 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 new file mode 100644 index 00000000..648ddd26 --- /dev/null +++ b/src/third_party/asn1/ChatTypePrivate.c @@ -0,0 +1,59 @@ +/* + * 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 "ChatTypePrivate.h" + +static asn_TYPE_member_t asn_MBR_ChatTypePrivate_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct ChatTypePrivate, playerId), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NonZeroId, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "playerId" + }, +}; +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 695 */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_ChatTypePrivate_specs_1 = { + sizeof(struct ChatTypePrivate), + offsetof(struct ChatTypePrivate, _asn_ctx), + asn_MAP_ChatTypePrivate_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 0, /* Start extensions */ + 2 /* Stop extensions */ +}; +asn_TYPE_descriptor_t asn_DEF_ChatTypePrivate = { + "ChatTypePrivate", + "ChatTypePrivate", + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_constraint, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, + 0, 0, /* No PER support, use "-gen-PER" to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_ChatTypePrivate_tags_1, + sizeof(asn_DEF_ChatTypePrivate_tags_1) + /sizeof(asn_DEF_ChatTypePrivate_tags_1[0]), /* 1 */ + asn_DEF_ChatTypePrivate_tags_1, /* Same as above */ + sizeof(asn_DEF_ChatTypePrivate_tags_1) + /sizeof(asn_DEF_ChatTypePrivate_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_ChatTypePrivate_1, + 1, /* Elements count */ + &asn_SPC_ChatTypePrivate_specs_1 /* Additional specs */ +}; + diff --git a/src/third_party/asn1/ChatTypePrivate.h b/src/third_party/asn1/ChatTypePrivate.h new file mode 100644 index 00000000..29692dae --- /dev/null +++ b/src/third_party/asn1/ChatTypePrivate.h @@ -0,0 +1,42 @@ +/* + * 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 _ChatTypePrivate_H_ +#define _ChatTypePrivate_H_ + + +#include + +/* Including external dependencies */ +#include "NonZeroId.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ChatTypePrivate */ +typedef struct ChatTypePrivate { + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} ChatTypePrivate_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_ChatTypePrivate; + +#ifdef __cplusplus +} +#endif + +#endif /* _ChatTypePrivate_H_ */ +#include diff --git a/src/third_party/asn1/DialogMessage.c b/src/third_party/asn1/DialogMessage.c index 4062ec27..84bfc77b 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 693 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* notificationText at 698 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DialogMessage_specs_1 = { sizeof(struct DialogMessage), diff --git a/src/third_party/asn1/ErrorMessage.c b/src/third_party/asn1/ErrorMessage.c index 8db9b9fc..8590aefb 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 727 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* errorReason at 732 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ErrorMessage_specs_1 = { sizeof(struct ErrorMessage), diff --git a/src/third_party/asn1/ReportAvatarAckMessage.c b/src/third_party/asn1/ReportAvatarAckMessage.c index c9933561..caf45c0f 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 717 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 719 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 722 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 724 */ }; 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 b3b8b52c..40367250 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 712 */ - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 714 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 717 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 719 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarMessage_specs_1 = { sizeof(struct ReportAvatarMessage), diff --git a/src/third_party/asn1/TimeoutWarningMessage.c b/src/third_party/asn1/TimeoutWarningMessage.c index be0268ed..1209d68b 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 702 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 698 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 707 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 703 */ }; static asn_SEQUENCE_specifics_t asn_SPC_TimeoutWarningMessage_specs_1 = { sizeof(struct TimeoutWarningMessage),