- Timestamp:
- May 31, 2006, 8:21:07 AM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/graphics/importer/height_map.cc
r7954 r8014 134 134 w = yOffset; 135 135 136 PRINTF(0)("Values: i = %i, w = %i\n", i, w);136 // PRINTF(0)("Values: i = %i, w = %i\n", i, w); 137 137 138 138 // add a vertex to the list … … 599 599 float c = normalVectorField [(xInt)][yInt].y; 600 600 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); 604 604 605 605 -
branches/network/src/lib/network/network_game_manager.cc
r7984 r8014 57 57 58 58 this->setSynchronized(true); 59 59 60 } 60 61 … … 74 75 bool NetworkGameManager::signalNewPlayer( int userId ) 75 76 { 77 assert( SharedNetworkData::getInstance()->isGameServer() ); 78 assert( State::getGameRules() ); 76 79 assert( State::getGameRules()->isA( CL_NETWORK_GAME_RULES ) ); 77 80 … … 84 87 BaseObject * bo = Factory::fabricate( playableClassId ); 85 88 89 assert( bo != NULL ); 86 90 assert( bo->isA( CL_PLAYABLE ) ); 87 91 … … 89 93 90 94 playable.loadModel( playableModel ); 95 playable.setOwner( userId ); 96 playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() ); 97 playable.setSynchronized( true ); 91 98 92 99 PlayerStats * stats = rules.getNewPlayerStats( userId ); 100 101 stats->setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() ); 102 stats->setSynchronized( true ); 103 stats->setOwner( getHostID() ); 93 104 94 105 stats->setTeamId( team ); -
branches/network/src/lib/network/player_stats.cc
r7984 r8014 59 59 playableUniqueId_handle = registerVarId( new SynchronizeableInt( &playableUniqueId, &playableUniqueId, "playableUniqueId" ) ); 60 60 modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName" ) ); 61 62 PRINTF(0)("PlayerStats created\n"); 61 63 } 62 64 … … 80 82 { 81 83 this->setPlayableUniqueId( this->playableUniqueId ); 84 85 PRINTF(0)("uniqueID changed %d %d\n", userId, getHostID()); 82 86 83 87 if ( userId == getHostID() ) -
branches/network/src/lib/network/player_stats.h
r7984 r8014 24 24 virtual void varChangeHandler( std::list<int> & id ); 25 25 26 PlayerStats * getStats( int userId );26 static PlayerStats * getStats( int userId ); 27 27 28 28 inline int getUserId(){ return userId; } -
branches/network/src/lib/network/synchronizeable.cc
r7979 r8014 36 36 { 37 37 this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable"); 38 this->owner = -1;38 this->owner = 0; 39 39 this->hostID = SharedNetworkData::getInstance()->getHostID(); 40 40 this->setIsServer(this->hostID == 0); … … 333 333 void Synchronizeable::registerVar( SynchronizeableVar * var ) 334 334 { 335 PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str());335 //PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str()); 336 336 syncVarList.push_back( var ); 337 337 } … … 345 345 int Synchronizeable::registerVarId( SynchronizeableVar * var ) 346 346 { 347 PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str());347 //PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str()); 348 348 syncVarList.push_back( var ); 349 349 var->setWatched( true ); -
branches/network/src/story_entities/multi_player_world_data.cc
r7984 r8014 45 45 #include "network_manager.h" 46 46 #include "network_game_manager.h" 47 #include "player_stats.h" 47 48 48 49 … … 203 204 this->localPlayer = new Player(); 204 205 206 #if 0 205 207 Playable* playable; 206 208 const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE); … … 215 217 playable->setPlayDirection(Quaternion(M_PI, Vector(0.0, 1.0, 0.0))); 216 218 } 219 #endif 217 220 } 218 221 else … … 244 247 245 248 State::setPlayer(this->localPlayer); 249 246 250 } 247 251 … … 265 269 /* call underlying function */ 266 270 GameWorldData::loadScene(root); 271 272 if ( NetworkManager::getInstance()->isGameServer() ) 273 { 274 NetworkGameManager::getInstance()->signalNewPlayer( 0 ); 275 State::getPlayer()->setPlayable( PlayerStats::getStats( 0 )->getPlayable() ); 276 } 267 277 } 268 278
Note: See TracChangeset
for help on using the changeset viewer.