diff --git a/chatcleaner.pro b/chatcleaner.pro index d697e4a3..daee7bca 100644 --- a/chatcleaner.pro +++ b/chatcleaner.pro @@ -13,11 +13,9 @@ OBJECTS_DIR = obj TEMPLATE = app INCLUDEPATH += src/ \ src/chatcleaner/ \ - src/third_party/asn1/ \ src/net/ DEPENDPATH += src/ \ src/chatcleaner/ \ - src/third_party/asn1/ \ src/net/ SOURCES += src/chatcleaner/chatcleaner.cpp \ src/chatcleaner/cleanerserver.cpp \ diff --git a/pokerth_game.pro b/pokerth_game.pro index 09f47258..2c143e8e 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -43,7 +43,6 @@ INCLUDEPATH += . \ src/engine/local_engine \ src/engine/network_engine \ src/config \ - src/third_party/asn1 \ src/gui/qt \ src/gui/qt/connecttoserverdialog \ src/core \ diff --git a/pokerth_lib.pro b/pokerth_lib.pro index f58b9199..d3ec4dd3 100644 --- a/pokerth_lib.pro +++ b/pokerth_lib.pro @@ -27,7 +27,6 @@ INCLUDEPATH += . \ src/engine/local_engine \ src/engine/network_engine \ src/config \ - src/third_party/asn1 \ src/core DEPENDPATH += . \ @@ -100,7 +99,6 @@ HEADERS += \ src/net/uploadhelper.h \ src/net/downloaderthread.h \ src/net/downloadhelper.h \ - src/net/internalchatcleanerpacket.h \ src/engine/local_engine/cardsvalue.h \ src/engine/local_engine/localboard.h \ src/engine/local_engine/localenginefactory.h \ @@ -201,7 +199,6 @@ SOURCES += \ src/net/common/transferhelper.cpp \ src/net/common/uploaderthread.cpp \ src/net/common/uploadhelper.cpp \ - src/net/common/internalchatcleanerpacket.cpp \ src/gui/generic/serverguiwrapper.cpp \ src/gui/qttoolsinterface.cpp \ src/net/common/sendbuffer.cpp \ diff --git a/pokerth_protocol.pro b/pokerth_protocol.pro index 4b1be2bf..14da5993 100644 --- a/pokerth_protocol.pro +++ b/pokerth_protocol.pro @@ -18,96 +18,24 @@ QT -= core \ # PRECOMPILED_HEADER = src/pch_lib.h INCLUDEPATH += . \ - src \ - src/third_party/asn1 + src DEPENDPATH += . \ - src \ - src/third_party/asn1 + src # Input -HEADERS += src/third_party/asn1/asn_application.h \ - src/third_party/asn1/asn_codecs.h \ - src/third_party/asn1/asn_codecs_prim.h \ - src/third_party/asn1/asn_internal.h \ - src/third_party/asn1/asn_SEQUENCE_OF.h \ - src/third_party/asn1/asn_SET_OF.h \ - src/third_party/asn1/asn_system.h \ - src/third_party/asn1/ber_decoder.h \ - src/third_party/asn1/ber_tlv_length.h \ - src/third_party/asn1/ber_tlv_tag.h \ - src/third_party/asn1/BIT_STRING.h \ - src/third_party/asn1/BOOLEAN.h \ - src/third_party/asn1/constraints.h \ - src/third_party/asn1/constr_CHOICE.h \ - src/third_party/asn1/constr_SEQUENCE.h \ - src/third_party/asn1/constr_SEQUENCE_OF.h \ - src/third_party/asn1/constr_SET_OF.h \ - src/third_party/asn1/constr_TYPE.h \ - src/third_party/asn1/der_encoder.h \ - src/third_party/asn1/INTEGER.h \ - src/third_party/asn1/NativeEnumerated.h \ - src/third_party/asn1/NativeInteger.h \ - src/third_party/asn1/OCTET_STRING.h \ - src/third_party/asn1/per_decoder.h \ - src/third_party/asn1/per_encoder.h \ - src/third_party/asn1/per_opentype.h \ - src/third_party/asn1/per_support.h \ - src/third_party/asn1/UTF8String.h \ - src/third_party/asn1/xer_decoder.h \ - src/third_party/asn1/xer_encoder.h \ - src/third_party/asn1/xer_support.h \ - src/third_party/asn1/ChatCleanerMessage.h \ - src/third_party/asn1/CleanerChatTypeLobby.h \ - src/third_party/asn1/CleanerChatTypeGame.h \ - src/third_party/asn1/CleanerChatType.h \ - src/third_party/asn1/CleanerInitMessage.h \ - src/third_party/asn1/CleanerInitAckMessage.h \ - src/third_party/asn1/CleanerChatRequestMessage.h \ - src/third_party/asn1/CleanerChatReplyMessage.h -HEADERS += src/third_party/protobuf/pokerth.pb.h -SOURCES += src/third_party/asn1/ChatCleanerMessage.c \ - src/third_party/asn1/CleanerChatTypeLobby.c \ - src/third_party/asn1/CleanerChatTypeGame.c \ - src/third_party/asn1/CleanerChatType.c \ - src/third_party/asn1/CleanerInitMessage.c \ - src/third_party/asn1/CleanerInitAckMessage.c \ - src/third_party/asn1/CleanerChatRequestMessage.c \ - src/third_party/asn1/CleanerChatReplyMessage.c \ - src/third_party/asn1/xer_support.c \ - src/third_party/asn1/xer_encoder.c \ - src/third_party/asn1/xer_decoder.c \ - src/third_party/asn1/UTF8String.c \ - src/third_party/asn1/per_support.c \ - src/third_party/asn1/per_opentype.c \ - src/third_party/asn1/per_encoder.c \ - src/third_party/asn1/per_decoder.c \ - src/third_party/asn1/OCTET_STRING.c \ - src/third_party/asn1/NativeInteger.c \ - src/third_party/asn1/NativeEnumerated.c \ - src/third_party/asn1/INTEGER.c \ - src/third_party/asn1/der_encoder.c \ - src/third_party/asn1/constraints.c \ - src/third_party/asn1/constr_TYPE.c \ - src/third_party/asn1/constr_SET_OF.c \ - src/third_party/asn1/constr_SEQUENCE_OF.c \ - src/third_party/asn1/constr_SEQUENCE.c \ - src/third_party/asn1/constr_CHOICE.c \ - src/third_party/asn1/BOOLEAN.c \ - src/third_party/asn1/BIT_STRING.c \ - src/third_party/asn1/ber_tlv_tag.c \ - src/third_party/asn1/ber_tlv_length.c \ - src/third_party/asn1/ber_decoder.c \ - src/third_party/asn1/asn_SET_OF.c \ - src/third_party/asn1/asn_SEQUENCE_OF.c \ - src/third_party/asn1/asn_codecs_prim.c -SOURCES += src/third_party/protobuf/pokerth.pb.cc -win32 { + +HEADERS += src/third_party/protobuf/pokerth.pb.h \ + src/third_party/protobuf/chatcleaner.pb.h +SOURCES += src/third_party/protobuf/pokerth.pb.cc \ + src/third_party/protobuf/chatcleaner.pb.cc +win32 { DEFINES += CURL_STATICLIB DEFINES += _WIN32_WINNT=0x0501 } unix : !mac { INCLUDEPATH += $${PREFIX}/include system(protoc pokerth.proto --cpp_out=src/third_party/protobuf) + system(protoc chatcleaner.proto --cpp_out=src/third_party/protobuf) system(protoc pokerth.proto --java_out=tests/src) } mac { diff --git a/pokerth_server.pro b/pokerth_server.pro index 822d03e9..7f069fbe 100644 --- a/pokerth_server.pro +++ b/pokerth_server.pro @@ -30,7 +30,6 @@ INCLUDEPATH += . \ src/engine/local_engine \ src/engine/network_engine \ src/config \ - src/third_party/asn1 \ src/core \ DEPENDPATH += . \ diff --git a/src/chatcleaner/cleanerserver.cpp b/src/chatcleaner/cleanerserver.cpp index 3e59f174..c85f5d1d 100644 --- a/src/chatcleaner/cleanerserver.cpp +++ b/src/chatcleaner/cleanerserver.cpp @@ -34,7 +34,8 @@ #include #include #include -#include +#include + #include "messagefilter.h" #include "cleanerconfig.h" @@ -93,23 +94,38 @@ void CleanerServer::onRead() bool error = bytesRead < 1; if (!error) { m_recvBufUsed += bytesRead; - - asn_dec_rval_t retVal; + bool valid; do { - // Try to decode the packets. - InternalChatCleanerPacket recvMsg; - retVal = ber_decode(0, &asn_DEF_ChatCleanerMessage, (void **)recvMsg.GetMsgPtr(), m_recvBuf, m_recvBufUsed); - if(retVal.code == RC_OK) { - if (retVal.consumed < m_recvBufUsed) { - m_recvBufUsed -= retVal.consumed; - memmove(m_recvBuf, m_recvBuf + retVal.consumed, m_recvBufUsed); - } else + valid = false; + if (m_recvBufUsed >= CLEANER_NET_HEADER_SIZE) { + // Read the size of the packet (first 4 bytes in network byte order). + uint32_t nativeVal; + memcpy(&nativeVal, &m_recvBuf[0], sizeof(uint32_t)); + size_t packetSize = ntohl(nativeVal); + if (packetSize > MAX_CLEANER_PACKET_SIZE) { m_recvBufUsed = 0; - - // Handle the packets. - error = handleMessage(recvMsg); + qDebug() << "Invalid packet size: " << packetSize; + } else if (m_recvBufUsed >= packetSize + CLEANER_NET_HEADER_SIZE) { + try { + // Try to decode the packet. + boost::shared_ptr recvMsg(ChatCleanerMessage::default_instance().New()); + if (recvMsg->ParseFromArray(&m_recvBuf[CLEANER_NET_HEADER_SIZE], static_cast(packetSize))) { + m_recvBufUsed -= (packetSize + CLEANER_NET_HEADER_SIZE); + if (m_recvBufUsed) { + memmove(m_recvBuf, m_recvBuf + packetSize + CLEANER_NET_HEADER_SIZE, m_recvBufUsed); + } + } + // Handle the packet. + error = handleMessage(*recvMsg); + valid = true; + } catch (const exception &e) { + // Reset buffer on error. + m_recvBufUsed = 0; + qDebug() << "Exception while decoding packet: " << e.what(); + } + } } - } while (!error && retVal.code == RC_OK); + } while (valid && !error); } if (error) { @@ -131,71 +147,58 @@ void CleanerServer::onRead() tcpSocket->write(checkMessage.toAscii().data(), checkMessage.length());*/ } -bool CleanerServer::handleMessage(InternalChatCleanerPacket &msg) +bool CleanerServer::handleMessage(ChatCleanerMessage &msg) { bool error = true; - if (msg.GetMsg()->present == ChatCleanerMessage_PR_cleanerInitMessage) { - CleanerInitMessage_t *netInit = &msg.GetMsg()->choice.cleanerInitMessage; - if (netInit->requestedVersion == CLEANER_PROTOCOL_VERSION) { - string tmpClientSecret((const char *)netInit->clientSecret.buf, netInit->clientSecret.size); - if (clientSecret == QString::fromStdString(tmpClientSecret)) { + if (msg.messagetype() == ChatCleanerMessage::Type_CleanerInitMessage) { + const CleanerInitMessage &netInit = msg.cleanerinitmessage(); + if (netInit.requestedversion() == CLEANER_PROTOCOL_VERSION) { + if (clientSecret == QString::fromStdString(netInit.clientsecret())) { error = false; - InternalChatCleanerPacket tmpAck; - tmpAck.GetMsg()->present = ChatCleanerMessage_PR_cleanerInitAckMessage; - CleanerInitAckMessage_t *netAck = &tmpAck.GetMsg()->choice.cleanerInitAckMessage; - netAck->serverVersion = CLEANER_PROTOCOL_VERSION; - string tmpServerSecret(serverSecret.toStdString()); - OCTET_STRING_fromBuf(&netAck->serverSecret, - tmpServerSecret.c_str(), - tmpServerSecret.length()); - sendMessageToClient(tmpAck); + boost::shared_ptr tmpAck(ChatCleanerMessage::default_instance().New()); + tmpAck->set_messagetype(ChatCleanerMessage::Type_CleanerInitAckMessage); + CleanerInitAckMessage *netAck = tmpAck->mutable_cleanerinitackmessage(); + netAck->set_serverversion(CLEANER_PROTOCOL_VERSION); + netAck->set_serversecret(serverSecret.toStdString()); + sendMessageToClient(*tmpAck); } else qDebug() << "Invalid client secret."; } else - qDebug() << "Invalid client version: " << netInit->requestedVersion; - } else if (msg.GetMsg()->present == ChatCleanerMessage_PR_cleanerChatRequestMessage) { + qDebug() << "Invalid client version: " << netInit.requestedversion(); + } else if (msg.messagetype() == ChatCleanerMessage::Type_CleanerChatRequestMessage) { error = false; - CleanerChatRequestMessage_t *netRequest = &msg.GetMsg()->choice.cleanerChatRequestMessage; - unsigned playerId = netRequest->playerId; - QString nick(QString::fromUtf8( - string((const char *)netRequest->playerName.buf, netRequest->playerName.size).c_str())); - QString message(QString::fromUtf8( - string((const char *)netRequest->chatMessage.buf, netRequest->chatMessage.size).c_str())); - unsigned gameId = 0; - if (netRequest->cleanerChatType.present == CleanerChatType_PR_cleanerChatTypeGame) { - gameId = netRequest->cleanerChatType.choice.cleanerChatTypeGame.gameId; - } + const CleanerChatRequestMessage &netRequest = msg.cleanerchatrequestmessage(); + unsigned playerId = netRequest.playerid(); + QString nick(QString::fromUtf8(netRequest.playername().c_str())); + QString message(QString::fromUtf8(netRequest.chatmessage().c_str())); + unsigned gameId = netRequest.gameid(); QStringList checkreturn = myMessageFilter->check(gameId, playerId, nick, message); QString checkAction = checkreturn.at(0); QString checkMessage = checkreturn.at(1); if (!checkAction.isEmpty()) { - InternalChatCleanerPacket tmpReply; - tmpReply.GetMsg()->present = ChatCleanerMessage_PR_cleanerChatReplyMessage; - CleanerChatReplyMessage_t *netReply = &tmpReply.GetMsg()->choice.cleanerChatReplyMessage; - netReply->requestId = netRequest->requestId; - netReply->cleanerChatType = netRequest->cleanerChatType; - netReply->playerId = netRequest->playerId; + boost::shared_ptr tmpReply(ChatCleanerMessage::default_instance().New()); + tmpReply->set_messagetype(ChatCleanerMessage::Type_CleanerChatReplyMessage); + CleanerChatReplyMessage *netReply = tmpReply->mutable_cleanerchatreplymessage(); + netReply->set_requestid(netRequest.requestid()); + netReply->set_gameid(netRequest.gameid()); + netReply->set_cleanerchattype(netRequest.cleanerchattype()); + netReply->set_playerid(netRequest.playerid()); if(checkAction == "warn") { - netReply->cleanerActionType = cleanerActionType_cleanerActionWarning; + netReply->set_cleaneractiontype(CleanerChatReplyMessage_CleanerActionType_cleanerActionWarning); } else if (checkAction == "kick") { - netReply->cleanerActionType = cleanerActionType_cleanerActionKick; + netReply->set_cleaneractiontype(CleanerChatReplyMessage_CleanerActionType_cleanerActionKick); } else if (checkAction == "kickban") { - netReply->cleanerActionType = cleanerActionType_cleanerActionBan; + netReply->set_cleaneractiontype(CleanerChatReplyMessage_CleanerActionType_cleanerActionBan); } else if (checkAction == "mute") { - netReply->cleanerActionType = cleanerActionType_cleanerActionMute; + netReply->set_cleaneractiontype(CleanerChatReplyMessage_CleanerActionType_cleanerActionMute); } - string tmpCheck(checkMessage.toUtf8()); - netReply->cleanerText = - OCTET_STRING_new_fromBuf( - &asn_DEF_OCTET_STRING, - (const char *)tmpCheck.c_str(), - tmpCheck.length()); - sendMessageToClient(tmpReply); + netReply->set_cleanertext(checkMessage.toUtf8()); + sendMessageToClient(*tmpReply); } } return error; @@ -220,14 +223,13 @@ void CleanerServer::refreshConfig() myMessageFilter->refreshConfig(); } -void CleanerServer::sendMessageToClient(InternalChatCleanerPacket &msg) +void CleanerServer::sendMessageToClient(ChatCleanerMessage &msg) { - unsigned char buf[MAX_CLEANER_PACKET_SIZE]; - asn_enc_rval_t e = der_encode_to_buffer(&asn_DEF_ChatCleanerMessage, msg.GetMsg(), buf, MAX_CLEANER_PACKET_SIZE); - - if (e.encoded == -1) - qDebug() << "Failed to encode chat cleaner packet: " << msg.GetMsg()->present; - else - tcpSocket->write((const char *)buf, e.encoded); + uint32_t packetSize = msg.ByteSize(); + google::protobuf::uint8 *buf = new google::protobuf::uint8[packetSize + CLEANER_NET_HEADER_SIZE]; + *((uint32_t *)buf) = htonl(packetSize); + msg.SerializeWithCachedSizesToArray(&buf[CLEANER_NET_HEADER_SIZE]); + tcpSocket->write((const char *)buf, packetSize + CLEANER_NET_HEADER_SIZE); + delete[] buf; } diff --git a/src/chatcleaner/cleanerserver.h b/src/chatcleaner/cleanerserver.h index c72fb67f..568dacfa 100644 --- a/src/chatcleaner/cleanerserver.h +++ b/src/chatcleaner/cleanerserver.h @@ -33,10 +33,14 @@ #include #include -#include + +#define CLEANER_NET_HEADER_SIZE 4 +#define MAX_CLEANER_PACKET_SIZE 512 +#define CLEANER_PROTOCOL_VERSION 2 class MessageFilter; class CleanerConfig; +class ChatCleanerMessage; class CleanerServer: public QObject { @@ -49,10 +53,10 @@ public: private slots: void newCon(); void onRead(); - bool handleMessage(InternalChatCleanerPacket &msg); + bool handleMessage(ChatCleanerMessage &msg); void socketStateChanged(QAbstractSocket::SocketState); void refreshConfig(); - void sendMessageToClient(InternalChatCleanerPacket &msg); + void sendMessageToClient(ChatCleanerMessage &msg); private: QTcpServer *tcpServer; @@ -66,7 +70,7 @@ private: QString serverSecret; unsigned char m_recvBuf[2*MAX_CLEANER_PACKET_SIZE]; - unsigned m_recvBufUsed; + size_t m_recvBufUsed; int secondsSinceLastConfigChange; }; diff --git a/src/net/chatcleanermanager.h b/src/net/chatcleanermanager.h index d321741e..6a14d3d3 100644 --- a/src/net/chatcleanermanager.h +++ b/src/net/chatcleanermanager.h @@ -37,9 +37,13 @@ #include #include #include -#include + +#define CLEANER_NET_HEADER_SIZE 4 +#define MAX_CLEANER_PACKET_SIZE 512 +#define CLEANER_PROTOCOL_VERSION 2 class SendBuffer; +class ChatCleanerMessage; class ChatCleanerManager : public boost::enable_shared_from_this { @@ -58,9 +62,9 @@ protected: void HandleResolve(const boost::system::error_code& ec, boost::asio::ip::tcp::resolver::iterator endpoint_iterator); void HandleConnect(const boost::system::error_code& ec, boost::asio::ip::tcp::resolver::iterator endpoint_iterator); void HandleRead(const boost::system::error_code &ec, size_t bytesRead); - bool HandleMessage(InternalChatCleanerPacket &msg); + bool HandleMessage(ChatCleanerMessage &msg); - void SendMessageToServer(InternalChatCleanerPacket &msg); + void SendMessageToServer(ChatCleanerMessage &msg); unsigned GetNextRequestId(); private: diff --git a/src/net/common/chatcleanermanager.cpp b/src/net/common/chatcleanermanager.cpp index bf360c1d..fb6ba8fe 100644 --- a/src/net/common/chatcleanermanager.cpp +++ b/src/net/common/chatcleanermanager.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include @@ -98,24 +98,20 @@ void ChatCleanerManager::HandleGameChatText(unsigned gameId, unsigned playerId, const std::string &name, const std::string &text) { if (m_connected) { - InternalChatCleanerPacket tmpChat; - tmpChat.GetMsg()->present = ChatCleanerMessage_PR_cleanerChatRequestMessage; - CleanerChatRequestMessage_t *netRequest = &tmpChat.GetMsg()->choice.cleanerChatRequestMessage; - netRequest->requestId = GetNextRequestId(); + boost::shared_ptr tmpChat(ChatCleanerMessage::default_instance().New()); + tmpChat->set_messagetype(ChatCleanerMessage::Type_CleanerChatRequestMessage); + CleanerChatRequestMessage *netRequest = tmpChat->mutable_cleanerchatrequestmessage(); + netRequest->set_requestid(GetNextRequestId()); if (gameId) { - netRequest->cleanerChatType.present = CleanerChatType_PR_cleanerChatTypeGame; - netRequest->cleanerChatType.choice.cleanerChatTypeGame.gameId = gameId; + netRequest->set_cleanerchattype(cleanerChatTypeGame); + netRequest->set_gameid(gameId); } else { - netRequest->cleanerChatType.present = CleanerChatType_PR_cleanerChatTypeLobby; + netRequest->set_cleanerchattype(cleanerChatTypeLobby); } - netRequest->playerId = playerId; - OCTET_STRING_fromBuf(&netRequest->playerName, - name.c_str(), - (int)name.length()); - OCTET_STRING_fromBuf(&netRequest->chatMessage, - text.c_str(), - (int)text.length()); - SendMessageToServer(tmpChat); + netRequest->set_playerid(playerId); + netRequest->set_playername(name); + netRequest->set_chatmessage(text); + SendMessageToServer(*tmpChat); } } @@ -141,14 +137,12 @@ ChatCleanerManager::HandleConnect(const boost::system::error_code& ec, boost::asio::ip::tcp::resolver::iterator endpoint_iterator) { if (!ec) { - InternalChatCleanerPacket tmpInit; - tmpInit.GetMsg()->present = ChatCleanerMessage_PR_cleanerInitMessage; - CleanerInitMessage_t *netInit = &tmpInit.GetMsg()->choice.cleanerInitMessage; - netInit->requestedVersion = CLEANER_PROTOCOL_VERSION; - OCTET_STRING_fromBuf(&netInit->clientSecret, - m_clientSecret.c_str(), - (int)m_clientSecret.length()); - SendMessageToServer(tmpInit); + boost::shared_ptr tmpInit(ChatCleanerMessage::default_instance().New()); + tmpInit->set_messagetype(ChatCleanerMessage::Type_CleanerInitMessage); + CleanerInitMessage *netInit = tmpInit->mutable_cleanerinitmessage(); + netInit->set_requestedversion(CLEANER_PROTOCOL_VERSION); + netInit->set_clientsecret(m_clientSecret); + SendMessageToServer(*tmpInit); m_socket->async_read_some( boost::asio::buffer(m_recvBuf, sizeof(m_recvBuf)), boost::bind( @@ -180,24 +174,38 @@ ChatCleanerManager::HandleRead(const boost::system::error_code &ec, size_t bytes bool error = false; m_recvBufUsed += bytesRead; - asn_dec_rval_t retVal; + bool valid; do { - InternalChatCleanerPacket recvMsg; - retVal = ber_decode(0, &asn_DEF_ChatCleanerMessage, (void **)recvMsg.GetMsgPtr(), m_recvBuf, m_recvBufUsed); - if(retVal.code == RC_OK) { - // Consume the bytes. - if (retVal.consumed < m_recvBufUsed) { - m_recvBufUsed -= retVal.consumed; - memmove(m_recvBuf, m_recvBuf + retVal.consumed, m_recvBufUsed); - } else + valid = false; + if (m_recvBufUsed >= CLEANER_NET_HEADER_SIZE) { + // Read the size of the packet (first 4 bytes in network byte order). + uint32_t nativeVal; + memcpy(&nativeVal, &m_recvBuf[0], sizeof(uint32_t)); + size_t packetSize = ntohl(nativeVal); + if (packetSize > MAX_CLEANER_PACKET_SIZE) { m_recvBufUsed = 0; - - if (asn_check_constraints(&asn_DEF_ChatCleanerMessage, recvMsg.GetMsg(), NULL, NULL) == 0) - error = HandleMessage(recvMsg); - else - LOG_ERROR("Received invalid chat cleaner packet."); + LOG_ERROR("Invalid packet size: " << packetSize); + } else if (m_recvBufUsed >= packetSize + CLEANER_NET_HEADER_SIZE) { + try { + // Try to decode the packet. + boost::shared_ptr recvMsg(ChatCleanerMessage::default_instance().New()); + if (recvMsg->ParseFromArray(&m_recvBuf[CLEANER_NET_HEADER_SIZE], static_cast(packetSize))) { + m_recvBufUsed -= (packetSize + CLEANER_NET_HEADER_SIZE); + if (m_recvBufUsed) { + memmove(m_recvBuf, m_recvBuf + packetSize + CLEANER_NET_HEADER_SIZE, m_recvBufUsed); + } + } + // Handle the packet. + error = HandleMessage(*recvMsg); + valid = true; + } catch (const exception &e) { + // Reset buffer on error. + m_recvBufUsed = 0; + LOG_ERROR("Exception while decoding packet: " << e.what()); + } + } } - } while (!error && retVal.code == RC_OK); + } while (valid && !error); if (!error) { m_socket->async_read_some( @@ -224,14 +232,13 @@ ChatCleanerManager::HandleRead(const boost::system::error_code &ec, size_t bytes } bool -ChatCleanerManager::HandleMessage(InternalChatCleanerPacket &msg) +ChatCleanerManager::HandleMessage(ChatCleanerMessage &msg) { bool error = true; - if (msg.GetMsg()->present == ChatCleanerMessage_PR_cleanerInitAckMessage) { - CleanerInitAckMessage_t *netAck = &msg.GetMsg()->choice.cleanerInitAckMessage; - if (netAck->serverVersion == CLEANER_PROTOCOL_VERSION) { - string tmpSecret((const char *)netAck->serverSecret.buf, netAck->serverSecret.size); - if (m_serverSecret == tmpSecret) { + if (msg.messagetype() == ChatCleanerMessage::Type_CleanerInitAckMessage) { + const CleanerInitAckMessage &netAck = msg.cleanerinitackmessage(); + if (netAck.serverversion() == CLEANER_PROTOCOL_VERSION) { + if (m_serverSecret == netAck.serversecret()) { m_connected = true; error = false; LOG_MSG("Successfully connected to chat cleaner."); @@ -239,36 +246,37 @@ ChatCleanerManager::HandleMessage(InternalChatCleanerPacket &msg) } if (!m_connected) LOG_ERROR("Chat cleaner handshake failed."); - } else if (msg.GetMsg()->present == ChatCleanerMessage_PR_cleanerChatReplyMessage) { - CleanerChatReplyMessage_t *netReply = &msg.GetMsg()->choice.cleanerChatReplyMessage; - if (netReply->cleanerText) { - if (netReply->cleanerChatType.present == CleanerChatType_PR_cleanerChatTypeLobby) { - m_callback.SignalChatBotMessage(string((const char *)netReply->cleanerText->buf, netReply->cleanerText->size)); - } else if (netReply->cleanerChatType.present == CleanerChatType_PR_cleanerChatTypeGame) { - m_callback.SignalChatBotMessage(netReply->cleanerChatType.choice.cleanerChatTypeGame.gameId, string((const char *)netReply->cleanerText->buf, netReply->cleanerText->size)); + } else if (msg.messagetype() == ChatCleanerMessage::Type_CleanerChatReplyMessage) { + const CleanerChatReplyMessage &netReply = msg.cleanerchatreplymessage(); + if (!netReply.cleanertext().empty()) { + if (netReply.cleanerchattype() == cleanerChatTypeLobby) { + m_callback.SignalChatBotMessage(netReply.cleanertext()); + } else if (netReply.cleanerchattype() == cleanerChatTypeGame) { + m_callback.SignalChatBotMessage(netReply.gameid(), netReply.cleanertext()); } } - if (netReply->cleanerActionType == cleanerActionType_cleanerActionKick) - m_callback.SignalKickPlayer(netReply->playerId); - else if (netReply->cleanerActionType == cleanerActionType_cleanerActionBan) - m_callback.SignalBanPlayer(netReply->playerId); - else if (netReply->cleanerActionType == cleanerActionType_cleanerActionMute) - m_callback.SignalMutePlayer(netReply->playerId); + if (netReply.cleaneractiontype() == CleanerChatReplyMessage_CleanerActionType_cleanerActionKick) + m_callback.SignalKickPlayer(netReply.playerid()); + else if (netReply.cleaneractiontype() == CleanerChatReplyMessage_CleanerActionType_cleanerActionBan) + m_callback.SignalBanPlayer(netReply.playerid()); + else if (netReply.cleaneractiontype() == CleanerChatReplyMessage_CleanerActionType_cleanerActionMute) + m_callback.SignalMutePlayer(netReply.playerid()); error = false; } return error; } void -ChatCleanerManager::SendMessageToServer(InternalChatCleanerPacket &msg) +ChatCleanerManager::SendMessageToServer(ChatCleanerMessage &msg) { - asn_enc_rval_t e = der_encode(&asn_DEF_ChatCleanerMessage, msg.GetMsg(), &SendBuffer::EncodeToBuf, m_sendManager.get()); + uint32_t packetSize = msg.ByteSize(); + google::protobuf::uint8 *buf = new google::protobuf::uint8[packetSize + CLEANER_NET_HEADER_SIZE]; + *((uint32_t *)buf) = htonl(packetSize); + msg.SerializeWithCachedSizesToArray(&buf[CLEANER_NET_HEADER_SIZE]); + SendBuffer::EncodeToBuf(buf, packetSize + CLEANER_NET_HEADER_SIZE, m_sendManager.get()); + delete[] buf; - if (e.encoded == -1) - LOG_ERROR("Failed to encode chat cleaner packet: " << msg.GetMsg()->present); - else { - m_sendManager->AsyncSendNextPacket(m_socket); - } + m_sendManager->AsyncSendNextPacket(m_socket); } unsigned diff --git a/src/net/common/internalchatcleanerpacket.cpp b/src/net/common/internalchatcleanerpacket.cpp deleted file mode 100644 index f73561ae..00000000 --- a/src/net/common/internalchatcleanerpacket.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************************** - * PokerTH - The open source texas holdem engine * - * Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - * * - * Additional permission under GNU AGPL version 3 section 7 * - * * - * If you modify this program, or any covered work, by linking or * - * combining it with the OpenSSL project's OpenSSL library (or a * - * modified version of that library), containing parts covered by the * - * terms of the OpenSSL or SSLeay licenses, the authors of PokerTH * - * (Felix Hammer, Florian Thauer, Lothar May) grant you additional * - * permission to convey the resulting work. * - * Corresponding Source for a non-source form of such a combination * - * shall include the source code for the parts of OpenSSL used as well * - * as that of the covered work. * - *****************************************************************************/ - -#include -#include -#include - -using namespace std; - -InternalChatCleanerPacket::InternalChatCleanerPacket() -{ - m_msg = (ChatCleanerMessage_t *)calloc(1, sizeof(ChatCleanerMessage_t)); -} - -InternalChatCleanerPacket::~InternalChatCleanerPacket() -{ - ASN_STRUCT_FREE(asn_DEF_ChatCleanerMessage, m_msg); -} - diff --git a/src/net/internalchatcleanerpacket.h b/src/net/internalchatcleanerpacket.h deleted file mode 100644 index 0de52e60..00000000 --- a/src/net/internalchatcleanerpacket.h +++ /dev/null @@ -1,62 +0,0 @@ -/***************************************************************************** - * PokerTH - The open source texas holdem engine * - * Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - * * - * Additional permission under GNU AGPL version 3 section 7 * - * * - * If you modify this program, or any covered work, by linking or * - * combining it with the OpenSSL project's OpenSSL library (or a * - * modified version of that library), containing parts covered by the * - * terms of the OpenSSL or SSLeay licenses, the authors of PokerTH * - * (Felix Hammer, Florian Thauer, Lothar May) grant you additional * - * permission to convey the resulting work. * - * Corresponding Source for a non-source form of such a combination * - * shall include the source code for the parts of OpenSSL used as well * - * as that of the covered work. * - *****************************************************************************/ -/* PokerTH chat cleaner packet. */ - -#ifndef _INTERNALCHATCLEANERPACKET_H_ -#define _INTERNALCHATCLEANERPACKET_H_ - -#define CLEANER_PROTOCOL_VERSION 2 -#define MAX_CLEANER_PACKET_SIZE 384 - -typedef struct ChatCleanerMessage ChatCleanerMessage_t; - -class InternalChatCleanerPacket -{ -public: - InternalChatCleanerPacket(); - - InternalChatCleanerPacket(ChatCleanerMessage_t *msg) - : m_msg(msg) { - } - ~InternalChatCleanerPacket(); - ChatCleanerMessage_t *GetMsg() { - return m_msg; - } - ChatCleanerMessage_t **GetMsgPtr() { - return &m_msg; - } - -private: - ChatCleanerMessage_t *m_msg; -}; - -#endif - diff --git a/src/third_party/protobuf/chatcleaner.pb.cc b/src/third_party/protobuf/chatcleaner.pb.cc new file mode 100644 index 00000000..bc138ee6 --- /dev/null +++ b/src/third_party/protobuf/chatcleaner.pb.cc @@ -0,0 +1,1605 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: chatcleaner.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "chatcleaner.pb.h" + +#include + +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +void protobuf_ShutdownFile_chatcleaner_2eproto() { + delete CleanerInitMessage::default_instance_; + delete CleanerInitAckMessage::default_instance_; + delete CleanerChatRequestMessage::default_instance_; + delete CleanerChatReplyMessage::default_instance_; + delete ChatCleanerMessage::default_instance_; +} + +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER +void protobuf_AddDesc_chatcleaner_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + +#else +void protobuf_AddDesc_chatcleaner_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + +#endif + CleanerInitMessage::default_instance_ = new CleanerInitMessage(); + CleanerInitAckMessage::default_instance_ = new CleanerInitAckMessage(); + CleanerChatRequestMessage::default_instance_ = new CleanerChatRequestMessage(); + CleanerChatReplyMessage::default_instance_ = new CleanerChatReplyMessage(); + ChatCleanerMessage::default_instance_ = new ChatCleanerMessage(); + CleanerInitMessage::default_instance_->InitAsDefaultInstance(); + CleanerInitAckMessage::default_instance_->InitAsDefaultInstance(); + CleanerChatRequestMessage::default_instance_->InitAsDefaultInstance(); + CleanerChatReplyMessage::default_instance_->InitAsDefaultInstance(); + ChatCleanerMessage::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_chatcleaner_2eproto); +} + +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_chatcleaner_2eproto_once_); +void protobuf_AddDesc_chatcleaner_2eproto() { + ::google::protobuf::::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_chatcleaner_2eproto_once_, + &protobuf_AddDesc_chatcleaner_2eproto_impl); +} +#else +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_chatcleaner_2eproto { + StaticDescriptorInitializer_chatcleaner_2eproto() { + protobuf_AddDesc_chatcleaner_2eproto(); + } +} static_descriptor_initializer_chatcleaner_2eproto_; +#endif +bool CleanerChatType_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CleanerInitMessage::kRequestedVersionFieldNumber; +const int CleanerInitMessage::kClientSecretFieldNumber; +#endif // !_MSC_VER + +CleanerInitMessage::CleanerInitMessage() + : ::google::protobuf::MessageLite() { + SharedCtor(); +} + +void CleanerInitMessage::InitAsDefaultInstance() { +} + +CleanerInitMessage::CleanerInitMessage(const CleanerInitMessage& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); +} + +void CleanerInitMessage::SharedCtor() { + _cached_size_ = 0; + requestedversion_ = 0u; + clientsecret_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CleanerInitMessage::~CleanerInitMessage() { + SharedDtor(); +} + +void CleanerInitMessage::SharedDtor() { + if (clientsecret_ != &::google::protobuf::internal::kEmptyString) { + delete clientsecret_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void CleanerInitMessage::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const CleanerInitMessage& CleanerInitMessage::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chatcleaner_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chatcleaner_2eproto(); +#endif + return *default_instance_; +} + +CleanerInitMessage* CleanerInitMessage::default_instance_ = NULL; + +CleanerInitMessage* CleanerInitMessage::New() const { + return new CleanerInitMessage; +} + +void CleanerInitMessage::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + requestedversion_ = 0u; + if (has_clientsecret()) { + if (clientsecret_ != &::google::protobuf::internal::kEmptyString) { + clientsecret_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +bool CleanerInitMessage::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required uint32 requestedVersion = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &requestedversion_))); + set_has_requestedversion(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_clientSecret; + break; + } + + // required string clientSecret = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_clientSecret: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_clientsecret())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } + return true; +#undef DO_ +} + +void CleanerInitMessage::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required uint32 requestedVersion = 1; + if (has_requestedversion()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->requestedversion(), output); + } + + // required string clientSecret = 2; + if (has_clientsecret()) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->clientsecret(), output); + } + +} + +int CleanerInitMessage::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 requestedVersion = 1; + if (has_requestedversion()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->requestedversion()); + } + + // required string clientSecret = 2; + if (has_clientsecret()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->clientsecret()); + } + + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CleanerInitMessage::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void CleanerInitMessage::MergeFrom(const CleanerInitMessage& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_requestedversion()) { + set_requestedversion(from.requestedversion()); + } + if (from.has_clientsecret()) { + set_clientsecret(from.clientsecret()); + } + } +} + +void CleanerInitMessage::CopyFrom(const CleanerInitMessage& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CleanerInitMessage::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void CleanerInitMessage::Swap(CleanerInitMessage* other) { + if (other != this) { + std::swap(requestedversion_, other->requestedversion_); + std::swap(clientsecret_, other->clientsecret_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string CleanerInitMessage::GetTypeName() const { + return "CleanerInitMessage"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CleanerInitAckMessage::kServerVersionFieldNumber; +const int CleanerInitAckMessage::kServerSecretFieldNumber; +#endif // !_MSC_VER + +CleanerInitAckMessage::CleanerInitAckMessage() + : ::google::protobuf::MessageLite() { + SharedCtor(); +} + +void CleanerInitAckMessage::InitAsDefaultInstance() { +} + +CleanerInitAckMessage::CleanerInitAckMessage(const CleanerInitAckMessage& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); +} + +void CleanerInitAckMessage::SharedCtor() { + _cached_size_ = 0; + serverversion_ = 0u; + serversecret_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CleanerInitAckMessage::~CleanerInitAckMessage() { + SharedDtor(); +} + +void CleanerInitAckMessage::SharedDtor() { + if (serversecret_ != &::google::protobuf::internal::kEmptyString) { + delete serversecret_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void CleanerInitAckMessage::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const CleanerInitAckMessage& CleanerInitAckMessage::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chatcleaner_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chatcleaner_2eproto(); +#endif + return *default_instance_; +} + +CleanerInitAckMessage* CleanerInitAckMessage::default_instance_ = NULL; + +CleanerInitAckMessage* CleanerInitAckMessage::New() const { + return new CleanerInitAckMessage; +} + +void CleanerInitAckMessage::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + serverversion_ = 0u; + if (has_serversecret()) { + if (serversecret_ != &::google::protobuf::internal::kEmptyString) { + serversecret_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +bool CleanerInitAckMessage::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required uint32 serverVersion = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &serverversion_))); + set_has_serverversion(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_serverSecret; + break; + } + + // required string serverSecret = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_serverSecret: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_serversecret())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } + return true; +#undef DO_ +} + +void CleanerInitAckMessage::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required uint32 serverVersion = 1; + if (has_serverversion()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->serverversion(), output); + } + + // required string serverSecret = 2; + if (has_serversecret()) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->serversecret(), output); + } + +} + +int CleanerInitAckMessage::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 serverVersion = 1; + if (has_serverversion()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->serverversion()); + } + + // required string serverSecret = 2; + if (has_serversecret()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->serversecret()); + } + + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CleanerInitAckMessage::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void CleanerInitAckMessage::MergeFrom(const CleanerInitAckMessage& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_serverversion()) { + set_serverversion(from.serverversion()); + } + if (from.has_serversecret()) { + set_serversecret(from.serversecret()); + } + } +} + +void CleanerInitAckMessage::CopyFrom(const CleanerInitAckMessage& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CleanerInitAckMessage::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void CleanerInitAckMessage::Swap(CleanerInitAckMessage* other) { + if (other != this) { + std::swap(serverversion_, other->serverversion_); + std::swap(serversecret_, other->serversecret_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string CleanerInitAckMessage::GetTypeName() const { + return "CleanerInitAckMessage"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CleanerChatRequestMessage::kRequestIdFieldNumber; +const int CleanerChatRequestMessage::kCleanerChatTypeFieldNumber; +const int CleanerChatRequestMessage::kGameIdFieldNumber; +const int CleanerChatRequestMessage::kPlayerIdFieldNumber; +const int CleanerChatRequestMessage::kPlayerNameFieldNumber; +const int CleanerChatRequestMessage::kChatMessageFieldNumber; +#endif // !_MSC_VER + +CleanerChatRequestMessage::CleanerChatRequestMessage() + : ::google::protobuf::MessageLite() { + SharedCtor(); +} + +void CleanerChatRequestMessage::InitAsDefaultInstance() { +} + +CleanerChatRequestMessage::CleanerChatRequestMessage(const CleanerChatRequestMessage& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); +} + +void CleanerChatRequestMessage::SharedCtor() { + _cached_size_ = 0; + requestid_ = 0u; + cleanerchattype_ = 0; + gameid_ = 0u; + playerid_ = 0u; + playername_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + chatmessage_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CleanerChatRequestMessage::~CleanerChatRequestMessage() { + SharedDtor(); +} + +void CleanerChatRequestMessage::SharedDtor() { + if (playername_ != &::google::protobuf::internal::kEmptyString) { + delete playername_; + } + if (chatmessage_ != &::google::protobuf::internal::kEmptyString) { + delete chatmessage_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void CleanerChatRequestMessage::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const CleanerChatRequestMessage& CleanerChatRequestMessage::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chatcleaner_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chatcleaner_2eproto(); +#endif + return *default_instance_; +} + +CleanerChatRequestMessage* CleanerChatRequestMessage::default_instance_ = NULL; + +CleanerChatRequestMessage* CleanerChatRequestMessage::New() const { + return new CleanerChatRequestMessage; +} + +void CleanerChatRequestMessage::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + requestid_ = 0u; + cleanerchattype_ = 0; + gameid_ = 0u; + playerid_ = 0u; + if (has_playername()) { + if (playername_ != &::google::protobuf::internal::kEmptyString) { + playername_->clear(); + } + } + if (has_chatmessage()) { + if (chatmessage_ != &::google::protobuf::internal::kEmptyString) { + chatmessage_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +bool CleanerChatRequestMessage::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required uint32 requestId = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &requestid_))); + set_has_requestid(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(16)) goto parse_cleanerChatType; + break; + } + + // required .CleanerChatType cleanerChatType = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_cleanerChatType: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::CleanerChatType_IsValid(value)) { + set_cleanerchattype(static_cast< ::CleanerChatType >(value)); + } + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(24)) goto parse_gameId; + break; + } + + // optional uint32 gameId = 3 [default = 0]; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_gameId: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &gameid_))); + set_has_gameid(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(32)) goto parse_playerId; + break; + } + + // required uint32 playerId = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_playerId: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &playerid_))); + set_has_playerid(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(42)) goto parse_playerName; + break; + } + + // required string playerName = 5; + case 5: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_playerName: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_playername())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(50)) goto parse_chatMessage; + break; + } + + // required string chatMessage = 6; + case 6: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_chatMessage: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_chatmessage())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } + return true; +#undef DO_ +} + +void CleanerChatRequestMessage::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required uint32 requestId = 1; + if (has_requestid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->requestid(), output); + } + + // required .CleanerChatType cleanerChatType = 2; + if (has_cleanerchattype()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->cleanerchattype(), output); + } + + // optional uint32 gameId = 3 [default = 0]; + if (has_gameid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->gameid(), output); + } + + // required uint32 playerId = 4; + if (has_playerid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->playerid(), output); + } + + // required string playerName = 5; + if (has_playername()) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 5, this->playername(), output); + } + + // required string chatMessage = 6; + if (has_chatmessage()) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 6, this->chatmessage(), output); + } + +} + +int CleanerChatRequestMessage::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 requestId = 1; + if (has_requestid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->requestid()); + } + + // required .CleanerChatType cleanerChatType = 2; + if (has_cleanerchattype()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->cleanerchattype()); + } + + // optional uint32 gameId = 3 [default = 0]; + if (has_gameid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->gameid()); + } + + // required uint32 playerId = 4; + if (has_playerid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->playerid()); + } + + // required string playerName = 5; + if (has_playername()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->playername()); + } + + // required string chatMessage = 6; + if (has_chatmessage()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->chatmessage()); + } + + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CleanerChatRequestMessage::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void CleanerChatRequestMessage::MergeFrom(const CleanerChatRequestMessage& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_requestid()) { + set_requestid(from.requestid()); + } + if (from.has_cleanerchattype()) { + set_cleanerchattype(from.cleanerchattype()); + } + if (from.has_gameid()) { + set_gameid(from.gameid()); + } + if (from.has_playerid()) { + set_playerid(from.playerid()); + } + if (from.has_playername()) { + set_playername(from.playername()); + } + if (from.has_chatmessage()) { + set_chatmessage(from.chatmessage()); + } + } +} + +void CleanerChatRequestMessage::CopyFrom(const CleanerChatRequestMessage& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CleanerChatRequestMessage::IsInitialized() const { + if ((_has_bits_[0] & 0x0000003b) != 0x0000003b) return false; + + return true; +} + +void CleanerChatRequestMessage::Swap(CleanerChatRequestMessage* other) { + if (other != this) { + std::swap(requestid_, other->requestid_); + std::swap(cleanerchattype_, other->cleanerchattype_); + std::swap(gameid_, other->gameid_); + std::swap(playerid_, other->playerid_); + std::swap(playername_, other->playername_); + std::swap(chatmessage_, other->chatmessage_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string CleanerChatRequestMessage::GetTypeName() const { + return "CleanerChatRequestMessage"; +} + + +// =================================================================== + +bool CleanerChatReplyMessage_CleanerActionType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage::cleanerActionNone; +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage::cleanerActionWarning; +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage::cleanerActionKick; +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage::cleanerActionBan; +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage::cleanerActionMute; +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage::CleanerActionType_MIN; +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage::CleanerActionType_MAX; +const int CleanerChatReplyMessage::CleanerActionType_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int CleanerChatReplyMessage::kRequestIdFieldNumber; +const int CleanerChatReplyMessage::kCleanerChatTypeFieldNumber; +const int CleanerChatReplyMessage::kGameIdFieldNumber; +const int CleanerChatReplyMessage::kPlayerIdFieldNumber; +const int CleanerChatReplyMessage::kCleanerActionTypeFieldNumber; +const int CleanerChatReplyMessage::kCleanerTextFieldNumber; +#endif // !_MSC_VER + +CleanerChatReplyMessage::CleanerChatReplyMessage() + : ::google::protobuf::MessageLite() { + SharedCtor(); +} + +void CleanerChatReplyMessage::InitAsDefaultInstance() { +} + +CleanerChatReplyMessage::CleanerChatReplyMessage(const CleanerChatReplyMessage& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); +} + +void CleanerChatReplyMessage::SharedCtor() { + _cached_size_ = 0; + requestid_ = 0u; + cleanerchattype_ = 0; + gameid_ = 0u; + playerid_ = 0u; + cleaneractiontype_ = 0; + cleanertext_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CleanerChatReplyMessage::~CleanerChatReplyMessage() { + SharedDtor(); +} + +void CleanerChatReplyMessage::SharedDtor() { + if (cleanertext_ != &::google::protobuf::internal::kEmptyString) { + delete cleanertext_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void CleanerChatReplyMessage::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const CleanerChatReplyMessage& CleanerChatReplyMessage::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chatcleaner_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chatcleaner_2eproto(); +#endif + return *default_instance_; +} + +CleanerChatReplyMessage* CleanerChatReplyMessage::default_instance_ = NULL; + +CleanerChatReplyMessage* CleanerChatReplyMessage::New() const { + return new CleanerChatReplyMessage; +} + +void CleanerChatReplyMessage::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + requestid_ = 0u; + cleanerchattype_ = 0; + gameid_ = 0u; + playerid_ = 0u; + cleaneractiontype_ = 0; + if (has_cleanertext()) { + if (cleanertext_ != &::google::protobuf::internal::kEmptyString) { + cleanertext_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +bool CleanerChatReplyMessage::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required uint32 requestId = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &requestid_))); + set_has_requestid(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(16)) goto parse_cleanerChatType; + break; + } + + // required .CleanerChatType cleanerChatType = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_cleanerChatType: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::CleanerChatType_IsValid(value)) { + set_cleanerchattype(static_cast< ::CleanerChatType >(value)); + } + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(24)) goto parse_gameId; + break; + } + + // optional uint32 gameId = 3 [default = 0]; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_gameId: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &gameid_))); + set_has_gameid(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(32)) goto parse_playerId; + break; + } + + // required uint32 playerId = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_playerId: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &playerid_))); + set_has_playerid(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(40)) goto parse_cleanerActionType; + break; + } + + // required .CleanerChatReplyMessage.CleanerActionType cleanerActionType = 5; + case 5: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_cleanerActionType: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::CleanerChatReplyMessage_CleanerActionType_IsValid(value)) { + set_cleaneractiontype(static_cast< ::CleanerChatReplyMessage_CleanerActionType >(value)); + } + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(50)) goto parse_cleanerText; + break; + } + + // optional string cleanerText = 6 [default = ""]; + case 6: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_cleanerText: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_cleanertext())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } + return true; +#undef DO_ +} + +void CleanerChatReplyMessage::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required uint32 requestId = 1; + if (has_requestid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->requestid(), output); + } + + // required .CleanerChatType cleanerChatType = 2; + if (has_cleanerchattype()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->cleanerchattype(), output); + } + + // optional uint32 gameId = 3 [default = 0]; + if (has_gameid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->gameid(), output); + } + + // required uint32 playerId = 4; + if (has_playerid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->playerid(), output); + } + + // required .CleanerChatReplyMessage.CleanerActionType cleanerActionType = 5; + if (has_cleaneractiontype()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->cleaneractiontype(), output); + } + + // optional string cleanerText = 6 [default = ""]; + if (has_cleanertext()) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 6, this->cleanertext(), output); + } + +} + +int CleanerChatReplyMessage::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 requestId = 1; + if (has_requestid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->requestid()); + } + + // required .CleanerChatType cleanerChatType = 2; + if (has_cleanerchattype()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->cleanerchattype()); + } + + // optional uint32 gameId = 3 [default = 0]; + if (has_gameid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->gameid()); + } + + // required uint32 playerId = 4; + if (has_playerid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->playerid()); + } + + // required .CleanerChatReplyMessage.CleanerActionType cleanerActionType = 5; + if (has_cleaneractiontype()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->cleaneractiontype()); + } + + // optional string cleanerText = 6 [default = ""]; + if (has_cleanertext()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->cleanertext()); + } + + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CleanerChatReplyMessage::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void CleanerChatReplyMessage::MergeFrom(const CleanerChatReplyMessage& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_requestid()) { + set_requestid(from.requestid()); + } + if (from.has_cleanerchattype()) { + set_cleanerchattype(from.cleanerchattype()); + } + if (from.has_gameid()) { + set_gameid(from.gameid()); + } + if (from.has_playerid()) { + set_playerid(from.playerid()); + } + if (from.has_cleaneractiontype()) { + set_cleaneractiontype(from.cleaneractiontype()); + } + if (from.has_cleanertext()) { + set_cleanertext(from.cleanertext()); + } + } +} + +void CleanerChatReplyMessage::CopyFrom(const CleanerChatReplyMessage& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CleanerChatReplyMessage::IsInitialized() const { + if ((_has_bits_[0] & 0x0000001b) != 0x0000001b) return false; + + return true; +} + +void CleanerChatReplyMessage::Swap(CleanerChatReplyMessage* other) { + if (other != this) { + std::swap(requestid_, other->requestid_); + std::swap(cleanerchattype_, other->cleanerchattype_); + std::swap(gameid_, other->gameid_); + std::swap(playerid_, other->playerid_); + std::swap(cleaneractiontype_, other->cleaneractiontype_); + std::swap(cleanertext_, other->cleanertext_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string CleanerChatReplyMessage::GetTypeName() const { + return "CleanerChatReplyMessage"; +} + + +// =================================================================== + +bool ChatCleanerMessage_ChatCleanerMessageType_IsValid(int value) { + switch(value) { + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage::Type_CleanerInitMessage; +const ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage::Type_CleanerInitAckMessage; +const ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage::Type_CleanerChatRequestMessage; +const ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage::Type_CleanerChatReplyMessage; +const ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage::ChatCleanerMessageType_MIN; +const ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage::ChatCleanerMessageType_MAX; +const int ChatCleanerMessage::ChatCleanerMessageType_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ChatCleanerMessage::kMessageTypeFieldNumber; +const int ChatCleanerMessage::kCleanerInitMessageFieldNumber; +const int ChatCleanerMessage::kCleanerInitAckMessageFieldNumber; +const int ChatCleanerMessage::kCleanerChatRequestMessageFieldNumber; +const int ChatCleanerMessage::kCleanerChatReplyMessageFieldNumber; +#endif // !_MSC_VER + +ChatCleanerMessage::ChatCleanerMessage() + : ::google::protobuf::MessageLite() { + SharedCtor(); +} + +void ChatCleanerMessage::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + cleanerinitmessage_ = const_cast< ::CleanerInitMessage*>( + ::CleanerInitMessage::internal_default_instance()); +#else + cleanerinitmessage_ = const_cast< ::CleanerInitMessage*>(&::CleanerInitMessage::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + cleanerinitackmessage_ = const_cast< ::CleanerInitAckMessage*>( + ::CleanerInitAckMessage::internal_default_instance()); +#else + cleanerinitackmessage_ = const_cast< ::CleanerInitAckMessage*>(&::CleanerInitAckMessage::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + cleanerchatrequestmessage_ = const_cast< ::CleanerChatRequestMessage*>( + ::CleanerChatRequestMessage::internal_default_instance()); +#else + cleanerchatrequestmessage_ = const_cast< ::CleanerChatRequestMessage*>(&::CleanerChatRequestMessage::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + cleanerchatreplymessage_ = const_cast< ::CleanerChatReplyMessage*>( + ::CleanerChatReplyMessage::internal_default_instance()); +#else + cleanerchatreplymessage_ = const_cast< ::CleanerChatReplyMessage*>(&::CleanerChatReplyMessage::default_instance()); +#endif +} + +ChatCleanerMessage::ChatCleanerMessage(const ChatCleanerMessage& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); +} + +void ChatCleanerMessage::SharedCtor() { + _cached_size_ = 0; + messagetype_ = 1; + cleanerinitmessage_ = NULL; + cleanerinitackmessage_ = NULL; + cleanerchatrequestmessage_ = NULL; + cleanerchatreplymessage_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ChatCleanerMessage::~ChatCleanerMessage() { + SharedDtor(); +} + +void ChatCleanerMessage::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete cleanerinitmessage_; + delete cleanerinitackmessage_; + delete cleanerchatrequestmessage_; + delete cleanerchatreplymessage_; + } +} + +void ChatCleanerMessage::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ChatCleanerMessage& ChatCleanerMessage::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chatcleaner_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chatcleaner_2eproto(); +#endif + return *default_instance_; +} + +ChatCleanerMessage* ChatCleanerMessage::default_instance_ = NULL; + +ChatCleanerMessage* ChatCleanerMessage::New() const { + return new ChatCleanerMessage; +} + +void ChatCleanerMessage::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + messagetype_ = 1; + if (has_cleanerinitmessage()) { + if (cleanerinitmessage_ != NULL) cleanerinitmessage_->::CleanerInitMessage::Clear(); + } + if (has_cleanerinitackmessage()) { + if (cleanerinitackmessage_ != NULL) cleanerinitackmessage_->::CleanerInitAckMessage::Clear(); + } + if (has_cleanerchatrequestmessage()) { + if (cleanerchatrequestmessage_ != NULL) cleanerchatrequestmessage_->::CleanerChatRequestMessage::Clear(); + } + if (has_cleanerchatreplymessage()) { + if (cleanerchatreplymessage_ != NULL) cleanerchatreplymessage_->::CleanerChatReplyMessage::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +bool ChatCleanerMessage::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .ChatCleanerMessage.ChatCleanerMessageType messageType = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::ChatCleanerMessage_ChatCleanerMessageType_IsValid(value)) { + set_messagetype(static_cast< ::ChatCleanerMessage_ChatCleanerMessageType >(value)); + } + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_cleanerInitMessage; + break; + } + + // optional .CleanerInitMessage cleanerInitMessage = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_cleanerInitMessage: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_cleanerinitmessage())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(26)) goto parse_cleanerInitAckMessage; + break; + } + + // optional .CleanerInitAckMessage cleanerInitAckMessage = 3; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_cleanerInitAckMessage: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_cleanerinitackmessage())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_cleanerChatRequestMessage; + break; + } + + // optional .CleanerChatRequestMessage cleanerChatRequestMessage = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_cleanerChatRequestMessage: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_cleanerchatrequestmessage())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(42)) goto parse_cleanerChatReplyMessage; + break; + } + + // optional .CleanerChatReplyMessage cleanerChatReplyMessage = 5; + case 5: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_cleanerChatReplyMessage: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_cleanerchatreplymessage())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } + return true; +#undef DO_ +} + +void ChatCleanerMessage::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required .ChatCleanerMessage.ChatCleanerMessageType messageType = 1; + if (has_messagetype()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->messagetype(), output); + } + + // optional .CleanerInitMessage cleanerInitMessage = 2; + if (has_cleanerinitmessage()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->cleanerinitmessage(), output); + } + + // optional .CleanerInitAckMessage cleanerInitAckMessage = 3; + if (has_cleanerinitackmessage()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->cleanerinitackmessage(), output); + } + + // optional .CleanerChatRequestMessage cleanerChatRequestMessage = 4; + if (has_cleanerchatrequestmessage()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->cleanerchatrequestmessage(), output); + } + + // optional .CleanerChatReplyMessage cleanerChatReplyMessage = 5; + if (has_cleanerchatreplymessage()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->cleanerchatreplymessage(), output); + } + +} + +int ChatCleanerMessage::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .ChatCleanerMessage.ChatCleanerMessageType messageType = 1; + if (has_messagetype()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->messagetype()); + } + + // optional .CleanerInitMessage cleanerInitMessage = 2; + if (has_cleanerinitmessage()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->cleanerinitmessage()); + } + + // optional .CleanerInitAckMessage cleanerInitAckMessage = 3; + if (has_cleanerinitackmessage()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->cleanerinitackmessage()); + } + + // optional .CleanerChatRequestMessage cleanerChatRequestMessage = 4; + if (has_cleanerchatrequestmessage()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->cleanerchatrequestmessage()); + } + + // optional .CleanerChatReplyMessage cleanerChatReplyMessage = 5; + if (has_cleanerchatreplymessage()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->cleanerchatreplymessage()); + } + + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ChatCleanerMessage::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ChatCleanerMessage::MergeFrom(const ChatCleanerMessage& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_messagetype()) { + set_messagetype(from.messagetype()); + } + if (from.has_cleanerinitmessage()) { + mutable_cleanerinitmessage()->::CleanerInitMessage::MergeFrom(from.cleanerinitmessage()); + } + if (from.has_cleanerinitackmessage()) { + mutable_cleanerinitackmessage()->::CleanerInitAckMessage::MergeFrom(from.cleanerinitackmessage()); + } + if (from.has_cleanerchatrequestmessage()) { + mutable_cleanerchatrequestmessage()->::CleanerChatRequestMessage::MergeFrom(from.cleanerchatrequestmessage()); + } + if (from.has_cleanerchatreplymessage()) { + mutable_cleanerchatreplymessage()->::CleanerChatReplyMessage::MergeFrom(from.cleanerchatreplymessage()); + } + } +} + +void ChatCleanerMessage::CopyFrom(const ChatCleanerMessage& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ChatCleanerMessage::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + if (has_cleanerinitmessage()) { + if (!this->cleanerinitmessage().IsInitialized()) return false; + } + if (has_cleanerinitackmessage()) { + if (!this->cleanerinitackmessage().IsInitialized()) return false; + } + if (has_cleanerchatrequestmessage()) { + if (!this->cleanerchatrequestmessage().IsInitialized()) return false; + } + if (has_cleanerchatreplymessage()) { + if (!this->cleanerchatreplymessage().IsInitialized()) return false; + } + return true; +} + +void ChatCleanerMessage::Swap(ChatCleanerMessage* other) { + if (other != this) { + std::swap(messagetype_, other->messagetype_); + std::swap(cleanerinitmessage_, other->cleanerinitmessage_); + std::swap(cleanerinitackmessage_, other->cleanerinitackmessage_); + std::swap(cleanerchatrequestmessage_, other->cleanerchatrequestmessage_); + std::swap(cleanerchatreplymessage_, other->cleanerchatreplymessage_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ChatCleanerMessage::GetTypeName() const { + return "ChatCleanerMessage"; +} + + +// @@protoc_insertion_point(namespace_scope) + +// @@protoc_insertion_point(global_scope) diff --git a/src/third_party/protobuf/chatcleaner.pb.h b/src/third_party/protobuf/chatcleaner.pb.h new file mode 100644 index 00000000..37dce473 --- /dev/null +++ b/src/third_party/protobuf/chatcleaner.pb.h @@ -0,0 +1,1524 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: chatcleaner.proto + +#ifndef PROTOBUF_chatcleaner_2eproto__INCLUDED +#define PROTOBUF_chatcleaner_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 2005000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_chatcleaner_2eproto(); +void protobuf_AssignDesc_chatcleaner_2eproto(); +void protobuf_ShutdownFile_chatcleaner_2eproto(); + +class CleanerInitMessage; +class CleanerInitAckMessage; +class CleanerChatRequestMessage; +class CleanerChatReplyMessage; +class ChatCleanerMessage; + +enum CleanerChatReplyMessage_CleanerActionType { + CleanerChatReplyMessage_CleanerActionType_cleanerActionNone = 0, + CleanerChatReplyMessage_CleanerActionType_cleanerActionWarning = 1, + CleanerChatReplyMessage_CleanerActionType_cleanerActionKick = 2, + CleanerChatReplyMessage_CleanerActionType_cleanerActionBan = 3, + CleanerChatReplyMessage_CleanerActionType_cleanerActionMute = 4 +}; +bool CleanerChatReplyMessage_CleanerActionType_IsValid(int value); +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage_CleanerActionType_CleanerActionType_MIN = CleanerChatReplyMessage_CleanerActionType_cleanerActionNone; +const CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage_CleanerActionType_CleanerActionType_MAX = CleanerChatReplyMessage_CleanerActionType_cleanerActionMute; +const int CleanerChatReplyMessage_CleanerActionType_CleanerActionType_ARRAYSIZE = CleanerChatReplyMessage_CleanerActionType_CleanerActionType_MAX + 1; + +enum ChatCleanerMessage_ChatCleanerMessageType { + ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerInitMessage = 1, + ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerInitAckMessage = 2, + ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerChatRequestMessage = 3, + ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerChatReplyMessage = 4 +}; +bool ChatCleanerMessage_ChatCleanerMessageType_IsValid(int value); +const ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage_ChatCleanerMessageType_ChatCleanerMessageType_MIN = ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerInitMessage; +const ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage_ChatCleanerMessageType_ChatCleanerMessageType_MAX = ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerChatReplyMessage; +const int ChatCleanerMessage_ChatCleanerMessageType_ChatCleanerMessageType_ARRAYSIZE = ChatCleanerMessage_ChatCleanerMessageType_ChatCleanerMessageType_MAX + 1; + +enum CleanerChatType { + cleanerChatTypeLobby = 0, + cleanerChatTypeGame = 1 +}; +bool CleanerChatType_IsValid(int value); +const CleanerChatType CleanerChatType_MIN = cleanerChatTypeLobby; +const CleanerChatType CleanerChatType_MAX = cleanerChatTypeGame; +const int CleanerChatType_ARRAYSIZE = CleanerChatType_MAX + 1; + +// =================================================================== + +class CleanerInitMessage : public ::google::protobuf::MessageLite { + public: + CleanerInitMessage(); + virtual ~CleanerInitMessage(); + + CleanerInitMessage(const CleanerInitMessage& from); + + inline CleanerInitMessage& operator=(const CleanerInitMessage& from) { + CopyFrom(from); + return *this; + } + + static const CleanerInitMessage& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const CleanerInitMessage* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(CleanerInitMessage* other); + + // implements Message ---------------------------------------------- + + CleanerInitMessage* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const CleanerInitMessage& from); + void MergeFrom(const CleanerInitMessage& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 requestedVersion = 1; + inline bool has_requestedversion() const; + inline void clear_requestedversion(); + static const int kRequestedVersionFieldNumber = 1; + inline ::google::protobuf::uint32 requestedversion() const; + inline void set_requestedversion(::google::protobuf::uint32 value); + + // required string clientSecret = 2; + inline bool has_clientsecret() const; + inline void clear_clientsecret(); + static const int kClientSecretFieldNumber = 2; + inline const ::std::string& clientsecret() const; + inline void set_clientsecret(const ::std::string& value); + inline void set_clientsecret(const char* value); + inline void set_clientsecret(const char* value, size_t size); + inline ::std::string* mutable_clientsecret(); + inline ::std::string* release_clientsecret(); + inline void set_allocated_clientsecret(::std::string* clientsecret); + + // @@protoc_insertion_point(class_scope:CleanerInitMessage) + private: + inline void set_has_requestedversion(); + inline void clear_has_requestedversion(); + inline void set_has_clientsecret(); + inline void clear_has_clientsecret(); + + ::std::string* clientsecret_; + ::google::protobuf::uint32 requestedversion_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chatcleaner_2eproto_impl(); + #else + friend void protobuf_AddDesc_chatcleaner_2eproto(); + #endif + friend void protobuf_AssignDesc_chatcleaner_2eproto(); + friend void protobuf_ShutdownFile_chatcleaner_2eproto(); + + void InitAsDefaultInstance(); + static CleanerInitMessage* default_instance_; +}; +// ------------------------------------------------------------------- + +class CleanerInitAckMessage : public ::google::protobuf::MessageLite { + public: + CleanerInitAckMessage(); + virtual ~CleanerInitAckMessage(); + + CleanerInitAckMessage(const CleanerInitAckMessage& from); + + inline CleanerInitAckMessage& operator=(const CleanerInitAckMessage& from) { + CopyFrom(from); + return *this; + } + + static const CleanerInitAckMessage& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const CleanerInitAckMessage* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(CleanerInitAckMessage* other); + + // implements Message ---------------------------------------------- + + CleanerInitAckMessage* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const CleanerInitAckMessage& from); + void MergeFrom(const CleanerInitAckMessage& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 serverVersion = 1; + inline bool has_serverversion() const; + inline void clear_serverversion(); + static const int kServerVersionFieldNumber = 1; + inline ::google::protobuf::uint32 serverversion() const; + inline void set_serverversion(::google::protobuf::uint32 value); + + // required string serverSecret = 2; + inline bool has_serversecret() const; + inline void clear_serversecret(); + static const int kServerSecretFieldNumber = 2; + inline const ::std::string& serversecret() const; + inline void set_serversecret(const ::std::string& value); + inline void set_serversecret(const char* value); + inline void set_serversecret(const char* value, size_t size); + inline ::std::string* mutable_serversecret(); + inline ::std::string* release_serversecret(); + inline void set_allocated_serversecret(::std::string* serversecret); + + // @@protoc_insertion_point(class_scope:CleanerInitAckMessage) + private: + inline void set_has_serverversion(); + inline void clear_has_serverversion(); + inline void set_has_serversecret(); + inline void clear_has_serversecret(); + + ::std::string* serversecret_; + ::google::protobuf::uint32 serverversion_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chatcleaner_2eproto_impl(); + #else + friend void protobuf_AddDesc_chatcleaner_2eproto(); + #endif + friend void protobuf_AssignDesc_chatcleaner_2eproto(); + friend void protobuf_ShutdownFile_chatcleaner_2eproto(); + + void InitAsDefaultInstance(); + static CleanerInitAckMessage* default_instance_; +}; +// ------------------------------------------------------------------- + +class CleanerChatRequestMessage : public ::google::protobuf::MessageLite { + public: + CleanerChatRequestMessage(); + virtual ~CleanerChatRequestMessage(); + + CleanerChatRequestMessage(const CleanerChatRequestMessage& from); + + inline CleanerChatRequestMessage& operator=(const CleanerChatRequestMessage& from) { + CopyFrom(from); + return *this; + } + + static const CleanerChatRequestMessage& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const CleanerChatRequestMessage* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(CleanerChatRequestMessage* other); + + // implements Message ---------------------------------------------- + + CleanerChatRequestMessage* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const CleanerChatRequestMessage& from); + void MergeFrom(const CleanerChatRequestMessage& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 requestId = 1; + inline bool has_requestid() const; + inline void clear_requestid(); + static const int kRequestIdFieldNumber = 1; + inline ::google::protobuf::uint32 requestid() const; + inline void set_requestid(::google::protobuf::uint32 value); + + // required .CleanerChatType cleanerChatType = 2; + inline bool has_cleanerchattype() const; + inline void clear_cleanerchattype(); + static const int kCleanerChatTypeFieldNumber = 2; + inline ::CleanerChatType cleanerchattype() const; + inline void set_cleanerchattype(::CleanerChatType value); + + // optional uint32 gameId = 3 [default = 0]; + inline bool has_gameid() const; + inline void clear_gameid(); + static const int kGameIdFieldNumber = 3; + inline ::google::protobuf::uint32 gameid() const; + inline void set_gameid(::google::protobuf::uint32 value); + + // required uint32 playerId = 4; + inline bool has_playerid() const; + inline void clear_playerid(); + static const int kPlayerIdFieldNumber = 4; + inline ::google::protobuf::uint32 playerid() const; + inline void set_playerid(::google::protobuf::uint32 value); + + // required string playerName = 5; + inline bool has_playername() const; + inline void clear_playername(); + static const int kPlayerNameFieldNumber = 5; + inline const ::std::string& playername() const; + inline void set_playername(const ::std::string& value); + inline void set_playername(const char* value); + inline void set_playername(const char* value, size_t size); + inline ::std::string* mutable_playername(); + inline ::std::string* release_playername(); + inline void set_allocated_playername(::std::string* playername); + + // required string chatMessage = 6; + inline bool has_chatmessage() const; + inline void clear_chatmessage(); + static const int kChatMessageFieldNumber = 6; + inline const ::std::string& chatmessage() const; + inline void set_chatmessage(const ::std::string& value); + inline void set_chatmessage(const char* value); + inline void set_chatmessage(const char* value, size_t size); + inline ::std::string* mutable_chatmessage(); + inline ::std::string* release_chatmessage(); + inline void set_allocated_chatmessage(::std::string* chatmessage); + + // @@protoc_insertion_point(class_scope:CleanerChatRequestMessage) + private: + inline void set_has_requestid(); + inline void clear_has_requestid(); + inline void set_has_cleanerchattype(); + inline void clear_has_cleanerchattype(); + inline void set_has_gameid(); + inline void clear_has_gameid(); + inline void set_has_playerid(); + inline void clear_has_playerid(); + inline void set_has_playername(); + inline void clear_has_playername(); + inline void set_has_chatmessage(); + inline void clear_has_chatmessage(); + + ::google::protobuf::uint32 requestid_; + int cleanerchattype_; + ::google::protobuf::uint32 gameid_; + ::google::protobuf::uint32 playerid_; + ::std::string* playername_; + ::std::string* chatmessage_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(6 + 31) / 32]; + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chatcleaner_2eproto_impl(); + #else + friend void protobuf_AddDesc_chatcleaner_2eproto(); + #endif + friend void protobuf_AssignDesc_chatcleaner_2eproto(); + friend void protobuf_ShutdownFile_chatcleaner_2eproto(); + + void InitAsDefaultInstance(); + static CleanerChatRequestMessage* default_instance_; +}; +// ------------------------------------------------------------------- + +class CleanerChatReplyMessage : public ::google::protobuf::MessageLite { + public: + CleanerChatReplyMessage(); + virtual ~CleanerChatReplyMessage(); + + CleanerChatReplyMessage(const CleanerChatReplyMessage& from); + + inline CleanerChatReplyMessage& operator=(const CleanerChatReplyMessage& from) { + CopyFrom(from); + return *this; + } + + static const CleanerChatReplyMessage& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const CleanerChatReplyMessage* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(CleanerChatReplyMessage* other); + + // implements Message ---------------------------------------------- + + CleanerChatReplyMessage* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const CleanerChatReplyMessage& from); + void MergeFrom(const CleanerChatReplyMessage& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef CleanerChatReplyMessage_CleanerActionType CleanerActionType; + static const CleanerActionType cleanerActionNone = CleanerChatReplyMessage_CleanerActionType_cleanerActionNone; + static const CleanerActionType cleanerActionWarning = CleanerChatReplyMessage_CleanerActionType_cleanerActionWarning; + static const CleanerActionType cleanerActionKick = CleanerChatReplyMessage_CleanerActionType_cleanerActionKick; + static const CleanerActionType cleanerActionBan = CleanerChatReplyMessage_CleanerActionType_cleanerActionBan; + static const CleanerActionType cleanerActionMute = CleanerChatReplyMessage_CleanerActionType_cleanerActionMute; + static inline bool CleanerActionType_IsValid(int value) { + return CleanerChatReplyMessage_CleanerActionType_IsValid(value); + } + static const CleanerActionType CleanerActionType_MIN = + CleanerChatReplyMessage_CleanerActionType_CleanerActionType_MIN; + static const CleanerActionType CleanerActionType_MAX = + CleanerChatReplyMessage_CleanerActionType_CleanerActionType_MAX; + static const int CleanerActionType_ARRAYSIZE = + CleanerChatReplyMessage_CleanerActionType_CleanerActionType_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // required uint32 requestId = 1; + inline bool has_requestid() const; + inline void clear_requestid(); + static const int kRequestIdFieldNumber = 1; + inline ::google::protobuf::uint32 requestid() const; + inline void set_requestid(::google::protobuf::uint32 value); + + // required .CleanerChatType cleanerChatType = 2; + inline bool has_cleanerchattype() const; + inline void clear_cleanerchattype(); + static const int kCleanerChatTypeFieldNumber = 2; + inline ::CleanerChatType cleanerchattype() const; + inline void set_cleanerchattype(::CleanerChatType value); + + // optional uint32 gameId = 3 [default = 0]; + inline bool has_gameid() const; + inline void clear_gameid(); + static const int kGameIdFieldNumber = 3; + inline ::google::protobuf::uint32 gameid() const; + inline void set_gameid(::google::protobuf::uint32 value); + + // required uint32 playerId = 4; + inline bool has_playerid() const; + inline void clear_playerid(); + static const int kPlayerIdFieldNumber = 4; + inline ::google::protobuf::uint32 playerid() const; + inline void set_playerid(::google::protobuf::uint32 value); + + // required .CleanerChatReplyMessage.CleanerActionType cleanerActionType = 5; + inline bool has_cleaneractiontype() const; + inline void clear_cleaneractiontype(); + static const int kCleanerActionTypeFieldNumber = 5; + inline ::CleanerChatReplyMessage_CleanerActionType cleaneractiontype() const; + inline void set_cleaneractiontype(::CleanerChatReplyMessage_CleanerActionType value); + + // optional string cleanerText = 6 [default = ""]; + inline bool has_cleanertext() const; + inline void clear_cleanertext(); + static const int kCleanerTextFieldNumber = 6; + inline const ::std::string& cleanertext() const; + inline void set_cleanertext(const ::std::string& value); + inline void set_cleanertext(const char* value); + inline void set_cleanertext(const char* value, size_t size); + inline ::std::string* mutable_cleanertext(); + inline ::std::string* release_cleanertext(); + inline void set_allocated_cleanertext(::std::string* cleanertext); + + // @@protoc_insertion_point(class_scope:CleanerChatReplyMessage) + private: + inline void set_has_requestid(); + inline void clear_has_requestid(); + inline void set_has_cleanerchattype(); + inline void clear_has_cleanerchattype(); + inline void set_has_gameid(); + inline void clear_has_gameid(); + inline void set_has_playerid(); + inline void clear_has_playerid(); + inline void set_has_cleaneractiontype(); + inline void clear_has_cleaneractiontype(); + inline void set_has_cleanertext(); + inline void clear_has_cleanertext(); + + ::google::protobuf::uint32 requestid_; + int cleanerchattype_; + ::google::protobuf::uint32 gameid_; + ::google::protobuf::uint32 playerid_; + ::std::string* cleanertext_; + int cleaneractiontype_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(6 + 31) / 32]; + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chatcleaner_2eproto_impl(); + #else + friend void protobuf_AddDesc_chatcleaner_2eproto(); + #endif + friend void protobuf_AssignDesc_chatcleaner_2eproto(); + friend void protobuf_ShutdownFile_chatcleaner_2eproto(); + + void InitAsDefaultInstance(); + static CleanerChatReplyMessage* default_instance_; +}; +// ------------------------------------------------------------------- + +class ChatCleanerMessage : public ::google::protobuf::MessageLite { + public: + ChatCleanerMessage(); + virtual ~ChatCleanerMessage(); + + ChatCleanerMessage(const ChatCleanerMessage& from); + + inline ChatCleanerMessage& operator=(const ChatCleanerMessage& from) { + CopyFrom(from); + return *this; + } + + static const ChatCleanerMessage& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ChatCleanerMessage* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ChatCleanerMessage* other); + + // implements Message ---------------------------------------------- + + ChatCleanerMessage* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ChatCleanerMessage& from); + void MergeFrom(const ChatCleanerMessage& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessageType; + static const ChatCleanerMessageType Type_CleanerInitMessage = ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerInitMessage; + static const ChatCleanerMessageType Type_CleanerInitAckMessage = ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerInitAckMessage; + static const ChatCleanerMessageType Type_CleanerChatRequestMessage = ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerChatRequestMessage; + static const ChatCleanerMessageType Type_CleanerChatReplyMessage = ChatCleanerMessage_ChatCleanerMessageType_Type_CleanerChatReplyMessage; + static inline bool ChatCleanerMessageType_IsValid(int value) { + return ChatCleanerMessage_ChatCleanerMessageType_IsValid(value); + } + static const ChatCleanerMessageType ChatCleanerMessageType_MIN = + ChatCleanerMessage_ChatCleanerMessageType_ChatCleanerMessageType_MIN; + static const ChatCleanerMessageType ChatCleanerMessageType_MAX = + ChatCleanerMessage_ChatCleanerMessageType_ChatCleanerMessageType_MAX; + static const int ChatCleanerMessageType_ARRAYSIZE = + ChatCleanerMessage_ChatCleanerMessageType_ChatCleanerMessageType_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // required .ChatCleanerMessage.ChatCleanerMessageType messageType = 1; + inline bool has_messagetype() const; + inline void clear_messagetype(); + static const int kMessageTypeFieldNumber = 1; + inline ::ChatCleanerMessage_ChatCleanerMessageType messagetype() const; + inline void set_messagetype(::ChatCleanerMessage_ChatCleanerMessageType value); + + // optional .CleanerInitMessage cleanerInitMessage = 2; + inline bool has_cleanerinitmessage() const; + inline void clear_cleanerinitmessage(); + static const int kCleanerInitMessageFieldNumber = 2; + inline const ::CleanerInitMessage& cleanerinitmessage() const; + inline ::CleanerInitMessage* mutable_cleanerinitmessage(); + inline ::CleanerInitMessage* release_cleanerinitmessage(); + inline void set_allocated_cleanerinitmessage(::CleanerInitMessage* cleanerinitmessage); + + // optional .CleanerInitAckMessage cleanerInitAckMessage = 3; + inline bool has_cleanerinitackmessage() const; + inline void clear_cleanerinitackmessage(); + static const int kCleanerInitAckMessageFieldNumber = 3; + inline const ::CleanerInitAckMessage& cleanerinitackmessage() const; + inline ::CleanerInitAckMessage* mutable_cleanerinitackmessage(); + inline ::CleanerInitAckMessage* release_cleanerinitackmessage(); + inline void set_allocated_cleanerinitackmessage(::CleanerInitAckMessage* cleanerinitackmessage); + + // optional .CleanerChatRequestMessage cleanerChatRequestMessage = 4; + inline bool has_cleanerchatrequestmessage() const; + inline void clear_cleanerchatrequestmessage(); + static const int kCleanerChatRequestMessageFieldNumber = 4; + inline const ::CleanerChatRequestMessage& cleanerchatrequestmessage() const; + inline ::CleanerChatRequestMessage* mutable_cleanerchatrequestmessage(); + inline ::CleanerChatRequestMessage* release_cleanerchatrequestmessage(); + inline void set_allocated_cleanerchatrequestmessage(::CleanerChatRequestMessage* cleanerchatrequestmessage); + + // optional .CleanerChatReplyMessage cleanerChatReplyMessage = 5; + inline bool has_cleanerchatreplymessage() const; + inline void clear_cleanerchatreplymessage(); + static const int kCleanerChatReplyMessageFieldNumber = 5; + inline const ::CleanerChatReplyMessage& cleanerchatreplymessage() const; + inline ::CleanerChatReplyMessage* mutable_cleanerchatreplymessage(); + inline ::CleanerChatReplyMessage* release_cleanerchatreplymessage(); + inline void set_allocated_cleanerchatreplymessage(::CleanerChatReplyMessage* cleanerchatreplymessage); + + // @@protoc_insertion_point(class_scope:ChatCleanerMessage) + private: + inline void set_has_messagetype(); + inline void clear_has_messagetype(); + inline void set_has_cleanerinitmessage(); + inline void clear_has_cleanerinitmessage(); + inline void set_has_cleanerinitackmessage(); + inline void clear_has_cleanerinitackmessage(); + inline void set_has_cleanerchatrequestmessage(); + inline void clear_has_cleanerchatrequestmessage(); + inline void set_has_cleanerchatreplymessage(); + inline void clear_has_cleanerchatreplymessage(); + + ::CleanerInitMessage* cleanerinitmessage_; + ::CleanerInitAckMessage* cleanerinitackmessage_; + ::CleanerChatRequestMessage* cleanerchatrequestmessage_; + ::CleanerChatReplyMessage* cleanerchatreplymessage_; + int messagetype_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32]; + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chatcleaner_2eproto_impl(); + #else + friend void protobuf_AddDesc_chatcleaner_2eproto(); + #endif + friend void protobuf_AssignDesc_chatcleaner_2eproto(); + friend void protobuf_ShutdownFile_chatcleaner_2eproto(); + + void InitAsDefaultInstance(); + static ChatCleanerMessage* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +// CleanerInitMessage + +// required uint32 requestedVersion = 1; +inline bool CleanerInitMessage::has_requestedversion() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CleanerInitMessage::set_has_requestedversion() { + _has_bits_[0] |= 0x00000001u; +} +inline void CleanerInitMessage::clear_has_requestedversion() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CleanerInitMessage::clear_requestedversion() { + requestedversion_ = 0u; + clear_has_requestedversion(); +} +inline ::google::protobuf::uint32 CleanerInitMessage::requestedversion() const { + return requestedversion_; +} +inline void CleanerInitMessage::set_requestedversion(::google::protobuf::uint32 value) { + set_has_requestedversion(); + requestedversion_ = value; +} + +// required string clientSecret = 2; +inline bool CleanerInitMessage::has_clientsecret() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CleanerInitMessage::set_has_clientsecret() { + _has_bits_[0] |= 0x00000002u; +} +inline void CleanerInitMessage::clear_has_clientsecret() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CleanerInitMessage::clear_clientsecret() { + if (clientsecret_ != &::google::protobuf::internal::kEmptyString) { + clientsecret_->clear(); + } + clear_has_clientsecret(); +} +inline const ::std::string& CleanerInitMessage::clientsecret() const { + return *clientsecret_; +} +inline void CleanerInitMessage::set_clientsecret(const ::std::string& value) { + set_has_clientsecret(); + if (clientsecret_ == &::google::protobuf::internal::kEmptyString) { + clientsecret_ = new ::std::string; + } + clientsecret_->assign(value); +} +inline void CleanerInitMessage::set_clientsecret(const char* value) { + set_has_clientsecret(); + if (clientsecret_ == &::google::protobuf::internal::kEmptyString) { + clientsecret_ = new ::std::string; + } + clientsecret_->assign(value); +} +inline void CleanerInitMessage::set_clientsecret(const char* value, size_t size) { + set_has_clientsecret(); + if (clientsecret_ == &::google::protobuf::internal::kEmptyString) { + clientsecret_ = new ::std::string; + } + clientsecret_->assign(reinterpret_cast(value), size); +} +inline ::std::string* CleanerInitMessage::mutable_clientsecret() { + set_has_clientsecret(); + if (clientsecret_ == &::google::protobuf::internal::kEmptyString) { + clientsecret_ = new ::std::string; + } + return clientsecret_; +} +inline ::std::string* CleanerInitMessage::release_clientsecret() { + clear_has_clientsecret(); + if (clientsecret_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = clientsecret_; + clientsecret_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void CleanerInitMessage::set_allocated_clientsecret(::std::string* clientsecret) { + if (clientsecret_ != &::google::protobuf::internal::kEmptyString) { + delete clientsecret_; + } + if (clientsecret) { + set_has_clientsecret(); + clientsecret_ = clientsecret; + } else { + clear_has_clientsecret(); + clientsecret_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } +} + +// ------------------------------------------------------------------- + +// CleanerInitAckMessage + +// required uint32 serverVersion = 1; +inline bool CleanerInitAckMessage::has_serverversion() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CleanerInitAckMessage::set_has_serverversion() { + _has_bits_[0] |= 0x00000001u; +} +inline void CleanerInitAckMessage::clear_has_serverversion() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CleanerInitAckMessage::clear_serverversion() { + serverversion_ = 0u; + clear_has_serverversion(); +} +inline ::google::protobuf::uint32 CleanerInitAckMessage::serverversion() const { + return serverversion_; +} +inline void CleanerInitAckMessage::set_serverversion(::google::protobuf::uint32 value) { + set_has_serverversion(); + serverversion_ = value; +} + +// required string serverSecret = 2; +inline bool CleanerInitAckMessage::has_serversecret() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CleanerInitAckMessage::set_has_serversecret() { + _has_bits_[0] |= 0x00000002u; +} +inline void CleanerInitAckMessage::clear_has_serversecret() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CleanerInitAckMessage::clear_serversecret() { + if (serversecret_ != &::google::protobuf::internal::kEmptyString) { + serversecret_->clear(); + } + clear_has_serversecret(); +} +inline const ::std::string& CleanerInitAckMessage::serversecret() const { + return *serversecret_; +} +inline void CleanerInitAckMessage::set_serversecret(const ::std::string& value) { + set_has_serversecret(); + if (serversecret_ == &::google::protobuf::internal::kEmptyString) { + serversecret_ = new ::std::string; + } + serversecret_->assign(value); +} +inline void CleanerInitAckMessage::set_serversecret(const char* value) { + set_has_serversecret(); + if (serversecret_ == &::google::protobuf::internal::kEmptyString) { + serversecret_ = new ::std::string; + } + serversecret_->assign(value); +} +inline void CleanerInitAckMessage::set_serversecret(const char* value, size_t size) { + set_has_serversecret(); + if (serversecret_ == &::google::protobuf::internal::kEmptyString) { + serversecret_ = new ::std::string; + } + serversecret_->assign(reinterpret_cast(value), size); +} +inline ::std::string* CleanerInitAckMessage::mutable_serversecret() { + set_has_serversecret(); + if (serversecret_ == &::google::protobuf::internal::kEmptyString) { + serversecret_ = new ::std::string; + } + return serversecret_; +} +inline ::std::string* CleanerInitAckMessage::release_serversecret() { + clear_has_serversecret(); + if (serversecret_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = serversecret_; + serversecret_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void CleanerInitAckMessage::set_allocated_serversecret(::std::string* serversecret) { + if (serversecret_ != &::google::protobuf::internal::kEmptyString) { + delete serversecret_; + } + if (serversecret) { + set_has_serversecret(); + serversecret_ = serversecret; + } else { + clear_has_serversecret(); + serversecret_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } +} + +// ------------------------------------------------------------------- + +// CleanerChatRequestMessage + +// required uint32 requestId = 1; +inline bool CleanerChatRequestMessage::has_requestid() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CleanerChatRequestMessage::set_has_requestid() { + _has_bits_[0] |= 0x00000001u; +} +inline void CleanerChatRequestMessage::clear_has_requestid() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CleanerChatRequestMessage::clear_requestid() { + requestid_ = 0u; + clear_has_requestid(); +} +inline ::google::protobuf::uint32 CleanerChatRequestMessage::requestid() const { + return requestid_; +} +inline void CleanerChatRequestMessage::set_requestid(::google::protobuf::uint32 value) { + set_has_requestid(); + requestid_ = value; +} + +// required .CleanerChatType cleanerChatType = 2; +inline bool CleanerChatRequestMessage::has_cleanerchattype() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CleanerChatRequestMessage::set_has_cleanerchattype() { + _has_bits_[0] |= 0x00000002u; +} +inline void CleanerChatRequestMessage::clear_has_cleanerchattype() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CleanerChatRequestMessage::clear_cleanerchattype() { + cleanerchattype_ = 0; + clear_has_cleanerchattype(); +} +inline ::CleanerChatType CleanerChatRequestMessage::cleanerchattype() const { + return static_cast< ::CleanerChatType >(cleanerchattype_); +} +inline void CleanerChatRequestMessage::set_cleanerchattype(::CleanerChatType value) { + assert(::CleanerChatType_IsValid(value)); + set_has_cleanerchattype(); + cleanerchattype_ = value; +} + +// optional uint32 gameId = 3 [default = 0]; +inline bool CleanerChatRequestMessage::has_gameid() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void CleanerChatRequestMessage::set_has_gameid() { + _has_bits_[0] |= 0x00000004u; +} +inline void CleanerChatRequestMessage::clear_has_gameid() { + _has_bits_[0] &= ~0x00000004u; +} +inline void CleanerChatRequestMessage::clear_gameid() { + gameid_ = 0u; + clear_has_gameid(); +} +inline ::google::protobuf::uint32 CleanerChatRequestMessage::gameid() const { + return gameid_; +} +inline void CleanerChatRequestMessage::set_gameid(::google::protobuf::uint32 value) { + set_has_gameid(); + gameid_ = value; +} + +// required uint32 playerId = 4; +inline bool CleanerChatRequestMessage::has_playerid() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void CleanerChatRequestMessage::set_has_playerid() { + _has_bits_[0] |= 0x00000008u; +} +inline void CleanerChatRequestMessage::clear_has_playerid() { + _has_bits_[0] &= ~0x00000008u; +} +inline void CleanerChatRequestMessage::clear_playerid() { + playerid_ = 0u; + clear_has_playerid(); +} +inline ::google::protobuf::uint32 CleanerChatRequestMessage::playerid() const { + return playerid_; +} +inline void CleanerChatRequestMessage::set_playerid(::google::protobuf::uint32 value) { + set_has_playerid(); + playerid_ = value; +} + +// required string playerName = 5; +inline bool CleanerChatRequestMessage::has_playername() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void CleanerChatRequestMessage::set_has_playername() { + _has_bits_[0] |= 0x00000010u; +} +inline void CleanerChatRequestMessage::clear_has_playername() { + _has_bits_[0] &= ~0x00000010u; +} +inline void CleanerChatRequestMessage::clear_playername() { + if (playername_ != &::google::protobuf::internal::kEmptyString) { + playername_->clear(); + } + clear_has_playername(); +} +inline const ::std::string& CleanerChatRequestMessage::playername() const { + return *playername_; +} +inline void CleanerChatRequestMessage::set_playername(const ::std::string& value) { + set_has_playername(); + if (playername_ == &::google::protobuf::internal::kEmptyString) { + playername_ = new ::std::string; + } + playername_->assign(value); +} +inline void CleanerChatRequestMessage::set_playername(const char* value) { + set_has_playername(); + if (playername_ == &::google::protobuf::internal::kEmptyString) { + playername_ = new ::std::string; + } + playername_->assign(value); +} +inline void CleanerChatRequestMessage::set_playername(const char* value, size_t size) { + set_has_playername(); + if (playername_ == &::google::protobuf::internal::kEmptyString) { + playername_ = new ::std::string; + } + playername_->assign(reinterpret_cast(value), size); +} +inline ::std::string* CleanerChatRequestMessage::mutable_playername() { + set_has_playername(); + if (playername_ == &::google::protobuf::internal::kEmptyString) { + playername_ = new ::std::string; + } + return playername_; +} +inline ::std::string* CleanerChatRequestMessage::release_playername() { + clear_has_playername(); + if (playername_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = playername_; + playername_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void CleanerChatRequestMessage::set_allocated_playername(::std::string* playername) { + if (playername_ != &::google::protobuf::internal::kEmptyString) { + delete playername_; + } + if (playername) { + set_has_playername(); + playername_ = playername; + } else { + clear_has_playername(); + playername_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } +} + +// required string chatMessage = 6; +inline bool CleanerChatRequestMessage::has_chatmessage() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void CleanerChatRequestMessage::set_has_chatmessage() { + _has_bits_[0] |= 0x00000020u; +} +inline void CleanerChatRequestMessage::clear_has_chatmessage() { + _has_bits_[0] &= ~0x00000020u; +} +inline void CleanerChatRequestMessage::clear_chatmessage() { + if (chatmessage_ != &::google::protobuf::internal::kEmptyString) { + chatmessage_->clear(); + } + clear_has_chatmessage(); +} +inline const ::std::string& CleanerChatRequestMessage::chatmessage() const { + return *chatmessage_; +} +inline void CleanerChatRequestMessage::set_chatmessage(const ::std::string& value) { + set_has_chatmessage(); + if (chatmessage_ == &::google::protobuf::internal::kEmptyString) { + chatmessage_ = new ::std::string; + } + chatmessage_->assign(value); +} +inline void CleanerChatRequestMessage::set_chatmessage(const char* value) { + set_has_chatmessage(); + if (chatmessage_ == &::google::protobuf::internal::kEmptyString) { + chatmessage_ = new ::std::string; + } + chatmessage_->assign(value); +} +inline void CleanerChatRequestMessage::set_chatmessage(const char* value, size_t size) { + set_has_chatmessage(); + if (chatmessage_ == &::google::protobuf::internal::kEmptyString) { + chatmessage_ = new ::std::string; + } + chatmessage_->assign(reinterpret_cast(value), size); +} +inline ::std::string* CleanerChatRequestMessage::mutable_chatmessage() { + set_has_chatmessage(); + if (chatmessage_ == &::google::protobuf::internal::kEmptyString) { + chatmessage_ = new ::std::string; + } + return chatmessage_; +} +inline ::std::string* CleanerChatRequestMessage::release_chatmessage() { + clear_has_chatmessage(); + if (chatmessage_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = chatmessage_; + chatmessage_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void CleanerChatRequestMessage::set_allocated_chatmessage(::std::string* chatmessage) { + if (chatmessage_ != &::google::protobuf::internal::kEmptyString) { + delete chatmessage_; + } + if (chatmessage) { + set_has_chatmessage(); + chatmessage_ = chatmessage; + } else { + clear_has_chatmessage(); + chatmessage_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } +} + +// ------------------------------------------------------------------- + +// CleanerChatReplyMessage + +// required uint32 requestId = 1; +inline bool CleanerChatReplyMessage::has_requestid() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CleanerChatReplyMessage::set_has_requestid() { + _has_bits_[0] |= 0x00000001u; +} +inline void CleanerChatReplyMessage::clear_has_requestid() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CleanerChatReplyMessage::clear_requestid() { + requestid_ = 0u; + clear_has_requestid(); +} +inline ::google::protobuf::uint32 CleanerChatReplyMessage::requestid() const { + return requestid_; +} +inline void CleanerChatReplyMessage::set_requestid(::google::protobuf::uint32 value) { + set_has_requestid(); + requestid_ = value; +} + +// required .CleanerChatType cleanerChatType = 2; +inline bool CleanerChatReplyMessage::has_cleanerchattype() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CleanerChatReplyMessage::set_has_cleanerchattype() { + _has_bits_[0] |= 0x00000002u; +} +inline void CleanerChatReplyMessage::clear_has_cleanerchattype() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CleanerChatReplyMessage::clear_cleanerchattype() { + cleanerchattype_ = 0; + clear_has_cleanerchattype(); +} +inline ::CleanerChatType CleanerChatReplyMessage::cleanerchattype() const { + return static_cast< ::CleanerChatType >(cleanerchattype_); +} +inline void CleanerChatReplyMessage::set_cleanerchattype(::CleanerChatType value) { + assert(::CleanerChatType_IsValid(value)); + set_has_cleanerchattype(); + cleanerchattype_ = value; +} + +// optional uint32 gameId = 3 [default = 0]; +inline bool CleanerChatReplyMessage::has_gameid() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void CleanerChatReplyMessage::set_has_gameid() { + _has_bits_[0] |= 0x00000004u; +} +inline void CleanerChatReplyMessage::clear_has_gameid() { + _has_bits_[0] &= ~0x00000004u; +} +inline void CleanerChatReplyMessage::clear_gameid() { + gameid_ = 0u; + clear_has_gameid(); +} +inline ::google::protobuf::uint32 CleanerChatReplyMessage::gameid() const { + return gameid_; +} +inline void CleanerChatReplyMessage::set_gameid(::google::protobuf::uint32 value) { + set_has_gameid(); + gameid_ = value; +} + +// required uint32 playerId = 4; +inline bool CleanerChatReplyMessage::has_playerid() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void CleanerChatReplyMessage::set_has_playerid() { + _has_bits_[0] |= 0x00000008u; +} +inline void CleanerChatReplyMessage::clear_has_playerid() { + _has_bits_[0] &= ~0x00000008u; +} +inline void CleanerChatReplyMessage::clear_playerid() { + playerid_ = 0u; + clear_has_playerid(); +} +inline ::google::protobuf::uint32 CleanerChatReplyMessage::playerid() const { + return playerid_; +} +inline void CleanerChatReplyMessage::set_playerid(::google::protobuf::uint32 value) { + set_has_playerid(); + playerid_ = value; +} + +// required .CleanerChatReplyMessage.CleanerActionType cleanerActionType = 5; +inline bool CleanerChatReplyMessage::has_cleaneractiontype() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void CleanerChatReplyMessage::set_has_cleaneractiontype() { + _has_bits_[0] |= 0x00000010u; +} +inline void CleanerChatReplyMessage::clear_has_cleaneractiontype() { + _has_bits_[0] &= ~0x00000010u; +} +inline void CleanerChatReplyMessage::clear_cleaneractiontype() { + cleaneractiontype_ = 0; + clear_has_cleaneractiontype(); +} +inline ::CleanerChatReplyMessage_CleanerActionType CleanerChatReplyMessage::cleaneractiontype() const { + return static_cast< ::CleanerChatReplyMessage_CleanerActionType >(cleaneractiontype_); +} +inline void CleanerChatReplyMessage::set_cleaneractiontype(::CleanerChatReplyMessage_CleanerActionType value) { + assert(::CleanerChatReplyMessage_CleanerActionType_IsValid(value)); + set_has_cleaneractiontype(); + cleaneractiontype_ = value; +} + +// optional string cleanerText = 6 [default = ""]; +inline bool CleanerChatReplyMessage::has_cleanertext() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void CleanerChatReplyMessage::set_has_cleanertext() { + _has_bits_[0] |= 0x00000020u; +} +inline void CleanerChatReplyMessage::clear_has_cleanertext() { + _has_bits_[0] &= ~0x00000020u; +} +inline void CleanerChatReplyMessage::clear_cleanertext() { + if (cleanertext_ != &::google::protobuf::internal::kEmptyString) { + cleanertext_->clear(); + } + clear_has_cleanertext(); +} +inline const ::std::string& CleanerChatReplyMessage::cleanertext() const { + return *cleanertext_; +} +inline void CleanerChatReplyMessage::set_cleanertext(const ::std::string& value) { + set_has_cleanertext(); + if (cleanertext_ == &::google::protobuf::internal::kEmptyString) { + cleanertext_ = new ::std::string; + } + cleanertext_->assign(value); +} +inline void CleanerChatReplyMessage::set_cleanertext(const char* value) { + set_has_cleanertext(); + if (cleanertext_ == &::google::protobuf::internal::kEmptyString) { + cleanertext_ = new ::std::string; + } + cleanertext_->assign(value); +} +inline void CleanerChatReplyMessage::set_cleanertext(const char* value, size_t size) { + set_has_cleanertext(); + if (cleanertext_ == &::google::protobuf::internal::kEmptyString) { + cleanertext_ = new ::std::string; + } + cleanertext_->assign(reinterpret_cast(value), size); +} +inline ::std::string* CleanerChatReplyMessage::mutable_cleanertext() { + set_has_cleanertext(); + if (cleanertext_ == &::google::protobuf::internal::kEmptyString) { + cleanertext_ = new ::std::string; + } + return cleanertext_; +} +inline ::std::string* CleanerChatReplyMessage::release_cleanertext() { + clear_has_cleanertext(); + if (cleanertext_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = cleanertext_; + cleanertext_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void CleanerChatReplyMessage::set_allocated_cleanertext(::std::string* cleanertext) { + if (cleanertext_ != &::google::protobuf::internal::kEmptyString) { + delete cleanertext_; + } + if (cleanertext) { + set_has_cleanertext(); + cleanertext_ = cleanertext; + } else { + clear_has_cleanertext(); + cleanertext_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } +} + +// ------------------------------------------------------------------- + +// ChatCleanerMessage + +// required .ChatCleanerMessage.ChatCleanerMessageType messageType = 1; +inline bool ChatCleanerMessage::has_messagetype() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ChatCleanerMessage::set_has_messagetype() { + _has_bits_[0] |= 0x00000001u; +} +inline void ChatCleanerMessage::clear_has_messagetype() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ChatCleanerMessage::clear_messagetype() { + messagetype_ = 1; + clear_has_messagetype(); +} +inline ::ChatCleanerMessage_ChatCleanerMessageType ChatCleanerMessage::messagetype() const { + return static_cast< ::ChatCleanerMessage_ChatCleanerMessageType >(messagetype_); +} +inline void ChatCleanerMessage::set_messagetype(::ChatCleanerMessage_ChatCleanerMessageType value) { + assert(::ChatCleanerMessage_ChatCleanerMessageType_IsValid(value)); + set_has_messagetype(); + messagetype_ = value; +} + +// optional .CleanerInitMessage cleanerInitMessage = 2; +inline bool ChatCleanerMessage::has_cleanerinitmessage() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ChatCleanerMessage::set_has_cleanerinitmessage() { + _has_bits_[0] |= 0x00000002u; +} +inline void ChatCleanerMessage::clear_has_cleanerinitmessage() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ChatCleanerMessage::clear_cleanerinitmessage() { + if (cleanerinitmessage_ != NULL) cleanerinitmessage_->::CleanerInitMessage::Clear(); + clear_has_cleanerinitmessage(); +} +inline const ::CleanerInitMessage& ChatCleanerMessage::cleanerinitmessage() const { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return cleanerinitmessage_ != NULL ? *cleanerinitmessage_ : *default_instance().cleanerinitmessage_; +#else + return cleanerinitmessage_ != NULL ? *cleanerinitmessage_ : *default_instance_->cleanerinitmessage_; +#endif +} +inline ::CleanerInitMessage* ChatCleanerMessage::mutable_cleanerinitmessage() { + set_has_cleanerinitmessage(); + if (cleanerinitmessage_ == NULL) cleanerinitmessage_ = new ::CleanerInitMessage; + return cleanerinitmessage_; +} +inline ::CleanerInitMessage* ChatCleanerMessage::release_cleanerinitmessage() { + clear_has_cleanerinitmessage(); + ::CleanerInitMessage* temp = cleanerinitmessage_; + cleanerinitmessage_ = NULL; + return temp; +} +inline void ChatCleanerMessage::set_allocated_cleanerinitmessage(::CleanerInitMessage* cleanerinitmessage) { + delete cleanerinitmessage_; + cleanerinitmessage_ = cleanerinitmessage; + if (cleanerinitmessage) { + set_has_cleanerinitmessage(); + } else { + clear_has_cleanerinitmessage(); + } +} + +// optional .CleanerInitAckMessage cleanerInitAckMessage = 3; +inline bool ChatCleanerMessage::has_cleanerinitackmessage() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ChatCleanerMessage::set_has_cleanerinitackmessage() { + _has_bits_[0] |= 0x00000004u; +} +inline void ChatCleanerMessage::clear_has_cleanerinitackmessage() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ChatCleanerMessage::clear_cleanerinitackmessage() { + if (cleanerinitackmessage_ != NULL) cleanerinitackmessage_->::CleanerInitAckMessage::Clear(); + clear_has_cleanerinitackmessage(); +} +inline const ::CleanerInitAckMessage& ChatCleanerMessage::cleanerinitackmessage() const { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return cleanerinitackmessage_ != NULL ? *cleanerinitackmessage_ : *default_instance().cleanerinitackmessage_; +#else + return cleanerinitackmessage_ != NULL ? *cleanerinitackmessage_ : *default_instance_->cleanerinitackmessage_; +#endif +} +inline ::CleanerInitAckMessage* ChatCleanerMessage::mutable_cleanerinitackmessage() { + set_has_cleanerinitackmessage(); + if (cleanerinitackmessage_ == NULL) cleanerinitackmessage_ = new ::CleanerInitAckMessage; + return cleanerinitackmessage_; +} +inline ::CleanerInitAckMessage* ChatCleanerMessage::release_cleanerinitackmessage() { + clear_has_cleanerinitackmessage(); + ::CleanerInitAckMessage* temp = cleanerinitackmessage_; + cleanerinitackmessage_ = NULL; + return temp; +} +inline void ChatCleanerMessage::set_allocated_cleanerinitackmessage(::CleanerInitAckMessage* cleanerinitackmessage) { + delete cleanerinitackmessage_; + cleanerinitackmessage_ = cleanerinitackmessage; + if (cleanerinitackmessage) { + set_has_cleanerinitackmessage(); + } else { + clear_has_cleanerinitackmessage(); + } +} + +// optional .CleanerChatRequestMessage cleanerChatRequestMessage = 4; +inline bool ChatCleanerMessage::has_cleanerchatrequestmessage() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ChatCleanerMessage::set_has_cleanerchatrequestmessage() { + _has_bits_[0] |= 0x00000008u; +} +inline void ChatCleanerMessage::clear_has_cleanerchatrequestmessage() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ChatCleanerMessage::clear_cleanerchatrequestmessage() { + if (cleanerchatrequestmessage_ != NULL) cleanerchatrequestmessage_->::CleanerChatRequestMessage::Clear(); + clear_has_cleanerchatrequestmessage(); +} +inline const ::CleanerChatRequestMessage& ChatCleanerMessage::cleanerchatrequestmessage() const { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return cleanerchatrequestmessage_ != NULL ? *cleanerchatrequestmessage_ : *default_instance().cleanerchatrequestmessage_; +#else + return cleanerchatrequestmessage_ != NULL ? *cleanerchatrequestmessage_ : *default_instance_->cleanerchatrequestmessage_; +#endif +} +inline ::CleanerChatRequestMessage* ChatCleanerMessage::mutable_cleanerchatrequestmessage() { + set_has_cleanerchatrequestmessage(); + if (cleanerchatrequestmessage_ == NULL) cleanerchatrequestmessage_ = new ::CleanerChatRequestMessage; + return cleanerchatrequestmessage_; +} +inline ::CleanerChatRequestMessage* ChatCleanerMessage::release_cleanerchatrequestmessage() { + clear_has_cleanerchatrequestmessage(); + ::CleanerChatRequestMessage* temp = cleanerchatrequestmessage_; + cleanerchatrequestmessage_ = NULL; + return temp; +} +inline void ChatCleanerMessage::set_allocated_cleanerchatrequestmessage(::CleanerChatRequestMessage* cleanerchatrequestmessage) { + delete cleanerchatrequestmessage_; + cleanerchatrequestmessage_ = cleanerchatrequestmessage; + if (cleanerchatrequestmessage) { + set_has_cleanerchatrequestmessage(); + } else { + clear_has_cleanerchatrequestmessage(); + } +} + +// optional .CleanerChatReplyMessage cleanerChatReplyMessage = 5; +inline bool ChatCleanerMessage::has_cleanerchatreplymessage() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ChatCleanerMessage::set_has_cleanerchatreplymessage() { + _has_bits_[0] |= 0x00000010u; +} +inline void ChatCleanerMessage::clear_has_cleanerchatreplymessage() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ChatCleanerMessage::clear_cleanerchatreplymessage() { + if (cleanerchatreplymessage_ != NULL) cleanerchatreplymessage_->::CleanerChatReplyMessage::Clear(); + clear_has_cleanerchatreplymessage(); +} +inline const ::CleanerChatReplyMessage& ChatCleanerMessage::cleanerchatreplymessage() const { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return cleanerchatreplymessage_ != NULL ? *cleanerchatreplymessage_ : *default_instance().cleanerchatreplymessage_; +#else + return cleanerchatreplymessage_ != NULL ? *cleanerchatreplymessage_ : *default_instance_->cleanerchatreplymessage_; +#endif +} +inline ::CleanerChatReplyMessage* ChatCleanerMessage::mutable_cleanerchatreplymessage() { + set_has_cleanerchatreplymessage(); + if (cleanerchatreplymessage_ == NULL) cleanerchatreplymessage_ = new ::CleanerChatReplyMessage; + return cleanerchatreplymessage_; +} +inline ::CleanerChatReplyMessage* ChatCleanerMessage::release_cleanerchatreplymessage() { + clear_has_cleanerchatreplymessage(); + ::CleanerChatReplyMessage* temp = cleanerchatreplymessage_; + cleanerchatreplymessage_ = NULL; + return temp; +} +inline void ChatCleanerMessage::set_allocated_cleanerchatreplymessage(::CleanerChatReplyMessage* cleanerchatreplymessage) { + delete cleanerchatreplymessage_; + cleanerchatreplymessage_ = cleanerchatreplymessage; + if (cleanerchatreplymessage) { + set_has_cleanerchatreplymessage(); + } else { + clear_has_cleanerchatreplymessage(); + } +} + + +// @@protoc_insertion_point(namespace_scope) + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_chatcleaner_2eproto__INCLUDED