Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8838 in orxonox.OLD


Ignore:
Timestamp:
Jun 28, 2006, 12:44:07 AM (18 years ago)
Author:
patrick
Message:

mulitplayer: debuggin session

Location:
branches/multi_player_map/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/multi_player_map/src/lib/collision_detection/cd_engine.cc

    r8490 r8838  
    8484        if( likely((*entity2) != this->terrain))
    8585        {
    86           PRINTF(4)("checking object %s against %s\n", (*entity1)->getName(), (*entity2)->getName());
     86          PRINTF(5)("checking object %s (%s) against %s (%s)\n", (*entity1)->getClassName(), (*entity1)->getName(), (*entity2)->getClassName(), (*entity2)->getName());
    8787          tree = (*entity1)->getOBBTree();
    8888          if( likely(tree != NULL) && (*entity2)->getOBBTree() != NULL)
  • branches/multi_player_map/src/lib/collision_detection/obb_tree_node.cc

    r8776 r8838  
    516516        (treeNode->nodeRight == NULL && treeNode->nodeLeft == NULL)) )
    517517    {
     518      PRINTF(0)("----------------------------------------------\\n\n\n\n\n\n--------------------------------\n\n\n");
    518519      nodeA->registerCollision(nodeA, nodeB, (BoundingVolume*)this->bvElement, (BoundingVolume*)treeNode->bvElement);
    519520    }
  • branches/multi_player_map/src/lib/collision_reaction/cr_object_damage.cc

    r8779 r8838  
    5656  float damage = 0.0f;
    5757
    58   PRINTF(4)("Dealing damage - Handling collision: %s vs %s\n",
     58  PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",
    5959            collision->getEntityA()->getClassName(),
    6060            collision->getEntityB()->getClassName());
  • branches/multi_player_map/src/story_entities/multi_player_world.cc

    r8833 r8838  
    9494{
    9595  //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS), this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     96
     97  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_PLAYERS_PROJ\n\n");
    9698  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    9799    this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
    98    
     100
     101  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    99102  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    100103    this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
     104  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    101105  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    102106    this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
    103107
     108  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01_PROJ\n\n");
    104109  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    105110    this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
     111  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_01 vs OM_GROUP_00_PROJ\n\n");
    106112  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    107113    this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
     114  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01\n\n");
    108115  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    109116    this->dataTank->objectManager->getObjectList(OM_GROUP_01));
    110117
     118  PRINTF(5)("\n-----------------------------------------\nchecking OM_COMMON vs OM_GROUP_00\n\n");
    111119  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    112120    this->dataTank->objectManager->getObjectList(OM_COMMON));
     121  PRINTF(5)("\n-----------------------------------------\nchecking OM_COMMON vs OM_GROUP_01\n\n");
    113122  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    114123    this->dataTank->objectManager->getObjectList(OM_COMMON));
     124  PRINTF(5)("\n-----------------------------------------\nchecking OM_COMMON vs OM_PLAYER\n\n");
     125  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
     126  this->dataTank->objectManager->getObjectList(OM_COMMON));
    115127
    116128}
  • branches/multi_player_map/src/util/multiplayer_team_deathmatch.cc

    r8827 r8838  
    8585  subscribeEvent( ES_MENU, SDLK_F1 );
    8686  subscribeEvent( ES_MENU, KeyMapper::PEV_FIRE1 );
    87  
     87
    8888  this->notifier = new OrxGui::GLGuiNotifier();
    8989  this->notifier->show();
     
    106106  unsubscribeEvent( ES_MENU, SDLK_F1 );
    107107  unsubscribeEvent( ES_MENU, KeyMapper::PEV_FIRE1 );
    108  
     108
    109109  if ( this->notifier )
    110110  {
     
    219219  if ( !SharedNetworkData::getInstance()->isGameServer() )
    220220    return;
    221    
     221
    222222  //handle kills
    223223  for ( std::vector<Kill>::iterator it = this->killList.begin(); it != this->killList.end();  )
    224224  {
    225225    std::vector<Kill>::iterator delit = it;
    226    
     226
    227227    onKill( it->getKiller()->getOwner(), it->getVictim()->getOwner() );
    228    
     228
    229229    it++;
    230230    killList.erase( delit );
    231231  }
    232  
     232
    233233  gameStateTimer -= dt;
    234234  //PRINTF(0)("TICK %f\n", gameStateTimer);
     
    482482  playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() );
    483483  playable.setSynchronized( true );
    484  
     484
    485485  stats.setTeamId( stats.getPreferedTeamId() );
    486486  stats.setPlayableClassId( playableClassId );
    487487  stats.setPlayableUniqueId( playable.getUniqueID() );
    488488  stats.setModelFileName( playableModel );
    489  
     489
    490490  this->respawnPlayable( &playable, stats.getPreferedTeamId(), 0.0f );
    491491
     
    629629  statsBox = new OrxGui::GLGuiBox();
    630630  statsBox->setAbsCoor2D( 300, 100 );
    631  
     631
    632632  this->table = new OrxGui::GLGuiTable(0,0);
    633633
     
    647647      statsBox = NULL;
    648648    }
    649      
     649
    650650    EventHandler::getInstance()->popState();
    651651}
     
    666666  headers.push_back("");
    667667  this->table->setHeader(headers);
    668  
     668
    669669  std::map<int,std::string> fragsTeam0;
    670670  std::map<int,std::string> fragsTeam1;
    671  
     671
    672672  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
    673  
     673
    674674  if ( !list )
    675675    return;
    676  
     676
    677677  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    678678  {
    679679    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
    680    
     680
    681681    if ( stats.getTeamId() == 0 || stats.getTeamId() == 1 )
    682682    {
     
    687687    }
    688688  }
    689  
     689
    690690  char st[10];
    691691  int i = 0;
    692  
    693  
     692
     693
    694694  i = 2;
    695695  for ( std::map<int,std::string>::const_iterator it = fragsTeam0.begin(); it != fragsTeam0.end(); it++ )
     
    701701    i++;
    702702  }
    703  
     703
    704704  i = 2;
    705705  for ( std::map<int,std::string>::const_iterator it = fragsTeam1.begin(); it != fragsTeam1.end(); it++ )
     
    714714/**
    715715 * this function is called when a player kills another one or himself
    716  * @param killedUserId 
    717  * @param userId 
     716 * @param killedUserId
     717 * @param userId
    718718 */
    719719void MultiplayerTeamDeathmatch::onKill( int killedUserId, int userId )
     
    721721  assert( PlayerStats::getStats( killedUserId ) );
    722722  assert( PlayerStats::getStats( userId ) );
    723  
     723
    724724  PlayerStats & killedStats = *PlayerStats::getStats( killedUserId );
    725725  PlayerStats & stats = *PlayerStats::getStats( userId );
    726  
     726
    727727  if ( killedUserId != userId )
    728728    stats.setScore( stats.getScore() + 1 );
    729729  else
    730730    stats.setScore( stats.getScore() - 1 );
    731  
     731
    732732  if ( killedUserId == SharedNetworkData::getInstance()->getHostID() )
    733733  {
     
    735735    this->showStats();
    736736  }
    737  
     737
    738738  this->respawnPlayable( killedStats.getPlayable(), killedStats.getTeamId(), 3.0f );
    739739}
     
    741741/**
    742742 * this function is called on player respawn
    743  * @param userId 
     743 * @param userId
    744744 */
    745745void MultiplayerTeamDeathmatch::onRespawn( int userId )
     
    754754/**
    755755 * this function is called on player respawn
    756  * @param we 
     756 * @param we
    757757 */
    758758void MultiplayerTeamDeathmatch::registerSpawn( WorldEntity * we )
     
    761761}
    762762
     763
    763764void MultiplayerTeamDeathmatch::respawnPlayable( Playable * playable, int teamId, float delay )
    764765{
    765766  const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT );
    766  
     767
    767768  assert( list );
    768  
     769
    769770  std::vector<SpawningPoint*> spList;
    770  
     771
    771772  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    772773  {
    773774    SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it);
    774    
     775
    775776    if ( sp->getTeamId() == teamId )
    776777      spList.push_back( sp );
    777778  }
    778  
     779
    779780  if ( spList.size() == 0 )
    780781  {
     
    782783    {
    783784      SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it);
    784    
     785
    785786      if ( sp->getTeamId() < 0 )
    786787        spList.push_back( sp );
    787788    }
    788789  }
    789  
     790
    790791  assert( spList.size() != 0 );
    791  
     792
    792793  int n = (int)((float)spList.size() * (float)rand()/(float)RAND_MAX);
    793  
     794
    794795  spList[n]->pushEntity( playable, delay );
    795796}
  • branches/multi_player_map/src/world_entities/playable.cc

    r8827 r8838  
    6565
    6666  this->bDead = false;
    67  
     67
    6868  this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
    6969
  • branches/multi_player_map/src/world_entities/space_ships/space_ship.cc

    r8827 r8838  
    220220  this->burstSystem->setColor(0.5, .5,.5,.8,.8);
    221221  this->burstSystem->setColor(1.0, .8,.8,.8,.0);
    222  
     222
    223223  registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity" ) );
    224224  registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mousedir", PERMISSION_OWNER ) );
     
    511511void SpaceShip::respawn( )
    512512{
    513   toList( OM_PLAYERS );
    514 }
    515 
    516 
    517 
    518 
     513  if( this->uniqueID %2)
     514  toList( OM_GROUP_00 );
     515  else
     516    toList(OM_GROUP_01);
     517}
     518
     519
     520
     521
  • branches/multi_player_map/src/world_entities/world_entity.cc

    r8832 r8838  
    412412bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
    413413{
     414  PRINTF(0)("registering collision\n\n\n\n");
    414415  // is there any handler listening?
    415416  if( !this->bReactive)
     
    833834    loadModel( modelFileName, scaling );
    834835  }
    835  
     836
    836837  if ( std::find( id.begin(), id.end(), list_handle ) != id.end() )
    837838  {
Note: See TracChangeset for help on using the changeset viewer.