Implementing private messages in lobby chat, ticket #12. Some cosmetic improvements are still missing.

This commit is contained in:
lotodore
2011-02-11 23:02:29 +00:00
parent 02518c67b2
commit c4b8e567ed
25 changed files with 220 additions and 27 deletions
+6 -1
View File
@@ -669,7 +669,8 @@ ChatMessage ::= [APPLICATION 130] SEQUENCE {
chatTypeLobby [0] ChatTypeLobby, chatTypeLobby [0] ChatTypeLobby,
chatTypeGame [1] ChatTypeGame, chatTypeGame [1] ChatTypeGame,
chatTypeBot [2] ChatTypeBot, chatTypeBot [2] ChatTypeBot,
chatTypeBroadcast [3] ChatTypeBroadcast chatTypeBroadcast [3] ChatTypeBroadcast,
chatTypePrivate [4] ChatTypePrivate
}, },
chatText UTF8String (SIZE(1..128)) chatText UTF8String (SIZE(1..128))
} }
@@ -689,6 +690,10 @@ ChatTypeBroadcast ::= SEQUENCE {
ChatTypeBot ::= SEQUENCE { ChatTypeBot ::= SEQUENCE {
} }
ChatTypePrivate ::= SEQUENCE {
playerId NonZeroId
}
DialogMessage ::= [APPLICATION 131] SEQUENCE { DialogMessage ::= [APPLICATION 131] SEQUENCE {
notificationText UTF8String (SIZE(1..128)) notificationText UTF8String (SIZE(1..128))
} }
+4 -2
View File
@@ -170,7 +170,8 @@ HEADERS += src/third_party/asn1/AllInShowCardsMessage.h \
src/third_party/asn1/ReportAvatarAckMessage.h \ src/third_party/asn1/ReportAvatarAckMessage.h \
src/third_party/asn1/CleanerChatTypeLobby.h \ src/third_party/asn1/CleanerChatTypeLobby.h \
src/third_party/asn1/CleanerChatTypeGame.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 \ SOURCES += src/third_party/asn1/ChatCleanerMessage.c \
src/third_party/asn1/CleanerInitMessage.c \ src/third_party/asn1/CleanerInitMessage.c \
src/third_party/asn1/CleanerInitAckMessage.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/ReportAvatarAckMessage.c \
src/third_party/asn1/CleanerChatTypeLobby.c \ src/third_party/asn1/CleanerChatTypeLobby.c \
src/third_party/asn1/CleanerChatTypeGame.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 { win32 {
DEFINES += CURL_STATICLIB DEFINES += CURL_STATICLIB
DEFINES += _WIN32_WINNT=0x0501 DEFINES += _WIN32_WINNT=0x0501
+4
View File
@@ -223,6 +223,10 @@ void ServerGuiWrapper::SignalNetClientLobbyChatMsg(const string &playerName, con
{ {
if (myClientcb) myClientcb->SignalNetClientLobbyChatMsg(playerName, msg); 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) void ServerGuiWrapper::SignalNetClientMsgBox(const string &msg)
{ {
if (myClientcb) myClientcb->SignalNetClientMsgBox(msg); if (myClientcb) myClientcb->SignalNetClientMsgBox(msg);
+1
View File
@@ -123,6 +123,7 @@ public:
void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName); void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName);
void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg); void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg);
void SignalNetClientLobbyChatMsg(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 SignalNetClientWaitDialog();
void SignalNetClientWarningAutoFoldInRankingGame(unsigned remainingAutoFolds); void SignalNetClientWarningAutoFoldInRankingGame(unsigned remainingAutoFolds);
+50 -2
View File
@@ -44,10 +44,19 @@ void ChatTools::sendMessage()
if(myLineEdit->text().size() && mySession) { if(myLineEdit->text().size() && mySession) {
fillChatLinesHistory(myLineEdit->text()); fillChatLinesHistory(myLineEdit->text());
QString chatText(myLineEdit->text());
if(myChatType == INGAME_CHAT) { if(myChatType == INGAME_CHAT) {
mySession->sendGameChatMessage(myLineEdit->text().toUtf8().constData()); mySession->sendGameChatMessage(chatText.toUtf8().constData());
} else { } 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(""); 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() void ChatTools::clearChat()
{ {
@@ -247,3 +261,37 @@ void ChatTools::refreshIgnoreList()
{ {
ignoreList = myConfig->readConfigStringList("PlayerIgnoreList"); 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;
}
+4
View File
@@ -49,6 +49,7 @@ public slots:
void sendMessage(); void sendMessage();
void receiveMessage(QString playerName, QString message); void receiveMessage(QString playerName, QString message);
void privateMessage(QString playerName, QString message);
void clearChat(); void clearChat();
void checkInputLength(QString string); void checkInputLength(QString string);
@@ -76,6 +77,9 @@ public slots:
} }
void refreshIgnoreList(); void refreshIgnoreList();
protected:
unsigned parsePrivateMessageTarget(QString &chatText);
private: private:
+4
View File
@@ -404,6 +404,10 @@ void GuiWrapper::SignalNetClientLobbyChatMsg(const string &playerName, const str
{ {
myStartWindow->signalNetClientLobbyChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_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) void GuiWrapper::SignalNetClientMsgBox(const string &msg)
{ {
myStartWindow->signalNetClientMsgBox(QString::fromUtf8(msg.c_str())); myStartWindow->signalNetClientMsgBox(QString::fromUtf8(msg.c_str()));
+1
View File
@@ -135,6 +135,7 @@ public:
void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName); void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName);
void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg); void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg);
void SignalNetClientLobbyChatMsg(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(const std::string &msg);
void SignalNetClientMsgBox(unsigned msgId); void SignalNetClientMsgBox(unsigned msgId);
@@ -146,6 +146,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
connect(this, SIGNAL(signalNetClientGameChatMsg(QString, QString)), myGuiInterface->getMyW()->getMyChat(), SLOT(receiveMessage(QString, QString))); 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)), myStartNetworkGameDialog->getMyChat(), SLOT(receiveMessage(QString, QString)));
connect(this, SIGNAL(signalNetClientLobbyChatMsg(QString, QString)), myGameLobbyDialog->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(QString)), this, SLOT(networkMessage(QString)));
connect(this, SIGNAL(signalNetClientMsgBox(unsigned)), this, SLOT(networkMessage(unsigned))); connect(this, SIGNAL(signalNetClientMsgBox(unsigned)), this, SLOT(networkMessage(unsigned)));
connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, unsigned)), this, SLOT(showTimeoutDialog(int, unsigned))); connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, unsigned)), this, SLOT(showTimeoutDialog(int, unsigned)));
+1
View File
@@ -100,6 +100,7 @@ signals:
void signalNetClientGameStart(boost::shared_ptr<Game> game); void signalNetClientGameStart(boost::shared_ptr<Game> game);
void signalNetClientGameChatMsg(QString nickName, QString msg); void signalNetClientGameChatMsg(QString nickName, QString msg);
void signalNetClientLobbyChatMsg(QString nickName, QString msg); void signalNetClientLobbyChatMsg(QString nickName, QString msg);
void signalNetClientPrivateChatMsg(QString nickName, QString msg);
void signalNetClientMsgBox(QString msg); void signalNetClientMsgBox(QString msg);
void signalNetClientMsgBox(unsigned msgId); void signalNetClientMsgBox(unsigned msgId);
+1
View File
@@ -58,6 +58,7 @@ public:
virtual void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg) = 0; 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 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(const std::string &msg) = 0;
virtual void SignalNetClientMsgBox(unsigned msgId) = 0; virtual void SignalNetClientMsgBox(unsigned msgId) = 0;
virtual void SignalNetClientWaitDialog() = 0; virtual void SignalNetClientWaitDialog() = 0;
+5
View File
@@ -715,6 +715,11 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr<ClientThread> clien
PlayerInfo info; PlayerInfo info;
if (client->GetCachedPlayerInfo(playerId, info)) if (client->GetCachedPlayerInfo(playerId, info))
client->GetCallback().SignalNetClientLobbyChatMsg(info.playerName, STL_STRING_FROM_OCTET_STRING(netMessage->chatText)); 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) { } else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_dialogMessage) {
// Message box - display it in the GUI. // Message box - display it in the GUI.
+3 -3
View File
@@ -1396,9 +1396,9 @@ ServerLobbyThread::HandleNetPacketChatRequest(SessionWrapper session, const Chat
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc)); boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
packet->GetMsg()->present = PokerTHMessage_PR_chatMessage; packet->GetMsg()->present = PokerTHMessage_PR_chatMessage;
ChatMessage_t *netChat = &packet->GetMsg()->choice.chatMessage; ChatMessage_t *netChat = &packet->GetMsg()->choice.chatMessage;
netChat->chatType.present = chatType_PR_chatTypeLobby; netChat->chatType.present = chatType_PR_chatTypePrivate;
ChatTypeLobby_t *netLobbyChat = &netChat->chatType.choice.chatTypeLobby; ChatTypePrivate_t *netPrivateChat = &netChat->chatType.choice.chatTypePrivate;
netLobbyChat->playerId = session.playerData->GetUniqueId(); netPrivateChat->playerId = session.playerData->GetUniqueId();
OCTET_STRING_fromBuf( OCTET_STRING_fromBuf(
&netChat->chatText, &netChat->chatText,
(char *)chatRequest.chatText.buf, (char *)chatRequest.chatText.buf,
+1 -1
View File
@@ -23,7 +23,7 @@ static ber_tlv_tag_t asn_DEF_AfkWarningMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_AfkWarningMessage_tag2el_1[] = { 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 = { static asn_SEQUENCE_specifics_t asn_SPC_AfkWarningMessage_specs_1 = {
sizeof(struct AfkWarningMessage), sizeof(struct AfkWarningMessage),
+18 -7
View File
@@ -76,12 +76,22 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = {
0, 0,
"chatTypeBroadcast" "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[] = { 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 | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 669 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 670 */ { (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 | (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 = { static asn_CHOICE_specifics_t asn_SPC_chatType_specs_2 = {
sizeof(struct chatType), sizeof(struct chatType),
@@ -89,9 +99,9 @@ static asn_CHOICE_specifics_t asn_SPC_chatType_specs_2 = {
offsetof(struct chatType, present), offsetof(struct chatType, present),
sizeof(((struct chatType *)0)->present), sizeof(((struct chatType *)0)->present),
asn_MAP_chatType_tag2el_2, asn_MAP_chatType_tag2el_2,
4, /* Count of tags in the map */ 5, /* Count of tags in the map */
0, 0,
4 /* Extensions start */ 5 /* Extensions start */
}; };
static /* Use -fall-defs-global to expose */ static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_chatType_2 = { 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 tags (count) */
0, /* No PER visible constraints */ 0, /* No PER visible constraints */
asn_MBR_chatType_2, asn_MBR_chatType_2,
4, /* Elements count */ 5, /* Elements count */
&asn_SPC_chatType_specs_2 /* Additional specs */ &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)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_ChatMessage_tag2el_1[] = { 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 | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 669 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 670 */ { (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 | (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 = { static asn_SEQUENCE_specifics_t asn_SPC_ChatMessage_specs_1 = {
sizeof(struct ChatMessage), sizeof(struct ChatMessage),
offsetof(struct ChatMessage, _asn_ctx), offsetof(struct ChatMessage, _asn_ctx),
asn_MAP_ChatMessage_tag2el_1, 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) */ 0, 0, 0, /* Optional elements (not needed) */
1, /* Start extensions */ 1, /* Start extensions */
3 /* Stop extensions */ 3 /* Stop extensions */
+3
View File
@@ -17,6 +17,7 @@
#include "ChatTypeGame.h" #include "ChatTypeGame.h"
#include "ChatTypeBot.h" #include "ChatTypeBot.h"
#include "ChatTypeBroadcast.h" #include "ChatTypeBroadcast.h"
#include "ChatTypePrivate.h"
#include <constr_CHOICE.h> #include <constr_CHOICE.h>
#include <constr_SEQUENCE.h> #include <constr_SEQUENCE.h>
@@ -31,6 +32,7 @@ typedef enum chatType_PR {
chatType_PR_chatTypeGame, chatType_PR_chatTypeGame,
chatType_PR_chatTypeBot, chatType_PR_chatTypeBot,
chatType_PR_chatTypeBroadcast, chatType_PR_chatTypeBroadcast,
chatType_PR_chatTypePrivate,
/* Extensions may appear below */ /* Extensions may appear below */
} chatType_PR; } chatType_PR;
@@ -44,6 +46,7 @@ typedef struct ChatMessage {
ChatTypeGame_t chatTypeGame; ChatTypeGame_t chatTypeGame;
ChatTypeBot_t chatTypeBot; ChatTypeBot_t chatTypeBot;
ChatTypeBroadcast_t chatTypeBroadcast; ChatTypeBroadcast_t chatTypeBroadcast;
ChatTypePrivate_t chatTypePrivate;
/* /*
* This type is extensible, * This type is extensible,
* possible extensions are below. * possible extensions are below.
+2 -2
View File
@@ -31,8 +31,8 @@ static ber_tlv_tag_t asn_DEF_ChatTypeGame_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_ChatTypeGame_tag2el_1[] = { 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)), 0, 0, 1 }, /* gameId at 683 */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 684 */ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 685 */
}; };
static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeGame_specs_1 = { static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeGame_specs_1 = {
sizeof(struct ChatTypeGame), sizeof(struct ChatTypeGame),
+1 -1
View File
@@ -22,7 +22,7 @@ static ber_tlv_tag_t asn_DEF_ChatTypeLobby_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_ChatTypeLobby_tag2el_1[] = { 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 = { static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeLobby_specs_1 = {
sizeof(struct ChatTypeLobby), sizeof(struct ChatTypeLobby),
+59
View File
@@ -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 */
};
+42
View File
@@ -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 <asn_application.h>
/* Including external dependencies */
#include "NonZeroId.h"
#include <constr_SEQUENCE.h>
#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 <asn_internal.h>
+1 -1
View File
@@ -55,7 +55,7 @@ static ber_tlv_tag_t asn_DEF_DialogMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_DialogMessage_tag2el_1[] = { 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 = { static asn_SEQUENCE_specifics_t asn_SPC_DialogMessage_specs_1 = {
sizeof(struct DialogMessage), sizeof(struct DialogMessage),
+1 -1
View File
@@ -166,7 +166,7 @@ static ber_tlv_tag_t asn_DEF_ErrorMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_ErrorMessage_tag2el_1[] = { 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 = { static asn_SEQUENCE_specifics_t asn_SPC_ErrorMessage_specs_1 = {
sizeof(struct ErrorMessage), sizeof(struct ErrorMessage),
+2 -2
View File
@@ -151,8 +151,8 @@ static ber_tlv_tag_t asn_DEF_ReportAvatarAckMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_ReportAvatarAckMessage_tag2el_1[] = { 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 | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 722 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 719 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 724 */
}; };
static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarAckMessage_specs_1 = { static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarAckMessage_specs_1 = {
sizeof(struct ReportAvatarAckMessage), sizeof(struct ReportAvatarAckMessage),
+2 -2
View File
@@ -32,8 +32,8 @@ static ber_tlv_tag_t asn_DEF_ReportAvatarMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_ReportAvatarMessage_tag2el_1[] = { 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 | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 717 */
{ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 714 */ { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 719 */
}; };
static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarMessage_specs_1 = { static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarMessage_specs_1 = {
sizeof(struct ReportAvatarMessage), sizeof(struct ReportAvatarMessage),
+2 -2
View File
@@ -149,8 +149,8 @@ static ber_tlv_tag_t asn_DEF_TimeoutWarningMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
}; };
static asn_TYPE_tag2member_t asn_MAP_TimeoutWarningMessage_tag2el_1[] = { 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 | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 707 */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 698 */ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 703 */
}; };
static asn_SEQUENCE_specifics_t asn_SPC_TimeoutWarningMessage_specs_1 = { static asn_SEQUENCE_specifics_t asn_SPC_TimeoutWarningMessage_specs_1 = {
sizeof(struct TimeoutWarningMessage), sizeof(struct TimeoutWarningMessage),