[Orxonox-commit 1325] r6043 - in code/branches/console/src/orxonox: . gamestates

rgrieder at orxonox.net rgrieder at orxonox.net
Mon Nov 9 15:52:27 CET 2009


Author: rgrieder
Date: 2009-11-09 15:52:26 +0100 (Mon, 09 Nov 2009)
New Revision: 6043

Removed:
   code/branches/console/src/orxonox/gamestates/GSDedicated.cc
   code/branches/console/src/orxonox/gamestates/GSDedicated.h
   code/branches/console/src/orxonox/gamestates/GSDedicatedClient.cc
   code/branches/console/src/orxonox/gamestates/GSDedicatedClient.h
   code/branches/console/src/orxonox/gamestates/GSIOConsole.cc
   code/branches/console/src/orxonox/gamestates/GSIOConsole.h
Modified:
   code/branches/console/src/orxonox/Main.cc
   code/branches/console/src/orxonox/gamestates/CMakeLists.txt
   code/branches/console/src/orxonox/gamestates/GSClient.cc
   code/branches/console/src/orxonox/gamestates/GSMainMenu.cc
   code/branches/console/src/orxonox/gamestates/GSRoot.cc
   code/branches/console/src/orxonox/gamestates/GSServer.cc
Log:
Removed GameStates IOConsole, Dedicated and DedicatedClient because they have been rendered obsolete.

Modified: code/branches/console/src/orxonox/Main.cc
===================================================================
--- code/branches/console/src/orxonox/Main.cc	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/Main.cc	2009-11-09 14:52:26 UTC (rev 6043)
@@ -67,9 +67,8 @@
         "  mainMenu"
         "  standalone,server,client"
         "   level"
-        " dedicated,dedicatedClient"
+        " server,client"
         "  level"
-        " ioConsole"
         );
 
         game->requestState("root");
@@ -82,13 +81,14 @@
         else if (CommandLine::getValue("client").getBool())
             Game::getInstance().requestStates("graphics, client, level");
         else if (CommandLine::getValue("dedicated").getBool())
-            Game::getInstance().requestStates("dedicated, level");
+            Game::getInstance().requestStates("server, level");
         else if (CommandLine::getValue("dedicatedClient").getBool())
-            Game::getInstance().requestStates("dedicatedClient, level");
-        else if (CommandLine::getValue("console").getBool())
-            Game::getInstance().requestStates("ioConsole");
+            Game::getInstance().requestStates("client, level");
         else
-            Game::getInstance().requestStates("graphics, mainMenu");
+        {
+            if (!CommandLine::getValue("console").getBool())
+                Game::getInstance().requestStates("graphics, mainMenu");
+        }
 
         game->run();
         delete game;

Modified: code/branches/console/src/orxonox/gamestates/CMakeLists.txt
===================================================================
--- code/branches/console/src/orxonox/gamestates/CMakeLists.txt	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/CMakeLists.txt	2009-11-09 14:52:26 UTC (rev 6043)
@@ -1,9 +1,6 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   GSClient.cc
-  GSDedicated.cc
-  GSDedicatedClient.cc
   GSGraphics.cc
-  GSIOConsole.cc
   GSLevel.cc
   GSMainMenu.cc
   GSRoot.cc

Modified: code/branches/console/src/orxonox/gamestates/GSClient.cc
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSClient.cc	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSClient.cc	2009-11-09 14:52:26 UTC (rev 6043)
@@ -28,7 +28,7 @@
 
 #include "GSClient.h"
 
-#include "util/Clock.h"
+#include "util/Debug.h"
 #include "util/Exception.h"
 #include "core/CommandLine.h"
 #include "core/Game.h"
