Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2010, 8:54:00 PM (15 years ago)
Author:
scheusso
Message:

a lot of changes:

  • some fixes (mostly gamestate:diff)
  • FunctionCall buffering (if Gamestate is not recent enough)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network5/src/libraries/network/packet/Packet.cc

    r7163 r7759  
    5353
    5454// 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));
     55BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Reliable)    == static_cast<int>(ENET_PACKET_FLAG_RELIABLE));
     56BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Unsequenced) == static_cast<int>(ENET_PACKET_FLAG_UNSEQUENCED));
     57BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::NoAllocate)  == static_cast<int>(ENET_PACKET_FLAG_NO_ALLOCATE));
    5858
    5959#define PACKET_FLAG_DEFAULT PacketFlag::NoAllocate
     
    174174  unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
    175175  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;
    177177  switch( *(Type::Value *)(data + _PACKETID) )
    178178  {
    179179    case Type::Acknowledgement:
    180       COUT(5) << "ack" << std::endl;
     180//       COUT(5) << "ack" << std::endl;
    181181      p = new Acknowledgement( data, clientID );
    182182      break;
    183183    case Type::Chat:
    184       COUT(5) << "chat" << std::endl;
     184//       COUT(5) << "chat" << std::endl;
    185185      p = new Chat( data, clientID );
    186186      break;
    187187    case Type::ClassID:
    188       COUT(5) << "classid" << std::endl;
     188//       COUT(5) << "classid" << std::endl;
    189189      p = new ClassID( data, clientID );
    190190      break;
    191191    case Type::Gamestate:
    192       COUT(5) << "gamestate" << std::endl;
    193       // TODO: remove brackets
     192//       COUT(5) << "gamestate" << std::endl;
    194193      p = new Gamestate( data, clientID );
    195194      break;
    196195    case Type::Welcome:
    197       COUT(5) << "welcome" << std::endl;
     196//       COUT(5) << "welcome" << std::endl;
    198197      p = new Welcome( data, clientID );
    199198      break;
    200199    case Type::DeleteObjects:
    201       COUT(5) << "deleteobjects" << std::endl;
     200//       COUT(5) << "deleteobjects" << std::endl;
    202201      p = new DeleteObjects( data, clientID );
    203202      break;
    204203    case Type::FunctionCalls:
    205       COUT(5) << "functionCalls" << std::endl;
     204//       COUT(5) << "functionCalls" << std::endl;
    206205      p = new FunctionCalls( data, clientID );
    207206      break;
    208207    case Type::FunctionIDs:
    209       COUT(5) << "functionIDs" << std::endl;
     208//       COUT(5) << "functionIDs" << std::endl;
    210209      p = new FunctionIDs( data, clientID );
    211210      break;
    212211    default:
    213       assert(0); //TODO: repair this
     212      assert(0);
    214213      break;
    215214  }
     
    235234  delete it->second;
    236235  packetMap_.erase(it);
    237   COUT(6) << "PacketMap size: " << packetMap_.size() << std::endl;
     236//   COUT(6) << "PacketMap size: " << packetMap_.size() << std::endl;
    238237}
    239238
Note: See TracChangeset for help on using the changeset viewer.