Changeset 6404 in orxonox.OLD for branches/network/src/story_entities/multi_player_world.cc
- Timestamp:
- Jan 4, 2006, 1:49:20 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/story_entities/multi_player_world.cc
r6402 r6404 16 16 17 17 #include "multi_player_world.h" 18 #include "multi_player_world_data.h" 18 19 19 #include "state.h" 20 #include "class_list.h" 21 20 #include "factory.h" 22 21 #include "load_param.h" 23 #include "fast_factory.h"24 #include "factory.h"25 26 27 #include "shell_command.h"28 #include "resource_manager.h"29 #include "state.h"30 31 #include "game_loader.h"32 #include "glmenu_imagescreen.h"33 34 #include "p_node.h"35 #include "world_entity.h"36 #include "player.h"37 #include "camera.h"38 #include "environment.h"39 #include "terrain.h"40 41 42 22 43 23 44 24 using namespace std; 25 45 26 46 27 //! This creates a Factory to fabricate a MultiPlayerWorld … … 53 34 this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld"); 54 35 55 this->path = NULL; 56 36 this->multiPlayerWorldData = new MultiPlayerWorldData(); 57 37 this->loadParams(root); 58 38 } … … 68 48 { 69 49 PRINTF(3)("MultiPlayerWorld::~MultiPlayerWorld() - deleting current world\n"); 70 } 71 72 73 /** 74 * initializes the world. 75 * @param name the name of the world 76 * @param worldID the ID of this world 77 * 78 * set all stuff here that is world generic and does not use to much memory 79 * because the real init() function StoryEntity::init() will be called 80 * shortly before start of the game. 81 * since all worlds are initiated/referenced before they will be started. 82 * NO LEVEL LOADING HERE - NEVER! 83 */ 84 void MultiPlayerWorld::constuctorInit(const char* name, int worldID) 85 { 86 this->gameTime = 0.0f; 87 this->setSpeed(1.0); 88 this->shell = NULL; 89 90 this->showPNodes = false; 91 this->showBV = false; 50 if( this->multiPlayerWorldData) 51 delete this->multiPlayerWorldData; 92 52 } 93 53 … … 107 67 108 68 109 /**110 * loads the GameWorld by initializing all resources, and set their default values.111 */112 ErrorMessage MultiPlayerWorld::load()113 {114 115 ////////////////////////////116 // Loading Spawning Point //117 ////////////////////////////118 // element = root->FirstChildElement("SpawningPoints");119 // if( element == NULL)120 // {121 // PRINTF(1)("NetworkWorld is missing 'SpawningPoints'\n");122 // }123 // else124 // {125 // element = element->FirstChildElement();126 // // load Players/Objects/Whatever127 // PRINTF(4)("Loading Spawning Points\n");128 // while( element != NULL)129 // {130 // BaseObject* created = Factory::fabricate(element);131 // if( created != NULL )132 // {133 // // if(created->isA(CL_SPAWNING_POINT))134 // // this->spawn(dynamic_cast<WorldEntity*>(created));135 // printf("Created a Spawning Point %s: %s\n", created->getClassName(), created->getName());136 // }137 //138 //139 // element = element->NextSiblingElement();140 // glmis->step(); //! @todo temporary141 // }142 // PRINTF(4)("Done loading NetworkWorldEntities\n");143 // }144 //145 //146 // ////////////////////////147 // // find WorldEntities //148 // ////////////////////////149 // element = root->FirstChildElement("WorldEntities");150 // if( element == NULL)151 // {152 // PRINTF(1)("NetworkWorld is missing 'WorldEntities'\n");153 // }154 // else155 // {156 // element = element->FirstChildElement();157 // // load Players/Objects/Whatever158 // PRINTF(4)("Loading NetworkWorldEntities\n");159 // while( element != NULL)160 // {161 // if( NetworkManager::getInstance()->isGameServer())162 // {163 //164 // BaseObject* created = NetworkGameManager::getInstance()->createEntity(element);165 // if( created != NULL )166 // {167 // // if(created->isA(CL_WORLD_ENTITY))168 // // this->spawn(dynamic_cast<WorldEntity*>(created));169 // printf("Created a %s: %s\n", created->getClassName(), created->getName());170 // }171 // else172 // PRINTF(1)("NetworkWorld: could not create this entity\n");173 //174 // // if we load a 'Player' we use it as localPlayer175 //176 //177 // //todo do this more elegant178 // if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))179 // sky = dynamic_cast<WorldEntity*>(created);180 // if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))181 // {182 // terrain = dynamic_cast<Terrain*>(created);183 // CDEngine::getInstance()->setTerrain(terrain);184 //185 // }186 //187 // }188 // else if( /* !strcmp( element->Value(), "SkyBox") || */ /* !strcmp( element->Value(), "Terrain") || */ !strcmp( element->Value(), "SpaceShip"))189 // {190 // BaseObject* created = Factory::fabricate(element);191 // if( created != NULL )192 // {193 // // if(created->isA(CL_WORLD_ENTITY))194 // // this->spawn(dynamic_cast<WorldEntity*>(created));195 // printf("Created a %s: %s\n", created->getClassName(), created->getName());196 // }197 // else198 // PRINTF(1)("NetworkWorld: could not create this entity\n");199 //200 // // if we load a 'Player' we use it as localPlayer201 //202 //203 // //todo do this more elegant204 // if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))205 // sky = dynamic_cast<WorldEntity*>(created);206 // if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))207 // {208 // terrain = dynamic_cast<Terrain*>(created);209 // CDEngine::getInstance()->setTerrain(terrain);210 // }211 // }212 // element = element->NextSiblingElement();213 // glmis->step(); //! @todo temporary214 // PRINTF(4)("Done loading NetworkWorldEntities\n");215 // }216 }217 69 218 70 219 220
Note: See TracChangeset
for help on using the changeset viewer.