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/Connection.cc

    r3202 r3209  
    2929#include "Connection.h"
    3030
    31 #include <iostream>
    3231#include <cassert>
     32#include <enet/enet.h>
    3333#include <OgreTimer.h>
    34 
    35 #include "util/Debug.h"
    36 #include "util/Math.h"
    37 #include "util/Sleep.h"
    38 #include "ClientInformation.h"
    39 #include "synchronisable/Synchronisable.h"
    40 #include "packet/ClassID.h"
     34#include "packet/Packet.h"
    4135
    4236namespace orxonox
     
    5549  Connection::~Connection(){
    5650    Connection::instance_=0;
     51  }
     52
     53  int Connection::service(ENetEvent* event) {
     54    return enet_host_service( this->host_, event, NETWORK_WAIT_TIMEOUT );
     55  }
     56
     57  void Connection::disconnectPeer(ENetPeer *peer) {
     58    enet_peer_disconnect(peer, 0);
    5759  }
    5860
     
    9698  }
    9799
     100  bool Connection::processPacket(ENetEvent* event) {
     101    packet::Packet *p = packet::Packet::createPacket(event->packet, event->peer);
     102    return p->process();
     103  }
     104
    98105}
Note: See TracChangeset for help on using the changeset viewer.