Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2007, 12:28:19 AM (16 years ago)
Author:
scheusso
Message:

PacketDecoder:

Extended Class to make inheriting easier…

-added virtual function, that can be implemented by lower classes

Client:

Added some function, changed some things (input, gamestate, connectionhandling)

Server:

same as client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/ClientConnection.cc

    r355 r369  
    5454  }
    5555
     56  ENetPacket *ClientConnection::getPacket(){
     57    ENetAddress address;
     58    return getPacket(address);
     59  }
     60 
    5661  bool ClientConnection::queueEmpty(){
    5762    return buffer.isEmpty();
     
    110115      quit=true;
    111116    //connect to the server
    112     if(!establishConnection())
     117    if(!establishConnection()){
    113118      quit=true;
     119      return;
     120    }
    114121    //main loop
    115122    while(!quit){
     
    126133        break;
    127134      case ENET_EVENT_TYPE_DISCONNECT:
    128         // add some error/log handling here
    129         // extend =====================
     135        quit=true;
     136        // server closed the connection
     137        return;
    130138        break;
    131139      case ENET_EVENT_TYPE_NONE:
     
    143151  bool ClientConnection::disconnectConnection(){
    144152    ENetEvent event;
    145 //     enet_peer_disconnect(server);
    146153    enet_peer_disconnect(server, 0);
    147154    while(enet_host_service(client, &event, NETWORK_WAIT_TIMEOUT) > 0){
Note: See TracChangeset for help on using the changeset viewer.