Changeset 444
- Timestamp:
- Dec 9, 2007, 7:02:16 PM (17 years ago)
- Location:
- code/branches/FICN/src/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/ClientInformation.cc
r442 r444 173 173 ClientInformation *ClientInformation::findClient(ENetAddress *address, bool look_backwards){ 174 174 ClientInformation *temp = this; 175 while(temp!=0 && (temp->getPeer()->address.host!=address->host || temp->getPeer()->address.port != address->port)) 175 while(temp!=0){ 176 if(temp->head){ 177 temp = temp->next(); 178 continue; 179 } 180 if(temp->getPeer()->address.host==address->host && temp->getPeer()->address.port == address->port) 181 break; 176 182 temp = temp->next(); 183 } 177 184 // returns 0 if nothing has been found 178 185 return temp; -
code/branches/FICN/src/network/ClientInformation.h
r436 r444 14 14 15 15 #include <enet/enet.h> 16 #include <iostream> //debug 16 17 17 18 #define GAMESTATEID_INITIAL -1 -
code/branches/FICN/src/network/ConnectionManager.cc
r442 r444 55 55 ENetPacket *ConnectionManager::getPacket(int &clientID){ 56 56 ENetAddress address; 57 ENetPacket *packet=getPacket(address); 58 clientID=head_->findClient(&address)->getID(); 57 ENetPacket *packet=getPacket(address);std::cout << "searching clientid " << head_->getID() << std::endl; 58 ClientInformation *temp =head_->findClient(&address); 59 std::cout << "searching clientid " << temp << std::endl; 60 clientID=temp->getID(); 59 61 return packet; 60 62 } -
code/branches/FICN/src/network/Server.cc
r442 r444 22 22 Server::Server(){ 23 23 packet_gen = PacketGenerator(); 24 clients = new ClientInformation( );24 clients = new ClientInformation(true); 25 25 connection = new ConnectionManager(clients); 26 26 gamestates = new GameStateManager(clients); … … 109 109 int clientID=-1; 110 110 while(!connection->queueEmpty()){ 111 std::cout << "Client " << clientID << " sent: " << std::endl; 111 112 packet = connection->getPacket(clientID); 112 113 elaborate(packet, clientID); -
code/branches/FICN/src/network/dummyserver3.cc
r441 r444 26 26 void dummyserver3::loop(){ 27 27 open(); 28 while(true) 28 while(true){ 29 29 tick(); 30 } 30 31 } 31 32
Note: See TracChangeset
for help on using the changeset viewer.