本文整理汇总了C++中CNetMessage::Deserialize方法的典型用法代码示例。如果您正苦于以下问题:C++ CNetMessage::Deserialize方法的具体用法?C++ CNetMessage::Deserialize怎么用?C++ CNetMessage::Deserialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNetMessage
的用法示例。
在下文中一共展示了CNetMessage::Deserialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateMessage
CNetMessage* CNetMessageFactory::CreateMessage(const void* pData,
size_t dataSize,
ScriptInterface& scriptInterface)
{
CNetMessage* pNewMessage = NULL;
CNetMessage header;
// Figure out message type
header.Deserialize((const u8*)pData, (const u8*)pData + dataSize);
switch (header.GetType())
{
case NMT_GAME_SETUP:
pNewMessage = new CGameSetupMessage(scriptInterface);
break;
case NMT_PLAYER_ASSIGNMENT:
pNewMessage = new CPlayerAssignmentMessage;
break;
case NMT_FILE_TRANSFER_REQUEST:
pNewMessage = new CFileTransferRequestMessage;
break;
case NMT_FILE_TRANSFER_RESPONSE:
pNewMessage = new CFileTransferResponseMessage;
break;
case NMT_FILE_TRANSFER_DATA:
pNewMessage = new CFileTransferDataMessage;
break;
case NMT_FILE_TRANSFER_ACK:
pNewMessage = new CFileTransferAckMessage;
break;
case NMT_JOIN_SYNC_START:
pNewMessage = new CJoinSyncStartMessage;
break;
case NMT_REJOINED:
pNewMessage = new CRejoinedMessage;
break;
case NMT_KICKED:
pNewMessage = new CKickedMessage;
break;
case NMT_LOADED_GAME:
pNewMessage = new CLoadedGameMessage;
break;
case NMT_SERVER_HANDSHAKE:
pNewMessage = new CSrvHandshakeMessage;
break;
case NMT_SERVER_HANDSHAKE_RESPONSE:
pNewMessage = new CSrvHandshakeResponseMessage;
break;
case NMT_CLIENT_HANDSHAKE:
pNewMessage = new CCliHandshakeMessage;
break;
case NMT_AUTHENTICATE:
pNewMessage = new CAuthenticateMessage;
break;
case NMT_AUTHENTICATE_RESULT:
pNewMessage = new CAuthenticateResultMessage;
break;
case NMT_GAME_START:
pNewMessage = new CGameStartMessage;
break;
case NMT_END_COMMAND_BATCH:
pNewMessage = new CEndCommandBatchMessage;
break;
case NMT_SYNC_CHECK:
pNewMessage = new CSyncCheckMessage;
break;
case NMT_SYNC_ERROR:
pNewMessage = new CSyncErrorMessage;
break;
case NMT_CHAT:
pNewMessage = new CChatMessage;
break;
case NMT_READY:
pNewMessage = new CReadyMessage;
break;
case NMT_SIMULATION_COMMAND:
pNewMessage = new CSimulationMessage(scriptInterface);
break;
//.........这里部分代码省略.........