Changeset 1890 for code/branches/network/src/network/packet/Chat.cc
- Timestamp:
- Oct 6, 2008, 1:30:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/packet/Chat.cc
r1800 r1890 37 37 #define _PACKETID 0 38 38 const int _PLAYERID = _PACKETID + sizeof(ENUM::Type); 39 #define _MESSAGELENGTH _PLAYERID + sizeof(u nsigned int)40 #define _MESSAGE _MESSAGELENGTH + sizeof(u nsigned int)39 #define _MESSAGELENGTH _PLAYERID + sizeof(uint32_t) 40 #define _MESSAGE _MESSAGELENGTH + sizeof(uint32_t) 41 41 42 42 Chat::Chat( std::string message, unsigned int playerID ) … … 52 52 } 53 53 54 Chat::Chat( u nsigned char *data,int clientID )54 Chat::Chat( uint8_t* data, unsigned int clientID ) 55 55 : Packet(data, clientID) 56 56 { 57 messageLength_ = *(u nsigned int *)(data + _MESSAGELENGTH );57 messageLength_ = *(uint32_t *)(data + _MESSAGELENGTH ); 58 58 } 59 59 … … 67 67 68 68 bool Chat::process(){ 69 bool b = Host::incomingChat(std::string((const char*)data_+_MESSAGE), *(u nsigned int *)(data_+_PLAYERID));69 bool b = Host::incomingChat(std::string((const char*)data_+_MESSAGE), *(uint32_t *)(data_+_PLAYERID)); 70 70 delete this; 71 71 return b;
Note: See TracChangeset
for help on using the changeset viewer.