Index: code/branches/ggz/bin/ggz/module.dsc
===================================================================
--- code/branches/ggz/bin/ggz/module.dsc	(revision 3000)
+++ code/branches/ggz/bin/ggz/module.dsc	(revision 3000)
@@ -0,0 +1,10 @@
+[ModuleInfo]
+Author = Orxonox Developers
+CommandLine = /home/adi/development/orxonox/orxonox/build/bin/orxonox --state client
+Frontend = ogre
+Homepage = http://www.orxonox.net/
+Name = Orxonox
+ProtocolEngine = Orxonox
+ProtocolVersion = 0
+Version = 0
+IconPath = /home/adi/development/orxonox/media/materials/textures/orxonox_logo.svg
Index: code/branches/ggz/bin/ggz/orxonox.dsc
===================================================================
--- code/branches/ggz/bin/ggz/orxonox.dsc	(revision 3000)
+++ code/branches/ggz/bin/ggz/orxonox.dsc	(revision 3000)
@@ -0,0 +1,27 @@
+[GameInfo]
+Author = Orxonox Developers
+Description = Space Shooter
+Homepage = http://www.orxonox.net/
+Name = Orxonox
+Version = 0
+
+[LaunchInfo]
+ExecutablePath = /home/adi/development/orxonox/orxonox/build/bin/orxonox --state standalone
+
+[Protocol]
+Engine = Orxonox
+Version = 0
+
+[TableOptions]
+AllowLeave = 1
+BotsAllowed = 1..16
+PlayersAllowed = 1..16
+KillWhenEmpty = 0
+AllowSpectators = 1
+AllowRestore = 1
+AllowPeers = 1
+
+[Statistics]
+Records = 0
+Ratings = 0
+Highscore = 0
Index: code/branches/ggz/bin/ggz/orxonox.room
===================================================================
--- code/branches/ggz/bin/ggz/orxonox.room	(revision 3000)
+++ code/branches/ggz/bin/ggz/orxonox.room	(revision 3000)
@@ -0,0 +1,7 @@
+[RoomInfo]
+Name = Orxonox
+Description = Space Shooter
+GameType = Orxonox
+MaxPlayers = 32
+MaxTables = 32
+EntryRestriction = none
Index: code/branches/ggz/cmake/FindGGZ.cmake
===================================================================
--- code/branches/ggz/cmake/FindGGZ.cmake	(revision 2999)
+++ code/branches/ggz/cmake/FindGGZ.cmake	(revision 3000)
@@ -5,5 +5,5 @@
 FIND_LIBRARY(GGZMOD_LIBRARY NAMES ggzmod)
 
-# handle the QUIETLY and REQUIRED arguments and set GGZ_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set GGZMOD_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
Index: code/branches/ggz/cmake/LibraryConfig.cmake
===================================================================
--- code/branches/ggz/cmake/LibraryConfig.cmake	(revision 2999)
+++ code/branches/ggz/cmake/LibraryConfig.cmake	(revision 3000)
@@ -116,4 +116,9 @@
 FIND_PACKAGE(ZLIB            REQUIRED)
 FIND_PACKAGE(GGZ                     )
+IF(GGZMOD_FOUND)
+	ADD_COMPILER_FLAGS("-DHAS_GGZ")
+ELSE(GGZMOD_FOUND)
+	MESSAGE("GGZMOD not found, disabling GGZ support")
+ENDIF(GGZMOD_FOUND)
 IF(WIN32)
   FIND_PACKAGE(DirectX       REQUIRED)
Index: code/branches/ggz/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/ggz/src/orxonox/CMakeLists.txt	(revision 2999)
+++ code/branches/ggz/src/orxonox/CMakeLists.txt	(revision 3000)
@@ -20,5 +20,4 @@
 SET_SOURCE_FILES(ORXONOX_SRC_FILES
   CameraManager.cc
-  GGZClient.cc
   GraphicsEngine.cc
   LevelManager.cc
@@ -27,4 +26,7 @@
   PlayerManager.cc
 )
+IF(GGZMOD_FOUND)
+	ADD_SOURCE_FILES(ORXONOX_SRC_FILES GGZClient.cc)
+ENDIF(GGZMOD_FOUND)
 ADD_SUBDIRECTORY(gamestates)
 ADD_SUBDIRECTORY(gui)
Index: code/branches/ggz/src/orxonox/GGZClient.cc
===================================================================
--- code/branches/ggz/src/orxonox/GGZClient.cc	(revision 2999)
+++ code/branches/ggz/src/orxonox/GGZClient.cc	(revision 3000)
@@ -2,4 +2,5 @@
 
 #include <cassert>
+#include <boost/bind.hpp>
 
 namespace orxonox
@@ -13,19 +14,10 @@
         singletonRef_s = this;
 
