Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9476 in orxonox.OLD for branches/proxy/src


Ignore:
Timestamp:
Jul 25, 2006, 11:35:11 PM (18 years ago)
Author:
patrick
Message:

now the clients can connect to the proxy servers.

⇒ hybrid proxy servers are half way done. There is still one major problem:

NetworkGameManager
This class is not yet hybrid at all. I will have take some more time for this one…

Location:
branches/proxy/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/network_game_manager.cc

    r9470 r9476  
    9191bool NetworkGameManager::signalNewPlayer( int userId )
    9292{
    93   assert( SharedNetworkData::getInstance()->isMasterServer() /*||  SharedNetworkData::getInstance()->isProxyServerActive()*/);
     93  assert( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServerActive());
    9494  assert( State::getGameRules() );
    9595  assert( State::getGameRules()->isA( CL_NETWORK_GAME_RULES ) );
     
    168168bool NetworkGameManager::delSynchronizeableHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
    169169{
    170   if ( SharedNetworkData::getInstance()->isMasterServer() /*||  SharedNetworkData::getInstance()->isProxyServerActive()*/)
     170  if ( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServerActive())
    171171  {
    172172    PRINTF(2)("Recieved DeleteSynchronizeable message from client %d!\n", userId);
     
    229229bool NetworkGameManager::preferedTeamHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
    230230{
    231   assert( SharedNetworkData::getInstance()->isMasterServer() /*||  SharedNetworkData::getInstance()->isProxyServerActive()*/);
     231  assert( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServerActive());
    232232
    233233  int teamId = 0;
     
    261261void NetworkGameManager::prefereTeam( int teamId )
    262262{
    263   if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)
     263  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
    264264    setPreferedTeam( SharedNetworkData::getInstance()->getHostID(), teamId );
    265265  else
     
    305305{
    306306  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() )
    308308  {
    309309    MessageManager::getInstance()->sendMessage( messageId, data, dataLength, RT_ALL_NOT_ME, 0, MP_HIGHBANDWIDTH );
     
    347347  assert( Converter::stringToByteArray(message, buf+2*INTSIZE, message.length()+INTSIZE) == message.length()+INTSIZE );
    348348
    349   if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)
     349  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
    350350    MessageManager::getInstance()->sendMessage( MSGID_CHATMESSAGE, buf, message.length()+3*INTSIZE, RT_ALL_ME, 0, MP_HIGHBANDWIDTH );
    351351  else
  • branches/proxy/src/lib/network/network_manager.cc

    r9475 r9476  
    133133  this->networkStream = new NetworkStream(NET_PROXY_SERVER_ACTIVE );
    134134  // first connect to the master server for synchronization
    135   this->networkStream->connectToMasterServer(NetworkSettings::getInstance()->getMasterAddr().ipString(), 10000);
     135//   this->networkStream->connectToMasterServer(NetworkSettings::getInstance()->getMasterAddr().ipString(), 10000);
    136136  // start the handshake with the master server
    137   this->networkStream->startHandshake(NET_ID_MASTER_SERVER);
     137//   this->networkStream->startHandshake(NET_ID_MASTER_SERVER);
    138138
    139139
     
    146146
    147147  // start the network game manager
    148 //   this->networkStream->createNetworkGameManager();
     148   this->networkStream->createNetworkGameManager();
    149149
    150150
  • branches/proxy/src/lib/network/network_stream.cc

    r9474 r9476  
    228228void NetworkStream::createServer(int clientPort, int proxyPort)
    229229{
    230   this->proxySocket = new UdpServerSocket(clientPort);
    231   this->clientSocket= new UdpServerSocket(proxyPort);
     230  PRINTF(0)(" Creating new Server: listening for clients on port %i and for proxies on port %i", clientPort, proxyPort);
     231  this->clientSocket= new UdpServerSocket(clientPort);
     232  this->proxySocket = new UdpServerSocket(proxyPort);
    232233}
    233234
  • branches/proxy/src/story_entities/multi_player_world_data.cc

    r9466 r9476  
    112112  const TiXmlElement* element = NULL;
    113113
    114   if( SharedNetworkData::getInstance()->isMasterServer())
     114  if( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
    115115  {
    116116    /* load the spawning points */
     
    148148    element = element->FirstChildElement();
    149149
    150     if( SharedNetworkData::getInstance()->isMasterServer() )
     150    if( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
    151151    {
    152152      while( element != NULL)
     
    206206
    207207
    208     if( SharedNetworkData::getInstance()->isMasterServer())
     208    if( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
    209209    {
    210210      this->localPlayer = new Player();
     
    284284
    285285  // create server playable
    286   if ( SharedNetworkData::getInstance()->isMasterServer())
     286  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
    287287  {
    288288    NetworkGameManager::getInstance()->signalNewPlayer( 0 );
Note: See TracChangeset for help on using the changeset viewer.