Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9541 in orxonox.OLD for branches/proxy/src/lib


Ignore:
Timestamp:
Jul 28, 2006, 10:33:34 AM (18 years ago)
Author:
patrick
Message:

discovered a bug in the client id assignement algorithm. corrected. proxy control center should work now. testing

Location:
branches/proxy/src/lib/network
Files:
5 edited

Legend:

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

    r9529 r9541  
    275275      else
    276276      {
    277         // forwarding the messages but only if its not a client
    278         if( !SharedNetworkData::getInstance()->isClient())
     277        // forwarding the messages but only if its a proxy
     278        if( /*!SharedNetworkData::getInstance()->isClient()*/ SharedNetworkData::getInstance()->isProxyServerActive())
    279279        {
    280280          PRINTF(0)("===========>> Forwarding Message msg with type: %i, from sender %i, to rec: %i\n", messageType, senderId, destinationId);
  • branches/proxy/src/lib/network/network_game_manager.cc

    r9537 r9541  
    9191bool NetworkGameManager::signalNewPlayer( int userId )
    9292{
    93   assert( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServerActive());
     93  assert( SharedNetworkData::getInstance()->isMasterServer());
    9494  assert( State::getGameRules() );
    9595  assert( State::getGameRules()->isA( CL_NETWORK_GAME_RULES ) );
  • branches/proxy/src/lib/network/network_stream.cc

    r9538 r9541  
    398398        //userId = 1;
    399399        // each server (proxy and master) have an address space for new network nodes of 1000 nodes
    400         userId = SharedNetworkData::getInstance()->getHostID() * 1000;
     400        userId = SharedNetworkData::getInstance()->getHostID() * 1000 + 1;
    401401
    402402        for ( PeerList::iterator it = peers.begin(); it != peers.end(); it++ )
  • branches/proxy/src/lib/network/player_stats.cc

    r9531 r9541  
    163163  if ( this->playable && userId == SharedNetworkData::getInstance()->getHostID() )
    164164  {
     165    PRINTF(0)(">>>>>>>>>>>>>>>>>>>>>> assign playable %i to user %i (localuser)\n\n\n", this->playable->getUniqueID(), userId);
    165166    State::getPlayer()->setPlayable( this->playable );
    166167    // also set the team id
  • branches/proxy/src/lib/network/proxy/proxy_control.cc

    r9540 r9541  
    2121#include "state.h"
    2222#include "shared_network_data.h"
     23#include "network_game_manager.h"
    2324
    2425#include "converter.h"
     
    103104bool ProxyControl::messageHandlerNewClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  )
    104105{
    105   PRINTF(0)("Got Signal: new player arrived\n");
     106  int userId;
     107  // body data length correct?
     108  if ( dataLength != INTSIZE )
     109  {
     110    PRINTF(2)("new client message has wrong size: %d\n", dataLength );
     111    return true;
     112  }
     113  // read the userId fromt he message body
     114  assert( Converter::byteArrayToInt( data, &userId) == INTSIZE );
     115
     116  PRINTF(0)("Got Signal: new player arrived with userId: %i\n", userId);
    106117  // part for the master server
    107118  if( SharedNetworkData::getInstance()->isMasterServer())
    108119  {
    109 
     120    // we now create the new player ship and stuff...
     121    NetworkGameManager::getInstance()->signalNewPlayer(userId);
    110122  }
    111123  else if(SharedNetworkData::getInstance()->isProxyServerActive())
Note: See TracChangeset for help on using the changeset viewer.