-        boost::asio::ip::tcp::socket::non_blocking_io non_blocking_io(true);
-        ggzSocket.io_control(non_blocking_io);
-        gameSocket.io_control(non_blocking_io);
-
-        active = ggzmod_is_ggz_mode();
-        if (active) {
-            initGGZ();
-        }
+        initGGZ();
     }
 
     GGZClient::~GGZClient()
     {
-        if (active) {
-            deinitGGZ();
-        }
+        deinitGGZ();
 
         assert(singletonRef_s);
@@ -37,4 +29,9 @@
         assert(singletonRef_s);
         return *singletonRef_s;
+    }
+
+    bool GGZClient::isActive()
+    {
+        return ggzmod_is_ggz_mode();
     }
 
@@ -61,6 +58,6 @@
         }
         /* TODO: Error */
-        ggzSocket.assign(boost::asio::ip::tcp::v4(), fd);
-        ggzSocket.async_read_some(boost::asio::null_buffers(), handleGGZ);
+        ggzSocket.assign(boost::asio::local::stream_protocol(), fd);
+        ggzSocket.async_read_some(boost::asio::null_buffers(), boost::bind(&handleGGZ, boost::asio::placeholders::error));
     }
 
@@ -72,5 +69,5 @@
 
     /* Got data from game server */
-    void handleGame(const boost::system::error_code& /*e*/)
+    void GGZClient::handleGame(const boost::system::error_code& /*e*/)
     {
         /* TODO: read from gameSocket */
@@ -88,6 +85,6 @@
     {
         ggzmod_set_state(ggzmod, GGZMOD_STATE_PLAYING);
-        gameSocket.assign(boost::asio::ip::tcp::v4(), *(int*)data);
-        gameSocket.async_read_some(boost::asio::null_buffers(), handleGame);
+        getInstance().gameSocket.assign(boost::asio::local::stream_protocol(), *(int*)data);
+        getInstance().gameSocket.async_read_some(boost::asio::null_buffers(), boost::bind(&handleGame, boost::asio::placeholders::error));
     }
 }
Index: code/branches/ggz/src/orxonox/GGZClient.h
===================================================================
--- code/branches/ggz/src/orxonox/GGZClient.h	(revision 2999)
+++ code/branches/ggz/src/orxonox/GGZClient.h	(revision 3000)
@@ -17,4 +17,5 @@
 
             static GGZClient& getInstance();
+            static bool isActive();
             virtual void tick(const float dt);
 
@@ -22,14 +23,13 @@
             static GGZClient* singletonRef_s;
 
-            bool active;
             GGZMod * ggzmod;
             boost::asio::io_service io;
-            boost::asio::ip::tcp::socket ggzSocket;
-            boost::asio::ip::tcp::socket gameSocket;
+            boost::asio::local::stream_protocol::socket ggzSocket;
+            boost::asio::local::stream_protocol::socket gameSocket;
 
             void initGGZ();
             void deinitGGZ();
-            void handleGame(const boost::system::error_code& e);
-            void handleGGZ(const boost::system::error_code& e);
+            static void handleGame(const boost::system::error_code& e);
+            static void handleGGZ(const boost::system::error_code& e);
             static void handleGGZModServer(GGZMod * ggzmod, GGZModEvent e,
                     const void *data);
Index: code/branches/ggz/src/orxonox/gamestates/GSClient.cc
===================================================================
--- code/branches/ggz/src/orxonox/gamestates/GSClient.cc	(revision 2999)
+++ code/branches/ggz/src/orxonox/gamestates/GSClient.cc	(revision 3000)
@@ -24,4 +24,5 @@
  *   Co-authors:
  *      Fabian 'x3n' Landau
+ *      Adrian Friedli
  *
  */
@@ -53,4 +54,17 @@
         Core::setIsClient(true);
 
+#ifdef HAS_GGZ
+        ggzClient = NULL;
+        if (GGZClient::isActive()) {
+            COUT(3) << "Initializing GGZ\n";
+            ggzClient = new GGZClient;
+        }
+        else {
+            COUT(3) << "Not using GGZ\n";
+        }
+#else  /* HAS_GGZ */
+        COUT(3) << "GGZ support disabled\n";
+#endif /* HAS_GGZ */
+
         this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
 
@@ -69,4 +83,11 @@
         client_->closeConnection();
 
+#ifdef HAS_GGZ
+        if (ggzClient)
+        {
+            delete ggzClient;
+        }
+#endif /* HAS_GGZ */
+
         // destroy client
         delete this->client_;
Index: code/branches/ggz/src/orxonox/gamestates/GSClient.h
===================================================================
--- code/branches/ggz/src/orxonox/gamestates/GSClient.h	(revision 2999)
+++ code/branches/ggz/src/orxonox/gamestates/GSClient.h	(revision 3000)
@@ -23,5 +23,5 @@
  *      Reto Grieder
  *   Co-authors:
- *      ...
+ *      Adrian Friedli
  *
  */
@@ -34,4 +34,7 @@
 #include "GSLevel.h"
 #include "GSGraphics.h"
+#ifdef HAS_GGZ
+#include "GGZClient.h"
+#endif /* HAS_GGZ */
 
 namespace orxonox
@@ -50,4 +53,8 @@
 
         Client* client_;
+#ifdef HAS_GGZ
+        GGZClient* ggzClient;
+#endif /* HAS_GGZ */
+
     };
 }
