Changeset 888 for code/branches/network/src/network
- Timestamp:
- Mar 13, 2008, 3:25:10 PM (16 years ago)
- Location:
- code/branches/network/src/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Client.h
r790 r888 16 16 #include <string> 17 17 18 #include "orxonox/objects/Tickable.h" 19 18 20 #include "NetworkPrereqs.h" 19 21 #include "ClientConnection.h" … … 21 23 #include "GameStateClient.h" 22 24 //#include "NetworkFrameListener.h" 25 23 26 24 27 … … 32 35 * 33 36 */ 34 class _NetworkExport Client : PacketDecoder {37 class _NetworkExport Client : PacketDecoder, public orxonox::Tickable{ 35 38 public: 36 39 Client(); -
code/branches/network/src/network/ConnectionManager.cc
r790 r888 281 281 } 282 282 283 284 285 void ConnectionManager::addClientsObjectID( int clientID, int objectID ) { 286 COUT(4) << "ship of client: " << clientID << ": " << objectID << " mapped" << std::endl; 287 clientsShip.insert( std::make_pair( clientID, objectID ) ); 288 } 289 290 int ConnectionManager::getClientsShipID( int clientID ) { 291 return clientsShip[clientID]; 292 } 293 294 int ConnectionManager::getObjectsClientID( int objectID ) { 295 std::map<int, int>::iterator iter = clientsShip.begin(); 296 while( iter != clientsShip.end() ) { 297 if( iter->second == objectID ) return iter->first; 298 } 299 return -99; 300 } 301 302 void ConnectionManager::deleteClientIDReg( int clientID ) { 303 clientsShip.erase( clientID ); 304 } 305 306 void ConnectionManager::deleteObjectIDReg( int objectID ) { 307 std::map<int, int>::iterator iter = clientsShip.begin(); 308 while( iter != clientsShip.end() ) { 309 if( iter->second == objectID ) break; 310 } 311 clientsShip.erase( iter->first ); 312 } 313 283 314 } -
code/branches/network/src/network/ConnectionManager.h
r790 r888 14 14 15 15 #include <string> 16 #include <map> 16 17 // enet library for networking support 17 18 #include <enet/enet.h> … … 73 74 bool quit; // quit-variable (communication with threads) 74 75 ClientInformation *head_; 76 77 //functions to map what object every clients uses 78 std::map<int, int> clientsShip; 79 void addClientsObjectID( int clientID, int objectID ); 80 int getClientsShipID( int clientID ); 81 int getObjectsClientID( int objectID ); 82 void deleteClientIDReg( int clientID ); 83 void deleteObjectIDReg( int objectID ); 75 84 }; 76 85 -
code/branches/network/src/network/Server.h
r790 r888 16 16 #include <string> 17 17 18 #include "orxonox/objects/Tickable.h" 19 18 20 #include "PacketManager.h" 19 21 #include "NetworkPrereqs.h" 22 23 20 24 21 25 namespace network … … 25 29 * It implements all functions necessary for a Server 26 30 */ 27 class _NetworkExport Server : public PacketDecoder {31 class _NetworkExport Server : public PacketDecoder, public orxonox::Tickable{ 28 32 public: 29 33 Server();
Note: See TracChangeset
for help on using the changeset viewer.