Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6368 in orxonox.OLD


Ignore:
Timestamp:
Dec 31, 2005, 1:40:55 PM (18 years ago)
Author:
patrick
Message:

network: digging deeper to bring more sense into the framework

Location:
branches/network/src/story_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/story_entities/campaign.cc

    r6360 r6368  
    5252
    5353
     54/**
     55 *  initializes the class
     56 */
    5457ErrorMessage Campaign::init()
    5558{
     
    5760}
    5861
    59 /**
    60   \brief loads the Parameters of a Campaign
    61 * @param root: The XML-element to load from
     62
     63/**
     64 *  loads the Parameters of a Campaign
     65 * @param root: The XML-element to load from
    6266 */
    6367void Campaign::loadParams(const TiXmlElement* root)
     
    7276}
    7377
    74 /**
    75   \brief loads a WorldList
    76 * @param root: the XML-element to load from
     78
     79/**
     80 *  loads a WorldList
     81 * @param root: the XML-element to load from
    7782 */
    7883void Campaign::loadWorldListParams(const TiXmlElement* root)
     
    9398}
    9499
     100/**
     101 *  starts the campaing
     102 */
    95103ErrorMessage Campaign::start()
    96104{
     
    98106}
    99107
    100 //! @todo boky -> fix it
     108
     109/**
     110 *  starts the campaing with a specific ID
     111 * @param storyID the id of the StoryEntity
     112 */
    101113ErrorMessage Campaign::start(int storyID = 0)
    102114{
     
    127139      se = this->getStoryEntity(nextWorldID);
    128140      this->currentEntity = se;
    129       if( ( nextWorldID == WORLD_ID_GAMEEND) ||( se == NULL) )
     141      if( ( nextWorldID == WORLD_ID_GAMEEND) || ( se == NULL) )
    130142        {
    131143          PRINTF(4)("Quitting campaing story loop\n");
     
    148160
    149161
     162/**
     163 *  pauses the campaing
     164 */
    150165ErrorMessage Campaign::pause()
    151166{
  • branches/network/src/story_entities/game_world.cc

    r6366 r6368  
    8383GameWorld::GameWorld(const TiXmlElement* root)
    8484{
    85   this->constuctorInit("", -1);
     85  this->setClassID(CL_GAME_WORLD, "GameWorld");
     86  this->setName("Preloaded World - no name yet");
     87
     88  this->gameTime = 0.0f;
     89  this->setSpeed(1.0);
     90  this->music = NULL;
     91  this->shell = NULL;
     92  this->localPlayer = NULL;
     93  this->localCamera = NULL;
     94
     95  this->showPNodes = false;
     96  this->showBV = false;
     97
    8698  this->path = NULL;
    8799
     
    130142}
    131143
    132 /**
    133  *  initializes the world.
    134  * @param name the name of the world
    135  * @param worldID the ID of this world
    136  *
    137  * set all stuff here that is world generic and does not use to much memory
    138  * because the real init() function StoryEntity::init() will be called
    139  * shortly before start of the game.
    140  * since all worlds are initiated/referenced before they will be started.
    141  * NO LEVEL LOADING HERE - NEVER!
    142 */
    143 void GameWorld::constuctorInit(const char* name, int worldID)
    144 {
    145   this->setClassID(CL_GAME_WORLD, "GameWorld");
    146   this->setName(name);
    147 
    148   this->gameTime = 0.0f;
    149   this->setSpeed(1.0);
    150   this->music = NULL;
    151   this->shell = NULL;
    152   this->localPlayer = NULL;
    153   this->localCamera = NULL;
    154 
    155   this->showPNodes = false;
    156   this->showBV = false;
    157 }
     144
    158145
    159146/**
     
    174161    .describe("The Filename of this GameWorld (relative from the data-dir)");
    175162}
     163
    176164
    177165/**
  • branches/network/src/story_entities/game_world.h

    r6366 r6368  
    3535    void loadParams(const TiXmlElement* root);
    3636
    37 
    3837    /* classes from story-entity */
    3938    virtual ErrorMessage preLoad();
     
    7069
    7170  protected:
    72     virtual void constuctorInit(const char* name, int worldID);
    73 
    7471    /* world - running functions */
    7572    virtual void mainLoop ();
  • branches/network/src/story_entities/multi_player_world.cc

    r6366 r6368  
    116116 */
    117117ErrorMessage MultiPlayerWorld::load()
    118 {}
     118{
     119
     120  ////////////////////////////
     121  // Loading Spawning Point //
     122  ////////////////////////////
     123//   element = root->FirstChildElement("SpawningPoints");
     124//   if( element == NULL)
     125//   {
     126//     PRINTF(1)("NetworkWorld is missing 'SpawningPoints'\n");
     127//   }
     128//   else
     129//   {
     130//     element = element->FirstChildElement();
     131//       // load Players/Objects/Whatever
     132//     PRINTF(4)("Loading Spawning Points\n");
     133//     while( element != NULL)
     134//     {
     135//       BaseObject* created = Factory::fabricate(element);
     136//       if( created != NULL )
     137//       {
     138// //        if(created->isA(CL_SPAWNING_POINT))
     139// //          this->spawn(dynamic_cast<WorldEntity*>(created));
     140//         printf("Created a Spawning Point %s: %s\n", created->getClassName(), created->getName());
     141//       }
     142//
     143//
     144//       element = element->NextSiblingElement();
     145//       glmis->step(); //! @todo temporary
     146//     }
     147//     PRINTF(4)("Done loading NetworkWorldEntities\n");
     148//   }
     149//
     150//
     151//   ////////////////////////
     152//   // find WorldEntities //
     153//   ////////////////////////
     154//   element = root->FirstChildElement("WorldEntities");
     155//   if( element == NULL)
     156//   {
     157//     PRINTF(1)("NetworkWorld is missing 'WorldEntities'\n");
     158//   }
     159//   else
     160//   {
     161//     element = element->FirstChildElement();
     162//       // load Players/Objects/Whatever
     163//     PRINTF(4)("Loading NetworkWorldEntities\n");
     164//     while( element != NULL)
     165//     {
     166//       if( NetworkManager::getInstance()->isGameServer())
     167//       {
     168//
     169//         BaseObject* created = NetworkGameManager::getInstance()->createEntity(element);
     170//         if( created != NULL )
     171//         {
     172// //          if(created->isA(CL_WORLD_ENTITY))
     173// //            this->spawn(dynamic_cast<WorldEntity*>(created));
     174//           printf("Created a %s: %s\n", created->getClassName(), created->getName());
     175//         }
     176//         else
     177//           PRINTF(1)("NetworkWorld: could not create this entity\n");
     178//
     179//           // if we load a 'Player' we use it as localPlayer
     180//
     181//
     182//           //todo do this more elegant
     183//         if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
     184//           sky = dynamic_cast<WorldEntity*>(created);
     185//         if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
     186//         {
     187//           terrain = dynamic_cast<Terrain*>(created);
     188//           CDEngine::getInstance()->setTerrain(terrain);
     189//
     190//         }
     191//
     192//       }
     193//       else if( /* !strcmp( element->Value(), "SkyBox") || */ /* !strcmp( element->Value(), "Terrain") || */ !strcmp( element->Value(), "SpaceShip"))
     194//       {
     195//         BaseObject* created = Factory::fabricate(element);
     196//         if( created != NULL )
     197//         {
     198// //          if(created->isA(CL_WORLD_ENTITY))
     199// //            this->spawn(dynamic_cast<WorldEntity*>(created));
     200//           printf("Created a %s: %s\n", created->getClassName(), created->getName());
     201//         }
     202//         else
     203//           PRINTF(1)("NetworkWorld: could not create this entity\n");
     204//
     205//           // if we load a 'Player' we use it as localPlayer
     206//
     207//
     208//           //todo do this more elegant
     209//         if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
     210//           sky = dynamic_cast<WorldEntity*>(created);
     211//         if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
     212//         {
     213//           terrain = dynamic_cast<Terrain*>(created);
     214//           CDEngine::getInstance()->setTerrain(terrain);
     215//         }
     216//       }
     217//       element = element->NextSiblingElement();
     218//       glmis->step(); //! @todo temporary
     219//       PRINTF(4)("Done loading NetworkWorldEntities\n");
     220//     }
     221  }
     222
     223
     224
     225
Note: See TracChangeset for help on using the changeset viewer.