NetworkMessageV2::NetworkMessageV2 (const NetworkMessage& nm) { if (nm.getVersion() == 2) { _pBuf = (char *) malloc (nm.getLength()); memcpy (_pBuf, nm.getBuf(), nm.getLength()); _ui16NetMsgLen = nm.getLength(); } else { uint8 ui8Version = nm.getVersion(); uint8 ui8MsgType = nm.getMsgType(); uint32 ui32SourceAddress = nm.getSourceAddress(); uint32 ui32TargetAddress = nm.getTargetAddress(); uint16 ui16SessionId = nm.getSessionId(); uint16 ui16MsgId = nm.getMsgId(); uint8 ui8HopCount = nm.getHopCount(); uint8 ui8TTL = nm.getTTL(); ChunkType chunkType = (ChunkType) nm.getChunkType(); bool bReliable = nm.isReliableMsg(); const void *pMsgMetaData = nm.getMetaData(); uint16 ui16MsgMetaDataLen = nm.getMetaDataLen(); const void *pMsg = nm.getMsg(); uint16 ui16MsgLen = nm.getMsgLen(); uint8 ui8QueueSize = 0; create (ui8MsgType, ui32SourceAddress, ui32TargetAddress, ui16SessionId, ui16MsgId, ui8HopCount, ui8TTL, chunkType, bReliable, pMsgMetaData, ui16MsgMetaDataLen, pMsg, ui16MsgLen, 0); } }