- Timestamp:
- Jan 23, 2006, 3:15:07 PM (19 years ago)
- Location:
- branches/network/src/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/coord/p_node.cc
r6634 r6659 42 42 */ 43 43 PNode::PNode (PNode* parent, long nodeFlags) 44 : Synchronizeable(), BaseObject() 44 45 { 45 46 this->setClassID(CL_PARENT_NODE, "PNode"); -
branches/network/src/lib/network/network_manager.cc
r6658 r6659 114 114 this->bGameServer = true; 115 115 this->defaultSyncStream = new NetworkStream(port); 116 this->defaultSyncStream->createNetworkGameManager(); 116 117 PRINTF(0)("CREATE SERVER\n"); 117 118 this->bGameServer = true; -
branches/network/src/lib/network/network_stream.cc
r6658 r6659 81 81 this->handshakes.push_back( NULL ); 82 82 this->bActive = true; 83 this->networkGameManager = NetworkGameManager::getInstance();84 // setUniqueID( maxCon+2 ) because we need one id for every handshake85 // and one for handshake to reject client maxCon+186 this->networkGameManager->setUniqueID( this->maxConnections + 2 );87 this->connectSynchronizeable( *(this->networkGameManager) );88 89 this->setMaxConnections( 10 );90 83 } 91 84 … … 129 122 delete connectionMonitor; 130 123 delete networkProtocol; 124 } 125 126 127 void NetworkStream::createNetworkGameManager() 128 { 129 this->networkGameManager = NetworkGameManager::getInstance(); 130 // setUniqueID( maxCon+2 ) because we need one id for every handshake 131 // and one for handshake to reject client maxCon+1 132 this->networkGameManager->setUniqueID( this->maxConnections + 2 ); 133 this->connectSynchronizeable( *(this->networkGameManager) ); 134 this->setMaxConnections( 10 ); 131 135 } 132 136 … … 425 429 PRINT(0)(" Host ID: %i\n", this->myHostId); 426 430 427 PRINT(0)(" Connected Synchronizeables:\n");431 PRINT(0)(" Got %i connected Synchronizeables:\n", this->synchronizeables.size()); 428 432 for (SynchronizeableList::iterator it = synchronizeables.begin(); it!=synchronizeables.end(); it++) 429 433 { 430 PRINT(0)(" Synchronizeable of class: %s::%s, with unique ID: %i \n", (*it)->getClassName(), (*it)->getName(), (*it)->getUniqueID());434 PRINT(0)(" Synchronizeable of class: %s::%s, with unique ID: %i, Synchronize: %i\n", (*it)->getClassName(), (*it)->getName(), (*it)->getUniqueID(), (*it)->beSynchronized()); 431 435 } 432 436 -
branches/network/src/lib/network/network_stream.h
r6658 r6659 39 39 ~NetworkStream(); 40 40 void init(); 41 42 void createNetworkGameManager(); 41 43 42 44 void connectSynchronizeable(Synchronizeable& sync); -
branches/network/src/lib/network/synchronizeable.cc
r6658 r6659 43 43 44 44 this->bSynchronize = false; 45 NetworkStream* nd; 46 if( this->isA(CL_NETWORK_GAME_MANAGER)) 47 { 48 nd = NetworkGameManager::getInstance()->getNetworkStream(); 49 assert(nd != NULL); 50 nd->connectSynchronizeable(*this); 51 } 45 NetworkStream* nd = NetworkManager::getInstance()->getDefaultSyncStream(); 46 assert(nd != NULL); 47 nd->connectSynchronizeable(*this); 52 48 } 53 49 -
branches/network/src/lib/network/synchronizeable.h
r6658 r6659 167 167 public: 168 168 Synchronizeable(); 169 ~Synchronizeable();169 virtual ~Synchronizeable(); 170 170 171 171 virtual int writeBytes(const byte* data, int length, int sender);
Note: See TracChangeset
for help on using the changeset viewer.