Changeset 400 for code/branches/FICN/src/network/PacketDecoder.cc
- Timestamp:
- Dec 5, 2007, 3:46:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/PacketDecoder.cc
r374 r400 44 44 return true; 45 45 break; 46 case CLASSID: 47 clid(packet); 48 return true; 49 break; 46 50 } 47 51 return false; … … 126 130 } 127 131 132 void PacketDecoder::clid( ENetPacket *packet) 133 { 134 classid* cid = new classid; 135 cid->length = ((classid*)(packet->data))->length; 136 cid->id = ((classid *)(packet->data))->id; 137 cid->classid = ((classid *)(packet->data))->classid; 138 cid->message = (const char *)malloc(cid->length); 139 enet_packet_destroy( packet ); 140 processClassid(&cid); 141 } 142 143 128 144 // now the data processing functions: 129 145 … … 131 147 printChat(data); 132 148 } 149 150 void PacketDecoder::processClassid( classid *cid){ 151 printClassid(cid); 152 return; 153 } 154 155 133 156 134 157 //these are some print functions for test stuff … … 163 186 cout << "size of gamestate: " << data->size << endl; 164 187 } 188 189 void PacketDecoder::printClassid( classid *cid) 190 { 191 cout << "id of classid: " << cid->id << endl; 192 cout << "size of classid: " << cid->length << endl; 193 cout << "ID of classid: " << cid->classid <<endl; 194 cout << "data of classid: " << cid->message <<endl; 195 }
Note: See TracChangeset
for help on using the changeset viewer.