@@ -37,7 +37,7 @@
 
 namespace orxonox
 {
-    DeclareGameState(GSClient, "client", false, true);
+    DeclareGameState(GSClient, "client", false, false);
 
     SetCommandLineArgument(ip, "127.0.0.1").information("Sever IP as string in the form #.#.#.#");
 

Deleted: code/branches/console/src/orxonox/gamestates/GSDedicated.cc
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSDedicated.cc	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSDedicated.cc	2009-11-09 14:52:26 UTC (rev 6043)
@@ -1,73 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      Fabian 'x3n' Landau
- *
- */
-
-#include "GSDedicated.h"
-
-#include "util/Debug.h"
-#include "core/CommandLine.h"
-#include "core/Game.h"
-#include "core/GameMode.h"
-#include "network/Server.h"
-
-namespace orxonox
-{
-    DeclareGameState(GSDedicated, "dedicated", false, false);
-    
-    GSDedicated::GSDedicated(const GameStateInfo& info)
-        : GameState(info)
-        , server_(0)
-    {
-    }
-
-    GSDedicated::~GSDedicated()
-    {
-    }
-
-    void GSDedicated::activate()
-    {
-        GameMode::setHasServer(true);
-
-        this->server_ = new Server(CommandLine::getValue("port"));
-        COUT(0) << "Loading scene in server mode" << std::endl;
-
-        server_->open();
-    }
-
-    void GSDedicated::deactivate()
-    {
-        this->server_->close();
-        delete this->server_;
-
-        GameMode::setHasServer(false);
-    }
-
-    void GSDedicated::update(const Clock& time)
-    {
-        server_->update(time);
-    }
-}

Deleted: code/branches/console/src/orxonox/gamestates/GSDedicated.h
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSDedicated.h	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSDedicated.h	2009-11-09 14:52:26 UTC (rev 6043)
@@ -1,54 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _GSDedicated_H__
-#define _GSDedicated_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "core/GameState.h"
-#include "network/NetworkPrereqs.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport GSDedicated : public GameState
-    {
-    public:
-        GSDedicated(const GameStateInfo& info);
-        ~GSDedicated();
-
-        void activate();
-        void deactivate();
-        void update(const Clock& time);
-
-    private:
-        Server*                 server_;
-    };
-}
-
-#endif /* _GSDedicated_H__ */

Deleted: code/branches/console/src/orxonox/gamestates/GSDedicatedClient.cc
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSDedicatedClient.cc	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSDedicatedClient.cc	2009-11-09 14:52:26 UTC (rev 6043)
@@ -1,80 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      Oliver Scheuss
- *
- */
-
-#include "GSDedicatedClient.h"
-
-#include "util/Debug.h"
-#include "util/Exception.h"
-#include "core/CommandLine.h"
-#include "core/Game.h"
-#include "core/GameMode.h"
-#include "network/Client.h"
-
-namespace orxonox
-{
-    DeclareGameState(GSDedicatedClient, "dedicatedClient", false, false);
-    
-    GSDedicatedClient::GSDedicatedClient(const GameStateInfo& info)
-        : GameState(info)
-        , client_(0)
-    {
-    }
-
-    GSDedicatedClient::~GSDedicatedClient()
-    {
-    }
-
-    void GSDedicatedClient::activate()
-    {
-        GameMode::setIsClient(true);
-
-        this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
-        COUT(0) << "Loading scene in client mode" << std::endl;
-
-        if( !client_->establishConnection() )
-            ThrowException(InitialisationFailed, "Could not establish connection with server.");
-            
-        client_->update(Game::getInstance().getGameClock());
-    }
-
-    void GSDedicatedClient::deactivate()
-    {
-        if (this->client_)
-        {
-            this->client_->closeConnection();
-            delete this->client_;
-        }
-
-        GameMode::setIsClient(false);
-    }
-
-    void GSDedicatedClient::update(const Clock& time)
-    {
-        client_->update(time);
-    }
-}

Deleted: code/branches/console/src/orxonox/gamestates/GSDedicatedClient.h
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSDedicatedClient.h	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSDedicatedClient.h	2009-11-09 14:52:26 UTC (rev 6043)
@@ -1,55 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      Oliver Scheuss
- *
- */
-
-#ifndef _GSDedicatedClient_H__
-#define _GSDedicatedClient_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "core/GameState.h"
-#include "network/NetworkPrereqs.h"
-
-namespace orxonox
-{
-
-    class _OrxonoxExport GSDedicatedClient : public GameState
-    {
-    public:
-        GSDedicatedClient(const GameStateInfo& info);
-        ~GSDedicatedClient();
-
-        void activate();
-        void deactivate();
-        void update(const Clock& time);
-
-    private:
-        Client*                 client_;
-    };
-}
-
-#endif /* _GSDedicatedClient_H__ */

