Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8014 in orxonox.OLD for branches/network


Ignore:
Timestamp:
May 31, 2006, 8:21:07 AM (18 years ago)
Author:
rennerc
Message:

new NetworkGameManager works now

Location:
branches/network/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/importer/height_map.cc

    r7954 r8014  
    134134    w = yOffset;
    135135
    136     PRINTF(0)("Values: i = %i, w = %i\n", i, w);
     136//    PRINTF(0)("Values: i = %i, w = %i\n", i, w);
    137137
    138138    // add a vertex to the list
     
    599599  float c = normalVectorField [(xInt)][yInt].y;
    600600
    601   PRINTF(0)("a: %f \n" ,a);
    602   PRINTF(0)("b: %f \n" ,b);
    603   PRINTF(0)("c: %f \n" ,c);
     601//  PRINTF(0)("a: %f \n" ,a);
     602//  PRINTF(0)("b: %f \n" ,b);
     603//  PRINTF(0)("c: %f \n" ,c);
    604604
    605605
  • branches/network/src/lib/network/network_game_manager.cc

    r7984 r8014  
    5757
    5858  this->setSynchronized(true);
     59
    5960}
    6061
     
    7475bool NetworkGameManager::signalNewPlayer( int userId )
    7576{
     77  assert( SharedNetworkData::getInstance()->isGameServer() );
     78  assert( State::getGameRules() );
    7679  assert( State::getGameRules()->isA( CL_NETWORK_GAME_RULES ) );
    7780 
     
    8487  BaseObject * bo = Factory::fabricate( playableClassId );
    8588 
     89  assert( bo != NULL );
    8690  assert( bo->isA( CL_PLAYABLE ) );
    8791 
     
    8993 
    9094  playable.loadModel( playableModel );
     95  playable.setOwner( userId );
     96  playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() );
     97  playable.setSynchronized( true );
    9198 
    9299  PlayerStats * stats = rules.getNewPlayerStats( userId );
     100 
     101  stats->setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() );
     102  stats->setSynchronized( true );
     103  stats->setOwner( getHostID() );
    93104 
    94105  stats->setTeamId( team );
  • branches/network/src/lib/network/player_stats.cc

    r7984 r8014  
    5959  playableUniqueId_handle = registerVarId( new SynchronizeableInt( &playableUniqueId, &playableUniqueId, "playableUniqueId" ) );
    6060  modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName" ) );
     61 
     62  PRINTF(0)("PlayerStats created\n");
    6163}
    6264
     
    8082  {
    8183    this->setPlayableUniqueId( this->playableUniqueId );
     84   
     85    PRINTF(0)("uniqueID changed %d %d\n", userId, getHostID());
    8286   
    8387    if ( userId == getHostID() )
  • branches/network/src/lib/network/player_stats.h

    r7984 r8014  
    2424    virtual void varChangeHandler( std::list<int> & id );
    2525   
    26     PlayerStats * getStats( int userId );
     26    static PlayerStats * getStats( int userId );
    2727   
    2828    inline int getUserId(){ return userId; }
  • branches/network/src/lib/network/synchronizeable.cc

    r7979 r8014  
    3636{
    3737  this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable");
    38   this->owner = -1;
     38  this->owner = 0;
    3939  this->hostID = SharedNetworkData::getInstance()->getHostID();
    4040  this->setIsServer(this->hostID == 0);
     
    333333void Synchronizeable::registerVar( SynchronizeableVar * var )
    334334{
    335   PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str());
     335  //PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str());
    336336  syncVarList.push_back( var );
    337337}
     
    345345int Synchronizeable::registerVarId( SynchronizeableVar * var )
    346346{
    347   PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str());
     347  //PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str());
    348348  syncVarList.push_back( var );
    349349  var->setWatched( true );
  • branches/network/src/story_entities/multi_player_world_data.cc

    r7984 r8014  
    4545#include "network_manager.h"
    4646#include "network_game_manager.h"
     47#include "player_stats.h"
    4748
    4849
     
    203204      this->localPlayer = new Player();
    204205
     206#if 0
    205207      Playable* playable;
    206208      const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
     
    215217        playable->setPlayDirection(Quaternion(M_PI, Vector(0.0, 1.0, 0.0)));
    216218      }
     219#endif
    217220    }
    218221    else
     
    244247 
    245248  State::setPlayer(this->localPlayer);
     249 
    246250}
    247251
     
    265269  /* call underlying function */
    266270  GameWorldData::loadScene(root);
     271 
     272  if ( NetworkManager::getInstance()->isGameServer() )
     273  {
     274    NetworkGameManager::getInstance()->signalNewPlayer( 0 );
     275    State::getPlayer()->setPlayable( PlayerStats::getStats( 0 )->getPlayable() );
     276  }
    267277}
    268278
Note: See TracChangeset for help on using the changeset viewer.