Index: trunk/src/util/loading/game_loader.cc
===================================================================
--- trunk/src/util/loading/game_loader.cc	(revision 5994)
+++ trunk/src/util/loading/game_loader.cc	(revision 6139)
@@ -46,5 +46,5 @@
 /**
  *  simple constructor
-*/
+ */
 GameLoader::GameLoader ()
 {
@@ -57,5 +57,5 @@
 /**
  *  simple deconstructor
-*/
+ */
 GameLoader::~GameLoader ()
 {
@@ -69,7 +69,7 @@
  *  this class is a singleton class
  * @returns an instance of itself
-
-   if you are unsure about singleton classes, check the theory out on the internet :)
-*/
+ *
+ * if you are unsure about singleton classes, check the theory out on the internet :)
+ */
 GameLoader* GameLoader::getInstance()
 {
@@ -81,5 +81,5 @@
 /**
  *  initializes the GameLoader
-*/
+ */
 ErrorMessage GameLoader::init()
 {
@@ -100,7 +100,7 @@
  * @param fileName to be loaded
  * @returns the loaded campaign
-
-   this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
-*/
+ *
+ * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
+ */
 ErrorMessage GameLoader::loadCampaign(const char* fileName)
 {
@@ -112,8 +112,25 @@
       delete[] campaignName;
     }
-//   World* world0 = new World(DEBUG_WORLD_0);
-//   world0->setNextStoryID(WORLD_ID_GAMEEND);
-//   this->currentCampaign->addEntity(world0, WORLD_ID_2);
-}
+}
+
+
+/**
+ *  reads a campaign definition file into a campaign class
+ * @param fileName to be loaded
+ * @returns the loaded campaign
+ *
+ * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
+ */
+ErrorMessage GameLoader::loadNetworkCampaign(const char* fileName)
+{
+  ErrorMessage errorCode;
+  char* campaignName = ResourceManager::getFullName(fileName);
+  if (campaignName)
+  {
+    this->currentCampaign = this->fileToNetworkCampaign(campaignName);
+    delete[] campaignName;
+  }
+}
+
 
 /**
@@ -121,5 +138,5 @@
  * @param campaignID the identifier of the campaign.
  * @returns error message if not able to do so.
-*/
+ */
 ErrorMessage GameLoader::loadDebugCampaign(Uint32 campaignID)
 {
@@ -156,7 +173,7 @@
 
 /**
-  *  starts the current entity
-  * @returns error code if this action has caused a error
-*/
+ *  starts the current entity
+ * @returns error code if this action has caused a error
+ */
 ErrorMessage GameLoader::start()
 {
@@ -167,13 +184,13 @@
 
 /**
-  *  stops the current entity
-  * @returns error code if this action has caused a error
-
-    ATTENTION: this function shouldn't call other functions, or if so, they must return
-    after finishing. If you ignore or forget to do so, the current entity is not able to
-    terminate and it will run in the background or the ressources can't be freed or even
-    worse: are freed and the program will end in a segmentation fault!
-    hehehe, have ya seen it... :)
-*/
+ *  stops the current entity
+ * @returns error code if this action has caused a error
+ *
+ *  ATTENTION: this function shouldn't call other functions, or if so, they must return
+ *  after finishing. If you ignore or forget to do so, the current entity is not able to
+ *  terminate and it will run in the background or the ressources can't be freed or even
+ *  worse: are freed and the program will end in a segmentation fault!
+ *  hehehe, have ya seen it... :)
+ */
 void GameLoader::stop()
 {
@@ -184,9 +201,9 @@
 
 /**
-  *  pause the current entity
-  * @returns error code if this action has caused a error
-
-    this pauses the current entity or passes this call forth to the running entity.
-*/
+ *  pause the current entity
+ * @returns error code if this action has caused a error
+ *
+ * this pauses the current entity or passes this call forth to the running entity.
+ */
 ErrorMessage GameLoader::pause()
 {
@@ -198,9 +215,9 @@
 
 /**
-  *  resumes a pause
-  * @returns error code if this action has caused a error
-
-    this resumess the current entity or passes this call forth to the running entity.
-*/
+ *  resumes a pause
+ * @returns error code if this action has caused a error
+ *
+ *  this resumess the current entity or passes this call forth to the running entity.
+ */
 ErrorMessage GameLoader::resume()
 {
@@ -224,7 +241,7 @@
  * @param fileName to be loaded
  * @returns the loaded campaign
-
-   this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
-*/
+ *
+ * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
+ */
 Campaign* GameLoader::fileToCampaign(const char* fileName)
 {
@@ -273,4 +290,56 @@
 
 /**
+ *  reads a campaign definition file into a campaign class
+ * @param fileName to be loaded
+ * @returns the loaded campaign
+ *
+ *  this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
+ */
+Campaign* GameLoader::fileToNetworkCampaign(const char* fileName)
+{
+  /* do not entirely load the campaign. just the current world
+  before start of each world, it has to be initialized so it
+  can load everything it needs into memory then.
+  */
+
+  if( fileName == NULL)
+  {
+    PRINTF(2)("No filename specified for loading");
+    return NULL;
+  }
+
+  TiXmlDocument* XMLDoc = new TiXmlDocument( fileName);
+  // load the campaign document
+  if( !XMLDoc->LoadFile())
+  {
+      // report an error
+    PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", fileName, XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
+    delete XMLDoc;
+    return NULL;
+  }
+
+  // check basic validity
+  TiXmlElement* root = XMLDoc->RootElement();
+  assert( root != NULL);
+
+  if( strcmp( root->Value(), "Campaign"))
+  {
+      // report an error
+    PRINTF(2)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
+    delete XMLDoc;
+    return NULL;
+  }
+
+  // construct campaign
+  Campaign* c = new Campaign( root);
+
+  // free the XML data
+  delete XMLDoc;
+
+  return c;
+}
+
+
+/**
  *  handle keyboard commands
  * @param event the event to handle
@@ -312,6 +381,6 @@
 
 /**
-  \brief this changes to the next level
-*/
+ *  \brief this changes to the next level
+ */
 void GameLoader::nextLevel()
 {
@@ -322,8 +391,8 @@
 
 /**
-  \brief change to the previous level - not implemented
-
-  this propably useless
-*/
+ *  change to the previous level - not implemented
+ *
+ * this propably useless
+ */
 void GameLoader::previousLevel()
 {
Index: trunk/src/util/loading/game_loader.h
===================================================================
--- trunk/src/util/loading/game_loader.h	(revision 5994)
+++ trunk/src/util/loading/game_loader.h	(revision 6139)
@@ -40,4 +40,5 @@
 {
 
+
  public:
   ~GameLoader ();
@@ -46,5 +47,4 @@
 
   ErrorMessage init();
-  ErrorMessage loadCampaign(const char* name);
   ErrorMessage start();
   void stop();
@@ -53,12 +53,13 @@
   ErrorMessage destroy();
 
+  ErrorMessage loadCampaign(const char* name);
+  ErrorMessage loadDebugCampaign(Uint32 campaignID);
+  ErrorMessage loadNetworkCampaign(const char* fileName);
+
   void nextLevel();
   void previousLevel();
 
-  /** \brief a world command to send to the GameLoader @param cmd the command */
-  bool worldCommand(Command* cmd);
-  ErrorMessage loadDebugCampaign(Uint32 campaignID);
+  void process(const Event &event);
 
-  void process(const Event &event);
 
  private:
@@ -66,4 +67,6 @@
 
   Campaign* fileToCampaign(const char* name);
+  Campaign* fileToNetworkCampaign(const char* fileName);
+
 
  private:
