Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 23, 2009, 2:12:44 AM (15 years ago)
Author:
rgrieder
Message:

Cleanup in network plus a few dependency reductions (no enet-function inlines, using enum PacketFlag instead of the enet version)

File:
1 edited

Legend:

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

    r3208 r3209  
    3232#include <cassert>
    3333#include <enet/enet.h>
    34 
    35 #include "network/ClientInformation.h"
    36 
     34#include <boost/static_assert.hpp>
     35
     36#include "util/Debug.h"
    3737#include "Acknowledgement.h"
    38 #include "DeleteObjects.h"
    3938#include "Chat.h"
    4039#include "ClassID.h"
     40#include "DeleteObjects.h"
    4141#include "FunctionCalls.h"
    4242#include "FunctionIDs.h"
     
    4444#include "Welcome.h"
    4545#include "network/Host.h"
    46 #include "core/CoreIncludes.h"
     46#include "network/ClientInformation.h"
    4747
    4848namespace orxonox{
     
    5050namespace packet{
    5151
    52 #define PACKET_FLAG_DEFAULT ENET_PACKET_FLAG_NO_ALLOCATE
     52// Make sure we assume the right values
     53BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Reliable)   == static_cast<int>(ENET_PACKET_FLAG_RELIABLE));
     54BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Unsequence) == static_cast<int>(ENET_PACKET_FLAG_UNSEQUENCED));
     55BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::NoAllocate) == static_cast<int>(ENET_PACKET_FLAG_NO_ALLOCATE));
     56
     57#define PACKET_FLAG_DEFAULT PacketFlag::NoAllocate
    5358#define _PACKETID           0
    5459
     
    103108  }
    104109  else if (this->data_) {
    105     // This destructor was probably called as a consequence to ENet executing our callback.
     110    // This destructor was probably called as a consequence of ENet executing our callback.
    106111    // It simply serves us to be able to deallocate the packet content (data_) ourselves since
    107112    // we have created it in the first place.
Note: See TracChangeset for help on using the changeset viewer.