Chat bot integration now fully functional.
This commit is contained in:
+5
-1
@@ -552,7 +552,8 @@ ChatMessage ::= [APPLICATION 130] SEQUENCE {
|
|||||||
chatType CHOICE {
|
chatType CHOICE {
|
||||||
chatTypeLobby [0] ChatTypeLobby,
|
chatTypeLobby [0] ChatTypeLobby,
|
||||||
chatTypeGame [1] ChatTypeGame,
|
chatTypeGame [1] ChatTypeGame,
|
||||||
chatTypeBroadcast [2] ChatTypeBroadcast
|
chatTypeBot [2] ChatTypeBot,
|
||||||
|
chatTypeBroadcast [3] ChatTypeBroadcast
|
||||||
},
|
},
|
||||||
chatText UTF8String (SIZE(1..128))
|
chatText UTF8String (SIZE(1..128))
|
||||||
}
|
}
|
||||||
@@ -569,6 +570,9 @@ ChatTypeGame ::= SEQUENCE {
|
|||||||
ChatTypeBroadcast ::= SEQUENCE {
|
ChatTypeBroadcast ::= SEQUENCE {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChatTypeBot ::= SEQUENCE {
|
||||||
|
}
|
||||||
|
|
||||||
DialogMessage ::= [APPLICATION 131] SEQUENCE {
|
DialogMessage ::= [APPLICATION 131] SEQUENCE {
|
||||||
notificationText UTF8String (SIZE(1..128))
|
notificationText UTF8String (SIZE(1..128))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ HEADERS += \
|
|||||||
src/engine/berointerface.h \
|
src/engine/berointerface.h \
|
||||||
src/gui/guiinterface.h \
|
src/gui/guiinterface.h \
|
||||||
src/net/chatcleanermanager.h \
|
src/net/chatcleanermanager.h \
|
||||||
|
src/net/chatcleanercallback.h \
|
||||||
src/net/clientcallback.h \
|
src/net/clientcallback.h \
|
||||||
src/net/clientcontext.h \
|
src/net/clientcontext.h \
|
||||||
src/net/clientexception.h \
|
src/net/clientexception.h \
|
||||||
@@ -166,6 +167,7 @@ SOURCES += \
|
|||||||
src/engine/network_engine/clientplayer.cpp \
|
src/engine/network_engine/clientplayer.cpp \
|
||||||
src/engine/network_engine/clientbero.cpp \
|
src/engine/network_engine/clientbero.cpp \
|
||||||
src/net/common/chatcleanermanager.cpp \
|
src/net/common/chatcleanermanager.cpp \
|
||||||
|
src/net/common/chatcleanercallback.cpp \
|
||||||
src/net/common/clientcallback.cpp \
|
src/net/common/clientcallback.cpp \
|
||||||
src/net/common/clientcontext.cpp \
|
src/net/common/clientcontext.cpp \
|
||||||
src/net/common/clientstate.cpp \
|
src/net/common/clientstate.cpp \
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ HEADERS += src/third_party/asn1/AllInShowCardsMessage.h \
|
|||||||
src/third_party/asn1/ChatMessage.h \
|
src/third_party/asn1/ChatMessage.h \
|
||||||
src/third_party/asn1/ChatTypeGame.h \
|
src/third_party/asn1/ChatTypeGame.h \
|
||||||
src/third_party/asn1/ChatTypeLobby.h \
|
src/third_party/asn1/ChatTypeLobby.h \
|
||||||
|
src/third_party/asn1/ChatTypeBot.h \
|
||||||
src/third_party/asn1/ChatTypeBroadcast.h \
|
src/third_party/asn1/ChatTypeBroadcast.h \
|
||||||
src/third_party/asn1/ChatRequestMessage.h \
|
src/third_party/asn1/ChatRequestMessage.h \
|
||||||
src/third_party/asn1/ChatRequestTypeLobby.h \
|
src/third_party/asn1/ChatRequestTypeLobby.h \
|
||||||
@@ -247,8 +248,9 @@ SOURCES += src/third_party/asn1/ChatCleanerMessage.c \
|
|||||||
src/third_party/asn1/ChatRequestTypeLobby.c \
|
src/third_party/asn1/ChatRequestTypeLobby.c \
|
||||||
src/third_party/asn1/ChatRequestTypeGame.c \
|
src/third_party/asn1/ChatRequestTypeGame.c \
|
||||||
src/third_party/asn1/ChatMessage.c \
|
src/third_party/asn1/ChatMessage.c \
|
||||||
src/third_party/asn1/ChatTypeLobby.c \
|
|
||||||
src/third_party/asn1/ChatTypeGame.c \
|
src/third_party/asn1/ChatTypeGame.c \
|
||||||
|
src/third_party/asn1/ChatTypeLobby.c \
|
||||||
|
src/third_party/asn1/ChatTypeBot.c \
|
||||||
src/third_party/asn1/ChatTypeBroadcast.c \
|
src/third_party/asn1/ChatTypeBroadcast.c \
|
||||||
src/third_party/asn1/Card.c \
|
src/third_party/asn1/Card.c \
|
||||||
src/third_party/asn1/BOOLEAN.c \
|
src/third_party/asn1/BOOLEAN.c \
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
configList.push_back(ConfigInfo("AdminIRCServerNick", CONFIG_TYPE_INT, "PokerTH"));
|
configList.push_back(ConfigInfo("AdminIRCServerNick", CONFIG_TYPE_INT, "PokerTH"));
|
||||||
configList.push_back(ConfigInfo("UseChatCleaner", CONFIG_TYPE_INT, "0"));
|
configList.push_back(ConfigInfo("UseChatCleaner", CONFIG_TYPE_INT, "0"));
|
||||||
configList.push_back(ConfigInfo("ChatCleanerHostAddress", CONFIG_TYPE_STRING, "localhost"));
|
configList.push_back(ConfigInfo("ChatCleanerHostAddress", CONFIG_TYPE_STRING, "localhost"));
|
||||||
configList.push_back(ConfigInfo("ChatCleanerPort", CONFIG_TYPE_INT, "4237"));
|
configList.push_back(ConfigInfo("ChatCleanerPort", CONFIG_TYPE_INT, "4327"));
|
||||||
configList.push_back(ConfigInfo("ChatCleanerClientAuth", CONFIG_TYPE_STRING, ""));
|
configList.push_back(ConfigInfo("ChatCleanerClientAuth", CONFIG_TYPE_STRING, ""));
|
||||||
configList.push_back(ConfigInfo("ChatCleanerServerAuth", CONFIG_TYPE_STRING, ""));
|
configList.push_back(ConfigInfo("ChatCleanerServerAuth", CONFIG_TYPE_STRING, ""));
|
||||||
configList.push_back(ConfigInfo("ChatCleanerUseIpv6", CONFIG_TYPE_INT, "0"));
|
configList.push_back(ConfigInfo("ChatCleanerUseIpv6", CONFIG_TYPE_INT, "0"));
|
||||||
|
|||||||
@@ -25,13 +25,14 @@
|
|||||||
#include <boost/enable_shared_from_this.hpp>
|
#include <boost/enable_shared_from_this.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <net/internalchatcleanerpacket.h>
|
#include <net/internalchatcleanerpacket.h>
|
||||||
|
#include <net/chatcleanercallback.h>
|
||||||
|
|
||||||
class EncodedPacket;
|
class EncodedPacket;
|
||||||
|
|
||||||
class ChatCleanerManager : public boost::enable_shared_from_this<ChatCleanerManager>
|
class ChatCleanerManager : public boost::enable_shared_from_this<ChatCleanerManager>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChatCleanerManager(boost::shared_ptr<boost::asio::io_service> ioService);
|
ChatCleanerManager(ChatCleanerCallback &cb, boost::shared_ptr<boost::asio::io_service> ioService);
|
||||||
virtual ~ChatCleanerManager();
|
virtual ~ChatCleanerManager();
|
||||||
|
|
||||||
void Init(const std::string &serverAddr, int port, bool ipv6,
|
void Init(const std::string &serverAddr, int port, bool ipv6,
|
||||||
@@ -51,6 +52,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
ChatCleanerCallback &m_callback;
|
||||||
boost::shared_ptr<boost::asio::io_service> m_ioService;
|
boost::shared_ptr<boost::asio::io_service> m_ioService;
|
||||||
boost::shared_ptr<boost::asio::ip::tcp::resolver> m_resolver;
|
boost::shared_ptr<boost::asio::ip::tcp::resolver> m_resolver;
|
||||||
boost::shared_ptr<boost::asio::ip::tcp::socket> m_socket;
|
boost::shared_ptr<boost::asio::ip::tcp::socket> m_socket;
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ using namespace std;
|
|||||||
using boost::asio::ip::tcp;
|
using boost::asio::ip::tcp;
|
||||||
|
|
||||||
|
|
||||||
ChatCleanerManager::ChatCleanerManager(boost::shared_ptr<boost::asio::io_service> ioService)
|
ChatCleanerManager::ChatCleanerManager(ChatCleanerCallback &cb, boost::shared_ptr<boost::asio::io_service> ioService)
|
||||||
: m_ioService(ioService), m_connected(false), m_curRequestId(0), m_recvBufUsed(0)
|
: m_callback(cb), m_ioService(ioService), m_connected(false), m_curRequestId(0), m_recvBufUsed(0)
|
||||||
{
|
{
|
||||||
m_resolver.reset(
|
m_resolver.reset(
|
||||||
new boost::asio::ip::tcp::resolver(*m_ioService));
|
new boost::asio::ip::tcp::resolver(*m_ioService));
|
||||||
@@ -125,7 +125,9 @@ ChatCleanerManager::HandleConnect(const boost::system::error_code& ec,
|
|||||||
boost::asio::placeholders::error,
|
boost::asio::placeholders::error,
|
||||||
boost::asio::placeholders::bytes_transferred));
|
boost::asio::placeholders::bytes_transferred));
|
||||||
}
|
}
|
||||||
else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator())
|
else if (ec != boost::asio::error::operation_aborted)
|
||||||
|
{
|
||||||
|
if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator())
|
||||||
{
|
{
|
||||||
// Try next resolve entry.
|
// Try next resolve entry.
|
||||||
m_socket->close();
|
m_socket->close();
|
||||||
@@ -137,8 +139,7 @@ ChatCleanerManager::HandleConnect(const boost::system::error_code& ec,
|
|||||||
boost::asio::placeholders::error,
|
boost::asio::placeholders::error,
|
||||||
++endpoint_iterator));
|
++endpoint_iterator));
|
||||||
}
|
}
|
||||||
else if (ec != boost::asio::error::operation_aborted)
|
else
|
||||||
{
|
|
||||||
LOG_ERROR("Could not connect to chat cleaner server.");
|
LOG_ERROR("Could not connect to chat cleaner server.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,7 +180,10 @@ ChatCleanerManager::HandleRead(const boost::system::error_code &ec, size_t bytes
|
|||||||
else
|
else
|
||||||
m_recvBufUsed = 0;
|
m_recvBufUsed = 0;
|
||||||
|
|
||||||
|
if (asn_check_constraints(&asn_DEF_ChatCleanerMessage, recvMsg.GetMsg(), NULL, NULL) == 0)
|
||||||
error = HandleMessage(recvMsg);
|
error = HandleMessage(recvMsg);
|
||||||
|
else
|
||||||
|
LOG_ERROR("Received invalid chat cleaner packet.");
|
||||||
}
|
}
|
||||||
} while (!error && retVal.code == RC_OK);
|
} while (!error && retVal.code == RC_OK);
|
||||||
|
|
||||||
@@ -226,6 +230,12 @@ ChatCleanerManager::HandleMessage(InternalChatCleanerPacket &msg)
|
|||||||
if (!m_connected)
|
if (!m_connected)
|
||||||
LOG_ERROR("Chat cleaner handshake failed.");
|
LOG_ERROR("Chat cleaner handshake failed.");
|
||||||
}
|
}
|
||||||
|
else if (msg.GetMsg()->present == ChatCleanerMessage_PR_cleanerChatReplyMessage)
|
||||||
|
{
|
||||||
|
CleanerChatReplyMessage_t *netReply = &msg.GetMsg()->choice.cleanerChatReplyMessage;
|
||||||
|
m_callback.SignalChatBotMessage(string((const char *)netReply->cleanerText->buf, netReply->cleanerText->size));
|
||||||
|
error = false;
|
||||||
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -813,6 +813,10 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr<ClientThread> clien
|
|||||||
client->GetCallback().SignalNetClientGameChatMsg("(global notice)", STL_STRING_FROM_OCTET_STRING(netMessage->chatText));
|
client->GetCallback().SignalNetClientGameChatMsg("(global notice)", STL_STRING_FROM_OCTET_STRING(netMessage->chatText));
|
||||||
client->GetCallback().SignalNetClientLobbyChatMsg("(global notice)", STL_STRING_FROM_OCTET_STRING(netMessage->chatText));
|
client->GetCallback().SignalNetClientLobbyChatMsg("(global notice)", STL_STRING_FROM_OCTET_STRING(netMessage->chatText));
|
||||||
}
|
}
|
||||||
|
else if (netMessage->chatType.present == chatType_PR_chatTypeBot)
|
||||||
|
{
|
||||||
|
client->GetCallback().SignalNetClientLobbyChatMsg("(chat bot)", STL_STRING_FROM_OCTET_STRING(netMessage->chatText));
|
||||||
|
}
|
||||||
else if (netMessage->chatType.present == chatType_PR_chatTypeGame)
|
else if (netMessage->chatType.present == chatType_PR_chatTypeGame)
|
||||||
{
|
{
|
||||||
unsigned playerId = netMessage->chatType.choice.chatTypeGame.playerId;
|
unsigned playerId = netMessage->chatType.choice.chatTypeGame.playerId;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ using namespace std;
|
|||||||
using boost::asio::ip::tcp;
|
using boost::asio::ip::tcp;
|
||||||
|
|
||||||
|
|
||||||
class ServerSenderCallback : public SenderCallback, public SessionDataCallback
|
class ServerSenderCallback : public SenderCallback, public SessionDataCallback, public ChatCleanerCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ServerSenderCallback(ServerLobbyThread &server) : m_server(server) {}
|
ServerSenderCallback(ServerLobbyThread &server) : m_server(server) {}
|
||||||
@@ -84,6 +84,10 @@ public:
|
|||||||
{
|
{
|
||||||
m_server.GetSender().SignalSessionTerminated(session);
|
m_server.GetSender().SignalSessionTerminated(session);
|
||||||
}
|
}
|
||||||
|
virtual void SignalChatBotMessage(const string &msg)
|
||||||
|
{
|
||||||
|
m_server.SendChatBotMsg(msg);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ServerLobbyThread &m_server;
|
ServerLobbyThread &m_server;
|
||||||
@@ -103,7 +107,7 @@ ServerLobbyThread::ServerLobbyThread(GuiInterface &gui, ConfigFile *playerConfig
|
|||||||
m_sender.reset(new SenderHelper(*m_senderCallback, m_ioService));
|
m_sender.reset(new SenderHelper(*m_senderCallback, m_ioService));
|
||||||
m_receiver.reset(new ReceiverHelper);
|
m_receiver.reset(new ReceiverHelper);
|
||||||
m_banManager.reset(new ServerBanManager(m_ioService));
|
m_banManager.reset(new ServerBanManager(m_ioService));
|
||||||
m_chatCleanerManager.reset(new ChatCleanerManager(m_ioService));
|
m_chatCleanerManager.reset(new ChatCleanerManager(*m_senderCallback, m_ioService));
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerLobbyThread::~ServerLobbyThread()
|
ServerLobbyThread::~ServerLobbyThread()
|
||||||
@@ -445,9 +449,26 @@ ServerLobbyThread::SendGlobalMsgBox(const string &message)
|
|||||||
&netDialog->notificationText,
|
&netDialog->notificationText,
|
||||||
message.c_str(),
|
message.c_str(),
|
||||||
message.length());
|
message.length());
|
||||||
|
m_sessionManager.SendToAllSessions(GetSender(), packet, SessionData::Established);
|
||||||
m_gameSessionManager.SendToAllSessions(GetSender(), packet, SessionData::Game);
|
m_gameSessionManager.SendToAllSessions(GetSender(), packet, SessionData::Game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ServerLobbyThread::SendChatBotMsg(const std::string &message)
|
||||||
|
{
|
||||||
|
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
|
||||||
|
packet->GetMsg()->present = PokerTHMessage_PR_chatMessage;
|
||||||
|
ChatMessage_t *netChat = &packet->GetMsg()->choice.chatMessage;
|
||||||
|
netChat->chatType.present = chatType_PR_chatTypeBot;
|
||||||
|
OCTET_STRING_fromBuf(
|
||||||
|
&netChat->chatText,
|
||||||
|
message.c_str(),
|
||||||
|
message.length());
|
||||||
|
|
||||||
|
m_sessionManager.SendLobbyMsgToAllSessions(GetSender(), packet, SessionData::Established);
|
||||||
|
m_gameSessionManager.SendLobbyMsgToAllSessions(GetSender(), packet, SessionData::Game);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ServerLobbyThread::AddComputerPlayer(boost::shared_ptr<PlayerData> player)
|
ServerLobbyThread::AddComputerPlayer(boost::shared_ptr<PlayerData> player)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public:
|
|||||||
|
|
||||||
void SendGlobalChat(const std::string &message);
|
void SendGlobalChat(const std::string &message);
|
||||||
void SendGlobalMsgBox(const std::string &message);
|
void SendGlobalMsgBox(const std::string &message);
|
||||||
|
void SendChatBotMsg(const std::string &message);
|
||||||
|
|
||||||
void AddComputerPlayer(boost::shared_ptr<PlayerData> player);
|
void AddComputerPlayer(boost::shared_ptr<PlayerData> player);
|
||||||
void RemoveComputerPlayer(boost::shared_ptr<PlayerData> player);
|
void RemoveComputerPlayer(boost::shared_ptr<PlayerData> player);
|
||||||
|
|||||||
Vendored
+19
-8
@@ -59,9 +59,18 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = {
|
|||||||
0,
|
0,
|
||||||
"chatTypeGame"
|
"chatTypeGame"
|
||||||
},
|
},
|
||||||
{ ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeBroadcast),
|
{ ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeBot),
|
||||||
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
|
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
|
||||||
-1, /* IMPLICIT tag at current level */
|
-1, /* IMPLICIT tag at current level */
|
||||||
|
&asn_DEF_ChatTypeBot,
|
||||||
|
0, /* Defer constraints checking to the member type */
|
||||||
|
0, /* PER is not compiled, use -gen-PER */
|
||||||
|
0,
|
||||||
|
"chatTypeBot"
|
||||||
|
},
|
||||||
|
{ ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeBroadcast),
|
||||||
|
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
|
||||||
|
-1, /* IMPLICIT tag at current level */
|
||||||
&asn_DEF_ChatTypeBroadcast,
|
&asn_DEF_ChatTypeBroadcast,
|
||||||
0, /* Defer constraints checking to the member type */
|
0, /* Defer constraints checking to the member type */
|
||||||
0, /* PER is not compiled, use -gen-PER */
|
0, /* PER is not compiled, use -gen-PER */
|
||||||
@@ -72,7 +81,8 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = {
|
|||||||
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 553 */
|
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 553 */
|
||||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 554 */
|
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 554 */
|
||||||
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* chatTypeBroadcast at 556 */
|
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* chatTypeBot at 555 */
|
||||||
|
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* chatTypeBroadcast at 557 */
|
||||||
};
|
};
|
||||||
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),
|
||||||
@@ -80,9 +90,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,
|
||||||
3, /* Count of tags in the map */
|
4, /* Count of tags in the map */
|
||||||
0,
|
0,
|
||||||
3 /* Extensions start */
|
4 /* 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 = {
|
||||||
@@ -103,7 +113,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,
|
||||||
3, /* Elements count */
|
4, /* Elements count */
|
||||||
&asn_SPC_chatType_specs_2 /* Additional specs */
|
&asn_SPC_chatType_specs_2 /* Additional specs */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -132,16 +142,17 @@ 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 557 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 558 */
|
||||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 553 */
|
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 553 */
|
||||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 554 */
|
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 554 */
|
||||||
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 } /* chatTypeBroadcast at 556 */
|
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* chatTypeBot at 555 */
|
||||||
|
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* chatTypeBroadcast at 557 */
|
||||||
};
|
};
|
||||||
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,
|
||||||
4, /* Count of tags in the map */
|
5, /* 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 */
|
||||||
|
|||||||
Vendored
+3
@@ -14,6 +14,7 @@
|
|||||||
#include <UTF8String.h>
|
#include <UTF8String.h>
|
||||||
#include "ChatTypeLobby.h"
|
#include "ChatTypeLobby.h"
|
||||||
#include "ChatTypeGame.h"
|
#include "ChatTypeGame.h"
|
||||||
|
#include "ChatTypeBot.h"
|
||||||
#include "ChatTypeBroadcast.h"
|
#include "ChatTypeBroadcast.h"
|
||||||
#include <constr_CHOICE.h>
|
#include <constr_CHOICE.h>
|
||||||
#include <constr_SEQUENCE.h>
|
#include <constr_SEQUENCE.h>
|
||||||
@@ -27,6 +28,7 @@ typedef enum chatType_PR {
|
|||||||
chatType_PR_NOTHING, /* No components present */
|
chatType_PR_NOTHING, /* No components present */
|
||||||
chatType_PR_chatTypeLobby,
|
chatType_PR_chatTypeLobby,
|
||||||
chatType_PR_chatTypeGame,
|
chatType_PR_chatTypeGame,
|
||||||
|
chatType_PR_chatTypeBot,
|
||||||
chatType_PR_chatTypeBroadcast,
|
chatType_PR_chatTypeBroadcast,
|
||||||
/* Extensions may appear below */
|
/* Extensions may appear below */
|
||||||
|
|
||||||
@@ -39,6 +41,7 @@ typedef struct ChatMessage {
|
|||||||
union ChatMessage__chatType_u {
|
union ChatMessage__chatType_u {
|
||||||
ChatTypeLobby_t chatTypeLobby;
|
ChatTypeLobby_t chatTypeLobby;
|
||||||
ChatTypeGame_t chatTypeGame;
|
ChatTypeGame_t chatTypeGame;
|
||||||
|
ChatTypeBot_t chatTypeBot;
|
||||||
ChatTypeBroadcast_t chatTypeBroadcast;
|
ChatTypeBroadcast_t chatTypeBroadcast;
|
||||||
/*
|
/*
|
||||||
* This type is extensible,
|
* This type is extensible,
|
||||||
|
|||||||
Vendored
+45
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Generated by asn1c-0.9.22 (http://lionet.info/asn1c)
|
||||||
|
* From ASN.1 module "POKERTH-PROTOCOL"
|
||||||
|
* found in "../../../docs/pokerth.asn1"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <asn_internal.h>
|
||||||
|
|
||||||
|
#include "ChatTypeBot.h"
|
||||||
|
|
||||||
|
static ber_tlv_tag_t asn_DEF_ChatTypeBot_tags_1[] = {
|
||||||
|
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||||
|
};
|
||||||
|
static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeBot_specs_1 = {
|
||||||
|
sizeof(struct ChatTypeBot),
|
||||||
|
offsetof(struct ChatTypeBot, _asn_ctx),
|
||||||
|
0, /* No top level tags */
|
||||||
|
0, /* No tags in the map */
|
||||||
|
0, 0, 0, /* Optional elements (not needed) */
|
||||||
|
-1, /* Start extensions */
|
||||||
|
-1 /* Stop extensions */
|
||||||
|
};
|
||||||
|
asn_TYPE_descriptor_t asn_DEF_ChatTypeBot = {
|
||||||
|
"ChatTypeBot",
|
||||||
|
"ChatTypeBot",
|
||||||
|
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_ChatTypeBot_tags_1,
|
||||||
|
sizeof(asn_DEF_ChatTypeBot_tags_1)
|
||||||
|
/sizeof(asn_DEF_ChatTypeBot_tags_1[0]), /* 1 */
|
||||||
|
asn_DEF_ChatTypeBot_tags_1, /* Same as above */
|
||||||
|
sizeof(asn_DEF_ChatTypeBot_tags_1)
|
||||||
|
/sizeof(asn_DEF_ChatTypeBot_tags_1[0]), /* 1 */
|
||||||
|
0, /* No PER visible constraints */
|
||||||
|
0, 0, /* No members */
|
||||||
|
&asn_SPC_ChatTypeBot_specs_1 /* Additional specs */
|
||||||
|
};
|
||||||
|
|
||||||
Vendored
+38
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Generated by asn1c-0.9.22 (http://lionet.info/asn1c)
|
||||||
|
* From ASN.1 module "POKERTH-PROTOCOL"
|
||||||
|
* found in "../../../docs/pokerth.asn1"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ChatTypeBot_H_
|
||||||
|
#define _ChatTypeBot_H_
|
||||||
|
|
||||||
|
|
||||||
|
#include <asn_application.h>
|
||||||
|
|
||||||
|
/* Including external dependencies */
|
||||||
|
#include <constr_SEQUENCE.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ChatTypeBot */
|
||||||
|
typedef struct ChatTypeBot {
|
||||||
|
/*
|
||||||
|
* This type is extensible,
|
||||||
|
* possible extensions are below.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Context for parsing across buffer boundaries */
|
||||||
|
asn_struct_ctx_t _asn_ctx;
|
||||||
|
} ChatTypeBot_t;
|
||||||
|
|
||||||
|
/* Implementation */
|
||||||
|
extern asn_TYPE_descriptor_t asn_DEF_ChatTypeBot;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ChatTypeBot_H_ */
|
||||||
Vendored
+2
-2
@@ -32,8 +32,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 565 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 566 */
|
||||||
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 567 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 568 */
|
||||||
};
|
};
|
||||||
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),
|
||||||
|
|||||||
Vendored
+1
-1
@@ -23,7 +23,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 562 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 563 */
|
||||||
};
|
};
|
||||||
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),
|
||||||
|
|||||||
Vendored
+1
-1
@@ -56,7 +56,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 573 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* notificationText at 577 */
|
||||||
};
|
};
|
||||||
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),
|
||||||
|
|||||||
Vendored
+1
-1
@@ -165,7 +165,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 589 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* errorReason at 593 */
|
||||||
};
|
};
|
||||||
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
@@ -150,8 +150,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 582 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 586 */
|
||||||
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 578 */
|
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 582 */
|
||||||
};
|
};
|
||||||
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),
|
||||||
|
|||||||
Reference in New Issue
Block a user