Changeset 5851
- Timestamp:
- Oct 1, 2009, 4:40:28 PM (15 years ago)
- Location:
- code/branches/core5/src/libraries/network
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/network/ClientConnection.cc
r5749 r5851 133 133 } 134 134 135 void ClientConnection::add Client(ENetEvent* event)135 void ClientConnection::addPeer(ENetEvent* event) 136 136 { 137 137 assert(0); 138 138 } 139 void ClientConnection:: disconnectPeer(ENetEvent* event)139 void ClientConnection::removePeer(ENetEvent* event) 140 140 { 141 141 this->established_=false; -
code/branches/core5/src/libraries/network/ClientConnection.h
r5738 r5851 54 54 inline bool isConnected(){ return this->established_; } 55 55 private: 56 virtual void add Client(ENetEvent* event);57 virtual void disconnectPeer(ENetEvent* event);56 virtual void addPeer(ENetEvent* event); 57 virtual void removePeer(ENetEvent* event); 58 58 59 59 bool disconnectConnection(); -
code/branches/core5/src/libraries/network/Connection.cc
r5849 r5851 83 83 // log handling ================ 84 84 case ENET_EVENT_TYPE_CONNECT: 85 add Client( &event );85 addPeer( &event ); 86 86 break; 87 87 case ENET_EVENT_TYPE_DISCONNECT: 88 disconnectPeer( &event );88 removePeer( &event ); 89 89 break; 90 90 case ENET_EVENT_TYPE_RECEIVE: -
code/branches/core5/src/libraries/network/Connection.h
r5849 r5851 67 67 68 68 void processQueue(); 69 virtual void add Client(ENetEvent* event)=0;70 virtual void disconnectPeer(ENetEvent* event)=0;69 virtual void addPeer(ENetEvent* event)=0; 70 virtual void removePeer(ENetEvent* event)=0; 71 71 virtual bool processPacket(ENetEvent* event); 72 72 -
code/branches/core5/src/libraries/network/Server.cc
r5847 r5851 270 270 271 271 272 void Server::add Client(ENetEvent *event){272 void Server::addPeer(ENetEvent *event){ 273 273 static unsigned int newid=1; 274 274 … … 289 289 createClient(temp->getID()); 290 290 } 291 292 void Server::removePeer(ENetEvent *event) 293 { 294 COUT(4) << "removing client from list" << std::endl; 295 ClientInformation *client = ClientInformation::findClient(&event->peer->address); 296 if(!client) 297 return; 298 else 299 { 300 //ServerConnection::disconnectClient( client ); 301 ClientConnectionListener::broadcastClientDisconnected( client->getID() ); 302 delete client; 303 } 304 } 291 305 292 306 bool Server::createClient(int clientID){ -
code/branches/core5/src/libraries/network/Server.h
r5738 r5851 65 65 unsigned int playerID(){return 0;} 66 66 67 void addClient(ENetEvent *event); 67 void addPeer(ENetEvent *event); 68 void removePeer(ENetEvent *event); 69 68 70 bool createClient(int clientID); 69 71 void disconnectClient( ClientInformation *client); -
code/branches/core5/src/libraries/network/ServerConnection.cc
r5849 r5851 105 105 } 106 106 107 void ServerConnection::disconnectPeer( ENetEvent* event )108 {109 COUT(4) << "removing client from list" << std::endl;110 ClientInformation *client = ClientInformation::findClient(&event->peer->address);111 if(!client)112 return;113 else114 ServerConnection::disconnectClient( client );115 }116 117 107 void ServerConnection::disconnectClient(int clientID){ 118 108 ClientInformation *client = ClientInformation::findClient(clientID); -
code/branches/core5/src/libraries/network/ServerConnection.h
r5849 r5851 59 59 static bool addPacketAll(ENetPacket *packet); 60 60 virtual void disconnectClient(ClientInformation *client); 61 virtual void disconnectPeer( ENetEvent* event );62 61 void disconnectClient(int clientID); 63 62 protected:
Note: See TracChangeset
for help on using the changeset viewer.