Changeset 9470 in orxonox.OLD
- Timestamp:
- Jul 25, 2006, 10:23:17 PM (18 years ago)
- Location:
- branches/proxy/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/collision_detection/aabb_tree_node.cc
r9406 r9470 66 66 { 67 67 this->depth = depth; 68 69 this->init(); 68 70 } 69 71 … … 87 89 88 90 this->owner = NULL; 89 90 /* debug ids */91 if( this->nodePrev)92 this->treeIndex = 100 * this->depth + this->nodePrev->getID();93 else94 this->treeIndex = 0;95 91 } 96 92 -
branches/proxy/src/lib/network/network_game_manager.cc
r9452 r9470 91 91 bool NetworkGameManager::signalNewPlayer( int userId ) 92 92 { 93 assert( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive());93 assert( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/); 94 94 assert( State::getGameRules() ); 95 95 assert( State::getGameRules()->isA( CL_NETWORK_GAME_RULES ) ); … … 168 168 bool NetworkGameManager::delSynchronizeableHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ) 169 169 { 170 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())170 if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) 171 171 { 172 172 PRINTF(2)("Recieved DeleteSynchronizeable message from client %d!\n", userId); … … 229 229 bool NetworkGameManager::preferedTeamHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ) 230 230 { 231 assert( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive());231 assert( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/); 232 232 233 233 int teamId = 0; … … 261 261 void NetworkGameManager::prefereTeam( int teamId ) 262 262 { 263 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())263 if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) 264 264 setPreferedTeam( SharedNetworkData::getInstance()->getHostID(), teamId ); 265 265 else … … 305 305 { 306 306 PRINTF(0)("NetworkGameManager::chatMessageHandler %d %d\n", userId, SharedNetworkData::getInstance()->getHostID() ); 307 if ( (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive()) && userId != SharedNetworkData::getInstance()->getHostID() )307 if ( (SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) && userId != SharedNetworkData::getInstance()->getHostID() ) 308 308 { 309 309 MessageManager::getInstance()->sendMessage( messageId, data, dataLength, RT_ALL_NOT_ME, 0, MP_HIGHBANDWIDTH ); … … 347 347 assert( Converter::stringToByteArray(message, buf+2*INTSIZE, message.length()+INTSIZE) == message.length()+INTSIZE ); 348 348 349 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())349 if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) 350 350 MessageManager::getInstance()->sendMessage( MSGID_CHATMESSAGE, buf, message.length()+3*INTSIZE, RT_ALL_ME, 0, MP_HIGHBANDWIDTH ); 351 351 else -
branches/proxy/src/lib/network/network_manager.cc
r9467 r9470 131 131 132 132 // create the network stream af 133 this->networkStream = new NetworkStream(NET_PROXY_SERVER_ACTIVE );133 this->networkStream = new NetworkStream(NET_PROXY_SERVER_ACTIVE ); 134 134 // first connect to the master server for synchronization 135 135 this->networkStream->connectToMasterServer(NetworkSettings::getInstance()->getMasterAddr().ipString(), 9999); -
branches/proxy/src/lib/network/network_stream.cc
r9468 r9470 208 208 * @param port: the port number 209 209 */ 210 void NetworkStream::connectToProxyServer(int proxyId, std::string host, int port)210 void NetworkStream::connectToProxyServer(int proxyId, std::string host, int port) 211 211 { 212 212 PRINTF(0)("connect to proxy %s, this is proxyId %i\n", host.c_str(), proxyId); … … 253 253 void NetworkStream::startHandshake(int userId) 254 254 { 255 Handshake* hs = new Handshake( this->pInfo->nodeType);255 Handshake* hs = new Handshake(NET_CLIENT/* this->pInfo->nodeType*/); 256 256 // fake the unique id 257 257 hs->setUniqueID( NET_UID_HANDSHAKE ); … … 323 323 this->updateConnectionList(); 324 324 } 325 else if( this->pInfo->isProxyServerActive())326 {325 // else if( this->pInfo->isProxyServerActive()) 326 // { 327 327 // execute everything the proxy server should do 328 if ( this->clientSocket ) 329 this->clientSocket->update(); 330 if( this->proxySocket) 331 this->proxySocket->update(); 332 333 this->updateConnectionList(); 334 } 328 329 // if ( this->clientSocket ) 330 // this->clientSocket->update(); 331 // if( this->proxySocket) 332 // this->proxySocket->update(); 333 // 334 // this->updateConnectionList(); 335 // } 335 336 else 336 337 { … … 554 555 { 555 556 // make sure this is a client 556 if( this->pInfo->isClient() )557 if( this->pInfo->isClient() || SharedNetworkData::getInstance()->isProxyServerActive()) 557 558 { 558 559 SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() ); … … 752 753 753 754 // if we are a server (both master and proxy servers) and this is not our handshake 754 if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive()) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )755 if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/ ) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId ) 755 756 continue; 756 757 … … 766 767 767 768 // server fakes uniqueid == 0 for handshake 768 if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive()) &&769 if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive() */) && 769 770 sync.getUniqueID() <= SharedNetworkData::getInstance()->getMaxPlayer() + 1) // plus one to handle one client more than the max to redirect it 770 771 n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset ); … … 818 819 // now compress the data with the zip library 819 820 int compLength = 0; 820 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())821 if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) 821 822 compLength = Zip::getInstance()->zip( buf, offset, compBuf, UDP_PACKET_SIZE, dictServer ); 822 823 else … … 936 937 937 938 // if the node we got this unknown sync from is a client we ignore it (since it has no rights to create a new sync) 938 if ( peers[peer->second.userId].isClient() )939 if ( peers[peer->second.userId].isClient() || peers[peer->second.userId].isProxyServerActive()) 939 940 { 940 941 offset += syncDataLength; -
branches/proxy/src/lib/network/peer_info.cc
r9445 r9470 58 58 return PeerInfo::nodeTypeToString( this->nodeType ); 59 59 // the above does the same, and is faster in it. (there is no case where node is uninit i hope!) 60 /*61 switch( this->nodeType)62 {63 case NET_CLIENT:64 return std::string("client");65 case NET_PROXY_SERVER_ACTIVE:66 return std::string("proxy server active");67 case NET_PROXY_SERVER_PASSIVE:68 return std::string("proxy server passive");69 case NET_MASTER_SERVER:70 return std::string("master server");71 }72 73 return std::string("node is uninit");*/74 60 } 75 61 -
branches/proxy/src/lib/network/shared_network_data.h
r9452 r9470 28 28 29 29 /** @returns the next uniqueID free for an object */ 30 inline int getNewUniqueID() { return ( this->nodeType != NET_CLIENT)?this->newUniqueID++:-1; }30 inline int getNewUniqueID() { return ( isMasterServer())?this->newUniqueID++:-1; } 31 31 /** sets the @param newUniqueID: the new offset for the next unique id */ 32 32 inline void setNewUniqueID(int newUniqueID) { this->newUniqueID = newUniqueID; } -
branches/proxy/src/util/game_rules.cc
r9406 r9470 87 87 void GameRules::registerKill(const Kill& kill) 88 88 { 89 if ( SharedNetworkData::getInstance()->isClient() )89 if ( SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive()) 90 90 return; 91 91 -
branches/proxy/src/util/multiplayer_team_deathmatch.cc
r9455 r9470 152 152 box->setAbsCoor2D( 300, 100 ); 153 153 154 if( SharedNetworkData::getInstance()->isClient() )154 if( SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive()) 155 155 { 156 156 OrxGui::GLGuiPushButton * buttonSpectator = new OrxGui::GLGuiPushButton("Spectator"); … … 214 214 assignPlayable(); 215 215 216 if ( SharedNetworkData::getInstance()->isClient() )216 if ( SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive()) 217 217 return; 218 218 … … 278 278 void MultiplayerTeamDeathmatch::checkGameRules() 279 279 { 280 if ( SharedNetworkData::getInstance()->isClient() )280 if ( SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive()) 281 281 return; 282 282 -
branches/proxy/src/world_entities/creatures/fps_player.cc
r9452 r9470 287 287 //dealing damage 288 288 289 if ( State::isOnline() && (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive()))289 if ( State::isOnline() && (SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)) 290 290 { 291 291 this->damageTicker -= time; -
branches/proxy/src/world_entities/space_ships/space_ship.cc
r9452 r9470 310 310 void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location) 311 311 { 312 Playable::collidesWith(entity, location); 313 314 if( entity->isA(CL_PROJECTILE) && entity != ref) 315 { 316 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive()) 317 { 318 //TODO handle this 319 } 320 } 321 PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z); 312 322 313 } 323 314 -
branches/proxy/src/world_entities/world_entity.cc
r9406 r9470 257 257 bool WorldEntity::buildObbTree(int depth) 258 258 { 259 if (this->obbTree) 259 if( this->obbTree != NULL) 260 { 260 261 delete this->obbTree; 262 this->obbTree = NULL; 263 } 261 264 262 265 if (this->models[0] != NULL) … … 280 283 this->aabbNode = new AABBTreeNode(); 281 284 this->aabbNode->spawnBVTree(this->models[0]); 285 } 286 else 287 { 288 PRINTF(1)("could not create aabb bounding box, because no model was loaded yet\n"); 289 this->aabbNode = NULL; 290 return false; 282 291 } 283 292 return true;
Note: See TracChangeset
for help on using the changeset viewer.