- Timestamp:
- Dec 14, 2010, 8:54:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network5/src/libraries/network/packet/Packet.cc
r7163 r7759 53 53 54 54 // Make sure we assume the right values 55 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Reliable) == static_cast<int>(ENET_PACKET_FLAG_RELIABLE));56 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Unsequence ) == static_cast<int>(ENET_PACKET_FLAG_UNSEQUENCED));57 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::NoAllocate) == static_cast<int>(ENET_PACKET_FLAG_NO_ALLOCATE));55 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Reliable) == static_cast<int>(ENET_PACKET_FLAG_RELIABLE)); 56 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Unsequenced) == static_cast<int>(ENET_PACKET_FLAG_UNSEQUENCED)); 57 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::NoAllocate) == static_cast<int>(ENET_PACKET_FLAG_NO_ALLOCATE)); 58 58 59 59 #define PACKET_FLAG_DEFAULT PacketFlag::NoAllocate … … 174 174 unsigned int clientID = ClientInformation::findClient(&peer->address)->getID(); 175 175 Packet *p = 0; 176 COUT(6) << "packet type: " << *(Type::Value *)&data[_PACKETID] << std::endl;176 // COUT(6) << "packet type: " << *(Type::Value *)&data[_PACKETID] << std::endl; 177 177 switch( *(Type::Value *)(data + _PACKETID) ) 178 178 { 179 179 case Type::Acknowledgement: 180 COUT(5) << "ack" << std::endl;180 // COUT(5) << "ack" << std::endl; 181 181 p = new Acknowledgement( data, clientID ); 182 182 break; 183 183 case Type::Chat: 184 COUT(5) << "chat" << std::endl;184 // COUT(5) << "chat" << std::endl; 185 185 p = new Chat( data, clientID ); 186 186 break; 187 187 case Type::ClassID: 188 COUT(5) << "classid" << std::endl;188 // COUT(5) << "classid" << std::endl; 189 189 p = new ClassID( data, clientID ); 190 190 break; 191 191 case Type::Gamestate: 192 COUT(5) << "gamestate" << std::endl; 193 // TODO: remove brackets 192 // COUT(5) << "gamestate" << std::endl; 194 193 p = new Gamestate( data, clientID ); 195 194 break; 196 195 case Type::Welcome: 197 COUT(5) << "welcome" << std::endl;196 // COUT(5) << "welcome" << std::endl; 198 197 p = new Welcome( data, clientID ); 199 198 break; 200 199 case Type::DeleteObjects: 201 COUT(5) << "deleteobjects" << std::endl;200 // COUT(5) << "deleteobjects" << std::endl; 202 201 p = new DeleteObjects( data, clientID ); 203 202 break; 204 203 case Type::FunctionCalls: 205 COUT(5) << "functionCalls" << std::endl;204 // COUT(5) << "functionCalls" << std::endl; 206 205 p = new FunctionCalls( data, clientID ); 207 206 break; 208 207 case Type::FunctionIDs: 209 COUT(5) << "functionIDs" << std::endl;208 // COUT(5) << "functionIDs" << std::endl; 210 209 p = new FunctionIDs( data, clientID ); 211 210 break; 212 211 default: 213 assert(0); //TODO: repair this212 assert(0); 214 213 break; 215 214 } … … 235 234 delete it->second; 236 235 packetMap_.erase(it); 237 COUT(6) << "PacketMap size: " << packetMap_.size() << std::endl;236 // COUT(6) << "PacketMap size: " << packetMap_.size() << std::endl; 238 237 } 239 238
Note: See TracChangeset
for help on using the changeset viewer.