Deleted: code/branches/console/src/orxonox/gamestates/GSIOConsole.cc
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSIOConsole.cc	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSIOConsole.cc	2009-11-09 14:52:26 UTC (rev 6043)
@@ -1,73 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "GSIOConsole.h"
-
-#include <iostream>
-#include "core/ConsoleCommand.h"
-#include "core/CommandExecutor.h"
-#include "core/Game.h"
-
-namespace orxonox
-{
-    DeclareGameState(GSIOConsole, "ioConsole", false, false);
-
-    GSIOConsole::GSIOConsole(const GameStateInfo& info)
-        : GameState(info)
-    {
-    }
-
-    GSIOConsole::~GSIOConsole()
-    {
-    }
-
-    void GSIOConsole::activate()
-    {
-        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSIOConsole::loadMenu, this), "loadMenu"));
-    }
-
-    void GSIOConsole::deactivate()
-    {
-    }
-
-    void GSIOConsole::update(const Clock& time)
-    {
-		/*
-        std::cout << ">";
-        std::string command;
-        std::getline(std::cin, command);
-        CommandExecutor::execute(command, true);
-		*/
-    }
-
-    void GSIOConsole::loadMenu()
-    {
-        Game::getInstance().popState();
-        Game::getInstance().requestStates("graphics, mainMenu");
-    }
-}

Deleted: code/branches/console/src/orxonox/gamestates/GSIOConsole.h
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSIOConsole.h	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSIOConsole.h	2009-11-09 14:52:26 UTC (rev 6043)
@@ -1,52 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _GSIOConsole_H__
-#define _GSIOConsole_H__
-
-#include "OrxonoxPrereqs.h"
-#include "core/GameState.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport GSIOConsole : public GameState
-    {
-    public:
-        GSIOConsole(const GameStateInfo& info);
-        ~GSIOConsole();
-
-        void activate();
-        void deactivate();
-        void update(const Clock& time);
-
-    private:
-        void loadMenu();
-    };
-}
-
-#endif /* _GSIOConsole_H__ */

Modified: code/branches/console/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSMainMenu.cc	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSMainMenu.cc	2009-11-09 14:52:26 UTC (rev 6043)
@@ -90,7 +90,6 @@
         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startClient), "startClient"));
         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startDedicated), "startDedicated"));
         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu), "startMainMenu"));
-        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startIOConsole), "startIOConsole"));
 
         KeyBinderManager::getInstance().setToDefault();
         InputManager::getInstance().enterState("mainMenu");
@@ -145,7 +144,7 @@
         // HACK - HACK
         Game::getInstance().popState();
         Game::getInstance().popState();
-        Game::getInstance().requestStates("dedicated, level");
+        Game::getInstance().requestStates("server, level");
     }
     void GSMainMenu::startMainMenu()
     {
@@ -154,11 +153,4 @@
         Game::getInstance().popState();
         Game::getInstance().requestStates("mainmenu");
     }
-    void GSMainMenu::startIOConsole()
-    {
-        // HACK - HACK
-        Game::getInstance().popState();
-        Game::getInstance().popState();
-        Game::getInstance().requestStates("ioConsole");
-    }
 }

Modified: code/branches/console/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSRoot.cc	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSRoot.cc	2009-11-09 14:52:26 UTC (rev 6043)
@@ -89,13 +89,6 @@
 
     void GSRoot::update(const Clock& time)
     {
-        if (this->getActivity().topState)
-        {
-            // This state can not 'survive' on its own.
-            // Load a user interface therefore
-            Game::getInstance().requestState("ioConsole");
-        }
-
         for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; )
             (it++)->tick(time);
 

Modified: code/branches/console/src/orxonox/gamestates/GSServer.cc
===================================================================
--- code/branches/console/src/orxonox/gamestates/GSServer.cc	2009-11-06 07:21:03 UTC (rev 6042)
+++ code/branches/console/src/orxonox/gamestates/GSServer.cc	2009-11-09 14:52:26 UTC (rev 6043)
@@ -36,7 +36,7 @@
 
 namespace orxonox
 {
-    DeclareGameState(GSServer, "server", false, true);
+    DeclareGameState(GSServer, "server", false, false);
 
     SetCommandLineArgument(port, 55556).shortcut("p").information("Network communication port to be used 0-65535 (default: 55556)");
 




More information about the Orxonox-commit mailing list