Changeset 8838 in orxonox.OLD for branches/multi_player_map/src
- Timestamp:
- Jun 28, 2006, 12:44:07 AM (18 years ago)
- 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 84 84 if( likely((*entity2) != this->terrain)) 85 85 { 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()); 87 87 tree = (*entity1)->getOBBTree(); 88 88 if( likely(tree != NULL) && (*entity2)->getOBBTree() != NULL) -
branches/multi_player_map/src/lib/collision_detection/obb_tree_node.cc
r8776 r8838 516 516 (treeNode->nodeRight == NULL && treeNode->nodeLeft == NULL)) ) 517 517 { 518 PRINTF(0)("----------------------------------------------\\n\n\n\n\n\n--------------------------------\n\n\n"); 518 519 nodeA->registerCollision(nodeA, nodeB, (BoundingVolume*)this->bvElement, (BoundingVolume*)treeNode->bvElement); 519 520 } -
branches/multi_player_map/src/lib/collision_reaction/cr_object_damage.cc
r8779 r8838 56 56 float damage = 0.0f; 57 57 58 PRINTF( 4)("Dealing damage - Handling collision: %s vs %s\n",58 PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n", 59 59 collision->getEntityA()->getClassName(), 60 60 collision->getEntityB()->getClassName()); -
branches/multi_player_map/src/story_entities/multi_player_world.cc
r8833 r8838 94 94 { 95 95 //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"); 96 98 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS), 97 99 this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ)); 98 100 101 PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n"); 99 102 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS), 100 103 this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ)); 104 PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n"); 101 105 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS), 102 106 this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ)); 103 107 108 PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01_PROJ\n\n"); 104 109 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00), 105 110 this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ)); 111 PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_01 vs OM_GROUP_00_PROJ\n\n"); 106 112 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01), 107 113 this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ)); 114 PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01\n\n"); 108 115 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00), 109 116 this->dataTank->objectManager->getObjectList(OM_GROUP_01)); 110 117 118 PRINTF(5)("\n-----------------------------------------\nchecking OM_COMMON vs OM_GROUP_00\n\n"); 111 119 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00), 112 120 this->dataTank->objectManager->getObjectList(OM_COMMON)); 121 PRINTF(5)("\n-----------------------------------------\nchecking OM_COMMON vs OM_GROUP_01\n\n"); 113 122 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01), 114 123 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)); 115 127 116 128 } -
branches/multi_player_map/src/util/multiplayer_team_deathmatch.cc
r8827 r8838 85 85 subscribeEvent( ES_MENU, SDLK_F1 ); 86 86 subscribeEvent( ES_MENU, KeyMapper::PEV_FIRE1 ); 87 87 88 88 this->notifier = new OrxGui::GLGuiNotifier(); 89 89 this->notifier->show(); … … 106 106 unsubscribeEvent( ES_MENU, SDLK_F1 ); 107 107 unsubscribeEvent( ES_MENU, KeyMapper::PEV_FIRE1 ); 108 108 109 109 if ( this->notifier ) 110 110 { … … 219 219 if ( !SharedNetworkData::getInstance()->isGameServer() ) 220 220 return; 221 221 222 222 //handle kills 223 223 for ( std::vector<Kill>::iterator it = this->killList.begin(); it != this->killList.end(); ) 224 224 { 225 225 std::vector<Kill>::iterator delit = it; 226 226 227 227 onKill( it->getKiller()->getOwner(), it->getVictim()->getOwner() ); 228 228 229 229 it++; 230 230 killList.erase( delit ); 231 231 } 232 232 233 233 gameStateTimer -= dt; 234 234 //PRINTF(0)("TICK %f\n", gameStateTimer); … … 482 482 playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() ); 483 483 playable.setSynchronized( true ); 484 484 485 485 stats.setTeamId( stats.getPreferedTeamId() ); 486 486 stats.setPlayableClassId( playableClassId ); 487 487 stats.setPlayableUniqueId( playable.getUniqueID() ); 488 488 stats.setModelFileName( playableModel ); 489 489 490 490 this->respawnPlayable( &playable, stats.getPreferedTeamId(), 0.0f ); 491 491 … … 629 629 statsBox = new OrxGui::GLGuiBox(); 630 630 statsBox->setAbsCoor2D( 300, 100 ); 631 631 632 632 this->table = new OrxGui::GLGuiTable(0,0); 633 633 … … 647 647 statsBox = NULL; 648 648 } 649 649 650 650 EventHandler::getInstance()->popState(); 651 651 } … … 666 666 headers.push_back(""); 667 667 this->table->setHeader(headers); 668 668 669 669 std::map<int,std::string> fragsTeam0; 670 670 std::map<int,std::string> fragsTeam1; 671 671 672 672 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS ); 673 673 674 674 if ( !list ) 675 675 return; 676 676 677 677 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 678 678 { 679 679 PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it); 680 680 681 681 if ( stats.getTeamId() == 0 || stats.getTeamId() == 1 ) 682 682 { … … 687 687 } 688 688 } 689 689 690 690 char st[10]; 691 691 int i = 0; 692 693 692 693 694 694 i = 2; 695 695 for ( std::map<int,std::string>::const_iterator it = fragsTeam0.begin(); it != fragsTeam0.end(); it++ ) … … 701 701 i++; 702 702 } 703 703 704 704 i = 2; 705 705 for ( std::map<int,std::string>::const_iterator it = fragsTeam1.begin(); it != fragsTeam1.end(); it++ ) … … 714 714 /** 715 715 * this function is called when a player kills another one or himself 716 * @param killedUserId 717 * @param userId 716 * @param killedUserId 717 * @param userId 718 718 */ 719 719 void MultiplayerTeamDeathmatch::onKill( int killedUserId, int userId ) … … 721 721 assert( PlayerStats::getStats( killedUserId ) ); 722 722 assert( PlayerStats::getStats( userId ) ); 723 723 724 724 PlayerStats & killedStats = *PlayerStats::getStats( killedUserId ); 725 725 PlayerStats & stats = *PlayerStats::getStats( userId ); 726 726 727 727 if ( killedUserId != userId ) 728 728 stats.setScore( stats.getScore() + 1 ); 729 729 else 730 730 stats.setScore( stats.getScore() - 1 ); 731 731 732 732 if ( killedUserId == SharedNetworkData::getInstance()->getHostID() ) 733 733 { … … 735 735 this->showStats(); 736 736 } 737 737 738 738 this->respawnPlayable( killedStats.getPlayable(), killedStats.getTeamId(), 3.0f ); 739 739 } … … 741 741 /** 742 742 * this function is called on player respawn 743 * @param userId 743 * @param userId 744 744 */ 745 745 void MultiplayerTeamDeathmatch::onRespawn( int userId ) … … 754 754 /** 755 755 * this function is called on player respawn 756 * @param we 756 * @param we 757 757 */ 758 758 void MultiplayerTeamDeathmatch::registerSpawn( WorldEntity * we ) … … 761 761 } 762 762 763 763 764 void MultiplayerTeamDeathmatch::respawnPlayable( Playable * playable, int teamId, float delay ) 764 765 { 765 766 const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT ); 766 767 767 768 assert( list ); 768 769 769 770 std::vector<SpawningPoint*> spList; 770 771 771 772 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 772 773 { 773 774 SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it); 774 775 775 776 if ( sp->getTeamId() == teamId ) 776 777 spList.push_back( sp ); 777 778 } 778 779 779 780 if ( spList.size() == 0 ) 780 781 { … … 782 783 { 783 784 SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it); 784 785 785 786 if ( sp->getTeamId() < 0 ) 786 787 spList.push_back( sp ); 787 788 } 788 789 } 789 790 790 791 assert( spList.size() != 0 ); 791 792 792 793 int n = (int)((float)spList.size() * (float)rand()/(float)RAND_MAX); 793 794 794 795 spList[n]->pushEntity( playable, delay ); 795 796 } -
branches/multi_player_map/src/world_entities/playable.cc
r8827 r8838 65 65 66 66 this->bDead = false; 67 67 68 68 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY); 69 69 -
branches/multi_player_map/src/world_entities/space_ships/space_ship.cc
r8827 r8838 220 220 this->burstSystem->setColor(0.5, .5,.5,.8,.8); 221 221 this->burstSystem->setColor(1.0, .8,.8,.8,.0); 222 222 223 223 registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity" ) ); 224 224 registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mousedir", PERMISSION_OWNER ) ); … … 511 511 void SpaceShip::respawn( ) 512 512 { 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 412 412 bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB) 413 413 { 414 PRINTF(0)("registering collision\n\n\n\n"); 414 415 // is there any handler listening? 415 416 if( !this->bReactive) … … 833 834 loadModel( modelFileName, scaling ); 834 835 } 835 836 836 837 if ( std::find( id.begin(), id.end(), list_handle ) != id.end() ) 837 838 {
Note: See TracChangeset
for help on using the changeset viewer.