Index: /code/branches/network/src/audio/AudioBuffer.cc
===================================================================
--- /code/branches/network/src/audio/AudioBuffer.cc	(revision 1494)
+++ /code/branches/network/src/audio/AudioBuffer.cc	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
Index: /code/branches/network/src/audio/AudioBuffer.h
===================================================================
--- /code/branches/network/src/audio/AudioBuffer.h	(revision 1494)
+++ /code/branches/network/src/audio/AudioBuffer.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
Index: /code/branches/network/src/audio/AudioIncludes.h
===================================================================
--- /code/branches/network/src/audio/AudioIncludes.h	(revision 1494)
+++ /code/branches/network/src/audio/AudioIncludes.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -26,5 +27,10 @@
  */
 
-/**  @file  @brief Various headers used in the audio lib. Avoid including this to         increase accuracy of header file dependencies.*/
+/**
+  @file
+  @brief Various headers used in the audio lib. Avoid including this to
+         increase accuracy of header file dependencies.
+*/
+
 #include "AudioPrereqs.h"
 
Index: /code/branches/network/src/audio/AudioManager.cc
===================================================================
--- /code/branches/network/src/audio/AudioManager.cc	(revision 1494)
+++ /code/branches/network/src/audio/AudioManager.cc	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
Index: /code/branches/network/src/audio/AudioManager.h
===================================================================
--- /code/branches/network/src/audio/AudioManager.h	(revision 1494)
+++ /code/branches/network/src/audio/AudioManager.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
Index: /code/branches/network/src/audio/AudioPrereqs.h
===================================================================
--- /code/branches/network/src/audio/AudioPrereqs.h	(revision 1494)
+++ /code/branches/network/src/audio/AudioPrereqs.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -36,6 +37,27 @@
 #include "util/OrxonoxPlatform.h"
 
-//-----------------------------------------------------------------------// Shared library settings//-----------------------------------------------------------------------#if (ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32) && !defined( AUDIO_STATIC_BUILD )#  ifdef AUDIO_SHARED_BUILD#    define _AudioExport __declspec(dllexport)#  else#    if defined( __MINGW32__ )#      define _AudioExport#    else#      define _AudioExport __declspec(dllimport)#    endif#  endif#elif defined ( ORXONOX_GCC_VISIBILITY )#  define _AudioExport  __attribute__ ((visibility("default")))#else#  define _AudioExport#endif
-//-----------------------------------------------------------------------// Forward declarations//-----------------------------------------------------------------------
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+#if (ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32) && !defined( AUDIO_STATIC_BUILD )
+#  ifdef AUDIO_SHARED_BUILD
+#    define _AudioExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _AudioExport
+#    else
+#      define _AudioExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _AudioExport  __attribute__ ((visibility("default")))
+#else
+#  define _AudioExport
+#endif
+
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
 namespace audio
 {
@@ -46,8 +68,14 @@
 }
 
-//-----------------------------------------------------------------------// Warnings//-----------------------------------------------------------------------
+//-----------------------------------------------------------------------
+// Warnings
+//-----------------------------------------------------------------------
 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
 
-// set to 4: conversion from 'ogg_int64_t' to 'long', possible loss of data#pragma warning (4 : 4244)#endif
+// set to 4: conversion from 'ogg_int64_t' to 'long', possible loss of data
+#pragma warning (4 : 4244)
+
+#endif
+
 
 #endif /* _AudioPrereqs_H__ */
Index: /code/branches/network/src/audio/AudioSource.cc
===================================================================
--- /code/branches/network/src/audio/AudioSource.cc	(revision 1494)
+++ /code/branches/network/src/audio/AudioSource.cc	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
Index: /code/branches/network/src/audio/AudioSource.h
===================================================================
--- /code/branches/network/src/audio/AudioSource.h	(revision 1494)
+++ /code/branches/network/src/audio/AudioSource.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
Index: /code/branches/network/src/audio/AudioStream.h
===================================================================
--- /code/branches/network/src/audio/AudioStream.h	(revision 1494)
+++ /code/branches/network/src/audio/AudioStream.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -26,5 +27,7 @@
  */
 
-#ifndef _AudioStream_H__#define _AudioStream_H__
+#ifndef _AudioStream_H__
+#define _AudioStream_H__
+
 #include "AudioPrereqs.h"
 
@@ -35,6 +38,41 @@
 #include <vorbis/vorbisfile.h>
 #include <vorbis/codec.h>
-namespace audio{  #define BUFFER_SIZE (4096 * 4)  class _AudioExport AudioStream  {    public:      AudioStream(std::string path);      void open();      void release();      void display();      bool playback();      bool playing();      bool update();      inline bool isLoaded() { return loaded; }
-    protected:      bool stream(ALuint buffer);      void empty();      void check();      std::string errorString(int code);    private:      std::string path;
-      FILE*           oggFile;      OggVorbis_File  oggStream;      vorbis_info*    vorbisInfo;      vorbis_comment* vorbisComment;      bool loaded;
-      ALuint buffers[2];      ALuint source;      ALenum format;  };}#endif /* _AudioStream_H__ */
+
+namespace audio
+{
+  #define BUFFER_SIZE (4096 * 4)
+
+  class _AudioExport AudioStream
+  {
+    public:
+      AudioStream(std::string path);
+      void open();
+      void release();
+      void display();
+      bool playback();
+      bool playing();
+      bool update();
+      inline bool isLoaded() { return loaded; }
+
+    protected:
+      bool stream(ALuint buffer);
+      void empty();
+      void check();
+      std::string errorString(int code);
+
+    private:
+      std::string path;
+
+      FILE*           oggFile;
+      OggVorbis_File  oggStream;
+      vorbis_info*    vorbisInfo;
+      vorbis_comment* vorbisComment;
+      bool loaded;
+
+      ALuint buffers[2];
+      ALuint source;
+      ALenum format;
+  };
+}
+
+#endif /* _AudioStream_H__ */
Index: /code/branches/network/src/core/Error.cc
===================================================================
--- /code/branches/network/src/core/Error.cc	(revision 1494)
+++ /code/branches/network/src/core/Error.cc	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -25,7 +26,13 @@
  *
  */
-/**    @file Error.cc    @brief Implementation of the Error class.*/
+
+/**
+    @file Error.cc
+    @brief Implementation of the Error class.
+*/
+
 #include "Error.h"
 #include "Debug.h"
+
 namespace orxonox
 {
Index: /code/branches/network/src/core/Error.h
===================================================================
--- /code/branches/network/src/core/Error.h	(revision 1494)
+++ /code/branches/network/src/core/Error.h	(revision 1495)
@@ -1,6 +1,42 @@
-/* *   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: *      Nicolas Perrenoud *   Co-authors: *      ... * *//**    @file Error.h    @brief Definition of the Error class.*/#ifndef _Error_H__
+/*
+ *   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:
+ *      Nicolas Perrenoud
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Error.h
+    @brief Definition of the Error class.
+*/
+
+#ifndef _Error_H__
 #define _Error_H__
 
-#include "CorePrereqs.h"#include <string>
+#include "CorePrereqs.h"
+
+#include <string>
+
 namespace orxonox
 {
Index: /code/branches/network/src/core/Functor.h
===================================================================
--- /code/branches/network/src/core/Functor.h	(revision 1494)
+++ /code/branches/network/src/core/Functor.h	(revision 1495)
@@ -1,8 +1,475 @@
-/* *   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: *      Fabian 'x3n' Landau *   Co-authors: *      ... * *   Inspiration: Functor by Benjamin Grauer */#ifndef _Functor_H__#define _Functor_H__#include "CorePrereqs.h"#include "util/MultiTypeMath.h"#include "Debug.h"#define MAX_FUNCTOR_ARGUMENTS 5namespace orxonox{    enum FunctionType    {        FT_MEMBER,        FT_CONSTMEMBER,        FT_STATIC    };    template <class T>    inline std::string typeToString() { return "unknown"; }#define CreateTypeToStringTemplate(type) \    template <> \    inline std::string typeToString<type>() { return #type; } \    template <> \    inline std::string typeToString<type&>() { return #type; } \    template <> \    inline std::string typeToString<const type>() { return #type; } \    template <> \    inline std::string typeToString<const type&>() { return #type; }    CreateTypeToStringTemplate(int);    CreateTypeToStringTemplate(unsigned int);    CreateTypeToStringTemplate(char);    CreateTypeToStringTemplate(unsigned char);    CreateTypeToStringTemplate(short);    CreateTypeToStringTemplate(unsigned short);    CreateTypeToStringTemplate(long);    CreateTypeToStringTemplate(unsigned long);    CreateTypeToStringTemplate(float);    CreateTypeToStringTemplate(double);    CreateTypeToStringTemplate(long double);    CreateTypeToStringTemplate(bool);    CreateTypeToStringTemplate(Vector2);    CreateTypeToStringTemplate(Vector3);    CreateTypeToStringTemplate(Quaternion);    CreateTypeToStringTemplate(ColourValue);    CreateTypeToStringTemplate(Radian);    CreateTypeToStringTemplate(Degree);    template <> \    inline std::string typeToString<std::string>() { return "string"; } \    template <> \    inline std::string typeToString<std::string&>() { return "string"; } \    template <> \    inline std::string typeToString<const std::string>() { return "string"; } \    template <> \    inline std::string typeToString<const std::string&>() { return "string"; }    class _CoreExport Functor    {        public:            Functor() {}            virtual ~Functor() {}            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;            inline unsigned int getParamCount() const { return this->numParams_; }            inline bool hasReturnvalue() const { return this->hasReturnValue_; }            inline FunctionType getType() const { return this->type_; }            inline MultiTypeMath getReturnvalue() const { return this->returnedValue_; }            std::string getTypenameParam(unsigned int param) const { return (param >= 0 && param < 5) ? this->typeParam_[param] : ""; }            std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; }            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const = 0;        protected:            unsigned int numParams_;            bool hasReturnValue_;            FunctionType type_;            MultiTypeMath returnedValue_;            std::string typeReturnvalue_;            std::string typeParam_[MAX_FUNCTOR_ARGUMENTS];    };    class _CoreExport FunctorStatic : public Functor    {        public:            virtual ~FunctorStatic() {}            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;    };    template <class T>    class FunctorMember : public Functor    {        public:            FunctorMember()            {                constObject_ = 0;                object_ = 0;                bConstObject_ = false;            }            virtual ~FunctorMember() {}            virtual void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;            virtual void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)            {                if (this->bConstObject_)                {                    if (this->constObject_)                        (*this)(this->constObject_, param1, param2, param3, param4, param5);                    else                    {                        COUT(1) << "An error occurred in Functor.h:" << std::endl;                        COUT(1) << "Error: No const object set." << std::endl;                    }                }                else                {                    if (this->object_)                        (*this)(this->object_, param1, param2, param3, param4, param5);                    else                    {                        COUT(1) << "An error occurred in Functor.h:" << std::endl;                        COUT(1) << "Error: No object set." << std::endl;                    }                }            }            void setObject(T* object)            {                this->bConstObject_ = false;                this->object_ = object;            }            void setObject(const T* object)            {                this->bConstObject_ = true;                this->constObject_ = object;            }        private:            const T* constObject_;            T* object_;            bool bConstObject_;    };#define FUNCTOR_TEMPLATE(ismember, returnvalue, numparams) FUNCTOR_TEMPLATE##ismember##returnvalue##numparams#define FUNCTOR_TEMPLATE000#define FUNCTOR_TEMPLATE001 template <class P1>#define FUNCTOR_TEMPLATE002 template <class P1, class P2>#define FUNCTOR_TEMPLATE003 template <class P1, class P2, class P3>#define FUNCTOR_TEMPLATE004 template <class P1, class P2, class P3, class P4>#define FUNCTOR_TEMPLATE005 template <class P1, class P2, class P3, class P4, class P5>#define FUNCTOR_TEMPLATE010 template <class R>#define FUNCTOR_TEMPLATE011 template <class R, class P1>#define FUNCTOR_TEMPLATE012 template <class R, class P1, class P2>#define FUNCTOR_TEMPLATE013 template <class R, class P1, class P2, class P3>#define FUNCTOR_TEMPLATE014 template <class R, class P1, class P2, class P3, class P4>#define FUNCTOR_TEMPLATE015 template <class R, class P1, class P2, class P3, class P4, class P5>#define FUNCTOR_TEMPLATE100 template <class T>#define FUNCTOR_TEMPLATE101 template <class T, class P1>#define FUNCTOR_TEMPLATE102 template <class T, class P1, class P2>#define FUNCTOR_TEMPLATE103 template <class T, class P1, class P2, class P3>#define FUNCTOR_TEMPLATE104 template <class T, class P1, class P2, class P3, class P4>#define FUNCTOR_TEMPLATE105 template <class T, class P1, class P2, class P3, class P4, class P5>#define FUNCTOR_TEMPLATE110 template <class T, class R>#define FUNCTOR_TEMPLATE111 template <class T, class R, class P1>#define FUNCTOR_TEMPLATE112 template <class T, class R, class P1, class P2>#define FUNCTOR_TEMPLATE113 template <class T, class R, class P1, class P2, class P3>#define FUNCTOR_TEMPLATE114 template <class T, class R, class P1, class P2, class P3, class P4>#define FUNCTOR_TEMPLATE115 template <class T, class R, class P1, class P2, class P3, class P4, class P5>#define FUNCTOR_TEMPLATE_CLASSES(ismember, returnvalue, numparams) FUNCTOR_TEMPLATE_CLASSES##ismember##returnvalue##numparams#define FUNCTOR_TEMPLATE_CLASSES000#define FUNCTOR_TEMPLATE_CLASSES001 <P1>#define FUNCTOR_TEMPLATE_CLASSES002 <P1, P2>#define FUNCTOR_TEMPLATE_CLASSES003 <P1, P2, P3>#define FUNCTOR_TEMPLATE_CLASSES004 <P1, P2, P3, P4>#define FUNCTOR_TEMPLATE_CLASSES005 <P1, P2, P3, P4, P5>#define FUNCTOR_TEMPLATE_CLASSES010 <R>#define FUNCTOR_TEMPLATE_CLASSES011 <R, P1>#define FUNCTOR_TEMPLATE_CLASSES012 <R, P1, P2>#define FUNCTOR_TEMPLATE_CLASSES013 <R, P1, P2, P3>#define FUNCTOR_TEMPLATE_CLASSES014 <R, P1, P2, P3, P4>#define FUNCTOR_TEMPLATE_CLASSES015 <R, P1, P2, P3, P4, P5>#define FUNCTOR_TEMPLATE_CLASSES100 <T>#define FUNCTOR_TEMPLATE_CLASSES101 <T, P1>#define FUNCTOR_TEMPLATE_CLASSES102 <T, P1, P2>#define FUNCTOR_TEMPLATE_CLASSES103 <T, P1, P2, P3>#define FUNCTOR_TEMPLATE_CLASSES104 <T, P1, P2, P3, P4>#define FUNCTOR_TEMPLATE_CLASSES105 <T, P1, P2, P3, P4, P5>#define FUNCTOR_TEMPLATE_CLASSES110 <T, R>#define FUNCTOR_TEMPLATE_CLASSES111 <T, R, P1>#define FUNCTOR_TEMPLATE_CLASSES112 <T, R, P1, P2>#define FUNCTOR_TEMPLATE_CLASSES113 <T, R, P1, P2, P3>#define FUNCTOR_TEMPLATE_CLASSES114 <T, R, P1, P2, P3, P4>#define FUNCTOR_TEMPLATE_CLASSES115 <T, R, P1, P2, P3, P4, P5>#define FUNCTOR_TYPENAME_PARAMS(numparams) FUNCTOR_TYPENAME_PARAMS##numparams#define FUNCTOR_TYPENAME_PARAMS0#define FUNCTOR_TYPENAME_PARAMS1 this->typeParam_[0] = typeToString<P1>();#define FUNCTOR_TYPENAME_PARAMS2 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>();#define FUNCTOR_TYPENAME_PARAMS3 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>();#define FUNCTOR_TYPENAME_PARAMS4 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>(); this->typeParam_[3] = typeToString<P4>();#define FUNCTOR_TYPENAME_PARAMS5 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>(); this->typeParam_[3] = typeToString<P4>(); this->typeParam_[4] = typeToString<P5>();#define FUNCTOR_TYPENAME_RETURN(returnvalue) FUNCTOR_TYPENAME_RETURN##returnvalue#define FUNCTOR_TYPENAME_RETURN0#define FUNCTOR_TYPENAME_RETURN1 this->typeReturnvalue_ = typeToString<R>();#define FUNCTOR_FUNCTION_PARAMS(numparams) FUNCTOR_FUNCTION_PARAMS##numparams#define FUNCTOR_FUNCTION_PARAMS0#define FUNCTOR_FUNCTION_PARAMS1 P1 param1#define FUNCTOR_FUNCTION_PARAMS2 P1 param1, P2 param2#define FUNCTOR_FUNCTION_PARAMS3 P1 param1, P2 param2, P3 param3#define FUNCTOR_FUNCTION_PARAMS4 P1 param1, P2 param2, P3 param3, P4 param4#define FUNCTOR_FUNCTION_PARAMS5 P1 param1, P2 param2, P3 param3, P4 param4, P5 param5#define FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) FUNCTOR_FUNCTION_RETURNVALUE##returnvalue#define FUNCTOR_FUNCTION_RETURNVALUE0 void#define FUNCTOR_FUNCTION_RETURNVALUE1 R#define FUNCTOR_FUNCTION_CALL(numparams) FUNCTOR_FUNCTION_CALL##numparams#define FUNCTOR_FUNCTION_CALL0#define FUNCTOR_FUNCTION_CALL1 param1#define FUNCTOR_FUNCTION_CALL2 param1, param2#define FUNCTOR_FUNCTION_CALL3 param1, param2, param3#define FUNCTOR_FUNCTION_CALL4 param1, param2, param3, param4#define FUNCTOR_FUNCTION_CALL5 param1, param2, param3, param4, param5#define FUNCTOR_STORE_RETURNVALUE(returnvalue, functioncall) FUNCTOR_STORE_RETURNVALUE##returnvalue(functioncall)#define FUNCTOR_STORE_RETURNVALUE0(functioncall) functioncall#define FUNCTOR_STORE_RETURNVALUE1(functioncall) this->returnedValue_ = functioncall#define FUNCTOR_EVALUATE_PARAM(numparams) FUNCTOR_EVALUATE_PARAM##numparams#define FUNCTOR_EVALUATE_PARAM0#define FUNCTOR_EVALUATE_PARAM1 \    if (index == 0) { P1 temp = param; param = temp; }#define FUNCTOR_EVALUATE_PARAM2 \    if (index == 0) { P1 temp = param; param = temp; } \    else if (index == 1) { P2 temp = param; param = temp; }#define FUNCTOR_EVALUATE_PARAM3 \    if (index == 0) { P1 temp = param; param = temp; } \    else if (index == 1) { P2 temp = param; param = temp; } \    else if (index == 2) { P3 temp = param; param = temp; }#define FUNCTOR_EVALUATE_PARAM4 \    if (index == 0) { P1 temp = param; param = temp; } \    else if (index == 1) { P2 temp = param; param = temp; } \    else if (index == 2) { P3 temp = param; param = temp; } \    else if (index == 3) { P4 temp = param; param = temp; }#define FUNCTOR_EVALUATE_PARAM5 \    if (index == 0) { P1 temp = param; param = temp; } \    else if (index == 1) { P2 temp = param; param = temp; } \    else if (index == 2) { P3 temp = param; param = temp; } \    else if (index == 3) { P4 temp = param; param = temp; } \    else if (index == 4) { P5 temp = param; param = temp; }#define CREATE_STATIC_FUNCTOR(returnvalue, numparams) \    FUNCTOR_TEMPLATE(0, returnvalue, numparams) \    class FunctorStatic##returnvalue##numparams : public FunctorStatic \    { \        public: \            FunctorStatic##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \            { \                this->numParams_ = numparams; \                this->hasReturnValue_ = returnvalue; \                this->type_ = FT_STATIC; \                this->functionPointer_ = functionPointer; \                \                FUNCTOR_TYPENAME_PARAMS(numparams); \                FUNCTOR_TYPENAME_RETURN(returnvalue); \            } \    \            void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \            { \                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \            } \    \            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \            { \                FUNCTOR_EVALUATE_PARAM(numparams); \            } \    \        private: \            FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \    }; \    \    \    FUNCTOR_TEMPLATE(0, returnvalue, numparams) \    inline FunctorStatic##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(0, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \    { \        return new FunctorStatic##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(0, returnvalue, numparams) (functionPointer); \    }#define CREATE_MEMBER_FUNCTOR(returnvalue, numparams) \    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \    class FunctorMember##returnvalue##numparams : public FunctorMember<T> \    { \        public: \            FunctorMember##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \            { \                this->numParams_ = numparams; \                this->hasReturnValue_ = returnvalue; \                this->type_ = FT_MEMBER; \                this->functionPointer_ = functionPointer; \            } \    \            void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \            { \                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \            } \    \            void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \            { \                COUT(1) << "An error occurred in Functor.h:" << std::endl; \                COUT(1) << "Error: Function is not const." << std::endl; \            } \    \            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \            { \                FUNCTOR_EVALUATE_PARAM(numparams); \            } \    \        private: \            FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \    }; \    \    \    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \    class FunctorConstMember##returnvalue##numparams : public FunctorMember<T> \    { \        public: \            FunctorConstMember##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const) \            { \                this->numParams_ = numparams; \                this->hasReturnValue_ = returnvalue; \                this->type_ = FT_CONSTMEMBER; \                this->functionPointer_ = functionPointer; \            } \    \            void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \            { \                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \            } \    \            void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \            { \                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \            } \    \            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \            { \                FUNCTOR_EVALUATE_PARAM(numparams); \            } \    \        private: \            FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)) const; \    }; \    \    \    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \    inline FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \    { \        return new FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \    } \    \    \    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \    inline FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const) \    { \        return new FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \    }// disable annoying warning about forcing value to boolean
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ *   Inspiration: Functor by Benjamin Grauer
+ */
+
+#ifndef _Functor_H__
+#define _Functor_H__
+
+#include "CorePrereqs.h"
+
+#include "util/MultiTypeMath.h"
+#include "Debug.h"
+
+#define MAX_FUNCTOR_ARGUMENTS 5
+
+namespace orxonox
+{
+    enum FunctionType
+    {
+        FT_MEMBER,
+        FT_CONSTMEMBER,
+        FT_STATIC
+    };
+
+
+    template <class T>
+    inline std::string typeToString() { return "unknown"; }
+
+#define CreateTypeToStringTemplate(type) \
+    template <> \
+    inline std::string typeToString<type>() { return #type; } \
+    template <> \
+    inline std::string typeToString<type&>() { return #type; } \
+    template <> \
+    inline std::string typeToString<const type>() { return #type; } \
+    template <> \
+    inline std::string typeToString<const type&>() { return #type; }
+
+    CreateTypeToStringTemplate(int);
+    CreateTypeToStringTemplate(unsigned int);
+    CreateTypeToStringTemplate(char);
+    CreateTypeToStringTemplate(unsigned char);
+    CreateTypeToStringTemplate(short);
+    CreateTypeToStringTemplate(unsigned short);
+    CreateTypeToStringTemplate(long);
+    CreateTypeToStringTemplate(unsigned long);
+    CreateTypeToStringTemplate(float);
+    CreateTypeToStringTemplate(double);
+    CreateTypeToStringTemplate(long double);
+    CreateTypeToStringTemplate(bool);
+    CreateTypeToStringTemplate(Vector2);
+    CreateTypeToStringTemplate(Vector3);
+    CreateTypeToStringTemplate(Quaternion);
+    CreateTypeToStringTemplate(ColourValue);
+    CreateTypeToStringTemplate(Radian);
+    CreateTypeToStringTemplate(Degree);
+
+    template <> \
+    inline std::string typeToString<std::string>() { return "string"; } \
+    template <> \
+    inline std::string typeToString<std::string&>() { return "string"; } \
+    template <> \
+    inline std::string typeToString<const std::string>() { return "string"; } \
+    template <> \
+    inline std::string typeToString<const std::string&>() { return "string"; }
+
+    class _CoreExport Functor
+    {
+        public:
+            Functor() {}
+            virtual ~Functor() {}
+
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+
+            inline unsigned int getParamCount() const { return this->numParams_; }
+            inline bool hasReturnvalue() const { return this->hasReturnValue_; }
+            inline FunctionType getType() const { return this->type_; }
+            inline MultiTypeMath getReturnvalue() const { return this->returnedValue_; }
+
+            std::string getTypenameParam(unsigned int param) const { return (param >= 0 && param < 5) ? this->typeParam_[param] : ""; }
+            std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; }
+
+            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const = 0;
+
+        protected:
+            unsigned int numParams_;
+            bool hasReturnValue_;
+            FunctionType type_;
+            MultiTypeMath returnedValue_;
+
+            std::string typeReturnvalue_;
+            std::string typeParam_[MAX_FUNCTOR_ARGUMENTS];
+    };
+
+    class _CoreExport FunctorStatic : public Functor
+    {
+        public:
+            virtual ~FunctorStatic() {}
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+    };
+
+    template <class T>
+    class FunctorMember : public Functor
+    {
+        public:
+            FunctorMember()
+            {
+                constObject_ = 0;
+                object_ = 0;
+                bConstObject_ = false;
+            }
+            virtual ~FunctorMember() {}
+
+            virtual void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+            virtual void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
+            {
+                if (this->bConstObject_)
+                {
+                    if (this->constObject_)
+                        (*this)(this->constObject_, param1, param2, param3, param4, param5);
+                    else
+                    {
+                        COUT(1) << "An error occurred in Functor.h:" << std::endl;
+                        COUT(1) << "Error: No const object set." << std::endl;
+                    }
+                }
+                else
+                {
+                    if (this->object_)
+                        (*this)(this->object_, param1, param2, param3, param4, param5);
+                    else
+                    {
+                        COUT(1) << "An error occurred in Functor.h:" << std::endl;
+                        COUT(1) << "Error: No object set." << std::endl;
+                    }
+                }
+            }
+
+            void setObject(T* object)
+            {
+                this->bConstObject_ = false;
+                this->object_ = object;
+            }
+
+            void setObject(const T* object)
+            {
+                this->bConstObject_ = true;
+                this->constObject_ = object;
+            }
+
+        private:
+            const T* constObject_;
+            T* object_;
+            bool bConstObject_;
+    };
+
+
+
+#define FUNCTOR_TEMPLATE(ismember, returnvalue, numparams) FUNCTOR_TEMPLATE##ismember##returnvalue##numparams
+#define FUNCTOR_TEMPLATE000
+#define FUNCTOR_TEMPLATE001 template <class P1>
+#define FUNCTOR_TEMPLATE002 template <class P1, class P2>
+#define FUNCTOR_TEMPLATE003 template <class P1, class P2, class P3>
+#define FUNCTOR_TEMPLATE004 template <class P1, class P2, class P3, class P4>
+#define FUNCTOR_TEMPLATE005 template <class P1, class P2, class P3, class P4, class P5>
+#define FUNCTOR_TEMPLATE010 template <class R>
+#define FUNCTOR_TEMPLATE011 template <class R, class P1>
+#define FUNCTOR_TEMPLATE012 template <class R, class P1, class P2>
+#define FUNCTOR_TEMPLATE013 template <class R, class P1, class P2, class P3>
+#define FUNCTOR_TEMPLATE014 template <class R, class P1, class P2, class P3, class P4>
+#define FUNCTOR_TEMPLATE015 template <class R, class P1, class P2, class P3, class P4, class P5>
+#define FUNCTOR_TEMPLATE100 template <class T>
+#define FUNCTOR_TEMPLATE101 template <class T, class P1>
+#define FUNCTOR_TEMPLATE102 template <class T, class P1, class P2>
+#define FUNCTOR_TEMPLATE103 template <class T, class P1, class P2, class P3>
+#define FUNCTOR_TEMPLATE104 template <class T, class P1, class P2, class P3, class P4>
+#define FUNCTOR_TEMPLATE105 template <class T, class P1, class P2, class P3, class P4, class P5>
+#define FUNCTOR_TEMPLATE110 template <class T, class R>
+#define FUNCTOR_TEMPLATE111 template <class T, class R, class P1>
+#define FUNCTOR_TEMPLATE112 template <class T, class R, class P1, class P2>
+#define FUNCTOR_TEMPLATE113 template <class T, class R, class P1, class P2, class P3>
+#define FUNCTOR_TEMPLATE114 template <class T, class R, class P1, class P2, class P3, class P4>
+#define FUNCTOR_TEMPLATE115 template <class T, class R, class P1, class P2, class P3, class P4, class P5>
+
+
+
+#define FUNCTOR_TEMPLATE_CLASSES(ismember, returnvalue, numparams) FUNCTOR_TEMPLATE_CLASSES##ismember##returnvalue##numparams
+#define FUNCTOR_TEMPLATE_CLASSES000
+#define FUNCTOR_TEMPLATE_CLASSES001 <P1>
+#define FUNCTOR_TEMPLATE_CLASSES002 <P1, P2>
+#define FUNCTOR_TEMPLATE_CLASSES003 <P1, P2, P3>
+#define FUNCTOR_TEMPLATE_CLASSES004 <P1, P2, P3, P4>
+#define FUNCTOR_TEMPLATE_CLASSES005 <P1, P2, P3, P4, P5>
+#define FUNCTOR_TEMPLATE_CLASSES010 <R>
+#define FUNCTOR_TEMPLATE_CLASSES011 <R, P1>
+#define FUNCTOR_TEMPLATE_CLASSES012 <R, P1, P2>
+#define FUNCTOR_TEMPLATE_CLASSES013 <R, P1, P2, P3>
+#define FUNCTOR_TEMPLATE_CLASSES014 <R, P1, P2, P3, P4>
+#define FUNCTOR_TEMPLATE_CLASSES015 <R, P1, P2, P3, P4, P5>
+#define FUNCTOR_TEMPLATE_CLASSES100 <T>
+#define FUNCTOR_TEMPLATE_CLASSES101 <T, P1>
+#define FUNCTOR_TEMPLATE_CLASSES102 <T, P1, P2>
+#define FUNCTOR_TEMPLATE_CLASSES103 <T, P1, P2, P3>
+#define FUNCTOR_TEMPLATE_CLASSES104 <T, P1, P2, P3, P4>
+#define FUNCTOR_TEMPLATE_CLASSES105 <T, P1, P2, P3, P4, P5>
+#define FUNCTOR_TEMPLATE_CLASSES110 <T, R>
+#define FUNCTOR_TEMPLATE_CLASSES111 <T, R, P1>
+#define FUNCTOR_TEMPLATE_CLASSES112 <T, R, P1, P2>
+#define FUNCTOR_TEMPLATE_CLASSES113 <T, R, P1, P2, P3>
+#define FUNCTOR_TEMPLATE_CLASSES114 <T, R, P1, P2, P3, P4>
+#define FUNCTOR_TEMPLATE_CLASSES115 <T, R, P1, P2, P3, P4, P5>
+
+
+
+#define FUNCTOR_TYPENAME_PARAMS(numparams) FUNCTOR_TYPENAME_PARAMS##numparams
+#define FUNCTOR_TYPENAME_PARAMS0
+#define FUNCTOR_TYPENAME_PARAMS1 this->typeParam_[0] = typeToString<P1>();
+#define FUNCTOR_TYPENAME_PARAMS2 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>();
+#define FUNCTOR_TYPENAME_PARAMS3 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>();
+#define FUNCTOR_TYPENAME_PARAMS4 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>(); this->typeParam_[3] = typeToString<P4>();
+#define FUNCTOR_TYPENAME_PARAMS5 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>(); this->typeParam_[3] = typeToString<P4>(); this->typeParam_[4] = typeToString<P5>();
+
+#define FUNCTOR_TYPENAME_RETURN(returnvalue) FUNCTOR_TYPENAME_RETURN##returnvalue
+#define FUNCTOR_TYPENAME_RETURN0
+#define FUNCTOR_TYPENAME_RETURN1 this->typeReturnvalue_ = typeToString<R>();
+
+
+
+#define FUNCTOR_FUNCTION_PARAMS(numparams) FUNCTOR_FUNCTION_PARAMS##numparams
+#define FUNCTOR_FUNCTION_PARAMS0
+#define FUNCTOR_FUNCTION_PARAMS1 P1 param1
+#define FUNCTOR_FUNCTION_PARAMS2 P1 param1, P2 param2
+#define FUNCTOR_FUNCTION_PARAMS3 P1 param1, P2 param2, P3 param3
+#define FUNCTOR_FUNCTION_PARAMS4 P1 param1, P2 param2, P3 param3, P4 param4
+#define FUNCTOR_FUNCTION_PARAMS5 P1 param1, P2 param2, P3 param3, P4 param4, P5 param5
+
+#define FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) FUNCTOR_FUNCTION_RETURNVALUE##returnvalue
+#define FUNCTOR_FUNCTION_RETURNVALUE0 void
+#define FUNCTOR_FUNCTION_RETURNVALUE1 R
+
+
+
+#define FUNCTOR_FUNCTION_CALL(numparams) FUNCTOR_FUNCTION_CALL##numparams
+#define FUNCTOR_FUNCTION_CALL0
+#define FUNCTOR_FUNCTION_CALL1 param1
+#define FUNCTOR_FUNCTION_CALL2 param1, param2
+#define FUNCTOR_FUNCTION_CALL3 param1, param2, param3
+#define FUNCTOR_FUNCTION_CALL4 param1, param2, param3, param4
+#define FUNCTOR_FUNCTION_CALL5 param1, param2, param3, param4, param5
+
+#define FUNCTOR_STORE_RETURNVALUE(returnvalue, functioncall) FUNCTOR_STORE_RETURNVALUE##returnvalue(functioncall)
+#define FUNCTOR_STORE_RETURNVALUE0(functioncall) functioncall
+#define FUNCTOR_STORE_RETURNVALUE1(functioncall) this->returnedValue_ = functioncall
+
+
+
+#define FUNCTOR_EVALUATE_PARAM(numparams) FUNCTOR_EVALUATE_PARAM##numparams
+#define FUNCTOR_EVALUATE_PARAM0
+#define FUNCTOR_EVALUATE_PARAM1 \
+    if (index == 0) { P1 temp = param; param = temp; }
+#define FUNCTOR_EVALUATE_PARAM2 \
+    if (index == 0) { P1 temp = param; param = temp; } \
+    else if (index == 1) { P2 temp = param; param = temp; }
+#define FUNCTOR_EVALUATE_PARAM3 \
+    if (index == 0) { P1 temp = param; param = temp; } \
+    else if (index == 1) { P2 temp = param; param = temp; } \
+    else if (index == 2) { P3 temp = param; param = temp; }
+#define FUNCTOR_EVALUATE_PARAM4 \
+    if (index == 0) { P1 temp = param; param = temp; } \
+    else if (index == 1) { P2 temp = param; param = temp; } \
+    else if (index == 2) { P3 temp = param; param = temp; } \
+    else if (index == 3) { P4 temp = param; param = temp; }
+#define FUNCTOR_EVALUATE_PARAM5 \
+    if (index == 0) { P1 temp = param; param = temp; } \
+    else if (index == 1) { P2 temp = param; param = temp; } \
+    else if (index == 2) { P3 temp = param; param = temp; } \
+    else if (index == 3) { P4 temp = param; param = temp; } \
+    else if (index == 4) { P5 temp = param; param = temp; }
+
+
+
+
+
+#define CREATE_STATIC_FUNCTOR(returnvalue, numparams) \
+    FUNCTOR_TEMPLATE(0, returnvalue, numparams) \
+    class FunctorStatic##returnvalue##numparams : public FunctorStatic \
+    { \
+        public: \
+            FunctorStatic##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \
+            { \
+                this->numParams_ = numparams; \
+                this->hasReturnValue_ = returnvalue; \
+                this->type_ = FT_STATIC; \
+                this->functionPointer_ = functionPointer; \
+                \
+                FUNCTOR_TYPENAME_PARAMS(numparams); \
+                FUNCTOR_TYPENAME_RETURN(returnvalue); \
+            } \
+    \
+            void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
+            { \
+                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
+            } \
+    \
+            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
+            { \
+                FUNCTOR_EVALUATE_PARAM(numparams); \
+            } \
+    \
+        private: \
+            FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \
+    }; \
+    \
+    \
+    FUNCTOR_TEMPLATE(0, returnvalue, numparams) \
+    inline FunctorStatic##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(0, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \
+    { \
+        return new FunctorStatic##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(0, returnvalue, numparams) (functionPointer); \
+    }
+
+
+
+
+
+#define CREATE_MEMBER_FUNCTOR(returnvalue, numparams) \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \
+    class FunctorMember##returnvalue##numparams : public FunctorMember<T> \
+    { \
+        public: \
+            FunctorMember##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \
+            { \
+                this->numParams_ = numparams; \
+                this->hasReturnValue_ = returnvalue; \
+                this->type_ = FT_MEMBER; \
+                this->functionPointer_ = functionPointer; \
+            } \
+    \
+            void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
+            { \
+                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
+            } \
+    \
+            void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
+            { \
+                COUT(1) << "An error occurred in Functor.h:" << std::endl; \
+                COUT(1) << "Error: Function is not const." << std::endl; \
+            } \
+    \
+            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
+            { \
+                FUNCTOR_EVALUATE_PARAM(numparams); \
+            } \
+    \
+        private: \
+            FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \
+    }; \
+    \
+    \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \
+    class FunctorConstMember##returnvalue##numparams : public FunctorMember<T> \
+    { \
+        public: \
+            FunctorConstMember##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const) \
+            { \
+                this->numParams_ = numparams; \
+                this->hasReturnValue_ = returnvalue; \
+                this->type_ = FT_CONSTMEMBER; \
+                this->functionPointer_ = functionPointer; \
+            } \
+    \
+            void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
+            { \
+                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
+            } \
+    \
+            void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
+            { \
+                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
+            } \
+    \
+            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
+            { \
+                FUNCTOR_EVALUATE_PARAM(numparams); \
+            } \
+    \
+        private: \
+            FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)) const; \
+    }; \
+    \
+    \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \
+    inline FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \
+    { \
+        return new FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \
+    } \
+    \
+    \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \
+    inline FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const) \
+    { \
+        return new FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \
+    }
+
+
+// disable annoying warning about forcing value to boolean
 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
 #pragma warning(push)
 #pragma warning(disable:4100 4800)
 #endif
-#define CREATE_ALL_STATIC_FUNCTORS() \    CREATE_STATIC_FUNCTOR(0, 0); \    CREATE_STATIC_FUNCTOR(0, 1); \    CREATE_STATIC_FUNCTOR(0, 2); \    CREATE_STATIC_FUNCTOR(0, 3); \    CREATE_STATIC_FUNCTOR(0, 4); \    CREATE_STATIC_FUNCTOR(0, 5); \    CREATE_STATIC_FUNCTOR(1, 0); \    CREATE_STATIC_FUNCTOR(1, 1); \    CREATE_STATIC_FUNCTOR(1, 2); \    CREATE_STATIC_FUNCTOR(1, 3); \    CREATE_STATIC_FUNCTOR(1, 4); \    CREATE_STATIC_FUNCTOR(1, 5)#define CREATE_ALL_MEMBER_FUNCTORS() \    CREATE_MEMBER_FUNCTOR(0, 0); \    CREATE_MEMBER_FUNCTOR(0, 1); \    CREATE_MEMBER_FUNCTOR(0, 2); \    CREATE_MEMBER_FUNCTOR(0, 3); \    CREATE_MEMBER_FUNCTOR(0, 4); \    CREATE_MEMBER_FUNCTOR(0, 5); \    CREATE_MEMBER_FUNCTOR(1, 0); \    CREATE_MEMBER_FUNCTOR(1, 1); \    CREATE_MEMBER_FUNCTOR(1, 2); \    CREATE_MEMBER_FUNCTOR(1, 3); \    CREATE_MEMBER_FUNCTOR(1, 4); \    CREATE_MEMBER_FUNCTOR(1, 5)    CREATE_ALL_STATIC_FUNCTORS();    CREATE_ALL_MEMBER_FUNCTORS();}#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+
+#define CREATE_ALL_STATIC_FUNCTORS() \
+    CREATE_STATIC_FUNCTOR(0, 0); \
+    CREATE_STATIC_FUNCTOR(0, 1); \
+    CREATE_STATIC_FUNCTOR(0, 2); \
+    CREATE_STATIC_FUNCTOR(0, 3); \
+    CREATE_STATIC_FUNCTOR(0, 4); \
+    CREATE_STATIC_FUNCTOR(0, 5); \
+    CREATE_STATIC_FUNCTOR(1, 0); \
+    CREATE_STATIC_FUNCTOR(1, 1); \
+    CREATE_STATIC_FUNCTOR(1, 2); \
+    CREATE_STATIC_FUNCTOR(1, 3); \
+    CREATE_STATIC_FUNCTOR(1, 4); \
+    CREATE_STATIC_FUNCTOR(1, 5)
+
+
+#define CREATE_ALL_MEMBER_FUNCTORS() \
+    CREATE_MEMBER_FUNCTOR(0, 0); \
+    CREATE_MEMBER_FUNCTOR(0, 1); \
+    CREATE_MEMBER_FUNCTOR(0, 2); \
+    CREATE_MEMBER_FUNCTOR(0, 3); \
+    CREATE_MEMBER_FUNCTOR(0, 4); \
+    CREATE_MEMBER_FUNCTOR(0, 5); \
+    CREATE_MEMBER_FUNCTOR(1, 0); \
+    CREATE_MEMBER_FUNCTOR(1, 1); \
+    CREATE_MEMBER_FUNCTOR(1, 2); \
+    CREATE_MEMBER_FUNCTOR(1, 3); \
+    CREATE_MEMBER_FUNCTOR(1, 4); \
+    CREATE_MEMBER_FUNCTOR(1, 5)
+
+
+    CREATE_ALL_STATIC_FUNCTORS();
+    CREATE_ALL_MEMBER_FUNCTORS();
+}
+
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
 #pragma warning(pop)
-#endif#endif /* _Functor_H__ */
+#endif
+
+#endif /* _Functor_H__ */
Index: /code/branches/network/src/core/Identifier.cc
===================================================================
--- /code/branches/network/src/core/Identifier.cc	(revision 1494)
+++ /code/branches/network/src/core/Identifier.cc	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -30,7 +31,13 @@
     @brief Implementation of the Identifier class.
 */
-#include "Identifier.h"#include <ostream>
+
+#include "Identifier.h"
+
+#include <ostream>
+
 #include "Factory.h"
-#include "ConsoleCommand.h"#include "CommandExecutor.h"
+#include "ConsoleCommand.h"
+#include "CommandExecutor.h"
+
 namespace orxonox
 {
@@ -39,4 +46,5 @@
     // ###############################
     int Identifier::hierarchyCreatingCounter_s = 0; // Set the static member variable hierarchyCreatingCounter_s to zero (this static member variable is ok: it's used in main(), not before)
+
     /**
         @brief Constructor: No factory, no object created, new ObjectList and a unique networkID.
@@ -45,8 +53,16 @@
     {
         this->bCreatedOneObject_ = false;
-        this->factory_ = 0;        this->bHasConfigValues_ = false;        this->bHasConsoleCommands_ = false;
-
-        this->children_ = new std::set<const Identifier*>();        this->directChildren_ = new std::set<const Identifier*>();        // Use a static variable because the classID gets created before main() and that's why we should avoid static member variables        static unsigned int classIDcounter_s = 0;
-        this->classID_ = classIDcounter_s++;    }
+        this->factory_ = 0;
+
+        this->bHasConfigValues_ = false;
+        this->bHasConsoleCommands_ = false;
+
+        this->children_ = new std::set<const Identifier*>();
+        this->directChildren_ = new std::set<const Identifier*>();
+
+        // Use a static variable because the classID gets created before main() and that's why we should avoid static member variables
+        static unsigned int classIDcounter_s = 0;
+        this->classID_ = classIDcounter_s++;
+    }
 
     /**
@@ -55,5 +71,7 @@
     Identifier::~Identifier()
     {
-        delete this->children_;        delete this->directChildren_;    }
+        delete this->children_;
+        delete this->directChildren_;
+    }
 
     /**
@@ -67,7 +85,36 @@
 
         if (parents)
-        {            this->parents_ = (*parents);            this->directParents_ = (*parents);            // Iterate through all parents
+        {
+            this->parents_ = (*parents);
+            this->directParents_ = (*parents);
+
+            // Iterate through all parents
             for (std::set<const Identifier*>::iterator it = parents->begin(); it != parents->end(); ++it)
-            {                // Tell the parent we're one of it's children                (*it)->getChildrenIntern().insert((*it)->getChildrenIntern().end(), this);                // Erase all parents of our parent from our direct-parent-list                for (std::set<const Identifier*>::const_iterator it1 = (*it)->getParents().begin(); it1 != (*it)->getParents().end(); ++it1)                {                    // Search for the parent's parent in our direct-parent-list                    for (std::set<const Identifier*>::iterator it2 = this->directParents_.begin(); it2 != this->directParents_.end(); ++it2)                    {                        if ((*it1) == (*it2))                        {                            // We've found a non-direct parent in our list: Erase it                            this->directParents_.erase(it2);                            break;                        }                    }                }            }            // Now iterate through all direct parents            for (std::set<const Identifier*>::iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)            {                // Tell the parent we're one of it's direct children                (*it)->getDirectChildrenIntern().insert((*it)->getDirectChildrenIntern().end(), this);            }
+            {
+                // Tell the parent we're one of it's children
+                (*it)->getChildrenIntern().insert((*it)->getChildrenIntern().end(), this);
+
+                // Erase all parents of our parent from our direct-parent-list
+                for (std::set<const Identifier*>::const_iterator it1 = (*it)->getParents().begin(); it1 != (*it)->getParents().end(); ++it1)
+                {
+                    // Search for the parent's parent in our direct-parent-list
+                    for (std::set<const Identifier*>::iterator it2 = this->directParents_.begin(); it2 != this->directParents_.end(); ++it2)
+                    {
+                        if ((*it1) == (*it2))
+                        {
+                            // We've found a non-direct parent in our list: Erase it
+                            this->directParents_.erase(it2);
+                            break;
+                        }
+                    }
+                }
+            }
+
+            // Now iterate through all direct parents
+            for (std::set<const Identifier*>::iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
+            {
+                // Tell the parent we're one of it's direct children
+                (*it)->getDirectChildrenIntern().insert((*it)->getDirectChildrenIntern().end(), this);
+            }
         }
     }
@@ -85,5 +132,6 @@
         else
         {
-            COUT(1) << "An error occurred in Identifier.cc:" << std::endl;            COUT(1) << "Error: Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << std::endl;
+            COUT(1) << "An error occurred in Identifier.cc:" << std::endl;
+            COUT(1) << "Error: Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << std::endl;
             COUT(1) << "Aborting..." << std::endl;
             abort();
@@ -127,5 +175,15 @@
     {
         return (this->parents_.find(identifier) != this->parents_.end());
-    }    /**        @brief Returns true, if the assigned identifier is a direct child of the given identifier.        @param identifier The identifier to compare with    */    bool Identifier::isDirectChildOf(const Identifier* identifier) const    {        return (this->directParents_.find(identifier) != this->directParents_.end());    }
+    }
+
+    /**
+        @brief Returns true, if the assigned identifier is a direct child of the given identifier.
+        @param identifier The identifier to compare with
+    */
+    bool Identifier::isDirectChildOf(const Identifier* identifier) const
+    {
+        return (this->directParents_.find(identifier) != this->directParents_.end());
+    }
+
     /**
         @brief Returns true, if the assigned identifier is a parent of the given identifier.
@@ -135,3 +193,145 @@
     {
         return (this->children_->find(identifier) != this->children_->end());
-    }    /**        @brief Returns true, if the assigned identifier is a direct parent of the given identifier.        @param identifier The identifier to compare with    */    bool Identifier::isDirectParentOf(const Identifier* identifier) const    {        return (this->directChildren_->find(identifier) != this->directChildren_->end());    }    /**        @brief Returns the map that stores all Identifiers.        @return The map    */    std::map<std::string, Identifier*>& Identifier::getIdentifierMapIntern()    {        static std::map<std::string, Identifier*> identifierMap;        return identifierMap;    }    /**        @brief Returns the map that stores all Identifiers.        @return The map    */    std::map<std::string, Identifier*>& Identifier::getLowercaseIdentifierMapIntern()    {        static std::map<std::string, Identifier*> lowercaseIdentifierMap;        return lowercaseIdentifierMap;    }    /**        @brief Adds the ConfigValueContainer of a variable, given by the string of its name.        @param varname The name of the variablee        @param container The container    */    void Identifier::addConfigValueContainer(const std::string& varname, ConfigValueContainer* container)    {        std::map<std::string, ConfigValueContainer*>::const_iterator it = this->configValues_.find(varname);        if (it != this->configValues_.end())        {            COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << "." << std::endl;        }        this->bHasConfigValues_ = true;        this->configValues_[varname] = container;        this->configValues_LC_[getLowercase(varname)] = container;    }    /**        @brief Returns the ConfigValueContainer of a variable, given by the string of its name.        @param varname The name of the variable        @return The ConfigValueContainer    */    ConfigValueContainer* Identifier::getConfigValueContainer(const std::string& varname)    {        std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_.find(varname);        if (it != configValues_.end())            return ((*it).second);        else            return 0;    }    /**        @brief Returns the ConfigValueContainer of a variable, given by the string of its name in lowercase.        @param varname The name of the variable in lowercase        @return The ConfigValueContainer    */    ConfigValueContainer* Identifier::getLowercaseConfigValueContainer(const std::string& varname)    {        std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_LC_.find(varname);        if (it != configValues_LC_.end())            return ((*it).second);        else            return 0;    }    /**        @brief Adds a new console command of this class.        @param executor The executor of the command        @param bCreateShortcut If this is true a shortcut gets created so you don't have to add the classname to access this command        @return The executor of the command    */    ConsoleCommand& Identifier::addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut)    {        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(command->getName());        if (it != this->consoleCommands_.end())        {            COUT(2) << "Warning: Overwriting console-command with name " << command->getName() << " in class " << this->getName() << "." << std::endl;        }        this->bHasConsoleCommands_ = true;        this->consoleCommands_[command->getName()] = command;        this->consoleCommands_LC_[getLowercase(command->getName())] = command;        if (bCreateShortcut)            CommandExecutor::addConsoleCommandShortcut(command);        return (*command);    }    /**        @brief Returns the executor of a console command with given name.        @brief name The name of the requested console command        @return The executor of the requested console command    */    ConsoleCommand* Identifier::getConsoleCommand(const std::string& name) const    {        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(name);        if (it != this->consoleCommands_.end())            return (*it).second;        else            return 0;    }    /**        @brief Returns the executor of a console command with given name in lowercase.        @brief name The name of the requested console command in lowercae        @return The executor of the requested console command    */    ConsoleCommand* Identifier::getLowercaseConsoleCommand(const std::string& name) const    {        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_LC_.find(name);        if (it != this->consoleCommands_LC_.end())            return (*it).second;        else            return 0;    }    /**        @brief Lists the names of all Identifiers in a std::set<const Identifier*>.        @param out The outstream        @param list The list (or set) of Identifiers        @return The outstream    */    std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list)    {        for (std::set<const Identifier*>::const_iterator it = list.begin(); it != list.end(); ++it)            out << (*it)->getName() << " ";        return out;    }}
+    }
+
+    /**
+        @brief Returns true, if the assigned identifier is a direct parent of the given identifier.
+        @param identifier The identifier to compare with
+    */
+    bool Identifier::isDirectParentOf(const Identifier* identifier) const
+    {
+        return (this->directChildren_->find(identifier) != this->directChildren_->end());
+    }
+
+    /**
+        @brief Returns the map that stores all Identifiers.
+        @return The map
+    */
+    std::map<std::string, Identifier*>& Identifier::getIdentifierMapIntern()
+    {
+        static std::map<std::string, Identifier*> identifierMap;
+        return identifierMap;
+    }
+
+    /**
+        @brief Returns the map that stores all Identifiers.
+        @return The map
+    */
+    std::map<std::string, Identifier*>& Identifier::getLowercaseIdentifierMapIntern()
+    {
+        static std::map<std::string, Identifier*> lowercaseIdentifierMap;
+        return lowercaseIdentifierMap;
+    }
+
+    /**
+        @brief Adds the ConfigValueContainer of a variable, given by the string of its name.
+        @param varname The name of the variablee
+        @param container The container
+    */
+    void Identifier::addConfigValueContainer(const std::string& varname, ConfigValueContainer* container)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = this->configValues_.find(varname);
+        if (it != this->configValues_.end())
+        {
+            COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << "." << std::endl;
+        }
+
+        this->bHasConfigValues_ = true;
+        this->configValues_[varname] = container;
+        this->configValues_LC_[getLowercase(varname)] = container;
+    }
+
+    /**
+        @brief Returns the ConfigValueContainer of a variable, given by the string of its name.
+        @param varname The name of the variable
+        @return The ConfigValueContainer
+    */
+    ConfigValueContainer* Identifier::getConfigValueContainer(const std::string& varname)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_.find(varname);
+        if (it != configValues_.end())
+            return ((*it).second);
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the ConfigValueContainer of a variable, given by the string of its name in lowercase.
+        @param varname The name of the variable in lowercase
+        @return The ConfigValueContainer
+    */
+    ConfigValueContainer* Identifier::getLowercaseConfigValueContainer(const std::string& varname)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_LC_.find(varname);
+        if (it != configValues_LC_.end())
+            return ((*it).second);
+        else
+            return 0;
+    }
+
+    /**
+        @brief Adds a new console command of this class.
+        @param executor The executor of the command
+        @param bCreateShortcut If this is true a shortcut gets created so you don't have to add the classname to access this command
+        @return The executor of the command
+    */
+    ConsoleCommand& Identifier::addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut)
+    {
+        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(command->getName());
+        if (it != this->consoleCommands_.end())
+        {
+            COUT(2) << "Warning: Overwriting console-command with name " << command->getName() << " in class " << this->getName() << "." << std::endl;
+        }
+
+        this->bHasConsoleCommands_ = true;
+        this->consoleCommands_[command->getName()] = command;
+        this->consoleCommands_LC_[getLowercase(command->getName())] = command;
+
+        if (bCreateShortcut)
+            CommandExecutor::addConsoleCommandShortcut(command);
+
+        return (*command);
+    }
+
+    /**
+        @brief Returns the executor of a console command with given name.
+        @brief name The name of the requested console command
+        @return The executor of the requested console command
+    */
+    ConsoleCommand* Identifier::getConsoleCommand(const std::string& name) const
+    {
+        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(name);
+        if (it != this->consoleCommands_.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the executor of a console command with given name in lowercase.
+        @brief name The name of the requested console command in lowercae
+        @return The executor of the requested console command
+    */
+    ConsoleCommand* Identifier::getLowercaseConsoleCommand(const std::string& name) const
+    {
+        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_LC_.find(name);
+        if (it != this->consoleCommands_LC_.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Lists the names of all Identifiers in a std::set<const Identifier*>.
+        @param out The outstream
+        @param list The list (or set) of Identifiers
+        @return The outstream
+    */
+    std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list)
+    {
+        for (std::set<const Identifier*>::const_iterator it = list.begin(); it != list.end(); ++it)
+            out << (*it)->getName() << " ";
+
+        return out;
+    }
+}
Index: /code/branches/network/src/core/Identifier.h
===================================================================
--- /code/branches/network/src/core/Identifier.h	(revision 1494)
+++ /code/branches/network/src/core/Identifier.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -62,5 +63,7 @@
 #include "Debug.h"
 #include "Iterator.h"
-#include "MetaObjectList.h"#include "util/String.h"
+#include "MetaObjectList.h"
+#include "util/String.h"
+
 namespace orxonox
 {
Index: /code/branches/network/src/core/InputBuffer.h
===================================================================
--- /code/branches/network/src/core/InputBuffer.h	(revision 1494)
+++ /code/branches/network/src/core/InputBuffer.h	(revision 1495)
@@ -1,2 +1,189 @@
-/* *   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: *      Fabian 'x3n' Landau *   Co-authors: *      Reto Grieder * */#ifndef _InputBuffer_H__#define _InputBuffer_H__#include "CorePrereqs.h"#include <string>#include <list>#include "InputInterfaces.h"#include "OrxonoxClass.h"namespace orxonox{    class BaseInputBufferListenerTuple    {    public:        BaseInputBufferListenerTuple(bool bListenToAllChanges, bool bOnlySingleInput,            bool trueKeyFalseChar, char _char, KeyCode::Enum key)            : bListenToAllChanges_(bListenToAllChanges), bOnlySingleInput_(bOnlySingleInput),              trueKeyFalseChar_(trueKeyFalseChar), char_(_char), key_(key)        { }        virtual ~BaseInputBufferListenerTuple() { }        virtual void callFunction() = 0;        bool bListenToAllChanges_;        bool bOnlySingleInput_;        bool trueKeyFalseChar_;        char char_;        KeyCode::Enum key_;    };    template <class T>    class InputBufferListenerTuple : public BaseInputBufferListenerTuple    {    public:        InputBufferListenerTuple(T* listener, void (T::*function)(), bool bListenToAllChanges,            bool bOnlySingleInput, bool trueKeyFalseChar, char _char, KeyCode::Enum key)            : BaseInputBufferListenerTuple(bListenToAllChanges, bOnlySingleInput, trueKeyFalseChar, _char, key),              listener_(listener), function_(function)        { }
-        virtual ~InputBufferListenerTuple() { }        void callFunction()        {            (listener_->*function_)();        }        T* listener_;        void (T::*function_)();    };    class _CoreExport InputBuffer : public KeyHandler, public OrxonoxClass    {        public:            InputBuffer();            InputBuffer(const std::string allowedChars);            void setConfigValues();            template <class T>            void registerListener(T* listener, void (T::*function)(), bool bOnlySingleInput)            {                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, true, bOnlySingleInput, false, '\0', KeyCode::Unassigned);                this->listeners_.insert(this->listeners_.end(), newTuple);            }            template <class T>            void registerListener(T* listener, void (T::*function)() const, bool bOnlySingleInput)            {                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, true, bOnlySingleInput, false, '\0', KeyCode::Unassigned);                this->listeners_.insert(this->listeners_.end(), newTuple);            }            template <class T>            void registerListener(T* listener, void (T::*function)(), char _char, bool bOnlySingleInput)            {                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, bOnlySingleInput, false, _char, KeyCode::Unassigned);                this->listeners_.insert(this->listeners_.end(), newTuple);            }            template <class T>            void registerListener(T* listener, void (T::*function)() const, char _char, bool bOnlySingleInput)            {                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, bOnlySingleInput, false, _char, KeyCode::Unassigned);                this->listeners_.insert(this->listeners_.end(), newTuple);            }            template <class T>            void registerListener(T* listener, void (T::*function)(), KeyCode::Enum key)            {                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, true, true, '\0', key);                this->listeners_.insert(this->listeners_.end(), newTuple);            }            template <class T>            void registerListener(T* listener, void (T::*function)() const, KeyCode::Enum key)            {                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, true, true, '\0', key);                this->listeners_.insert(this->listeners_.end(), newTuple);            }            template <class T>            void unregisterListener(T* listener)            {                for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )                {                    InputBufferListenerTuple<T>* refListener = dynamic_cast<InputBufferListenerTuple<T>*>(*it);                    if (refListener && refListener->listener_ == listener)                        this->listeners_.erase(it++);                    else                        it++;                }            }            void set(const std::string& input, bool update = true);            void insert(const std::string& input, bool update = true);            void insert(const char& input, bool update = true);            void clear(bool update = true);            void removeAtCursor(bool update = true);            void removeBehindCursor(bool update = true);            void updated();            void updated(const char& update, bool bSingleInput);            inline std::string get() const                { return this->buffer_; }            inline unsigned int getSize() const                { return this->buffer_.size(); }            inline unsigned int getCursorPosition() const                { return this->cursor_; }            inline void setCursorPosition(unsigned int cursor)                { if (cursor <= this->buffer_.size()) { this->cursor_ = cursor; } }            inline void setCursorToEnd()                { this->cursor_ = this->buffer_.size(); }            inline void setCursorToBegin()                { this->cursor_ = 0; }            inline void increaseCursor()                { if (this->cursor_ < this->buffer_.size()) { ++this->cursor_; } }            inline void decreaseCursor()                { if (this->cursor_ > 0) { --this->cursor_; } }        private:            bool charIsAllowed(const char& input);            void keyPressed (const KeyEvent& evt);            void keyReleased(const KeyEvent& evt) { }            void keyHeld    (const KeyEvent& evt);            void processKey (const KeyEvent &e);            void tickInput(float dt, const HandlerState& state);            std::string buffer_;            std::list<BaseInputBufferListenerTuple*> listeners_;            std::string allowedChars_;            unsigned int cursor_;            KeyCode::Enum lastKey_;            float timeSinceKeyPressed_;            float timeSinceKeyRepeated_;            int keysToRepeat_;            float keyRepeatDeleay_;            float keyRepeatTime_;    };}#endif /* _InputBuffer_H__ */
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+#ifndef _InputBuffer_H__
+#define _InputBuffer_H__
+
+#include "CorePrereqs.h"
+
+#include <string>
+#include <list>
+
+#include "InputInterfaces.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    class BaseInputBufferListenerTuple
+    {
+    public:
+        BaseInputBufferListenerTuple(bool bListenToAllChanges, bool bOnlySingleInput,
+            bool trueKeyFalseChar, char _char, KeyCode::Enum key)
+            : bListenToAllChanges_(bListenToAllChanges), bOnlySingleInput_(bOnlySingleInput),
+              trueKeyFalseChar_(trueKeyFalseChar), char_(_char), key_(key)
+        { }
+        virtual ~BaseInputBufferListenerTuple() { }
+        virtual void callFunction() = 0;
+        bool bListenToAllChanges_;
+        bool bOnlySingleInput_;
+        bool trueKeyFalseChar_;
+        char char_;
+        KeyCode::Enum key_;
+    };
+
+    template <class T>
+    class InputBufferListenerTuple : public BaseInputBufferListenerTuple
+    {
+    public:
+        InputBufferListenerTuple(T* listener, void (T::*function)(), bool bListenToAllChanges,
+            bool bOnlySingleInput, bool trueKeyFalseChar, char _char, KeyCode::Enum key)
+            : BaseInputBufferListenerTuple(bListenToAllChanges, bOnlySingleInput, trueKeyFalseChar, _char, key),
+              listener_(listener), function_(function)
+        { }
+        virtual ~InputBufferListenerTuple() { }
+        void callFunction()
+        {
+            (listener_->*function_)();
+        }
+        T* listener_;
+        void (T::*function_)();
+    };
+
+    class _CoreExport InputBuffer : public KeyHandler, public OrxonoxClass
+    {
+        public:
+            InputBuffer();
+            InputBuffer(const std::string allowedChars);
+
+            void setConfigValues();
+
+            template <class T>
+            void registerListener(T* listener, void (T::*function)(), bool bOnlySingleInput)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, true, bOnlySingleInput, false, '\0', KeyCode::Unassigned);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)() const, bool bOnlySingleInput)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, true, bOnlySingleInput, false, '\0', KeyCode::Unassigned);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)(), char _char, bool bOnlySingleInput)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, bOnlySingleInput, false, _char, KeyCode::Unassigned);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)() const, char _char, bool bOnlySingleInput)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, bOnlySingleInput, false, _char, KeyCode::Unassigned);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+
+            template <class T>
+            void registerListener(T* listener, void (T::*function)(), KeyCode::Enum key)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, true, true, '\0', key);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)() const, KeyCode::Enum key)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, true, true, '\0', key);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+
+            template <class T>
+            void unregisterListener(T* listener)
+            {
+                for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
+                {
+                    InputBufferListenerTuple<T>* refListener = dynamic_cast<InputBufferListenerTuple<T>*>(*it);
+                    if (refListener && refListener->listener_ == listener)
+                        this->listeners_.erase(it++);
+                    else
+                        it++;
+                }
+            }
+
+            void set(const std::string& input, bool update = true);
+            void insert(const std::string& input, bool update = true);
+            void insert(const char& input, bool update = true);
+            void clear(bool update = true);
+            void removeAtCursor(bool update = true);
+            void removeBehindCursor(bool update = true);
+
+            void updated();
+            void updated(const char& update, bool bSingleInput);
+
+            inline std::string get() const
+                { return this->buffer_; }
+            inline unsigned int getSize() const
+                { return this->buffer_.size(); }
+
+            inline unsigned int getCursorPosition() const
+                { return this->cursor_; }
+            inline void setCursorPosition(unsigned int cursor)
+                { if (cursor <= this->buffer_.size()) { this->cursor_ = cursor; } }
+            inline void setCursorToEnd()
+                { this->cursor_ = this->buffer_.size(); }
+            inline void setCursorToBegin()
+                { this->cursor_ = 0; }
+            inline void increaseCursor()
+                { if (this->cursor_ < this->buffer_.size()) { ++this->cursor_; } }
+            inline void decreaseCursor()
+                { if (this->cursor_ > 0) { --this->cursor_; } }
+
+        private:
+            bool charIsAllowed(const char& input);
+
+            void keyPressed (const KeyEvent& evt);
+            void keyReleased(const KeyEvent& evt) { }
+            void keyHeld    (const KeyEvent& evt);
+            void processKey (const KeyEvent &e);
+
+            void tickInput(float dt, const HandlerState& state);
+
+            std::string buffer_;
+            std::list<BaseInputBufferListenerTuple*> listeners_;
+            std::string allowedChars_;
+            unsigned int cursor_;
+
+            KeyCode::Enum lastKey_;
+            float timeSinceKeyPressed_;
+            float timeSinceKeyRepeated_;
+            int keysToRepeat_;
+
+            float keyRepeatDeleay_;
+            float keyRepeatTime_;
+    };
+}
+
+#endif /* _InputBuffer_H__ */
Index: /code/branches/network/src/core/InputManager.cc
===================================================================
--- /code/branches/network/src/core/InputManager.cc	(revision 1494)
+++ /code/branches/network/src/core/InputManager.cc	(revision 1495)
@@ -41,5 +41,7 @@
 #include "KeyBinder.h"
 #include "CommandExecutor.h"
-#include "ConsoleCommand.h"#include "Shell.h"
+#include "ConsoleCommand.h"
+#include "Shell.h"
+
 namespace orxonox
 {
@@ -150,4 +152,5 @@
       addKeyHandler(buffer_, "buffer");
       Shell::getInstance().setInputBuffer(buffer_);
+
       keyBinder_ = new KeyBinder();
       keyBinder_->loadBindings();
@@ -194,5 +197,6 @@
         // register our listener in OIS.
         keyboard_->setEventCallback(this);
-        // note: OIS will not detect keys that have already been down when the keyboard was created.        CCOUT(ORX_DEBUG) << "Created OIS keyboard" << std::endl;
+        // note: OIS will not detect keys that have already been down when the keyboard was created.
+        CCOUT(ORX_DEBUG) << "Created OIS keyboard" << std::endl;
         return true;
       }
@@ -310,5 +314,7 @@
   void InputManager::setConfigValues()
   {
-    if (joySticksSize_)    {      std::vector<MultiTypeMath> coeffPos;
+    if (joySticksSize_)
+    {
+      std::vector<MultiTypeMath> coeffPos;
       std::vector<MultiTypeMath> coeffNeg;
       std::vector<MultiTypeMath> zero;
@@ -323,5 +329,37 @@
       }
 
-      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");      if (!cont)      {          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffPos", coeffPos);          getIdentifier()->addConfigValueContainer("CoeffPos", cont);      }      cont->getValue(&coeffPos);      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");      if (!cont)      {          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffNeg", coeffNeg);          getIdentifier()->addConfigValueContainer("CoeffNeg", cont);      }      cont->getValue(&coeffNeg);      cont = getIdentifier()->getConfigValueContainer("Zero");      if (!cont)      {          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "Zero", zero);          getIdentifier()->addConfigValueContainer("Zero", cont);      }      cont->getValue(&zero);      // copy values to our own variables      for (unsigned int i = 0; i < 24; i++)      {        joySticksCalibration_[0].positiveCoeff[i] = coeffPos[i];        joySticksCalibration_[0].negativeCoeff[i] = coeffNeg[i];        joySticksCalibration_[0].zeroStates[i]    = zero[i];      }    }  }
+      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");
+      if (!cont)
+      {
+          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffPos", coeffPos);
+          getIdentifier()->addConfigValueContainer("CoeffPos", cont);
+      }
+      cont->getValue(&coeffPos);
+
+      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
+      if (!cont)
+      {
+          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffNeg", coeffNeg);
+          getIdentifier()->addConfigValueContainer("CoeffNeg", cont);
+      }
+      cont->getValue(&coeffNeg);
+
+      cont = getIdentifier()->getConfigValueContainer("Zero");
+      if (!cont)
+      {
+          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "Zero", zero);
+          getIdentifier()->addConfigValueContainer("Zero", cont);
+      }
+      cont->getValue(&zero);
+
+      // copy values to our own variables
+      for (unsigned int i = 0; i < 24; i++)
+      {
+        joySticksCalibration_[0].positiveCoeff[i] = coeffPos[i];
+        joySticksCalibration_[0].negativeCoeff[i] = coeffNeg[i];
+        joySticksCalibration_[0].zeroStates[i]    = zero[i];
+      }
+    }
+  }
 
   /**
@@ -624,12 +662,24 @@
       else
         joySticksCalibration_[0].positiveCoeff[i] =  1.0f;
+
       // config value
-      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");      assert(cont);      cont->set(i, joySticksCalibration_[0].positiveCoeff[i]);      // negative coefficient
+      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");
+      assert(cont);
+      cont->set(i, joySticksCalibration_[0].positiveCoeff[i]);
+
+      // negative coefficient
       if (marginalsMin_[i] == INT_MAX)
         marginalsMin_[i] = -32768;
       // coefficients
       if (marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i])
-        joySticksCalibration_[0].negativeCoeff[i] = -1.0f/(marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i]);      else        joySticksCalibration_[0].negativeCoeff[i] =  1.0f;      // config value
-      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");      assert(cont);      cont->set(i, joySticksCalibration_[0].negativeCoeff[i]);      // zero states
+        joySticksCalibration_[0].negativeCoeff[i] = -1.0f/(marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i]);
+      else
+        joySticksCalibration_[0].negativeCoeff[i] =  1.0f;
+      // config value
+      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
+      assert(cont);
+      cont->set(i, joySticksCalibration_[0].negativeCoeff[i]);
+
+      // zero states
       if (i < 8)
       {
@@ -647,5 +697,8 @@
       }
       // config value
-      cont = getIdentifier()->getConfigValueContainer("Zero");      assert(cont);      cont->set(i, joySticksCalibration_[0].zeroStates[i]);    }
+      cont = getIdentifier()->getConfigValueContainer("Zero");
+      assert(cont);
+      cont->set(i, joySticksCalibration_[0].zeroStates[i]);
+    }
   }
 
Index: /code/branches/network/src/core/KeyBinder.cc
===================================================================
--- /code/branches/network/src/core/KeyBinder.cc	(revision 1494)
+++ /code/branches/network/src/core/KeyBinder.cc	(revision 1495)
@@ -41,5 +41,7 @@
 #include "ConfigValueIncludes.h"
 #include "CoreIncludes.h"
-#include "CommandExecutor.h"#include "ConsoleCommand.h"#include "Executor.h"
+#include "CommandExecutor.h"
+#include "ConsoleCommand.h"
+#include "Executor.h"
 // TODO: only needed by the CalibratorCallback class; move to new file
 #include "InputManager.h"
Index: /code/branches/network/src/core/Script_clean.h
===================================================================
--- /code/branches/network/src/core/Script_clean.h	(revision 1494)
+++ /code/branches/network/src/core/Script_clean.h	(revision 1495)
@@ -1,3 +1,31 @@
-/* *   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: *      Benjamin Knecht *   Co-authors: *      ... * *//**
+/*
+ *   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:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
  @file  script.h
  @brief Representation of an interface to lua
Index: /code/branches/network/src/core/SignalHandler.h
===================================================================
--- /code/branches/network/src/core/SignalHandler.h	(revision 1494)
+++ /code/branches/network/src/core/SignalHandler.h	(revision 1495)
@@ -1,4 +1,36 @@
-/* *   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: *      Christoph Renner *   Co-authors: *      ... * */
-/**    @file SignalHandler.h    @brief Definition of the SignalHandler class.*/#ifndef _SignalHandler_H__
+/*
+ *   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:
+ *      Christoph Renner
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file SignalHandler.h
+    @brief Definition of the SignalHandler class.
+*/
+
+#ifndef _SignalHandler_H__
 #define _SignalHandler_H__
 
Index: /code/branches/network/src/cpptcl/CppTcl.cc
===================================================================
--- /code/branches/network/src/cpptcl/CppTcl.cc	(revision 1494)
+++ /code/branches/network/src/cpptcl/CppTcl.cc	(revision 1495)
@@ -855,6 +855,19 @@
 interpreter::interpreter()
 {
-     interp_ =  Tcl_CreateInterp();     owner_ = true;
-}interpreter::interpreter(string const &libpath){     interp_ =  Tcl_CreateInterp();     owner_ = true;     try     {        this->eval("set tcl_library " + libpath);        Tcl_Init(this->interp_);     } catch (...) {}}
+     interp_ =  Tcl_CreateInterp();
+     owner_ = true;
+}
+
+interpreter::interpreter(string const &libpath)
+{
+     interp_ =  Tcl_CreateInterp();
+     owner_ = true;
+
+     try
+     {
+        this->eval("set tcl_library " + libpath);
+        Tcl_Init(this->interp_);
+     } catch (...) {}
+}
 
 interpreter::interpreter(Tcl_Interp *interp, bool owner)
@@ -870,5 +883,7 @@
           // clear all callback info belonging to this interpreter
           clear_definitions(interp_);
-          Tcl_DeleteInterp(interp_);     }
+
+          Tcl_DeleteInterp(interp_);
+     }
 }
 
Index: /code/branches/network/src/cpptcl/CppTcl.h
===================================================================
--- /code/branches/network/src/cpptcl/CppTcl.h	(revision 1494)
+++ /code/branches/network/src/cpptcl/CppTcl.h	(revision 1495)
@@ -467,5 +467,6 @@
 {
 public:
-     interpreter();     interpreter(std::string const &libpath);
+     interpreter();
+     interpreter(std::string const &libpath);
      interpreter(Tcl_Interp *, bool owner = true);
      ~interpreter();
Index: /code/branches/network/src/network/dummyclient.cc
===================================================================
--- /code/branches/network/src/network/dummyclient.cc	(revision 1494)
+++ /code/branches/network/src/network/dummyclient.cc	(revision 1495)
@@ -1,2 +1,124 @@
-/* *   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: *      Oliver Scheuss, (C) 2007 *   Co-authors: *      ... * *///o// Dummy client to test ConnectionManager and PacketBuffer classes//// Author: Oliver Scheuss#include <iostream>#include <string>#include <enet/enet.h>#include "util/Sleep.h"#include "PacketManager.h"#include "PacketTypes.h"
-using namespace std;int main(){  ENetHost * client;  ENetAddress address;  ENetEvent event;  ENetPeer *peer;  network::PacketGenerator pck;  enet_initialize();  atexit(enet_deinitialize);  cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl;  string str;  getline(cin, str);  cout << "You entered: " << str << endl;  if(str.compare("")==0)    str="127.0.0.1";  enet_address_set_host(&address, str.c_str());  address.port = 55556;  // create client object  client = enet_host_create(NULL, 2, 0, 0);  if(client==NULL){    fprintf(stderr, "An error occured");    exit(EXIT_FAILURE);  }  // connect peer  peer = enet_host_connect(client, &address, 2);  if(peer==NULL){    fprintf(stderr, "Peer establishing error");    exit(EXIT_FAILURE);  }  // wait 5 seconds for the connection attempt to succeed  if(enet_host_service(client, &event, 5000) > 0 && event.type == ENET_EVENT_TYPE_CONNECT){    cout << "Connection to " << str << " succeeded." << endl;    //puts("Connection to localhost:5555 succeeded.");  }else{    enet_peer_reset(peer);    cout << "Connection to " << str << " failed." << endl;    //puts("Connection to localhost:5555 failed.");    exit(EXIT_FAILURE);  }  for(int i=0; i<10; i++){    // weihnachtsmann bringt packete    //ENetPacket *packet = enet_packet_create ("packet1234", strlen("packet1234") + 1, ENET_PACKET_FLAG_RELIABLE);    // extend the packet and append the string foo to it    // send packet to peer on channel id 0    enet_peer_send(peer, 1, pck.chatMessage("test2"));    // keep the timeout very small for low delay    if(enet_host_service(client, &event, 1)==0){      cout << "successfully sent: " << event.type << endl;    }else{      cout << "failed sending" << endl;    }    usleep(1000000);  }  // now disconnect  //   enet_peer_disconnect (peer);  enet_peer_disconnect (peer, 0);  // 3 seconds timeout  while(enet_host_service(client, &event, 3000) > 0){    switch (event.type)    {    case ENET_EVENT_TYPE_RECEIVE:      enet_packet_destroy(event.packet);      break;    case ENET_EVENT_TYPE_DISCONNECT:      puts("Disconnection succeeded.");      return 0;    }  }  // if disconnect failed  enet_peer_reset(peer);  return 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:
+ *      Oliver Scheuss, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+//o
+// Dummy client to test ConnectionManager and PacketBuffer classes
+//
+// Author: Oliver Scheuss
+
+#include <iostream>
+#include <string>
+#include <enet/enet.h>
+
+#include "util/Sleep.h"
+#include "PacketManager.h"
+#include "PacketTypes.h"
+
+using namespace std;
+
+int main(){
+  ENetHost * client;
+  ENetAddress address;
+  ENetEvent event;
+  ENetPeer *peer;
+  network::PacketGenerator pck;
+
+  enet_initialize();
+  atexit(enet_deinitialize);
+
+  cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl;
+  string str;
+  getline(cin, str);
+  cout << "You entered: " << str << endl;
+  if(str.compare("")==0)
+    str="127.0.0.1";
+
+  enet_address_set_host(&address, str.c_str());
+  address.port = 55556;
+
+  // create client object
+  client = enet_host_create(NULL, 2, 0, 0);
+
+  if(client==NULL){
+    fprintf(stderr, "An error occured");
+    exit(EXIT_FAILURE);
+  }
+  // connect peer
+  peer = enet_host_connect(client, &address, 2);
+  if(peer==NULL){
+    fprintf(stderr, "Peer establishing error");
+    exit(EXIT_FAILURE);
+  }
+  // wait 5 seconds for the connection attempt to succeed
+  if(enet_host_service(client, &event, 5000) > 0 && event.type == ENET_EVENT_TYPE_CONNECT){
+    cout << "Connection to " << str << " succeeded." << endl;
+    //puts("Connection to localhost:5555 succeeded.");
+  }else{
+    enet_peer_reset(peer);
+    cout << "Connection to " << str << " failed." << endl;
+    //puts("Connection to localhost:5555 failed.");
+    exit(EXIT_FAILURE);
+  }
+
+  for(int i=0; i<10; i++){
+    // weihnachtsmann bringt packete
+    //ENetPacket *packet = enet_packet_create ("packet1234", strlen("packet1234") + 1, ENET_PACKET_FLAG_RELIABLE);
+    // extend the packet and append the string foo to it
+    // send packet to peer on channel id 0
+    enet_peer_send(peer, 1, pck.chatMessage("test2"));
+    // keep the timeout very small for low delay
+    if(enet_host_service(client, &event, 1)==0){
+      cout << "successfully sent: " << event.type << endl;
+    }else{
+      cout << "failed sending" << endl;
+    }
+    usleep(1000000);
+  }
+
+  // now disconnect
+  //   enet_peer_disconnect (peer);
+  enet_peer_disconnect (peer, 0);
+  // 3 seconds timeout
+  while(enet_host_service(client, &event, 3000) > 0){
+    switch (event.type)
+    {
+    case ENET_EVENT_TYPE_RECEIVE:
+      enet_packet_destroy(event.packet);
+      break;
+    case ENET_EVENT_TYPE_DISCONNECT:
+      puts("Disconnection succeeded.");
+      return 0;
+    }
+  }
+  // if disconnect failed
+  enet_peer_reset(peer);
+
+
+
+  return 0;
+}
Index: /code/branches/network/src/network/dummyclient2.cc
===================================================================
--- /code/branches/network/src/network/dummyclient2.cc	(revision 1494)
+++ /code/branches/network/src/network/dummyclient2.cc	(revision 1495)
@@ -1,3 +1,30 @@
-/* *   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: *      Oliver Scheuss, (C) 2007 *   Co-authors: *      ... * */
+/*
+ *   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:
+ *      Oliver Scheuss, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
 //
 // Dummy client to test ConnectionManager, PacketBuffer, ClientConnection and other classes
Index: /code/branches/network/src/network/dummyclient3.cc
===================================================================
--- /code/branches/network/src/network/dummyclient3.cc	(revision 1494)
+++ /code/branches/network/src/network/dummyclient3.cc	(revision 1495)
@@ -1,3 +1,31 @@
-/* *   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: *      ... *   Co-authors: *      ... * */#include "Client.h"
+/*
+ *   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:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Client.h"
 
 #include <iostream>
@@ -22,7 +50,12 @@
 
   Client client( str, PORT );
-  if ( client.establishConnection() )  {
-    COUT(3) << "connection established" << std::endl;  }
-  else  {    COUT(0) << "problems establishing connection" << std::endl;  }
+  if ( client.establishConnection() )
+  {
+    COUT(3) << "connection established" << std::endl;
+  }
+  else
+  {
+    COUT(0) << "problems establishing connection" << std::endl;
+  }
   char message[10000];
   char signs[] = "abcdefghijklmnopqrstuvwxy";
Index: /code/branches/network/src/network/dummyserver.cc
===================================================================
--- /code/branches/network/src/network/dummyserver.cc	(revision 1494)
+++ /code/branches/network/src/network/dummyserver.cc	(revision 1495)
@@ -1,2 +1,74 @@
-/* *   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: *      Oliver Scheuss, (C) 2007 *   Co-authors: *      ... * *///// Dummy server to test ConnectionManager and PacketBuffer classes//// Author: Oliver Scheuss#include <iostream>#include <enet/enet.h>#include "util/Sleep.h"#include "ConnectionManager.h"#include "PacketManager.h"#include "PacketTypes.h"
-#include "ClientInformation.h"using namespace network;int main(){  bool quit=false;  ENetPacket *packet;  ClientInformation clients;  ConnectionManager server = ConnectionManager(&clients);  server.createListener();  PacketDecoder dec;  while(!quit){    if(server.queueEmpty())      // Warning: usleep(100) is Sleep(100/1000) = Sleep(0), which is nothing!      usleep(1);    else{      ENetAddress addr;      packet=server.getPacket(addr);      if(packet==NULL){        // there was some error        //std::cout << "null pointer" << std::endl;        quit=true;      }      else{        //std::cout << "We received: " << packet->data << std::endl;        dec.elaborate(packet, 1);      }    }  }  server.quitListener();  return 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:
+ *      Oliver Scheuss, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+//
+// Dummy server to test ConnectionManager and PacketBuffer classes
+//
+// Author: Oliver Scheuss
+
+#include <iostream>
+#include <enet/enet.h>
+
+#include "util/Sleep.h"
+#include "ConnectionManager.h"
+#include "PacketManager.h"
+#include "PacketTypes.h"
+#include "ClientInformation.h"
+
+using namespace network;
+
+int main(){
+  bool quit=false;
+  ENetPacket *packet;
+  ClientInformation clients;
+  ConnectionManager server = ConnectionManager(&clients);
+  server.createListener();
+
+  PacketDecoder dec;
+
+  while(!quit){
+    if(server.queueEmpty())
+      // Warning: usleep(100) is Sleep(100/1000) = Sleep(0), which is nothing!
+      usleep(1);
+    else{
+      ENetAddress addr;
+      packet=server.getPacket(addr);
+      if(packet==NULL){
+        // there was some error
+        //std::cout << "null pointer" << std::endl;
+        quit=true;
+      }
+      else{
+        //std::cout << "We received: " << packet->data << std::endl;
+        dec.elaborate(packet, 1);
+      }
+    }
+  }
+  server.quitListener();
+  return 0;
+}
Index: /code/branches/network/src/network/dummyserver3.cc
===================================================================
--- /code/branches/network/src/network/dummyserver3.cc	(revision 1494)
+++ /code/branches/network/src/network/dummyserver3.cc	(revision 1495)
@@ -1,3 +1,31 @@
-/* *   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: *      Oliver Scheuss, (C) 2007 *   Co-authors: *      ... * */#include "Server.h"
+/*
+ *   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:
+ *      Oliver Scheuss, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Server.h"
 
 #include <iostream>
Index: /code/branches/network/src/ois/linux/LinuxKeyboard.cpp
===================================================================
--- /code/branches/network/src/ois/linux/LinuxKeyboard.cpp	(revision 1494)
+++ /code/branches/network/src/ois/linux/LinuxKeyboard.cpp	(revision 1495)
@@ -1,6 +1,444 @@
-/*The zlib/libpng LicenseCopyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)This software is provided 'as-is', without any express or implied warranty. In no event willthe authors be held liable for any damages arising from the use of this software.Permission is granted to anyone to use this software for any purpose, including commercialapplications, and to alter it and redistribute it freely, subject to the followingrestrictions:    1. The origin of this software must not be misrepresented; you must not claim that		you wrote the original software. If you use this software in a product,		an acknowledgment in the product documentation would be appreciated but is		not required.    2. Altered source versions must be plainly marked as such, and must not be		misrepresented as being the original software.    3. This notice may not be removed or altered from any source distribution.*/#include "linux/LinuxInputManager.h"#include "linux/LinuxKeyboard.h"#include "OISException.h"#include "OISEvents.h"#include <X11/keysym.h>#include <X11/Xutil.h>#include <cstring>using namespace OIS;#include <iostream>//-------------------------------------------------------------------//LinuxKeyboard::LinuxKeyboard(InputManager* creator, bool buffered, bool grab, bool useXRepeat)	: Keyboard(creator->inputSystemName(), buffered, 0, creator){	setlocale(LC_CTYPE, ""); //Set the locale to (hopefully) the users LANG UTF-8 Env var	display = 0;	window = 0;	grabKeyboard = grab;	keyFocusLost = false;	xAutoRepeat = useXRepeat;	oldXAutoRepeat = false;	//X Key Map to KeyCode	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_1, KC_1));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_2, KC_2));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_3, KC_3));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_4, KC_4));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_5, KC_5));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_6, KC_6));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_7, KC_7));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_8, KC_8));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_9, KC_9));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_0, KC_0));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_BackSpace, KC_BACK));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_minus, KC_MINUS));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_equal, KC_EQUALS));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_space, KC_SPACE));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_comma, KC_COMMA));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_period, KC_PERIOD));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_backslash, KC_BACKSLASH));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_slash, KC_SLASH));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_bracketleft, KC_LBRACKET));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_bracketright, KC_RBRACKET));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Escape,KC_ESCAPE));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Caps_Lock, KC_CAPITAL));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Tab, KC_TAB));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Return, KC_RETURN));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Control_L, KC_LCONTROL));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Control_R, KC_RCONTROL));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_colon, KC_COLON));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_semicolon, KC_SEMICOLON));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_apostrophe, KC_APOSTROPHE));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_grave, KC_GRAVE));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_b, KC_B));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_a, KC_A));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_c, KC_C));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_d, KC_D));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_e, KC_E));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_f, KC_F));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_g, KC_G));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_h, KC_H));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_i, KC_I));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_j, KC_J));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_k, KC_K));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_l, KC_L));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_m, KC_M));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_n, KC_N));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_o, KC_O));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_p, KC_P));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_q, KC_Q));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_r, KC_R));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_s, KC_S));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_t, KC_T));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_u, KC_U));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_v, KC_V));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_w, KC_W));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_x, KC_X));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_y, KC_Y));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_z, KC_Z));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F1, KC_F1));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F2, KC_F2));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F3, KC_F3));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F4, KC_F4));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F5, KC_F5));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F6, KC_F6));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F7, KC_F7));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F8, KC_F8));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F9, KC_F9));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F10, KC_F10));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F11, KC_F11));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F12, KC_F12));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F13, KC_F13));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F14, KC_F14));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F15, KC_F15));	//Keypad	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_0, KC_NUMPAD0));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_1, KC_NUMPAD1));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_2, KC_NUMPAD2));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_3, KC_NUMPAD3));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_4, KC_NUMPAD4));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_5, KC_NUMPAD5));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_6, KC_NUMPAD6));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_7, KC_NUMPAD7));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_8, KC_NUMPAD8));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_9, KC_NUMPAD9));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Add, KC_ADD));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Subtract, KC_SUBTRACT));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Decimal, KC_DECIMAL));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Equal, KC_NUMPADEQUALS));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Divide, KC_DIVIDE));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Multiply, KC_MULTIPLY));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Enter, KC_NUMPADENTER));	//Keypad with numlock off	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Home, KC_NUMPAD7));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Up, KC_NUMPAD8));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Page_Up, KC_NUMPAD9));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Left, KC_NUMPAD4));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Begin, KC_NUMPAD5));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Right, KC_NUMPAD6));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_End, KC_NUMPAD1));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Down, KC_NUMPAD2));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Page_Down, KC_NUMPAD3));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Insert, KC_NUMPAD0));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Delete, KC_DECIMAL));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Up, KC_UP));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Down, KC_DOWN));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Left, KC_LEFT));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Right, KC_RIGHT));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Page_Up, KC_PGUP));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Page_Down, KC_PGDOWN));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Home, KC_HOME));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_End, KC_END));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Num_Lock, KC_NUMLOCK));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Print, KC_SYSRQ));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Scroll_Lock, KC_SCROLL));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Pause, KC_PAUSE));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Shift_R, KC_RSHIFT));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Shift_L, KC_LSHIFT));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Alt_R, KC_RMENU));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Alt_L, KC_LMENU));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Insert, KC_INSERT));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Delete, KC_DELETE));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Super_L, KC_LWIN));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Super_R, KC_RWIN));	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Menu, KC_APPS));	static_cast<LinuxInputManager*>(mCreator)->_setKeyboardUsed(true);}//-------------------------------------------------------------------//void LinuxKeyboard::_initialize(){	//Clear our keyboard state buffer	memset( &KeyBuffer, 0, 256 );	mModifiers = 0;	if( display ) XCloseDisplay(display);	display = 0;	window = static_cast<LinuxInputManager*>(mCreator)->_getWindow();	//Create our local X mListener connection	if( !(display = XOpenDisplay(0)) )		OIS_EXCEPT(E_General, "LinuxKeyboard::_initialize >> Error opening X!");	//Set it to recieve Input events	if( XSelectInput(display, window, KeyPressMask | KeyReleaseMask) == BadWindow )		OIS_EXCEPT(E_General, "LinuxKeyboard::_initialize: X error!");	if( grabKeyboard )		XGrabKeyboard(display,window,True,GrabModeAsync,GrabModeAsync,CurrentTime);	keyFocusLost = false;	if( xAutoRepeat == false )	{		//We do not want to blindly turn on autorepeat later when quiting if		//it was not on to begin with.. So, let us check and see first		XKeyboardState old;		XGetKeyboardControl( display, &old );		oldXAutoRepeat = false;		if( old.global_auto_repeat == AutoRepeatModeOn )			oldXAutoRepeat = true;		XAutoRepeatOff( display );	}}//-------------------------------------------------------------------//LinuxKeyboard::~LinuxKeyboard(){	if( display )	{		if( oldXAutoRepeat )			XAutoRepeatOn(display);		if( grabKeyboard )			XUngrabKeyboard(display, CurrentTime);		XCloseDisplay(display);	}	static_cast<LinuxInputManager*>(mCreator)->_setKeyboardUsed(true);}//-------------------------------------------------------------------//unsigned int UTF8ToUTF32(unsigned char* buf){	unsigned char &FirstChar = buf[0];	if(FirstChar < 128)		return FirstChar;	unsigned int val = 0;	unsigned int len = 0;	if((FirstChar & 0xE0) == 0xC0) //2 Chars	{		len = 2;		val = FirstChar & 0x1F;	}	else if((FirstChar & 0xF0) == 0xE0) //3 Chars	{		len = 3;		val = FirstChar & 0x0F;	}	else if((FirstChar & 0xF8) == 0xF0) //4 Chars	{		len = 4;		val = FirstChar & 0x07;	}	else if((FirstChar & 0xFC) == 0xF8) //5 Chars	{		len = 5;		val = FirstChar & 0x03;	}	else // if((FirstChar & 0xFE) == 0xFC) //6 Chars	{		len = 6;		val = FirstChar & 0x01;	}	for(int i = 1; i < len; i++)		val = (val << 6) | (buf[i] & 0x3F);	return val;}//-------------------------------------------------------------------//bool LinuxKeyboard::isKeyDown( KeyCode key ) const{	return (KeyBuffer[key]);}//-------------------------------------------------------------------//void LinuxKeyboard::capture(){	KeySym key;	XEvent event;	LinuxInputManager* linMan = static_cast<LinuxInputManager*>(mCreator);	while( XPending(display) > 0 )	{
-		XNextEvent(display, &event);
-
-		if( KeyPress == event.type )		{			unsigned int character = 0;			if( mTextMode != Off )			{				unsigned char buffer[6] = {0,0,0,0,0,0};				XLookupString(&event.xkey, (char*)buffer, 6, &key, 0);				if( mTextMode == Unicode )					character = UTF8ToUTF32(buffer);				else if( mTextMode == Ascii)					character = buffer[0];			}			//Mask out the modifier states X11 sets and read again			event.xkey.state &= ~ShiftMask;			event.xkey.state &= ~LockMask;			XLookupString(&event.xkey, 0, 0,&key, 0);			_injectKeyDown(key, character);			//Just printing out some debugging info.. to verify all chars are mapped			//std::cout << "KEY PRESSED X=" << event.xkey.keycode;			//std::cout << "\n KeySym=" << key << std::endl;			//Check for Alt-Tab			if( event.xkey.state & Mod1Mask && key == XK_Tab )				linMan->_setGrabState(false);		}
-		else if( KeyRelease == event.type )		{			//Mask out the modifier states X sets.. or we will get improper values			event.xkey.state &= ~ShiftMask;			event.xkey.state &= ~LockMask;			//Else, it is a valid key release			XLookupString(&event.xkey,NULL,0,&key,NULL);			_injectKeyUp(key);
-		}	}	//If grabbing mode is on.. Handle focus lost/gained via Alt-Tab and mouse clicks	if( grabKeyboard )	{		if( linMan->_getGrabState() == false )		{			// are no longer grabbing			if( keyFocusLost == false )			{				//UnGrab KeyBoard				XUngrabKeyboard(display, CurrentTime);				keyFocusLost = true;			}		}		else		{			//We are grabbing - and regained focus			if( keyFocusLost == true )			{				//ReGrab KeyBoard				XGrabKeyboard(display, window, True, GrabModeAsync, GrabModeAsync, CurrentTime);				keyFocusLost = false;			}		}	}}//-------------------------------------------------------------------//void LinuxKeyboard::setBuffered(bool buffered){	mBuffered = buffered;}//-------------------------------------------------------------------//bool LinuxKeyboard::_injectKeyDown( KeySym key, int text ){	KeyCode kc = keyConversion[key];	KeyBuffer[kc] = 1;	//Turn on modifier flags	if( kc == KC_LCONTROL || kc == KC_RCONTROL)		mModifiers |= Ctrl;	else if( kc == KC_LSHIFT || kc == KC_RSHIFT )		mModifiers |= Shift;	else if( kc == KC_LMENU || kc == KC_RMENU )		mModifiers |= Alt;	if( mBuffered && mListener )		return mListener->keyPressed(KeyEvent(this,kc,text));	return true;}//-------------------------------------------------------------------//bool LinuxKeyboard::_injectKeyUp( KeySym key ){	KeyCode kc = keyConversion[key];	KeyBuffer[kc] = 0;	//Turn off modifier flags	if( kc == KC_LCONTROL || kc == KC_RCONTROL)		mModifiers &= ~Ctrl;	else if( kc == KC_LSHIFT || kc == KC_RSHIFT )		mModifiers &= ~Shift;	else if( kc == KC_LMENU || kc == KC_RMENU )		mModifiers &= ~Alt;	if( mBuffered && mListener )		return mListener->keyReleased(KeyEvent(this, kc, 0));	return true;}//-------------------------------------------------------------------//const std::string& LinuxKeyboard::getAsString( KeyCode kc ){	mGetString = "Unknown";	char *temp = 0;	XtoOIS_KeyMap::iterator i = keyConversion.begin(),				e = keyConversion.end();	for( ; i != e; ++i )	{		if( i->second == kc )		{			temp = XKeysymToString(i->first);			if( temp )				mGetString = temp;			break;		}	}	return mGetString;}//-------------------------------------------------------------------//void LinuxKeyboard::copyKeyStates( char keys[256] ) const{	memcpy( keys, KeyBuffer, 256 );}
+/*
+The zlib/libpng License
+
+Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
+
+This software is provided 'as-is', without any express or implied warranty. In no event will
+the authors be held liable for any damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including commercial
+applications, and to alter it and redistribute it freely, subject to the following
+restrictions:
+
+    1. The origin of this software must not be misrepresented; you must not claim that
+		you wrote the original software. If you use this software in a product,
+		an acknowledgment in the product documentation would be appreciated but is
+		not required.
+
+    2. Altered source versions must be plainly marked as such, and must not be
+		misrepresented as being the original software.
+
+    3. This notice may not be removed or altered from any source distribution.
+*/
+#include "linux/LinuxInputManager.h"
+#include "linux/LinuxKeyboard.h"
+#include "OISException.h"
+#include "OISEvents.h"
+
+#include <X11/keysym.h>
+#include <X11/Xutil.h>
+#include <cstring>
+
+using namespace OIS;
+#include <iostream>
+//-------------------------------------------------------------------//
+LinuxKeyboard::LinuxKeyboard(InputManager* creator, bool buffered, bool grab, bool useXRepeat)
+	: Keyboard(creator->inputSystemName(), buffered, 0, creator)
+{
+	setlocale(LC_CTYPE, ""); //Set the locale to (hopefully) the users LANG UTF-8 Env var
+
+	display = 0;
+	window = 0;
+
+	grabKeyboard = grab;
+	keyFocusLost = false;
+
+	xAutoRepeat = useXRepeat;
+	oldXAutoRepeat = false;
+
+	//X Key Map to KeyCode
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_1, KC_1));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_2, KC_2));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_3, KC_3));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_4, KC_4));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_5, KC_5));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_6, KC_6));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_7, KC_7));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_8, KC_8));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_9, KC_9));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_0, KC_0));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_BackSpace, KC_BACK));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_minus, KC_MINUS));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_equal, KC_EQUALS));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_space, KC_SPACE));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_comma, KC_COMMA));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_period, KC_PERIOD));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_backslash, KC_BACKSLASH));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_slash, KC_SLASH));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_bracketleft, KC_LBRACKET));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_bracketright, KC_RBRACKET));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Escape,KC_ESCAPE));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Caps_Lock, KC_CAPITAL));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Tab, KC_TAB));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Return, KC_RETURN));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Control_L, KC_LCONTROL));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Control_R, KC_RCONTROL));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_colon, KC_COLON));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_semicolon, KC_SEMICOLON));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_apostrophe, KC_APOSTROPHE));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_grave, KC_GRAVE));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_b, KC_B));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_a, KC_A));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_c, KC_C));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_d, KC_D));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_e, KC_E));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_f, KC_F));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_g, KC_G));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_h, KC_H));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_i, KC_I));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_j, KC_J));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_k, KC_K));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_l, KC_L));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_m, KC_M));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_n, KC_N));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_o, KC_O));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_p, KC_P));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_q, KC_Q));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_r, KC_R));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_s, KC_S));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_t, KC_T));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_u, KC_U));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_v, KC_V));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_w, KC_W));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_x, KC_X));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_y, KC_Y));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_z, KC_Z));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F1, KC_F1));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F2, KC_F2));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F3, KC_F3));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F4, KC_F4));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F5, KC_F5));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F6, KC_F6));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F7, KC_F7));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F8, KC_F8));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F9, KC_F9));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F10, KC_F10));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F11, KC_F11));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F12, KC_F12));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F13, KC_F13));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F14, KC_F14));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_F15, KC_F15));
+
+	//Keypad
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_0, KC_NUMPAD0));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_1, KC_NUMPAD1));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_2, KC_NUMPAD2));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_3, KC_NUMPAD3));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_4, KC_NUMPAD4));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_5, KC_NUMPAD5));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_6, KC_NUMPAD6));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_7, KC_NUMPAD7));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_8, KC_NUMPAD8));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_9, KC_NUMPAD9));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Add, KC_ADD));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Subtract, KC_SUBTRACT));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Decimal, KC_DECIMAL));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Equal, KC_NUMPADEQUALS));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Divide, KC_DIVIDE));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Multiply, KC_MULTIPLY));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Enter, KC_NUMPADENTER));
+
+	//Keypad with numlock off
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Home, KC_NUMPAD7));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Up, KC_NUMPAD8));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Page_Up, KC_NUMPAD9));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Left, KC_NUMPAD4));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Begin, KC_NUMPAD5));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Right, KC_NUMPAD6));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_End, KC_NUMPAD1));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Down, KC_NUMPAD2));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Page_Down, KC_NUMPAD3));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Insert, KC_NUMPAD0));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_KP_Delete, KC_DECIMAL));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Up, KC_UP));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Down, KC_DOWN));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Left, KC_LEFT));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Right, KC_RIGHT));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Page_Up, KC_PGUP));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Page_Down, KC_PGDOWN));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Home, KC_HOME));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_End, KC_END));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Num_Lock, KC_NUMLOCK));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Print, KC_SYSRQ));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Scroll_Lock, KC_SCROLL));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Pause, KC_PAUSE));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Shift_R, KC_RSHIFT));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Shift_L, KC_LSHIFT));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Alt_R, KC_RMENU));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Alt_L, KC_LMENU));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Insert, KC_INSERT));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Delete, KC_DELETE));
+
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Super_L, KC_LWIN));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Super_R, KC_RWIN));
+	keyConversion.insert(XtoOIS_KeyMap::value_type(XK_Menu, KC_APPS));
+
+	static_cast<LinuxInputManager*>(mCreator)->_setKeyboardUsed(true);
+}
+
+//-------------------------------------------------------------------//
+void LinuxKeyboard::_initialize()
+{
+	//Clear our keyboard state buffer
+	memset( &KeyBuffer, 0, 256 );
+	mModifiers = 0;
+
+	if( display ) XCloseDisplay(display);
+	display = 0;
+	window = static_cast<LinuxInputManager*>(mCreator)->_getWindow();
+
+	//Create our local X mListener connection
+	if( !(display = XOpenDisplay(0)) )
+		OIS_EXCEPT(E_General, "LinuxKeyboard::_initialize >> Error opening X!");
+
+	//Set it to recieve Input events
+	if( XSelectInput(display, window, KeyPressMask | KeyReleaseMask) == BadWindow )
+		OIS_EXCEPT(E_General, "LinuxKeyboard::_initialize: X error!");
+
+	if( grabKeyboard )
+		XGrabKeyboard(display,window,True,GrabModeAsync,GrabModeAsync,CurrentTime);
+
+	keyFocusLost = false;
+
+	if( xAutoRepeat == false )
+	{
+		//We do not want to blindly turn on autorepeat later when quiting if
+		//it was not on to begin with.. So, let us check and see first
+		XKeyboardState old;
+		XGetKeyboardControl( display, &old );
+		oldXAutoRepeat = false;
+
+		if( old.global_auto_repeat == AutoRepeatModeOn )
+			oldXAutoRepeat = true;
+
+		XAutoRepeatOff( display );
+	}
+}
+
+//-------------------------------------------------------------------//
+LinuxKeyboard::~LinuxKeyboard()
+{
+	if( display )
+	{
+		if( oldXAutoRepeat )
+			XAutoRepeatOn(display);
+
+		if( grabKeyboard )
+			XUngrabKeyboard(display, CurrentTime);
+
+		XCloseDisplay(display);
+	}
+
+	static_cast<LinuxInputManager*>(mCreator)->_setKeyboardUsed(true);
+}
+
+//-------------------------------------------------------------------//
+unsigned int UTF8ToUTF32(unsigned char* buf)
+{
+	unsigned char &FirstChar = buf[0];
+
+	if(FirstChar < 128)
+		return FirstChar;
+
+	unsigned int val = 0;
+	unsigned int len = 0;
+
+	if((FirstChar & 0xE0) == 0xC0) //2 Chars
+	{
+		len = 2;
+		val = FirstChar & 0x1F;
+	}
+	else if((FirstChar & 0xF0) == 0xE0) //3 Chars
+	{
+		len = 3;
+		val = FirstChar & 0x0F;
+	}
+	else if((FirstChar & 0xF8) == 0xF0) //4 Chars
+	{
+		len = 4;
+		val = FirstChar & 0x07;
+	}
+	else if((FirstChar & 0xFC) == 0xF8) //5 Chars
+	{
+		len = 5;
+		val = FirstChar & 0x03;
+	}
+	else // if((FirstChar & 0xFE) == 0xFC) //6 Chars
+	{
+		len = 6;
+		val = FirstChar & 0x01;
+	}
+
+	for(int i = 1; i < len; i++)
+		val = (val << 6) | (buf[i] & 0x3F);
+
+	return val;
+}
+
+//-------------------------------------------------------------------//
+bool LinuxKeyboard::isKeyDown( KeyCode key ) const
+{
+	return (KeyBuffer[key]);
+}
+
+//-------------------------------------------------------------------//
+void LinuxKeyboard::capture()
+{
+	KeySym key;
+	XEvent event;
+	LinuxInputManager* linMan = static_cast<LinuxInputManager*>(mCreator);
+
+	while( XPending(display) > 0 )
+	{ 		XNextEvent(display, &event);  		if( KeyPress == event.type )
+		{
+			unsigned int character = 0;
+
+			if( mTextMode != Off )
+			{
+				unsigned char buffer[6] = {0,0,0,0,0,0};
+				XLookupString(&event.xkey, (char*)buffer, 6, &key, 0);
+
+				if( mTextMode == Unicode )
+					character = UTF8ToUTF32(buffer);
+				else if( mTextMode == Ascii)
+					character = buffer[0];
+			}
+
+			//Mask out the modifier states X11 sets and read again
+			event.xkey.state &= ~ShiftMask;
+			event.xkey.state &= ~LockMask;
+			XLookupString(&event.xkey, 0, 0,&key, 0);
+
+			_injectKeyDown(key, character);
+
+			//Just printing out some debugging info.. to verify all chars are mapped
+			//std::cout << "KEY PRESSED X=" << event.xkey.keycode;
+			//std::cout << "\n KeySym=" << key << std::endl;
+
+			//Check for Alt-Tab
+			if( event.xkey.state & Mod1Mask && key == XK_Tab )
+				linMan->_setGrabState(false);
+		} 		else if( KeyRelease == event.type )
+		{
+			//Mask out the modifier states X sets.. or we will get improper values
+			event.xkey.state &= ~ShiftMask;
+			event.xkey.state &= ~LockMask;
+
+			//Else, it is a valid key release
+			XLookupString(&event.xkey,NULL,0,&key,NULL);
+			_injectKeyUp(key); 		}
+	}
+
+	//If grabbing mode is on.. Handle focus lost/gained via Alt-Tab and mouse clicks
+	if( grabKeyboard )
+	{
+		if( linMan->_getGrabState() == false )
+		{
+			// are no longer grabbing
+			if( keyFocusLost == false )
+			{
+				//UnGrab KeyBoard
+				XUngrabKeyboard(display, CurrentTime);
+				keyFocusLost = true;
+			}
+		}
+		else
+		{
+			//We are grabbing - and regained focus
+			if( keyFocusLost == true )
+			{
+				//ReGrab KeyBoard
+				XGrabKeyboard(display, window, True, GrabModeAsync, GrabModeAsync, CurrentTime);
+				keyFocusLost = false;
+			}
+		}
+	}
+}
+
+//-------------------------------------------------------------------//
+void LinuxKeyboard::setBuffered(bool buffered)
+{
+	mBuffered = buffered;
+}
+
+//-------------------------------------------------------------------//
+bool LinuxKeyboard::_injectKeyDown( KeySym key, int text )
+{
+	KeyCode kc = keyConversion[key];
+	KeyBuffer[kc] = 1;
+
+	//Turn on modifier flags
+	if( kc == KC_LCONTROL || kc == KC_RCONTROL)
+		mModifiers |= Ctrl;
+	else if( kc == KC_LSHIFT || kc == KC_RSHIFT )
+		mModifiers |= Shift;
+	else if( kc == KC_LMENU || kc == KC_RMENU )
+		mModifiers |= Alt;
+
+	if( mBuffered && mListener )
+		return mListener->keyPressed(KeyEvent(this,kc,text));
+
+	return true;
+}
+
+//-------------------------------------------------------------------//
+bool LinuxKeyboard::_injectKeyUp( KeySym key )
+{
+	KeyCode kc = keyConversion[key];
+	KeyBuffer[kc] = 0;
+
+	//Turn off modifier flags
+	if( kc == KC_LCONTROL || kc == KC_RCONTROL)
+		mModifiers &= ~Ctrl;
+	else if( kc == KC_LSHIFT || kc == KC_RSHIFT )
+		mModifiers &= ~Shift;
+	else if( kc == KC_LMENU || kc == KC_RMENU )
+		mModifiers &= ~Alt;
+
+	if( mBuffered && mListener )
+		return mListener->keyReleased(KeyEvent(this, kc, 0));
+
+	return true;
+}
+
+//-------------------------------------------------------------------//
+const std::string& LinuxKeyboard::getAsString( KeyCode kc )
+{
+	mGetString = "Unknown";
+	char *temp = 0;
+
+	XtoOIS_KeyMap::iterator i = keyConversion.begin(),
+				e = keyConversion.end();
+
+	for( ; i != e; ++i )
+	{
+		if( i->second == kc )
+		{
+			temp = XKeysymToString(i->first);
+			if( temp )
+				mGetString = temp;
+			break;
+		}
+	}
+
+	return mGetString;
+}
+
+//-------------------------------------------------------------------//
+void LinuxKeyboard::copyKeyStates( char keys[256] ) const
+{
+	memcpy( keys, KeyBuffer, 256 );
+}
Index: /code/branches/network/src/orxonox/CMakeLists.txt
===================================================================
--- /code/branches/network/src/orxonox/CMakeLists.txt	(revision 1494)
+++ /code/branches/network/src/orxonox/CMakeLists.txt	(revision 1495)
@@ -1,3 +1,81 @@
-SET( ORXONOX_SRC_FILES  GraphicsEngine.cc  Main.cc  Orxonox.cc  console/InGameConsole.cc  hud/HUD.cc  hud/BarOverlayElement.cc  hud/RadarOverlayElement.cc
+SET( ORXONOX_SRC_FILES
+  GraphicsEngine.cc
+  Main.cc
+  Orxonox.cc
+
+  console/InGameConsole.cc
+  hud/HUD.cc
+  hud/BarOverlayElement.cc
+  hud/RadarOverlayElement.cc
   hud/RadarObject.cc
-  hud/Navigation.cc  particle/ParticleInterface.cc  tolua/tolua_bind.cc  tools/BillboardSet.cc  tools/Light.cc  tools/Mesh.cc  tools/Timer.cc  objects/Ambient.cc  objects/Camera.cc  objects/CameraHandler.cc  objects/Explosion.cc  objects/Model.cc  objects/NPC.cc  objects/Projectile.cc  objects/RotatingProjectile.cc  objects/Skybox.cc  objects/SpaceShip.cc  objects/SpaceShipAI.cc  objects/WorldEntity.cc#  objects/weapon/AmmunitionDump.cc#  objects/weapon/BarrelGun.cc#  objects/weapon/BaseWeapon.cc#  objects/weapon/Bullet.cc#  objects/weapon/BulletManager.cc#  objects/weapon/WeaponStation.cc)GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)ADD_CUSTOM_COMMAND(  OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h  COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/orxonox/tolua/tolua_bind.cc -H ../../src/orxonox/tolua/tolua_bind.h ../../src/orxonox/tolua/tolua.pkg  DEPENDS tolua  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib)	ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} )IF(NETWORKTRAFFIC_TESTING_ENABLED)  SET( ORXONOXS_SRC_FILES    GraphicsEngine.cc    objects/Ambient.cc    objects/Camera.cc    objects/CameraHandler.cc    objects/Explosion.cc    objects/Model.cc    objects/NPC.cc    objects/Projectile.cc    objects/Skybox.cc    objects/SpaceShip.cc    objects/WorldEntity.cc  )  ADD_LIBRARY(orxonoxs SHARED ${ORXONOX_SRC_FILES})ENDIF(NETWORKTRAFFIC_TESTING_ENABLED)TARGET_LINK_LIBRARIES( orxonox  ${OGRE_LIBRARIES}  ${Lua_LIBRARIES}  tinyxml  tolualib  ois  util  core  audio  network)
+  hud/Navigation.cc
+  particle/ParticleInterface.cc
+  tolua/tolua_bind.cc
+
+  tools/BillboardSet.cc
+  tools/Light.cc
+  tools/Mesh.cc
+  tools/Timer.cc
+
+  objects/Ambient.cc
+  objects/Camera.cc
+  objects/CameraHandler.cc
+  objects/Explosion.cc
+  objects/Model.cc
+  objects/NPC.cc
+  objects/Projectile.cc
+  objects/RotatingProjectile.cc
+  objects/Skybox.cc
+  objects/SpaceShip.cc
+  objects/SpaceShipAI.cc
+  objects/WorldEntity.cc
+
+#  objects/weapon/AmmunitionDump.cc
+#  objects/weapon/BarrelGun.cc
+#  objects/weapon/BaseWeapon.cc
+#  objects/weapon/Bullet.cc
+#  objects/weapon/BulletManager.cc
+#  objects/weapon/WeaponStation.cc
+)
+
+GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
+ADD_CUSTOM_COMMAND(
+  OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h
+  COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/orxonox/tolua/tolua_bind.cc -H ../../src/orxonox/tolua/tolua_bind.h ../../src/orxonox/tolua/tolua.pkg
+  DEPENDS tolua
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib
+)
+	
+ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} )
+
+IF(NETWORKTRAFFIC_TESTING_ENABLED)
+
+  SET( ORXONOXS_SRC_FILES
+    GraphicsEngine.cc
+    objects/Ambient.cc
+    objects/Camera.cc
+    objects/CameraHandler.cc
+    objects/Explosion.cc
+    objects/Model.cc
+    objects/NPC.cc
+    objects/Projectile.cc
+    objects/Skybox.cc
+    objects/SpaceShip.cc
+    objects/WorldEntity.cc
+  )
+
+  ADD_LIBRARY(orxonoxs SHARED ${ORXONOX_SRC_FILES})
+ENDIF(NETWORKTRAFFIC_TESTING_ENABLED)
+
+TARGET_LINK_LIBRARIES( orxonox
+  ${OGRE_LIBRARIES}
+  ${Lua_LIBRARIES}
+  tinyxml
+  tolualib
+  ois
+  util
+  core
+  audio
+  network
+)
+
Index: /code/branches/network/src/orxonox/GraphicsEngine.cc
===================================================================
--- /code/branches/network/src/orxonox/GraphicsEngine.cc	(revision 1494)
+++ /code/branches/network/src/orxonox/GraphicsEngine.cc	(revision 1495)
@@ -44,5 +44,6 @@
 #include "core/ConfigValueIncludes.h"
 #include "core/Debug.h"
-#include "core/CommandExecutor.h"#include "core/TclBind.h"
+#include "core/CommandExecutor.h"
+#include "core/TclBind.h"
 #include "console/InGameConsole.h"
 
@@ -86,5 +87,7 @@
     SetConfigValue(ogreLogLevelTrivial_ , 5).description("Corresponding orxonox debug level for ogre Trivial");
     SetConfigValue(ogreLogLevelNormal_  , 4).description("Corresponding orxonox debug level for ogre Normal");
-    SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");    TclBind::getInstance().setDataPath(this->dataPath_);
+    SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
+
+    TclBind::getInstance().setDataPath(this->dataPath_);
   }
 
@@ -309,5 +312,17 @@
       return 0;
   }
-  /**    @brief Returns the window aspect ratio height/width.    @return The ratio  */  float GraphicsEngine::getWindowAspectRatio() const  {    if (this->renderWindow_)        return (float)this->renderWindow_->getHeight() / (float)this->renderWindow_->getWidth();    else        return 1.0f;  }
+
+  /**
+    @brief Returns the window aspect ratio height/width.
+    @return The ratio
+  */
+  float GraphicsEngine::getWindowAspectRatio() const
+  {
+    if (this->renderWindow_)
+        return (float)this->renderWindow_->getHeight() / (float)this->renderWindow_->getWidth();
+    else
+        return 1.0f;
+  }
+
   /**
     @brief Method called by the LogListener interface from Ogre.
@@ -356,5 +371,7 @@
   *       as rw. But we have to be careful when using multiple render windows!
   */
-  void GraphicsEngine::windowResized(Ogre::RenderWindow *rw)  {    // change the mouse clipping size for absolute mouse movements
+  void GraphicsEngine::windowResized(Ogre::RenderWindow *rw)
+  {
+    // change the mouse clipping size for absolute mouse movements
     int w = rw->getWidth();
     int h = rw->getHeight();
Index: /code/branches/network/src/orxonox/GraphicsEngine.h
===================================================================
--- /code/branches/network/src/orxonox/GraphicsEngine.h	(revision 1494)
+++ /code/branches/network/src/orxonox/GraphicsEngine.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -70,5 +71,6 @@
             size_t getWindowHandle();
             int getWindowWidth() const;
-            int getWindowHeight() const;            float getWindowAspectRatio() const;
+            int getWindowHeight() const;
+            float getWindowAspectRatio() const;
             float getAverageFPS() const
             { if (renderWindow_) return this->renderWindow_->getAverageFPS(); else return 0.0f; }
Index: /code/branches/network/src/orxonox/Orxonox.cc
===================================================================
--- /code/branches/network/src/orxonox/Orxonox.cc	(revision 1494)
+++ /code/branches/network/src/orxonox/Orxonox.cc	(revision 1495)
@@ -84,4 +84,5 @@
   SetConsoleCommandShortcut(Orxonox, slomo).setAccessLevel(AccessLevel::Offline).setDefaultValue(0, 1.0).setAxisParamIndex(0).setIsAxisRelative(false);
   SetConsoleCommandShortcut(Orxonox, setTimeFactor).setAccessLevel(AccessLevel::Offline).setDefaultValue(0, 1.0);
+
   /**
     @brief Reference to the only instance of the class.
Index: /code/branches/network/src/orxonox/Orxonox.h
===================================================================
--- /code/branches/network/src/orxonox/Orxonox.h	(revision 1494)
+++ /code/branches/network/src/orxonox/Orxonox.h	(revision 1495)
@@ -71,4 +71,5 @@
       static inline float getTimeFactor() { return Orxonox::getSingleton()->timefactor_; }
       static inline void exit() { Orxonox::getSingleton()->abortRequest(); }
+
    private:
       // don't mess with singletons
Index: /code/branches/network/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- /code/branches/network/src/orxonox/OrxonoxPrereqs.h	(revision 1494)
+++ /code/branches/network/src/orxonox/OrxonoxPrereqs.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -72,5 +73,6 @@
   class Projectile;
   class Skybox;
-  class SpaceShip;  class SpaceShipAI;
+  class SpaceShip;
+  class SpaceShipAI;
   class WorldEntity;
 
@@ -94,5 +96,9 @@
 
   // hud
-  class BarOverlayElement;  class HUD;  class Navigation;  class RadarObject;  class RadarOverlayElement;
+  class BarOverlayElement;
+  class HUD;
+  class Navigation;
+  class RadarObject;
+  class RadarOverlayElement;
 
   //console
Index: /code/branches/network/src/orxonox/OrxonoxStableHeaders.h
===================================================================
--- /code/branches/network/src/orxonox/OrxonoxStableHeaders.h	(revision 1494)
+++ /code/branches/network/src/orxonox/OrxonoxStableHeaders.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -30,9 +31,88 @@
  @brief Contains the bigger (or smaller) header files in order to precompile them with MSVC
  */
-#ifndef _OrxonoxStableHeaders_H__#define _OrxonoxStableHeaders_H__#include "util/OrxonoxPlatform.h"#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC// including std headers here is useless since they're already precompiled#ifndef WIN32_LEAN_AND_MEAN// prevent Ogre from including winsock.h that messes with winsock2.h from enet#  define WIN32_LEAN_AND_MEAN#endif// not including the entire Ogre.h doesn't exceed the default heap size for pch//#include <Ogre.h>#include <OgreBillboardSet.h>#include <OgreCamera.h>#include <OgreColourValue.h>#include <OgreConfigFile.h>#include <OgreEntity.h>#include <OgreException.h>#include <OgreFrameListener.h>#include <OgreLight.h>#include <OgreLog.h>#include <OgreLogManager.h>#include <OgreMath.h>#include <OgreMatrix3.h>#include <OgreOverlay.h>#include <OgreOverlayElement.h>#include <OgreOverlayManager.h>#include <OgreParticleEmitter.h>#include <OgreParticleSystem.h>#include <OgreQuaternion.h>#include <OgreResourceGroupManager.h>#include <OgreRenderWindow.h>#include <OgreRoot.h>#include <OgreSceneManager.h>#include <OgreSceneNode.h>#include <OgreStringConverter.h>#include <OgreTextureManager.h>#include <OgreTimer.h>#include <OgreVector2.h>#include <OgreVector3.h>#include <OgreVector3.h>#include <OgreViewport.h>#include <OgreWindowEventUtilities.h>//-----------------------------------------------------------------------
+
+#ifndef _OrxonoxStableHeaders_H__
+#define _OrxonoxStableHeaders_H__
+
+#include "util/OrxonoxPlatform.h"
+
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+
+// including std headers here is useless since they're already precompiled
+
+#ifndef WIN32_LEAN_AND_MEAN
+// prevent Ogre from including winsock.h that messes with winsock2.h from enet
+#  define WIN32_LEAN_AND_MEAN
+#endif
+// not including the entire Ogre.h doesn't exceed the default heap size for pch
+//#include <Ogre.h>
+#include <OgreBillboardSet.h>
+#include <OgreCamera.h>
+#include <OgreColourValue.h>
+#include <OgreConfigFile.h>
+#include <OgreEntity.h>
+#include <OgreException.h>
+#include <OgreFrameListener.h>
+#include <OgreLight.h>
+#include <OgreLog.h>
+#include <OgreLogManager.h>
+#include <OgreMath.h>
+#include <OgreMatrix3.h>
+#include <OgreOverlay.h>
+#include <OgreOverlayElement.h>
+#include <OgreOverlayManager.h>
+#include <OgreParticleEmitter.h>
+#include <OgreParticleSystem.h>
+#include <OgreQuaternion.h>
+#include <OgreResourceGroupManager.h>
+#include <OgreRenderWindow.h>
+#include <OgreRoot.h>
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+#include <OgreStringConverter.h>
+#include <OgreTextureManager.h>
+#include <OgreTimer.h>
+#include <OgreVector2.h>
+#include <OgreVector3.h>
+#include <OgreVector3.h>
+#include <OgreViewport.h>
+#include <OgreWindowEventUtilities.h>
+
+//-----------------------------------------------------------------------
 // ORXONOX HEADERS
 //-----------------------------------------------------------------------
 
 #include "ois/OIS.h"
+
 //#include "util/Convert.h"
-#include "util/Math.h"//#include "util/Multitype.h"//#include "util/MultiTypeMath.h"//#include "util/MultiTypePrimitive.h"//#include "util/MultiTypeString.h"#include "util/Sleep.h"#include "util/String.h"#include "util/SubString.h"//#include "util/XMLIncludes.h"#include "tinyxml/ticpp.h"#include "tinyxml/tinyxml.h"#include "core/BaseObject.h"//#include "core/CommandExecutor.h"//#include "core/CoreIncludes.h"//#include "core/ConfigValueIncludes.h"#include "core/Debug.h"//#include "core/Executor.h"#include "core/Tickable.h"//#include "core/XMLPort.h"#include "network/Synchronisable.h"#include "OrxonoxPrereqs.h"#include "tools/Timer.h"#include "objects/Model.h"#include "objects/WorldEntity.h"#endif /* Compiler MSVC */#endif /* _OrxonoxStableHeaders_H__ */
+#include "util/Math.h"
+//#include "util/Multitype.h"
+//#include "util/MultiTypeMath.h"
+//#include "util/MultiTypePrimitive.h"
+//#include "util/MultiTypeString.h"
+#include "util/Sleep.h"
+#include "util/String.h"
+#include "util/SubString.h"
+//#include "util/XMLIncludes.h"
+#include "tinyxml/ticpp.h"
+#include "tinyxml/tinyxml.h"
+
+#include "core/BaseObject.h"
+//#include "core/CommandExecutor.h"
+//#include "core/CoreIncludes.h"
+//#include "core/ConfigValueIncludes.h"
+#include "core/Debug.h"
+//#include "core/Executor.h"
+#include "core/Tickable.h"
+//#include "core/XMLPort.h"
+
+#include "network/Synchronisable.h"
+
+#include "OrxonoxPrereqs.h"
+#include "tools/Timer.h"
+#include "objects/Model.h"
+#include "objects/WorldEntity.h"
+
+#endif /* Compiler MSVC */
+
+#endif /* _OrxonoxStableHeaders_H__ */
Index: /code/branches/network/src/orxonox/PrecompiledHeaderFiles.cc
===================================================================
--- /code/branches/network/src/orxonox/PrecompiledHeaderFiles.cc	(revision 1494)
+++ /code/branches/network/src/orxonox/PrecompiledHeaderFiles.cc	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
Index: /code/branches/network/src/orxonox/console/InGameConsole.h
===================================================================
--- /code/branches/network/src/orxonox/console/InGameConsole.h	(revision 1494)
+++ /code/branches/network/src/orxonox/console/InGameConsole.h	(revision 1495)
@@ -1,3 +1,33 @@
-/* *   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: *      Felix Schulthess *   Co-authors: *      Fabian 'x3n' Landau * */#ifndef _InGameConsole_H__#define _InGameConsole_H__
+/*
+ *   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:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+#ifndef _InGameConsole_H__
+#define _InGameConsole_H__
+
 
 #include "OrxonoxPrereqs.h"
@@ -8,21 +38,56 @@
 #include "core/Tickable.h"
 #include "core/Shell.h"
-namespace orxonox{
+
+
+namespace orxonox
+{
     class _OrxonoxExport InGameConsole : public TickableReal, public ShellListener
     {
-        public:            static InGameConsole& getInstance();            void setConfigValues();            void tick(float dt);
+        public:
+            static InGameConsole& getInstance();
+
+            void setConfigValues();
+            void tick(float dt);
+
             void activate();
-            void deactivate();            void resize();            static void openConsole();            static void closeConsole();
+            void deactivate();
+            void resize();
+
+            static void openConsole();
+            static void closeConsole();
 
         private:
-            InGameConsole();            InGameConsole(const InGameConsole& other);            ~InGameConsole();            virtual void linesChanged();            virtual void onlyLastLineChanged();            virtual void lineAdded();            virtual void inputChanged();            virtual void cursorChanged();            virtual void exit();            void init();            void shiftLines();            void colourLine(int colourcode, int index);
+            InGameConsole();
+            InGameConsole(const InGameConsole& other);
+            ~InGameConsole();
+
+            virtual void linesChanged();
+            virtual void onlyLastLineChanged();
+            virtual void lineAdded();
+            virtual void inputChanged();
+            virtual void cursorChanged();
+            virtual void exit();
+
+            void init();
+            void shiftLines();
+            void colourLine(int colourcode, int index);
             void setCursorPosition(int pos);
             void print(const std::string& text, int index, bool alwaysShift = false);
             static Ogre::UTFString convert2UTF(std::string s);
-            static float REL_WIDTH;            static float REL_HEIGHT;            static float BLINK;            int windowW_;
-            int windowH_;            int desiredTextWidth_;            unsigned int maxCharsPerLine_;            unsigned int numLinesShifted_;
+
+            static float REL_WIDTH;
+            static float REL_HEIGHT;
+            static float BLINK;
+
+            int windowW_;
+            int windowH_;
+            int desiredTextWidth_;
+            unsigned int maxCharsPerLine_;
+            unsigned int numLinesShifted_;
             int scroll_;
             float scrollTimer_;
-            float cursor_;            unsigned int inputWindowStart_;            char cursorSymbol_;
+            float cursor_;
+            unsigned int inputWindowStart_;
+            char cursorSymbol_;
             bool active_;
             bool bShowCursor_;
@@ -35,3 +100,6 @@
             Ogre::BorderPanelOverlayElement* consoleOverlayBorder_;
             Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_;
-    };}#endif /* _InGameConsole_H__ */
+    };
+}
+
+#endif /* _InGameConsole_H__ */
Index: /code/branches/network/src/orxonox/hud/BarOverlayElement.cc
===================================================================
--- /code/branches/network/src/orxonox/hud/BarOverlayElement.cc	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/BarOverlayElement.cc	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Yuning Chai
Index: /code/branches/network/src/orxonox/hud/BarOverlayElement.h
===================================================================
--- /code/branches/network/src/orxonox/hud/BarOverlayElement.h	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/BarOverlayElement.h	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Yuning Chai
Index: /code/branches/network/src/orxonox/hud/HUD.h
===================================================================
--- /code/branches/network/src/orxonox/hud/HUD.h	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/HUD.h	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Yuning Chai
Index: /code/branches/network/src/orxonox/hud/Navigation.cc
===================================================================
--- /code/branches/network/src/orxonox/hud/Navigation.cc	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/Navigation.cc	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Felix Schulthess
Index: /code/branches/network/src/orxonox/hud/Navigation.h
===================================================================
--- /code/branches/network/src/orxonox/hud/Navigation.h	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/Navigation.h	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Felix Schulthess
Index: /code/branches/network/src/orxonox/hud/OverlayElementFactories.h
===================================================================
--- /code/branches/network/src/orxonox/hud/OverlayElementFactories.h	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/OverlayElementFactories.h	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Yuning Chai
Index: /code/branches/network/src/orxonox/hud/RadarObject.cc
===================================================================
--- /code/branches/network/src/orxonox/hud/RadarObject.cc	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/RadarObject.cc	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Felix Schulthess
Index: /code/branches/network/src/orxonox/hud/RadarObject.h
===================================================================
--- /code/branches/network/src/orxonox/hud/RadarObject.h	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/RadarObject.h	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Felix Schulthess
Index: /code/branches/network/src/orxonox/hud/RadarOverlayElement.cc
===================================================================
--- /code/branches/network/src/orxonox/hud/RadarOverlayElement.cc	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/RadarOverlayElement.cc	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Yuning Chai
Index: /code/branches/network/src/orxonox/hud/RadarOverlayElement.h
===================================================================
--- /code/branches/network/src/orxonox/hud/RadarOverlayElement.h	(revision 1494)
+++ /code/branches/network/src/orxonox/hud/RadarOverlayElement.h	(revision 1495)
@@ -1,3 +1,23 @@
-/* *   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. *
+/*
+ *   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:
  *      Yuning Chai
Index: /code/branches/network/src/orxonox/objects/Camera.h
===================================================================
--- /code/branches/network/src/orxonox/objects/Camera.h	(revision 1494)
+++ /code/branches/network/src/orxonox/objects/Camera.h	(revision 1495)
@@ -1,3 +1,71 @@
-/* *   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: *      Fabian 'x3n' Landau *   Co-authors: *      Benjamin Knecht * */#ifndef _Camera_H__#define _Camera_H__#include <OgrePrerequisites.h>#include <OgreSceneNode.h>#include <OgreCamera.h>#include "OrxonoxPrereqs.h"namespace orxonox{    class _OrxonoxExport Camera    {      friend class CameraHandler;      public:        Camera(Ogre::SceneNode* node = NULL);        virtual ~Camera();        void setPositionNode(Ogre::SceneNode* node);        inline Ogre::SceneNode* getCameraNode() { return this->positionNode_; }        // maybe also BaseObject        void setTargetNode(Ogre::SceneNode* obj);
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Benjamin Knecht
+ *
+ */
+
+#ifndef _Camera_H__
+#define _Camera_H__
+
+#include <OgrePrerequisites.h>
+#include <OgreSceneNode.h>
+#include <OgreCamera.h>
+
+#include "OrxonoxPrereqs.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Camera
+    {
+      friend class CameraHandler;
+      public:
+        Camera(Ogre::SceneNode* node = NULL);
+        virtual ~Camera();
+
+        void setPositionNode(Ogre::SceneNode* node);
+        inline Ogre::SceneNode* getCameraNode() { return this->positionNode_; }
+        // maybe also BaseObject
+        void setTargetNode(Ogre::SceneNode* obj);
+
         Ogre::Camera* cam_;
-        void tick(float dt);        void update();        inline bool hasFocus() { return this->bHasFocus_; }      private:        void removeFocus();        void setFocus(Ogre::Camera* ogreCam);      private:        Ogre::SceneNode* targetNode_;        Ogre::SceneNode* positionNode_;        Ogre::SceneNode* cameraNode_;        Ogre::Vector3 oldPos;        bool bHasFocus_;    };}#endif /* _Camera_H__ */
+
+        void tick(float dt);
+        void update();
+        inline bool hasFocus() { return this->bHasFocus_; }
+
+      private:
+        void removeFocus();
+        void setFocus(Ogre::Camera* ogreCam);
+
+      private:
+        Ogre::SceneNode* targetNode_;
+        Ogre::SceneNode* positionNode_;
+        Ogre::SceneNode* cameraNode_;
+        Ogre::Vector3 oldPos;
+        bool bHasFocus_;
+    };
+}
+
+#endif /* _Camera_H__ */
Index: /code/branches/network/src/orxonox/objects/SpaceShipAI.cc
===================================================================
--- /code/branches/network/src/orxonox/objects/SpaceShipAI.cc	(revision 1494)
+++ /code/branches/network/src/orxonox/objects/SpaceShipAI.cc	(revision 1495)
@@ -1,2 +1,293 @@
-/* *   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: *      Fabian 'x3n' Landau *   Co-authors: *      ... * */#include "OrxonoxStableHeaders.h"
-#include "SpaceShipAI.h"#include <OgreMath.h>#include "Projectile.h"#include "core/CoreIncludes.h"#include "core/Iterator.h"#include "core/Executor.h"#include "core/ConsoleCommand.h"#include "core/XMLPort.h"#define ACTION_INTERVAL 1.0fnamespace orxonox{    SetConsoleCommand(SpaceShipAI, createEnemy, true).setDefaultValue(0, 1);    SetConsoleCommand(SpaceShipAI, killEnemies, true).setDefaultValue(0, 0);    CreateFactory(SpaceShipAI);    SpaceShipAI::SpaceShipAI()    {        RegisterObject(SpaceShipAI);        this->alive_ = true;        this->setPosition(Vector3(rnd(-1000, 1000), rnd(-1000, 1000), rnd(-1000, 0000)));        this->target_ = 0;        this->bShooting_ = 0;        this->bHasTargetPosition_ = false;        this->setTeamNr((int)rnd(NUM_AI_TEAMS) % NUM_AI_TEAMS + 1);        if (NUM_AI_TEAMS > 0)            this->teamColours_[1] = ColourValue(1, 0, 0, 1);        if (NUM_AI_TEAMS > 1)            this->teamColours_[2] = ColourValue(0, 1, 0, 1);        if (NUM_AI_TEAMS > 2)            this->teamColours_[3] = ColourValue(0, 0, 1, 1);        for (int i = 4; i <= NUM_AI_TEAMS; ++i)            this->teamColours_[i] = ColourValue(rnd(), rnd(), rnd(), 1);    }    void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)    {        SpaceShip::XMLPort(xmlelement, mode);        myShip_=true;        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));    }    void SpaceShipAI::createEnemy(int num)    {        for (int i = 0; i < num; ++i)        {            SpaceShipAI* newenemy = new SpaceShipAI();            newenemy->setMesh("assff.mesh");//            newenemy->setPosition(0, 0, 0);            newenemy->setScale(10);            newenemy->setMaxSpeed(500);            newenemy->setMaxSideAndBackSpeed(50);            newenemy->setMaxRotation(1.0);            newenemy->setTransAcc(200);            newenemy->setRotAcc(3.0);            newenemy->setTransDamp(75);            newenemy->setRotDamp(1.0);            Element xmlelement;            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);        }    }    void SpaceShipAI::killEnemies(int num)    {        int i = 0;        for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; )        {            delete *(it++);            ++i;            if (num && i >= num)                break;        }    }    ColourValue SpaceShipAI::getProjectileColour() const    {        return this->teamColours_[this->getTeamNr()];    }    void SpaceShipAI::action()    {        float random;        float maxrand = 100.0f / ACTION_INTERVAL;        // search enemy        random = rnd(maxrand);//std::cout << "search enemy: " << random << std::endl;        if (random < 20 && (!this->target_))        {            this->searchNewTarget();        }        // forget enemy        random = rnd(maxrand);//std::cout << "forget enemy: " << random << std::endl;        if (random < 5 && (this->target_))        {            this->forgetTarget();        }        // next enemy        random = rnd(maxrand);//std::cout << "next enemy: " << random << std::endl;        if (random < 10 && (this->target_))        {            this->searchNewTarget();        }        // fly somewhere        random = rnd(maxrand);//std::cout << "fly somewhere: " << random << std::endl;        if (random < 40 && (!this->bHasTargetPosition_ && !this->target_))        {            this->searchNewTargetPosition();        }        // stop flying        random = rnd(maxrand);//std::cout << "stop flying: " << random << std::endl;        if (random < 10 && (this->bHasTargetPosition_ && !this->target_))        {            this->bHasTargetPosition_ = false;        }        // fly somewhere else        random = rnd(maxrand);//std::cout << "fly somewhere else: " << random << std::endl;        if (random < 30 && (this->bHasTargetPosition_ && !this->target_))        {            this->searchNewTargetPosition();        }        // shoot        random = rnd(maxrand);//std::cout << "shoot: " << random << std::endl;        if (random < 75 && (this->target_ && !this->bShooting_))        {            this->bShooting_ = true;        }        // stop shooting        random = rnd(maxrand);//std::cout << "stop shooting: " << random << std::endl;        if (random < 25 && (this->bShooting_))        {            this->bShooting_ = false;        }    }    void SpaceShipAI::tick(float dt)    {        if (this->target_)            this->aimAtTarget();        if (this->bHasTargetPosition_)            this->moveToTargetPosition(dt);        if (this->bShooting_ && this->isCloseAtTarget(2000) && this->isLookingAtTarget(Ogre::Math::PI / 10.0f))            this->doFire();        SpaceShip::tick(dt);    }    void SpaceShipAI::moveToTargetPosition(float dt)    {        static Radian RadianZERO(0);//        float dotprod = (this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(this->targetPosition_ - this->getPosition());        Quaternion rotation = (this->getOrientation() * Ogre::Vector3::UNIT_X).getRotationTo(this->targetPosition_ - this->getPosition());/*std::cout << "scalprod: " << dotprod << std::endl;std::cout << "dist: " << this->targetPosition_ - this->getPosition() << std::endl;std::cout << "yaw: " << rotation.getYaw().valueRadians() << std::endl;std::cout << "pitch: " << rotation.getPitch().valueRadians() << std::endl;std::cout << "roll: " << rotation.getRoll().valueRadians() << std::endl;*/        this->setMoveYaw(-rotation.getRoll().valueRadians());        this->setMovePitch(rotation.getYaw().valueRadians());        if ((this->targetPosition_ - this->getPosition()).length() > 100)        {            this->setMoveLongitudinal(1);        }    }    void SpaceShipAI::searchNewTargetPosition()    {        this->targetPosition_ = Vector3(rnd(-5000,5000), rnd(-5000,5000), rnd(-5000,5000));        this->bHasTargetPosition_ = true;    }    void SpaceShipAI::searchNewTarget()    {        this->targetPosition_ = this->getPosition();        this->forgetTarget();        for (Iterator<SpaceShip> it = ObjectList<SpaceShip>::begin(); it; ++it)        {            if (it->getTeamNr() != this->getTeamNr())            {                float speed = this->getVelocity().length();                Vector3 distanceCurrent = this->targetPosition_ - this->getPosition();                Vector3 distanceNew = it->getPosition() - this->getPosition();                if (!this->target_ || it->getPosition().squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * Ogre::Math::PI))                        < this->targetPosition_.squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * Ogre::Math::PI)))                {                    this->target_ = (*it);                    this->targetPosition_ = it->getPosition();                }            }        }   }    void SpaceShipAI::forgetTarget()    {        this->target_ = 0;        this->bShooting_ = false;    }    void SpaceShipAI::aimAtTarget()    {        if (!this->target_)            return;/*        Vector3 enemymovement = this->target_->getVelocity();        Vector3 distance_normalised = this->target_->getPosition() - this->getPosition();        distance_normalised.normalise();        float scalarprod = enemymovement.dotProduct(distance_normalised);        float aimoffset = scalarprod*scalarprod + Projectile::getSpeed() * Projectile::getSpeed() - this->target_->getVelocity().squaredLength();        if (aimoffset < 0)        {            this->bHasTargetPosition_ = false;            return;        }        aimoffset = -scalarprod + sqrt(aimoffset);        this->targetPosition_ = enemymovement + distance_normalised * aimoffset;        this->bHasTargetPosition_ = true;        std::cout << "targetpos: " << this->targetPosition_ << std::endl;*/        this->targetPosition_ = this->target_->getPosition();        this->bHasTargetPosition_ = true;    }    bool SpaceShipAI::isCloseAtTarget(float distance)    {        return (this->getPosition().squaredDistance(this->targetPosition_) < distance*distance);    }    bool SpaceShipAI::isLookingAtTarget(float angle)    {        return (this->getOrientation() * Ogre::Vector3::UNIT_X).directionEquals(this->targetPosition_ - this->getPosition(), Radian(angle));    }}
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "SpaceShipAI.h"
+
+#include <OgreMath.h>
+#include "Projectile.h"
+#include "core/CoreIncludes.h"
+#include "core/Iterator.h"
+#include "core/Executor.h"
+#include "core/ConsoleCommand.h"
+#include "core/XMLPort.h"
+
+#define ACTION_INTERVAL 1.0f
+
+namespace orxonox
+{
+    SetConsoleCommand(SpaceShipAI, createEnemy, true).setDefaultValue(0, 1);
+    SetConsoleCommand(SpaceShipAI, killEnemies, true).setDefaultValue(0, 0);
+
+    CreateFactory(SpaceShipAI);
+
+    SpaceShipAI::SpaceShipAI()
+    {
+        RegisterObject(SpaceShipAI);
+
+        this->alive_ = true;
+        this->setPosition(Vector3(rnd(-1000, 1000), rnd(-1000, 1000), rnd(-1000, 0000)));
+        this->target_ = 0;
+        this->bShooting_ = 0;
+        this->bHasTargetPosition_ = false;
+
+        this->setTeamNr((int)rnd(NUM_AI_TEAMS) % NUM_AI_TEAMS + 1);
+
+        if (NUM_AI_TEAMS > 0)
+            this->teamColours_[1] = ColourValue(1, 0, 0, 1);
+        if (NUM_AI_TEAMS > 1)
+            this->teamColours_[2] = ColourValue(0, 1, 0, 1);
+        if (NUM_AI_TEAMS > 2)
+            this->teamColours_[3] = ColourValue(0, 0, 1, 1);
+
+        for (int i = 4; i <= NUM_AI_TEAMS; ++i)
+            this->teamColours_[i] = ColourValue(rnd(), rnd(), rnd(), 1);
+    }
+
+    void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SpaceShip::XMLPort(xmlelement, mode);
+        myShip_=true;
+
+        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
+    }
+
+    void SpaceShipAI::createEnemy(int num)
+    {
+        for (int i = 0; i < num; ++i)
+        {
+            SpaceShipAI* newenemy = new SpaceShipAI();
+            newenemy->setMesh("assff.mesh");
+//            newenemy->setPosition(0, 0, 0);
+            newenemy->setScale(10);
+            newenemy->setMaxSpeed(500);
+            newenemy->setMaxSideAndBackSpeed(50);
+            newenemy->setMaxRotation(1.0);
+            newenemy->setTransAcc(200);
+            newenemy->setRotAcc(3.0);
+            newenemy->setTransDamp(75);
+            newenemy->setRotDamp(1.0);
+            Element xmlelement;
+            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);
+        }
+    }
+
+    void SpaceShipAI::killEnemies(int num)
+    {
+        int i = 0;
+        for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; )
+        {
+            delete *(it++);
+            ++i;
+            if (num && i >= num)
+                break;
+        }
+    }
+
+    ColourValue SpaceShipAI::getProjectileColour() const
+    {
+        return this->teamColours_[this->getTeamNr()];
+    }
+
+    void SpaceShipAI::action()
+    {
+        float random;
+        float maxrand = 100.0f / ACTION_INTERVAL;
+
+        // search enemy
+        random = rnd(maxrand);
+//std::cout << "search enemy: " << random << std::endl;
+        if (random < 20 && (!this->target_))
+        {
+            this->searchNewTarget();
+        }
+
+        // forget enemy
+        random = rnd(maxrand);
+//std::cout << "forget enemy: " << random << std::endl;
+        if (random < 5 && (this->target_))
+        {
+            this->forgetTarget();
+        }
+
+        // next enemy
+        random = rnd(maxrand);
+//std::cout << "next enemy: " << random << std::endl;
+        if (random < 10 && (this->target_))
+        {
+            this->searchNewTarget();
+        }
+
+        // fly somewhere
+        random = rnd(maxrand);
+//std::cout << "fly somewhere: " << random << std::endl;
+        if (random < 40 && (!this->bHasTargetPosition_ && !this->target_))
+        {
+            this->searchNewTargetPosition();
+        }
+
+        // stop flying
+        random = rnd(maxrand);
+//std::cout << "stop flying: " << random << std::endl;
+        if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
+        {
+            this->bHasTargetPosition_ = false;
+        }
+
+        // fly somewhere else
+        random = rnd(maxrand);
+//std::cout << "fly somewhere else: " << random << std::endl;
+        if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
+        {
+            this->searchNewTargetPosition();
+        }
+
+        // shoot
+        random = rnd(maxrand);
+//std::cout << "shoot: " << random << std::endl;
+        if (random < 75 && (this->target_ && !this->bShooting_))
+        {
+            this->bShooting_ = true;
+        }
+
+        // stop shooting
+        random = rnd(maxrand);
+//std::cout << "stop shooting: " << random << std::endl;
+        if (random < 25 && (this->bShooting_))
+        {
+            this->bShooting_ = false;
+        }
+    }
+
+    void SpaceShipAI::tick(float dt)
+    {
+        if (this->target_)
+            this->aimAtTarget();
+
+        if (this->bHasTargetPosition_)
+            this->moveToTargetPosition(dt);
+
+        if (this->bShooting_ && this->isCloseAtTarget(2000) && this->isLookingAtTarget(Ogre::Math::PI / 10.0f))
+            this->doFire();
+
+        SpaceShip::tick(dt);
+    }
+
+    void SpaceShipAI::moveToTargetPosition(float dt)
+    {
+        static Radian RadianZERO(0);
+
+//        float dotprod = (this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(this->targetPosition_ - this->getPosition());
+        Quaternion rotation = (this->getOrientation() * Ogre::Vector3::UNIT_X).getRotationTo(this->targetPosition_ - this->getPosition());
+/*
+std::cout << "scalprod: " << dotprod << std::endl;
+std::cout << "dist: " << this->targetPosition_ - this->getPosition() << std::endl;
+std::cout << "yaw: " << rotation.getYaw().valueRadians() << std::endl;
+std::cout << "pitch: " << rotation.getPitch().valueRadians() << std::endl;
+std::cout << "roll: " << rotation.getRoll().valueRadians() << std::endl;
+*/
+        this->setMoveYaw(-rotation.getRoll().valueRadians());
+        this->setMovePitch(rotation.getYaw().valueRadians());
+
+        if ((this->targetPosition_ - this->getPosition()).length() > 100)
+        {
+            this->setMoveLongitudinal(1);
+        }
+
+    }
+
+    void SpaceShipAI::searchNewTargetPosition()
+    {
+        this->targetPosition_ = Vector3(rnd(-5000,5000), rnd(-5000,5000), rnd(-5000,5000));
+        this->bHasTargetPosition_ = true;
+    }
+
+    void SpaceShipAI::searchNewTarget()
+    {
+        this->targetPosition_ = this->getPosition();
+        this->forgetTarget();
+
+        for (Iterator<SpaceShip> it = ObjectList<SpaceShip>::begin(); it; ++it)
+        {
+            if (it->getTeamNr() != this->getTeamNr())
+            {
+                float speed = this->getVelocity().length();
+                Vector3 distanceCurrent = this->targetPosition_ - this->getPosition();
+                Vector3 distanceNew = it->getPosition() - this->getPosition();
+                if (!this->target_ || it->getPosition().squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * Ogre::Math::PI))
+                        < this->targetPosition_.squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * Ogre::Math::PI)))
+                {
+                    this->target_ = (*it);
+                    this->targetPosition_ = it->getPosition();
+                }
+            }
+        }
+   }
+
+    void SpaceShipAI::forgetTarget()
+    {
+        this->target_ = 0;
+        this->bShooting_ = false;
+    }
+
+    void SpaceShipAI::aimAtTarget()
+    {
+        if (!this->target_)
+            return;
+/*
+        Vector3 enemymovement = this->target_->getVelocity();
+        Vector3 distance_normalised = this->target_->getPosition() - this->getPosition();
+        distance_normalised.normalise();
+
+        float scalarprod = enemymovement.dotProduct(distance_normalised);
+        float aimoffset = scalarprod*scalarprod + Projectile::getSpeed() * Projectile::getSpeed() - this->target_->getVelocity().squaredLength();
+        if (aimoffset < 0)
+        {
+            this->bHasTargetPosition_ = false;
+            return;
+        }
+        aimoffset = -scalarprod + sqrt(aimoffset);
+        this->targetPosition_ = enemymovement + distance_normalised * aimoffset;
+        this->bHasTargetPosition_ = true;
+
+        std::cout << "targetpos: " << this->targetPosition_ << std::endl;
+*/
+        this->targetPosition_ = this->target_->getPosition();
+        this->bHasTargetPosition_ = true;
+    }
+
+    bool SpaceShipAI::isCloseAtTarget(float distance)
+    {
+        return (this->getPosition().squaredDistance(this->targetPosition_) < distance*distance);
+    }
+
+    bool SpaceShipAI::isLookingAtTarget(float angle)
+    {
+        return (this->getOrientation() * Ogre::Vector3::UNIT_X).directionEquals(this->targetPosition_ - this->getPosition(), Radian(angle));
+    }
+}
Index: /code/branches/network/src/orxonox/objects/weapon/BaseWeapon.h
===================================================================
--- /code/branches/network/src/orxonox/objects/weapon/BaseWeapon.h	(revision 1494)
+++ /code/branches/network/src/orxonox/objects/weapon/BaseWeapon.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -25,3 +26,102 @@
  *
  */
-#ifndef _BaseWeapon_H__#define _BaseWeapon_H__#include "OrxonoxPrereqs.h"#include <OgrePrerequisites.h>#include "../Model.h"namespace orxonox {  class _OrxonoxExport BaseWeapon : public Model  {  public:    enum Action {      NOTHING  = 0,      RELOAD   = 1,      CHANGE_AMMO  = 2,      SPECIAL  = 3    };  protected:    enum State {      IDLE = 0,      PRIMARY_FIRE = 1,      SECONDARY_FIRE = 2,      RELOADING = 3,      CHANGING_AMMO = 4,    };  public:    BaseWeapon();	  virtual ~BaseWeapon();    bool addAction(const Action);    void primaryFireRequest();    void secondaryFireRequest();    int getAmmoState();    void setAmmoDump(AmmunitionDump*);    inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); };    virtual void tick(float dt);  protected:    virtual void primaryFire() = 0;    virtual void primaryFiring(float) = 0;    virtual void secondaryFire() = 0;    virtual void secondaryFiring(float) = 0;    virtual void registerAllVariables() { };  public:  protected:    Ogre::SceneManager *sceneMgr_;    int bulletCounter_;    BulletManager *bulletManager_;    AmmunitionDump *ammoDump_;    bool primaryFireRequest_;    bool secondaryFireRequest_;    float totalTime_;    float actionStartTime_;    State currentState_;    bool secondaryFired_;    Action nextAction_;    bool actionAdded_;    float timeSinceNextActionAdded_;    static float nextActionValidityPeriod_s;    // weapon properties    int leftAmmo_;    float primaryFirePower_;    float secondaryFirePower_;    float primaryFiringRate_;    float secondaryFiringRate_;    Real primaryBulletSpeed_;    Real secondaryBulletSpeed_;    int magazineSize_;  };}#endif /* _BaseWeapon_H__ */
+
+
+#ifndef _BaseWeapon_H__
+#define _BaseWeapon_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgrePrerequisites.h>
+
+#include "../Model.h"
+
+
+namespace orxonox {
+  class _OrxonoxExport BaseWeapon : public Model
+  {
+  public:
+    enum Action {
+      NOTHING  = 0,
+      RELOAD   = 1,
+      CHANGE_AMMO  = 2,
+      SPECIAL  = 3
+    };
+
+  protected:
+    enum State {
+      IDLE = 0,
+      PRIMARY_FIRE = 1,
+      SECONDARY_FIRE = 2,
+      RELOADING = 3,
+      CHANGING_AMMO = 4,
+    };
+
+  public:
+    BaseWeapon();
+	  virtual ~BaseWeapon();
+
+    bool addAction(const Action);
+
+    void primaryFireRequest();
+
+    void secondaryFireRequest();
+
+    int getAmmoState();
+
+    void setAmmoDump(AmmunitionDump*);
+
+    inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); };
+
+    virtual void tick(float dt);
+
+  protected:
+    virtual void primaryFire() = 0;
+
+    virtual void primaryFiring(float) = 0;
+
+    virtual void secondaryFire() = 0;
+
+    virtual void secondaryFiring(float) = 0;
+
+    virtual void registerAllVariables() { };
+
+  public:
+
+  protected:
+    Ogre::SceneManager *sceneMgr_;
+
+    int bulletCounter_;
+    BulletManager *bulletManager_;
+
+    AmmunitionDump *ammoDump_;
+
+    bool primaryFireRequest_;
+    bool secondaryFireRequest_;
+
+    float totalTime_;
+    float actionStartTime_;
+
+    State currentState_;
+    bool secondaryFired_;
+
+    Action nextAction_;
+    bool actionAdded_;
+    float timeSinceNextActionAdded_;
+    static float nextActionValidityPeriod_s;
+
+    // weapon properties
+    int leftAmmo_;
+    float primaryFirePower_;
+    float secondaryFirePower_;
+    float primaryFiringRate_;
+    float secondaryFiringRate_;
+    Real primaryBulletSpeed_;
+    Real secondaryBulletSpeed_;
+
+    int magazineSize_;
+
+  };
+}
+
+#endif /* _BaseWeapon_H__ */
Index: /code/branches/network/src/tinyxml/ticpp.cc
===================================================================
--- /code/branches/network/src/tinyxml/ticpp.cc	(revision 1494)
+++ /code/branches/network/src/tinyxml/ticpp.cc	(revision 1495)
@@ -1,3 +1,5 @@
-#define TIXML_USE_TICPP/*
+#define TIXML_USE_TICPP
+
+/*
 http://code.google.com/p/ticpp/
 Copyright (c) 2006 Ryan Pusztai, Ryan Mulder
Index: /code/branches/network/src/tinyxml/ticpp.h
===================================================================
--- /code/branches/network/src/tinyxml/ticpp.h	(revision 1494)
+++ /code/branches/network/src/tinyxml/ticpp.h	(revision 1495)
@@ -1,3 +1,5 @@
-#define TIXML_USE_TICPP/*
+#define TIXML_USE_TICPP
+
+/*
 http://code.google.com/p/ticpp/
 Copyright (c) 2006 Ryan Pusztai, Ryan Mulder
Index: /code/branches/network/src/tinyxml/ticpprc.h
===================================================================
--- /code/branches/network/src/tinyxml/ticpprc.h	(revision 1494)
+++ /code/branches/network/src/tinyxml/ticpprc.h	(revision 1495)
@@ -1,3 +1,5 @@
-#define TIXML_USE_TICPP/*
+#define TIXML_USE_TICPP
+
+/*
 http://code.google.com/p/ticpp/
 Copyright (c) 2006 Ryan Pusztai, Ryan Mulder
Index: /code/branches/network/src/tinyxml/tinyxml.h
===================================================================
--- /code/branches/network/src/tinyxml/tinyxml.h	(revision 1494)
+++ /code/branches/network/src/tinyxml/tinyxml.h	(revision 1495)
@@ -1,3 +1,5 @@
-#define TIXML_USE_TICPP/*
+#define TIXML_USE_TICPP
+
+/*
 www.sourceforge.net/projects/tinyxml
 Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
Index: /code/branches/network/src/util/ArgReader.cc
===================================================================
--- /code/branches/network/src/util/ArgReader.cc	(revision 1494)
+++ /code/branches/network/src/util/ArgReader.cc	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
Index: /code/branches/network/src/util/ArgReader.h
===================================================================
--- /code/branches/network/src/util/ArgReader.h	(revision 1494)
+++ /code/branches/network/src/util/ArgReader.h	(revision 1495)
@@ -1,3 +1,31 @@
-/* *   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: *      Benjamin Knecht <beni_at_orxonox.net> *   Co-authors: *      ... * *//**
+/*
+ *   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:
+ *      Benjamin Knecht <beni_at_orxonox.net>
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
  @file  Argreader.h
  @brief reads arguments
@@ -8,5 +36,8 @@
 #define _ArgReader_H__
 
-#include "UtilPrereqs.h"#include <string>
+#include "UtilPrereqs.h"
+
+#include <string>
+
 class _UtilExport ArgReader
 {
Index: /code/branches/network/src/util/Convert.h
===================================================================
--- /code/branches/network/src/util/Convert.h	(revision 1494)
+++ /code/branches/network/src/util/Convert.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -21,5 +22,7 @@
  *   Author:
  *      Benjamin Grauer
- *      Fabian 'x3n' Landau *   Co-authors: *      ...
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
  */
 
@@ -46,17 +49,586 @@
 #pragma warning(disable:4100 4800)
 #endif
-//////////// MAIN ////////////// Enum to declare the wanted conversion preference in case of equal type-levelsenum ConversionPreference{    CP_PreferToType,    CP_PreferFromType,};// Helper classes to determine the preferred partial template specializationclass _ToType_   {};class _FromType_ {};class _Explicit_ {};// The default convert functionstemplate <class FromType, class ToType, class Type>struct ConverterSpecialized{    enum { specialized = false };    static bool convert(ToType* output, const FromType& input)    { return false; }};// The default convert function if both types are the sametemplate <class BothTypes>struct ConverterSpecialized<BothTypes, BothTypes, _Explicit_>{    enum { specialized = true };    static bool convert(BothTypes* output, const BothTypes& input)    { (*output) = input; return true; }};// The possible levels#define __low__  0 // Everything that is or behaves like a primitive type (an can be converted with a typecast to every other low-level type)#define __mid__  1 // Everything that has overloaded << and >> operators to operate on a std::stream#define __high__ 2 // Everything that doesn't fullfill the lowerlevel-requirements and therefore needs specialized conversions// Defines the levels of all types: Default is __high__ so you don't have to define every high-level typetemplate <class T> struct ConverterLevel           { enum { level = __high__ }; };template <> struct ConverterLevel<std::string>     { enum { level = __mid__ }; };template <> struct ConverterLevel<orxonox::Radian> { enum { level = __mid__ }; };template <> struct ConverterLevel<orxonox::Degree> { enum { level = __mid__ }; };template <> struct ConverterLevel<int>             { enum { level = __low__ }; };template <> struct ConverterLevel<unsigned int>    { enum { level = __low__ }; };template <> struct ConverterLevel<char>            { enum { level = __low__ }; };template <> struct ConverterLevel<unsigned char>   { enum { level = __low__ }; };template <> struct ConverterLevel<short>           { enum { level = __low__ }; };template <> struct ConverterLevel<unsigned short>  { enum { level = __low__ }; };template <> struct ConverterLevel<long>            { enum { level = __low__ }; };template <> struct ConverterLevel<unsigned long>   { enum { level = __low__ }; };template <> struct ConverterLevel<float>           { enum { level = __low__ }; };template <> struct ConverterLevel<double>          { enum { level = __low__ }; };template <> struct ConverterLevel<long double>     { enum { level = __low__ }; };template <> struct ConverterLevel<bool>            { enum { level = __low__ }; };// Calculates the preference based on the levels of FromType and ToTypetemplate <int from, int to>struct ConverterPreference{    enum    {        // The maximum of both levels: element of {0, 1, 2}        // max 0: Both types are primitives or have a similar behaviour        // max 1: At least one type is not a primitive, but both can be put on a std::stream        // max 2: There is at least one generic type that needs specialized conversions        max = (from > to) ? from : to,        // The difference between both levels limited to +-1: element of {-1, 0, 1}        // diff -1: The FromType has higher level than the ToType        // diff  0: Both types have the same level        // diff  1: The ToType has higher level than the FromType        diff = ((to - from) > 1) ? 1 : (((to - from) < -1) ? -1 : to - from)    };};// The default conversion: This usually does nothingtemplate <int max, class FromType, class ToType>struct ConverterDefault{    static bool convert(ToType* output, const FromType& input)    {        return false;    }};// The default conversion for primitives: A typecast (defined over two partial specialized templates to exclude all non-primitive types and classes)    template <int max, class FromType, class ToType>template <class FromType, class ToType>struct ConverterDefault<0, FromType, ToType>{    static bool convert(ToType* output, const FromType& input)    {        (*output) = (ToType)input;        return true;    }};// Converter: Converts input of FromType into output of ToTypetemplate <int diff, int max, class FromType, class ToType, ConversionPreference pref>struct Converter{    static bool convert(ToType* output, const FromType& input)    {        return false;    }};// Converter: level{FromType} > level{ToType}template <int max, class FromType, class ToType, ConversionPreference pref>struct Converter<-1, max, FromType, ToType, pref>{   static bool convert(ToType* output, const FromType& input)    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };// Converter: level{FromType} < level{ToType}template <int max, class FromType, class ToType, ConversionPreference pref>struct Converter<1, max, FromType, ToType, pref>{   static bool convert(ToType* output, const FromType& input)    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };// Converter: level{FromType} = level{ToType}// CP_PreferToTypetemplate <int max, class FromType, class ToType>struct Converter<0, max, FromType, ToType, CP_PreferToType>{   static bool convert(ToType* output, const FromType& input)    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };// CP_PreferFromTypetemplate <int max, class FromType, class ToType>struct Converter<0, max, FromType, ToType, CP_PreferFromType>{   static bool convert(ToType* output, const FromType& input)    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };// Calls the Converter::convertValue function with the correct template type parameters calculated by ConverterPreferencetemplate <class FromType, class ToType>static bool convertValue(ToType* output, const FromType& input, ConversionPreference preference = CP_PreferToType){    return (preference == CP_PreferToType) ?           Converter<ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::diff,                     ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::max,                     FromType,                     ToType,                     CP_PreferToType>::convert(output, input)         : Converter<ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::diff,                     ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::max,                     FromType,                     ToType,                     CP_PreferFromType>::convert(output, input);}//////////////////////// HELPER FUNCTIONS ////////////////////////// Helper function: Calls convertValue with and without default value and returns true if the conversion was successfultemplate<class FromType, class ToType>static bool ConvertValue(ToType* output, const FromType& input, ConversionPreference preference = CP_PreferToType){    return convertValue(output, input, preference);}template<class FromType, class ToType>static bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback, ConversionPreference preference = CP_PreferToType){    if (convertValue(output, input, preference))        return true;    (*output) = fallback;    return false;}// Helper function: Calls convertValue with and without default value and returns the converted valuetemplate<class FromType, class ToType>static ToType getConvertedValue(const FromType& input, ConversionPreference preference = CP_PreferToType){    ToType output = ToType();    ConvertValue(&output, input, preference);    return output;}template<class FromType, class ToType>static ToType getConvertedValue(const FromType& input, const ToType& fallback, ConversionPreference preference = CP_PreferToType){    ToType output = fallback;    ConvertValue(&output, input, fallback, preference);    return output;}
+
+
+//////////
+// MAIN //
+//////////
+
+// Enum to declare the wanted conversion preference in case of equal type-levels
+enum ConversionPreference
+{
+    CP_PreferToType,
+    CP_PreferFromType,
+};
+
+// Helper classes to determine the preferred partial template specialization
+class _ToType_   {};
+class _FromType_ {};
+class _Explicit_ {};
+
+
+// The default convert functions
+template <class FromType, class ToType, class Type>
+struct ConverterSpecialized
+{
+    enum { specialized = false };
+    static bool convert(ToType* output, const FromType& input)
+    { return false; }
+};
+
+
+// The default convert function if both types are the same
+template <class BothTypes>
+struct ConverterSpecialized<BothTypes, BothTypes, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(BothTypes* output, const BothTypes& input)
+    { (*output) = input; return true; }
+};
+
+
+// The possible levels
+#define __low__  0 // Everything that is or behaves like a primitive type (an can be converted with a typecast to every other low-level type)
+#define __mid__  1 // Everything that has overloaded << and >> operators to operate on a std::stream
+#define __high__ 2 // Everything that doesn't fullfill the lowerlevel-requirements and therefore needs specialized conversions
+
+// Defines the levels of all types: Default is __high__ so you don't have to define every high-level type
+template <class T> struct ConverterLevel           { enum { level = __high__ }; };
+template <> struct ConverterLevel<std::string>     { enum { level = __mid__ }; };
+template <> struct ConverterLevel<orxonox::Radian> { enum { level = __mid__ }; };
+template <> struct ConverterLevel<orxonox::Degree> { enum { level = __mid__ }; };
+template <> struct ConverterLevel<int>             { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned int>    { enum { level = __low__ }; };
+template <> struct ConverterLevel<char>            { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned char>   { enum { level = __low__ }; };
+template <> struct ConverterLevel<short>           { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned short>  { enum { level = __low__ }; };
+template <> struct ConverterLevel<long>            { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned long>   { enum { level = __low__ }; };
+template <> struct ConverterLevel<float>           { enum { level = __low__ }; };
+template <> struct ConverterLevel<double>          { enum { level = __low__ }; };
+template <> struct ConverterLevel<long double>     { enum { level = __low__ }; };
+template <> struct ConverterLevel<bool>            { enum { level = __low__ }; };
+
+
+// Calculates the preference based on the levels of FromType and ToType
+template <int from, int to>
+struct ConverterPreference
+{
+    enum
+    {
+        // The maximum of both levels: element of {0, 1, 2}
+        // max 0: Both types are primitives or have a similar behaviour
+        // max 1: At least one type is not a primitive, but both can be put on a std::stream
+        // max 2: There is at least one generic type that needs specialized conversions
+        max = (from > to) ? from : to,
+
+        // The difference between both levels limited to +-1: element of {-1, 0, 1}
+        // diff -1: The FromType has higher level than the ToType
+        // diff  0: Both types have the same level
+        // diff  1: The ToType has higher level than the FromType
+        diff = ((to - from) > 1) ? 1 : (((to - from) < -1) ? -1 : to - from)
+    };
+};
+
+
+// The default conversion: This usually does nothing
+template <int max, class FromType, class ToType>
+struct ConverterDefault
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        return false;
+    }
+};
+// The default conversion for primitives: A typecast (defined over two partial specialized templates to exclude all non-primitive types and classes)    template <int max, class FromType, class ToType>
+template <class FromType, class ToType>
+struct ConverterDefault<0, FromType, ToType>
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        (*output) = (ToType)input;
+        return true;
+    }
+};
+
+
+// Converter: Converts input of FromType into output of ToType
+template <int diff, int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        return false;
+    }
+};
+// Converter: level{FromType} > level{ToType}
+template <int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter<-1, max, FromType, ToType, pref>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// Converter: level{FromType} < level{ToType}
+template <int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter<1, max, FromType, ToType, pref>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// Converter: level{FromType} = level{ToType}
+// CP_PreferToType
+template <int max, class FromType, class ToType>
+struct Converter<0, max, FromType, ToType, CP_PreferToType>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// CP_PreferFromType
+template <int max, class FromType, class ToType>
+struct Converter<0, max, FromType, ToType, CP_PreferFromType>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+
+
+// Calls the Converter::convertValue function with the correct template type parameters calculated by ConverterPreference
+template <class FromType, class ToType>
+static bool convertValue(ToType* output, const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    return (preference == CP_PreferToType) ?
+           Converter<ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::diff,
+                     ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::max,
+                     FromType,
+                     ToType,
+                     CP_PreferToType>::convert(output, input)
+         : Converter<ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::diff,
+                     ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::max,
+                     FromType,
+                     ToType,
+                     CP_PreferFromType>::convert(output, input);
+}
+
+
+//////////////////////
+// HELPER FUNCTIONS //
+//////////////////////
+
+// Helper function: Calls convertValue with and without default value and returns true if the conversion was successful
+template<class FromType, class ToType>
+static bool ConvertValue(ToType* output, const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    return convertValue(output, input, preference);
+}
+template<class FromType, class ToType>
+static bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback, ConversionPreference preference = CP_PreferToType)
+{
+    if (convertValue(output, input, preference))
+        return true;
+
+    (*output) = fallback;
+    return false;
+}
+
+// Helper function: Calls convertValue with and without default value and returns the converted value
+template<class FromType, class ToType>
+static ToType getConvertedValue(const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    ToType output = ToType();
+    ConvertValue(&output, input, preference);
+    return output;
+}
+template<class FromType, class ToType>
+static ToType getConvertedValue(const FromType& input, const ToType& fallback, ConversionPreference preference = CP_PreferToType)
+{
+    ToType output = fallback;
+    ConvertValue(&output, input, fallback, preference);
+    return output;
+}
+
+
 /////////////////////
 // SPECIALIZATIONS //
 /////////////////////
-/////////////// SAMPLES ////////////////*// convert everything to xyztemplate <class FromType>struct ConverterSpecialized<FromType, xyz, _ToType_>{    enum { specialized = true };    static bool convert(xyz* output, const FromType& input)    { return ...; }};// convert xyz to everythingtemplate <class ToType>struct ConverterSpecialized<xyz, ToType, _FromType_>{    enum { specialized = true };    static bool convert(ToType* output, const xyz& input)    { return ...; }};// convert abc to xyztemplate <>struct ConverterSpecialized<abc, xyz, _Explicit_>{    enum { specialized = true };    static bool convert(xyz* output, const abc& input)    { return ...; }};*/////////////// STRING //////////////// convert to stringtemplate <class FromType>struct ConverterSpecialized<FromType, std::string, _ToType_>{    enum { specialized = true };    static bool convert(std::string* output, const FromType& input)    {        std::ostringstream oss;        if (oss << input)        {            (*output) = oss.str();            return true;        }        else            return false;    }};// convert from stringtemplate <class ToType>struct ConverterSpecialized<std::string, ToType, _FromType_>{    enum { specialized = true };    static bool convert(ToType* output, const std::string& input)    {        std::istringstream iss(input);        if (iss >> (*output))            return true;        else            return false;    }};////////////////// MULTITYPES //////////////////// convert from MultiTypePrimitivetemplate <class ToType>struct ConverterSpecialized<MultiTypePrimitive, ToType, _FromType_>{    enum { specialized = true };    static bool convert(ToType* output, const MultiTypePrimitive& input)    {        if (input.getType() == MT_void)            return ConvertValue(output, input.getVoid());        else if (input.getType() == MT_int)            return ConvertValue(output, input.getInt());        else if (input.getType() == MT_uint)            return ConvertValue(output, input.getUnsignedInt());        else if (input.getType() == MT_char)            return ConvertValue(output, input.getChar());        else if (input.getType() == MT_uchar)            return ConvertValue(output, input.getUnsignedChar());        else if (input.getType() == MT_short)            return ConvertValue(output, input.getShort());        else if (input.getType() == MT_ushort)            return ConvertValue(output, input.getUnsignedShort());        else if (input.getType() == MT_long)            return ConvertValue(output, input.getLong());        else if (input.getType() == MT_ulong)            return ConvertValue(output, input.getUnsignedLong());        else if (input.getType() == MT_float)            return ConvertValue(output, input.getFloat());        else if (input.getType() == MT_double)            return ConvertValue(output, input.getDouble());        else if (input.getType() == MT_longdouble)            return ConvertValue(output, input.getLongDouble());        else if (input.getType() == MT_bool)            return ConvertValue(output, input.getBool());        else            return false;    }};// convert from MultiTypeStringtemplate <class ToType>struct ConverterSpecialized<MultiTypeString, ToType, _FromType_>{    enum { specialized = true };    static bool convert(ToType* output, const MultiTypeString& input)    {        if (input.getType() == MT_constchar)            return ConvertValue(output, input.getConstChar());        else if (input.getType() == MT_string)            return ConvertValue(output, input.getString());        else            return ConvertValue(output, (MultiTypePrimitive)input);    }};// convert from MultiTypeMathtemplate <class ToType>struct ConverterSpecialized<MultiTypeMath, ToType, _FromType_>{    enum { specialized = true };    static bool convert(ToType* output, const MultiTypeMath& input)    {        if (input.getType() == MT_vector2)            return ConvertValue(output, input.getVector2());        else if (input.getType() == MT_vector3)            return ConvertValue(output, input.getVector3());        else if (input.getType() == MT_vector4)            return ConvertValue(output, input.getVector4());        else if (input.getType() == MT_quaternion)            return ConvertValue(output, input.getQuaternion());        else if (input.getType() == MT_colourvalue)            return ConvertValue(output, input.getColourValue());        else if (input.getType() == MT_radian)            return ConvertValue(output, input.getRadian());        else if (input.getType() == MT_degree)            return ConvertValue(output, input.getDegree());        else            return ConvertValue(output, (MultiTypeString)input);    }};
+
+/////////////
+// SAMPLES //
+/////////////
+/*
+// convert everything to xyz
+template <class FromType>
+struct ConverterSpecialized<FromType, xyz, _ToType_>
+{
+    enum { specialized = true };
+    static bool convert(xyz* output, const FromType& input)
+    { return ...; }
+};
+
+// convert xyz to everything
+template <class ToType>
+struct ConverterSpecialized<xyz, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const xyz& input)
+    { return ...; }
+};
+
+// convert abc to xyz
+template <>
+struct ConverterSpecialized<abc, xyz, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(xyz* output, const abc& input)
+    { return ...; }
+};
+*/
+
+////////////
+// STRING //
+////////////
+
+// convert to string
+template <class FromType>
+struct ConverterSpecialized<FromType, std::string, _ToType_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const FromType& input)
+    {
+        std::ostringstream oss;
+        if (oss << input)
+        {
+            (*output) = oss.str();
+            return true;
+        }
+        else
+            return false;
+    }
+};
+
+// convert from string
+template <class ToType>
+struct ConverterSpecialized<std::string, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const std::string& input)
+    {
+        std::istringstream iss(input);
+        if (iss >> (*output))
+            return true;
+        else
+            return false;
+    }
+};
+
+
+////////////////
+// MULTITYPES //
+////////////////
+
+// convert from MultiTypePrimitive
+template <class ToType>
+struct ConverterSpecialized<MultiTypePrimitive, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypePrimitive& input)
+    {
+        if (input.getType() == MT_void)
+            return ConvertValue(output, input.getVoid());
+        else if (input.getType() == MT_int)
+            return ConvertValue(output, input.getInt());
+        else if (input.getType() == MT_uint)
+            return ConvertValue(output, input.getUnsignedInt());
+        else if (input.getType() == MT_char)
+            return ConvertValue(output, input.getChar());
+        else if (input.getType() == MT_uchar)
+            return ConvertValue(output, input.getUnsignedChar());
+        else if (input.getType() == MT_short)
+            return ConvertValue(output, input.getShort());
+        else if (input.getType() == MT_ushort)
+            return ConvertValue(output, input.getUnsignedShort());
+        else if (input.getType() == MT_long)
+            return ConvertValue(output, input.getLong());
+        else if (input.getType() == MT_ulong)
+            return ConvertValue(output, input.getUnsignedLong());
+        else if (input.getType() == MT_float)
+            return ConvertValue(output, input.getFloat());
+        else if (input.getType() == MT_double)
+            return ConvertValue(output, input.getDouble());
+        else if (input.getType() == MT_longdouble)
+            return ConvertValue(output, input.getLongDouble());
+        else if (input.getType() == MT_bool)
+            return ConvertValue(output, input.getBool());
+        else
+            return false;
+    }
+};
+
+// convert from MultiTypeString
+template <class ToType>
+struct ConverterSpecialized<MultiTypeString, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypeString& input)
+    {
+        if (input.getType() == MT_constchar)
+            return ConvertValue(output, input.getConstChar());
+        else if (input.getType() == MT_string)
+            return ConvertValue(output, input.getString());
+        else
+            return ConvertValue(output, (MultiTypePrimitive)input);
+    }
+};
+
+// convert from MultiTypeMath
+template <class ToType>
+struct ConverterSpecialized<MultiTypeMath, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypeMath& input)
+    {
+        if (input.getType() == MT_vector2)
+            return ConvertValue(output, input.getVector2());
+        else if (input.getType() == MT_vector3)
+            return ConvertValue(output, input.getVector3());
+        else if (input.getType() == MT_vector4)
+            return ConvertValue(output, input.getVector4());
+        else if (input.getType() == MT_quaternion)
+            return ConvertValue(output, input.getQuaternion());
+        else if (input.getType() == MT_colourvalue)
+            return ConvertValue(output, input.getColourValue());
+        else if (input.getType() == MT_radian)
+            return ConvertValue(output, input.getRadian());
+        else if (input.getType() == MT_degree)
+            return ConvertValue(output, input.getDegree());
+        else
+            return ConvertValue(output, (MultiTypeString)input);
+    }
+};
+
+
 ////////////////////
 // MATH TO STRING //
 ////////////////////
-// Vector2 to std::stringtemplate <>struct ConverterSpecialized<orxonox::Vector2, std::string, _Explicit_>{    enum { specialized = true };    static bool convert(std::string* output, const orxonox::Vector2& input)    {        std::ostringstream ostream;        if (ostream << input.x << "," << input.y)        {            (*output) = ostream.str();            return true;        }        return false;    }};// Vector3 to std::stringtemplate <>struct ConverterSpecialized<orxonox::Vector3, std::string, _Explicit_>{    enum { specialized = true };    static bool convert(std::string* output, const orxonox::Vector3& input)    {        std::ostringstream ostream;        if (ostream << input.x << "," << input.y << "," << input.z)        {            (*output) = ostream.str();            return true;        }        return false;    }};// Vector4 to std::stringtemplate <>struct ConverterSpecialized<orxonox::Vector4, std::string, _Explicit_>{    enum { specialized = true };    static bool convert(std::string* output, const orxonox::Vector4& input)    {        std::ostringstream ostream;        if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)        {            (*output) = ostream.str();            return true;        }        return false;    }};// Quaternion to std::stringtemplate <>struct ConverterSpecialized<orxonox::Quaternion, std::string, _Explicit_>{    enum { specialized = true };    static bool convert(std::string* output, const orxonox::Quaternion& input)    {        std::ostringstream ostream;        if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)        {            (*output) = ostream.str();            return true;        }        return false;    }};// ColourValue to std::stringtemplate <>struct ConverterSpecialized<orxonox::ColourValue, std::string, _Explicit_>{    enum { specialized = true };    static bool convert(std::string* output, const orxonox::ColourValue& input)    {        std::ostringstream ostream;        if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)        {            (*output) = ostream.str();            return true;        }        return false;    }};////////////////////
+
+// Vector2 to std::string
+template <>
+struct ConverterSpecialized<orxonox::Vector2, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector2& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
+    }
+};
+
+// Vector3 to std::string
+template <>
+struct ConverterSpecialized<orxonox::Vector3, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector3& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y << "," << input.z)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
+    }
+};
+
+// Vector4 to std::string
+template <>
+struct ConverterSpecialized<orxonox::Vector4, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector4& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
+    }
+};
+
+// Quaternion to std::string
+template <>
+struct ConverterSpecialized<orxonox::Quaternion, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Quaternion& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
+    }
+};
+
+// ColourValue to std::string
+template <>
+struct ConverterSpecialized<orxonox::ColourValue, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::ColourValue& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
+    }
+};
+
+
+////////////////////
 // STRING TO MATH //
 ////////////////////
-// std::string to Vector2template <>struct ConverterSpecialized<std::string, orxonox::Vector2, _Explicit_>{    enum { specialized = true };    static bool convert(orxonox::Vector2* output, const std::string& input)    {        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');        if (tokens.size() >= 2)        {            if (!ConvertValue(&(output->x), tokens[0]))                return false;            if (!ConvertValue(&(output->y), tokens[1]))                return false;            return true;        }        return false;    }};// std::string to Vector3template <>struct ConverterSpecialized<std::string, orxonox::Vector3, _Explicit_>{    enum { specialized = true };    static bool convert(orxonox::Vector3* output, const std::string& input)    {        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');        if (tokens.size() >= 3)        {            if (!ConvertValue(&(output->x), tokens[0]))                return false;            if (!ConvertValue(&(output->y), tokens[1]))                return false;            if (!ConvertValue(&(output->z), tokens[2]))                return false;            return true;        }        return false;    }};// std::string to Vector4template <>struct ConverterSpecialized<std::string, orxonox::Vector4, _Explicit_>{    enum { specialized = true };    static bool convert(orxonox::Vector4* output, const std::string& input)    {        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');        if (tokens.size() >= 4)        {            if (!ConvertValue(&(output->x), tokens[0]))                return false;            if (!ConvertValue(&(output->y), tokens[1]))                return false;            if (!ConvertValue(&(output->z), tokens[2]))                return false;            if (!ConvertValue(&(output->w), tokens[3]))                return false;            return true;        }        return false;    }};// std::string to Quaterniontemplate <>struct ConverterSpecialized<std::string, orxonox::Quaternion, _Explicit_>{    enum { specialized = true };    static bool convert(orxonox::Quaternion* output, const std::string& input)    {        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');        if (tokens.size() >= 4)        {            if (!ConvertValue(&(output->w), tokens[0]))                return false;            if (!ConvertValue(&(output->x), tokens[1]))                return false;            if (!ConvertValue(&(output->y), tokens[2]))                return false;            if (!ConvertValue(&(output->z), tokens[3]))                return false;            return true;        }        return false;    }};// std::string to ColourValuetemplate <>struct ConverterSpecialized<std::string, orxonox::ColourValue, _Explicit_>{    enum { specialized = true };    static bool convert(orxonox::ColourValue* output, const std::string& input)    {        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');        if (tokens.size() >= 4)        {            if (!ConvertValue(&(output->r), tokens[0]))                return false;            if (!ConvertValue(&(output->g), tokens[1]))                return false;            if (!ConvertValue(&(output->b), tokens[2]))                return false;            if (!ConvertValue(&(output->a), tokens[3]))                return false;            return true;        }        return false;    }};#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+
+// std::string to Vector2
+template <>
+struct ConverterSpecialized<std::string, orxonox::Vector2, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector2* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 2)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+};
+
+// std::string to Vector3
+template <>
+struct ConverterSpecialized<std::string, orxonox::Vector3, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector3* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 3)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[2]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+};
+
+// std::string to Vector4
+template <>
+struct ConverterSpecialized<std::string, orxonox::Vector4, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector4* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->w), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+};
+
+// std::string to Quaternion
+template <>
+struct ConverterSpecialized<std::string, orxonox::Quaternion, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Quaternion* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->w), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->x), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+};
+
+// std::string to ColourValue
+template <>
+struct ConverterSpecialized<std::string, orxonox::ColourValue, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::ColourValue* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->r), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->g), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->b), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->a), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+};
+
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
 #pragma warning(pop)
 #endif
+
 #endif /* _Convert_H__ */
Index: /code/branches/network/src/util/ExprParser.cc
===================================================================
--- /code/branches/network/src/util/ExprParser.cc	(revision 1494)
+++ /code/branches/network/src/util/ExprParser.cc	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -30,3 +31,421 @@
   @brief Declaration of FloatParser
 */
-#include "ExprParser.h"#include <cmath>#include <cstring>// macros for easier if, else statements#define CASE_1(var) if (!strcmp(SWITCH,var))#define CASE(var) else if (!strcmp(SWITCH,var))#define CASE_ELSE else//! skip white spaces#define PARSE_BLANKS while (*reading_stream == ' ') ++reading_stream;ExprParser::ExprParser(const std::string& str){  this->failed_ = false;  this->reading_stream = str.c_str();  if (str.size() == 0 || *reading_stream == '\0')  {    this->failed_ = true;    this->result_ = 0.0;  }  else  {    this->result_ = parse_expr_8();    this->remains_ = reading_stream;  }}//Private functions:/******************/double ExprParser::parse_argument(){   double value = parse_expr_8();   if (*reading_stream == ',')   {      ++reading_stream;      return value;   }   else   {     this->failed_ = true;     return 0;   }}double ExprParser::parse_last_argument(){   double value = parse_expr_8();   if (*reading_stream == ')')   {      ++reading_stream;      return value;   }   else   {     this->failed_ = true;     return 0;   }}double ExprParser::parse_expr_8(){   double value = parse_expr_7();   for(;;)   {      switch (op)      {         case oder:            value = parse_expr_7() || value;            break;         default: return value;      }   };}double ExprParser::parse_expr_7(){   double value = parse_expr_6();   for(;;)   {      switch (op)      {         case und:            value = value && parse_expr_6();            break;         default: return value;      }   };}double ExprParser::parse_expr_6(){   double value = parse_expr_5();   for(;;)   {      switch (op)      {         case gleich:            value = (value == parse_expr_5());            break;         case ungleich:            value = (value != parse_expr_5());            break;         default:            return value;      }   };}double ExprParser::parse_expr_5(){   double value = parse_expr_4();   for(;;)   {      switch (op)      {         case kleiner:            value = (value < parse_expr_4());            break;         case kleinergleich:            value = (value <= parse_expr_4());            break;         case groesser:            value = (value > parse_expr_4());            break;         case groessergleich:            value = (value >= parse_expr_4());            break;         default:            return value;      }   };}double ExprParser::parse_expr_4(){   double value = parse_expr_3();   for(;;)   {      switch (op)      {         case b_plus:            value += parse_expr_3();            break;         case b_minus:            value -= parse_expr_3();            break;         default:            return value;      }   };}double ExprParser::parse_expr_3(){   double value = parse_expr_2();   for(;;)   {      switch (op)      {         case mal:            value *= parse_expr_2();            break;         case durch:            value /= parse_expr_2();            break;         case modulo:         {            double temp = parse_expr_2();            value = value - floor(value/temp)*temp;            break;         }         default:            return value;      }   };}double ExprParser::parse_expr_2(){   double value = parse_expr_1();   while (*reading_stream != '\0')   {      op = parse_binary_operator();      switch (op)      {         case hoch:            value = pow(value,parse_expr_1());            break;         default:            return value;      }   };   op = undef;   return value;}double ExprParser::parse_expr_1(){   PARSE_BLANKS   double value;   unary_operator op = parse_unary_operator();   PARSE_BLANKS   if (*reading_stream == '\0')   {     // end of string     this->failed_ = true;     return 0;   }   else if (*reading_stream > 47 && *reading_stream < 59 || *reading_stream == 46)   {  // number      value = strtod(reading_stream, const_cast<char**>(&reading_stream));   }   else if (*reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)   {  // variable or function      char* word = new char[256];      parse_word(word);      PARSE_BLANKS      if (*reading_stream == '(')      {         ++reading_stream;#define SWITCH word         CASE_1("sin")            value = sin(parse_last_argument());         CASE("asin")            value = asin(parse_last_argument());         CASE("sinh")            value = sinh(parse_last_argument());         CASE("asinh")         {            value = parse_last_argument();            value = log(sqrt(pow(value, 2) + 1) + value);         }         CASE("cos")            value = cos(parse_last_argument());         CASE("acos")            value = acos(parse_last_argument());         CASE("cosh")            value = cosh(parse_last_argument());         CASE("acosh")         {            value = parse_last_argument();            value = log(sqrt(pow(value, 2) - 1) + value);         }         CASE("tan")            value = tan(parse_last_argument());         CASE("atan")            value = atan(parse_last_argument());         CASE("atan2")            value = atan2(parse_argument(),parse_last_argument());         CASE("tanh")            value = tanh(parse_last_argument());         CASE("atanh")         {            value = parse_last_argument();            value = 0.5*log((value + 1)/(value - 1));         }         CASE("int")            value = floor(parse_last_argument());         CASE("floor")            value = floor(parse_last_argument());         CASE("ceil")            value = ceil(parse_last_argument());         CASE("abs")            value = fabs(parse_last_argument());         CASE("exp")            value = exp(parse_last_argument());         CASE("log")            value = log10(parse_last_argument());         CASE("ln")            value = log(parse_last_argument());         CASE("sign")         {            value = parse_last_argument();            value = (value>0 ? 1 : (value<0 ? -1 : 0));         }         CASE("sqrt")            value = sqrt(parse_last_argument());         CASE("degrees")            value = parse_last_argument()*180/3.1415926535897932;         CASE("radians")            value = parse_last_argument()*3.1415926535897932/180;         CASE("mod")         {            value = parse_argument();            double value2 = parse_last_argument();            value = value - floor(value/value2)*value2;         }         CASE("pow")            value = pow(parse_argument(),parse_last_argument());         CASE("div")            value = floor(parse_argument()/parse_last_argument());         CASE("max")           value = std::max(parse_argument(),parse_last_argument());         CASE("min")           value = std::min(parse_argument(),parse_last_argument());         CASE_ELSE         {           this->failed_ = true;           delete[] word;           return 0;         }      }      else      {#define SWITCH word         CASE_1("pi")           value = 3.1415926535897932;         CASE("e")           value = 2.7182818284590452;         CASE_ELSE         {           this->failed_ = true;           delete[] word;           return 0;         }      }      delete[] word;   }   else if (*reading_stream == 40)   {  // expresion in paranthesis      ++reading_stream;      value = parse_last_argument();   }   else   {     this->failed_ = true;     return 0;   }   PARSE_BLANKS   switch (op)   {      case u_nicht: return !value;      case u_plus:  return  value;      case u_minus: return -value;      default:        {          this->failed_ = true;          return 0;        }   }}char* ExprParser::parse_word(char* str){   char* word = str;   int counter = 0;   while (*reading_stream > 47 && *reading_stream < 58 || *reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)   {      *word++ = *reading_stream++;      counter++;      if (counter > 255)      {        this->failed_ = true;        return '\0';      }   };   *word = '\0';   return str;}ExprParser::binary_operator ExprParser::parse_binary_operator(){   binary_operator op;   switch (*reading_stream)   {      case '+': op = b_plus; break;      case '-': op = b_minus; break;      case '*': op = mal; break;      case '/': op = durch; break;      case '^': op = hoch; break;      case '%': op = modulo; break;      case '&': op = und; break;      case '|': op = oder; break;      case '=': op = gleich; break;      case '!': op = b_nicht; break;      case '<': op = kleiner; break;      case '>': op = groesser; break;      default: return undef;   }   if (*++reading_stream == '=')   {      if (op > 9)      {         ++reading_stream;         return (binary_operator)(op + 3);      }      else      {         --reading_stream;         return undef;      }   }   else      return op;}ExprParser::unary_operator ExprParser::parse_unary_operator(){   switch (*reading_stream)   {      case '!':         ++reading_stream;         return u_nicht;      case '+':         ++reading_stream;         return u_plus;      case '-':         ++reading_stream;         return u_minus;      default :         return u_plus;   }}
+
+#include "ExprParser.h"
+#include <cmath>
+#include <cstring>
+
+// macros for easier if, else statements
+#define CASE_1(var) if (!strcmp(SWITCH,var))
+#define CASE(var) else if (!strcmp(SWITCH,var))
+#define CASE_ELSE else
+
+//! skip white spaces
+#define PARSE_BLANKS while (*reading_stream == ' ') ++reading_stream;
+
+ExprParser::ExprParser(const std::string& str)
+{
+  this->failed_ = false;
+  this->reading_stream = str.c_str();
+  if (str.size() == 0 || *reading_stream == '\0')
+  {
+    this->failed_ = true;
+    this->result_ = 0.0;
+  }
+  else
+  {
+    this->result_ = parse_expr_8();
+    this->remains_ = reading_stream;
+  }
+}
+
+//Private functions:
+/******************/
+double ExprParser::parse_argument()
+{
+   double value = parse_expr_8();
+   if (*reading_stream == ',')
+   {
+      ++reading_stream;
+      return value;
+   }
+   else
+   {
+     this->failed_ = true;
+     return 0;
+   }
+}
+
+double ExprParser::parse_last_argument()
+{
+   double value = parse_expr_8();
+   if (*reading_stream == ')')
+   {
+      ++reading_stream;
+      return value;
+   }
+   else
+   {
+     this->failed_ = true;
+     return 0;
+   }
+}
+
+double ExprParser::parse_expr_8()
+{
+   double value = parse_expr_7();
+   for(;;)
+   {
+      switch (op)
+      {
+         case oder:
+            value = parse_expr_7() || value;
+            break;
+         default: return value;
+      }
+   };
+}
+
+
+double ExprParser::parse_expr_7()
+{
+   double value = parse_expr_6();
+   for(;;)
+   {
+      switch (op)
+      {
+         case und:
+            value = value && parse_expr_6();
+            break;
+         default: return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_6()
+{
+   double value = parse_expr_5();
+   for(;;)
+   {
+      switch (op)
+      {
+         case gleich:
+            value = (value == parse_expr_5());
+            break;
+         case ungleich:
+            value = (value != parse_expr_5());
+            break;
+         default:
+            return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_5()
+{
+   double value = parse_expr_4();
+   for(;;)
+   {
+      switch (op)
+      {
+         case kleiner:
+            value = (value < parse_expr_4());
+            break;
+         case kleinergleich:
+            value = (value <= parse_expr_4());
+            break;
+         case groesser:
+            value = (value > parse_expr_4());
+            break;
+         case groessergleich:
+            value = (value >= parse_expr_4());
+            break;
+         default:
+            return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_4()
+{
+   double value = parse_expr_3();
+   for(;;)
+   {
+      switch (op)
+      {
+         case b_plus:
+            value += parse_expr_3();
+            break;
+         case b_minus:
+            value -= parse_expr_3();
+            break;
+         default:
+            return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_3()
+{
+   double value = parse_expr_2();
+   for(;;)
+   {
+      switch (op)
+      {
+         case mal:
+            value *= parse_expr_2();
+            break;
+         case durch:
+            value /= parse_expr_2();
+            break;
+         case modulo:
+         {
+            double temp = parse_expr_2();
+            value = value - floor(value/temp)*temp;
+            break;
+         }
+         default:
+            return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_2()
+{
+   double value = parse_expr_1();
+   while (*reading_stream != '\0')
+   {
+      op = parse_binary_operator();
+      switch (op)
+      {
+         case hoch:
+            value = pow(value,parse_expr_1());
+            break;
+         default:
+            return value;
+      }
+   };
+   op = undef;
+   return value;
+}
+
+double ExprParser::parse_expr_1()
+{
+   PARSE_BLANKS
+   double value;
+
+   unary_operator op = parse_unary_operator();
+   PARSE_BLANKS
+
+   if (*reading_stream == '\0')
+   {
+     // end of string
+     this->failed_ = true;
+     return 0;
+   }
+   else if (*reading_stream > 47 && *reading_stream < 59 || *reading_stream == 46)
+   {  // number
+      value = strtod(reading_stream, const_cast<char**>(&reading_stream));
+   }
+   else if (*reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
+   {  // variable or function
+      char* word = new char[256];
+      parse_word(word);
+      PARSE_BLANKS
+      if (*reading_stream == '(')
+      {
+         ++reading_stream;
+#define SWITCH word
+         CASE_1("sin")
+            value = sin(parse_last_argument());
+         CASE("asin")
+            value = asin(parse_last_argument());
+         CASE("sinh")
+            value = sinh(parse_last_argument());
+         CASE("asinh")
+         {
+            value = parse_last_argument();
+            value = log(sqrt(pow(value, 2) + 1) + value);
+         }
+         CASE("cos")
+            value = cos(parse_last_argument());
+         CASE("acos")
+            value = acos(parse_last_argument());
+         CASE("cosh")
+            value = cosh(parse_last_argument());
+         CASE("acosh")
+         {
+            value = parse_last_argument();
+            value = log(sqrt(pow(value, 2) - 1) + value);
+         }
+         CASE("tan")
+            value = tan(parse_last_argument());
+         CASE("atan")
+            value = atan(parse_last_argument());
+         CASE("atan2")
+            value = atan2(parse_argument(),parse_last_argument());
+         CASE("tanh")
+            value = tanh(parse_last_argument());
+         CASE("atanh")
+         {
+            value = parse_last_argument();
+            value = 0.5*log((value + 1)/(value - 1));
+         }
+         CASE("int")
+            value = floor(parse_last_argument());
+         CASE("floor")
+            value = floor(parse_last_argument());
+         CASE("ceil")
+            value = ceil(parse_last_argument());
+         CASE("abs")
+            value = fabs(parse_last_argument());
+         CASE("exp")
+            value = exp(parse_last_argument());
+         CASE("log")
+            value = log10(parse_last_argument());
+         CASE("ln")
+            value = log(parse_last_argument());
+         CASE("sign")
+         {
+            value = parse_last_argument();
+            value = (value>0 ? 1 : (value<0 ? -1 : 0));
+         }
+         CASE("sqrt")
+            value = sqrt(parse_last_argument());
+         CASE("degrees")
+            value = parse_last_argument()*180/3.1415926535897932;
+         CASE("radians")
+            value = parse_last_argument()*3.1415926535897932/180;
+         CASE("mod")
+         {
+            value = parse_argument();
+            double value2 = parse_last_argument();
+            value = value - floor(value/value2)*value2;
+         }
+         CASE("pow")
+            value = pow(parse_argument(),parse_last_argument());
+         CASE("div")
+            value = floor(parse_argument()/parse_last_argument());
+         CASE("max")
+           value = std::max(parse_argument(),parse_last_argument());
+         CASE("min")
+           value = std::min(parse_argument(),parse_last_argument());
+         CASE_ELSE
+         {
+           this->failed_ = true;
+           delete[] word;
+           return 0;
+         }
+      }
+      else
+      {
+#define SWITCH word
+         CASE_1("pi")
+           value = 3.1415926535897932;
+         CASE("e")
+           value = 2.7182818284590452;
+         CASE_ELSE
+         {
+           this->failed_ = true;
+           delete[] word;
+           return 0;
+         }
+      }
+      delete[] word;
+   }
+   else if (*reading_stream == 40)
+   {  // expresion in paranthesis
+      ++reading_stream;
+      value = parse_last_argument();
+   }
+   else
+   {
+     this->failed_ = true;
+     return 0;
+   }
+
+   PARSE_BLANKS
+   switch (op)
+   {
+      case u_nicht: return !value;
+      case u_plus:  return  value;
+      case u_minus: return -value;
+      default:
+        {
+          this->failed_ = true;
+          return 0;
+        }
+   }
+}
+
+char* ExprParser::parse_word(char* str)
+{
+   char* word = str;
+   int counter = 0;
+   while (*reading_stream > 47 && *reading_stream < 58 || *reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
+   {
+      *word++ = *reading_stream++;
+      counter++;
+      if (counter > 255)
+      {
+        this->failed_ = true;
+        return '\0';
+      }
+   };
+   *word = '\0';
+   return str;
+}
+
+ExprParser::binary_operator ExprParser::parse_binary_operator()
+{
+   binary_operator op;
+   switch (*reading_stream)
+   {
+      case '+': op = b_plus; break;
+      case '-': op = b_minus; break;
+      case '*': op = mal; break;
+      case '/': op = durch; break;
+      case '^': op = hoch; break;
+      case '%': op = modulo; break;
+      case '&': op = und; break;
+      case '|': op = oder; break;
+      case '=': op = gleich; break;
+      case '!': op = b_nicht; break;
+      case '<': op = kleiner; break;
+      case '>': op = groesser; break;
+      default: return undef;
+   }
+   if (*++reading_stream == '=')
+   {
+      if (op > 9)
+      {
+         ++reading_stream;
+         return (binary_operator)(op + 3);
+      }
+      else
+      {
+         --reading_stream;
+         return undef;
+      }
+   }
+   else
+      return op;
+}
+
+ExprParser::unary_operator ExprParser::parse_unary_operator()
+{
+   switch (*reading_stream)
+   {
+      case '!':
+         ++reading_stream;
+         return u_nicht;
+      case '+':
+         ++reading_stream;
+         return u_plus;
+      case '-':
+         ++reading_stream;
+         return u_minus;
+      default :
+         return u_plus;
+   }
+}
Index: /code/branches/network/src/util/ExprParser.h
===================================================================
--- /code/branches/network/src/util/ExprParser.h	(revision 1494)
+++ /code/branches/network/src/util/ExprParser.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -30,3 +31,77 @@
   @brief Declaration of FloatParser
 */
-#ifndef _FloatParser_H__#define _FloatParser_H__#include "UtilPrereqs.h"#include <string>class _UtilExport ExprParser{public:  enum binary_operator  {    b_plus,    b_minus,    mal,    durch,    modulo,    hoch,    undef,    oder,    und,    gleich,    b_nicht,    kleiner,    groesser,    ungleich,    kleinergleich,    groessergleich  };  enum unary_operator  {    u_plus,    u_minus,    u_nicht  };  ExprParser(const std::string& str);  std::string& getRemains() { return  this->remains_; }  double       getResult()  { return  this->result_; }  bool         getSuccess() { return !this->failed_; }private:  double parse_expr_1();  double parse_expr_2();  double parse_expr_3();  double parse_expr_4();  double parse_expr_5();  double parse_expr_6();  double parse_expr_7();  double parse_expr_8();  char* parse_word(char* str);  binary_operator parse_binary_operator();  unary_operator parse_unary_operator();  double parse_argument();  double parse_last_argument();  binary_operator op;  const char* reading_stream;  bool failed_;  double result_;  std::string remains_;};//Endzeichen für float expression: ')', '}', ']', ',', ';'_UtilExport bool parse_float(char* const, char**, double*);//Endzeichen angegeben_UtilExport bool parse_float(char* const, char**, char, double*);//Letzter Teil-float eines Vektors parsen (keine Vergleichs- und Logikoperationen)_UtilExport bool parse_vector_float(char* const, char**, bool, double*);#endif /* _FloatParser_H__ */
+
+#ifndef _FloatParser_H__
+#define _FloatParser_H__
+
+#include "UtilPrereqs.h"
+#include <string>
+
+class _UtilExport ExprParser
+{
+public:
+  enum binary_operator
+  {
+    b_plus,
+    b_minus,
+    mal,
+    durch,
+    modulo,
+    hoch,
+    undef,
+    oder,
+    und,
+    gleich,
+    b_nicht,
+    kleiner,
+    groesser,
+    ungleich,
+    kleinergleich,
+    groessergleich
+  };
+
+  enum unary_operator
+  {
+    u_plus,
+    u_minus,
+    u_nicht
+  };
+
+
+  ExprParser(const std::string& str);
+  std::string& getRemains() { return  this->remains_; }
+  double       getResult()  { return  this->result_; }
+  bool         getSuccess() { return !this->failed_; }
+
+private:
+  double parse_expr_1();
+  double parse_expr_2();
+  double parse_expr_3();
+  double parse_expr_4();
+  double parse_expr_5();
+  double parse_expr_6();
+  double parse_expr_7();
+  double parse_expr_8();
+  char* parse_word(char* str);
+  binary_operator parse_binary_operator();
+  unary_operator parse_unary_operator();
+
+  double parse_argument();
+  double parse_last_argument();
+
+  binary_operator op;
+  const char* reading_stream;
+  bool failed_;
+  double result_;
+  std::string remains_;
+
+};
+
+//Endzeichen für float expression: ')', '}', ']', ',', ';'
+_UtilExport bool parse_float(char* const, char**, double*);
+//Endzeichen angegeben
+_UtilExport bool parse_float(char* const, char**, char, double*);
+//Letzter Teil-float eines Vektors parsen (keine Vergleichs- und Logikoperationen)
+_UtilExport bool parse_vector_float(char* const, char**, bool, double*);
+
+#endif /* _FloatParser_H__ */
Index: /code/branches/network/src/util/MultiTypeMath.h
===================================================================
--- /code/branches/network/src/util/MultiTypeMath.h	(revision 1494)
+++ /code/branches/network/src/util/MultiTypeMath.h	(revision 1495)
@@ -1,8 +1,194 @@
-/* *   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: *      Fabian 'x3n' Landau *   Co-authors: *      ... * *   Inspiration: MultiType by Benjamin Grauer */#ifndef _MultiTypeMath_H__#define _MultiTypeMath_H__#include "UtilPrereqs.h"#include "MultiTypeString.h"#include "Math.h"// disable annoying warning about multiple assignment operators
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ *   Inspiration: MultiType by Benjamin Grauer
+ */
+
+#ifndef _MultiTypeMath_H__
+#define _MultiTypeMath_H__
+
+#include "UtilPrereqs.h"
+
+#include "MultiTypeString.h"
+#include "Math.h"
+
+// disable annoying warning about multiple assignment operators
 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
 #pragma warning(push)
 #pragma warning(disable:4522)
 #endif
-class _UtilExport MultiTypeMath : public MultiTypeString{    public:        MultiTypeMath(MultiType type = MT_null);        inline MultiTypeMath(void*          value) : MultiTypeString(value) {}        inline MultiTypeMath(int            value) : MultiTypeString(value) {}        inline MultiTypeMath(unsigned int   value) : MultiTypeString(value) {}        inline MultiTypeMath(char           value) : MultiTypeString(value) {}        inline MultiTypeMath(unsigned char  value) : MultiTypeString(value) {}        inline MultiTypeMath(short          value) : MultiTypeString(value) {}        inline MultiTypeMath(unsigned short value) : MultiTypeString(value) {}        inline MultiTypeMath(long           value) : MultiTypeString(value) {}        inline MultiTypeMath(unsigned long  value) : MultiTypeString(value) {}        inline MultiTypeMath(float          value) : MultiTypeString(value) {}        inline MultiTypeMath(double         value) : MultiTypeString(value) {}        inline MultiTypeMath(long double    value) : MultiTypeString(value) {}        inline MultiTypeMath(bool           value) : MultiTypeString(value) {}        inline MultiTypeMath(const char*             value) : MultiTypeString(value) {}        inline MultiTypeMath(const std::string&      value) : MultiTypeString(value) {}        inline MultiTypeMath(const orxonox::Vector2&     value) { this->setValue(value); }        inline MultiTypeMath(const orxonox::Vector3&     value) { this->setValue(value); }        inline MultiTypeMath(const orxonox::Vector4&     value) { this->setValue(value); }        inline MultiTypeMath(const orxonox::ColourValue& value) { this->setValue(value); }        inline MultiTypeMath(const orxonox::Quaternion&  value) { this->setValue(value); }        inline MultiTypeMath(const orxonox::Radian&      value) { this->setValue(value); }        inline MultiTypeMath(const orxonox::Degree&      value) { this->setValue(value); }        inline MultiTypeMath(const MultiTypeMath& mtm)          { this->setValue(mtm);   }        inline MultiTypeMath(const MultiTypeString& mts)        { this->setValue(mts);   }        inline MultiTypeMath(const MultiTypePrimitive& mtp)     { this->setValue(mtp);   }        virtual inline ~MultiTypeMath() {}        using MultiTypeString::operator=;        inline MultiTypeMath& operator=(const orxonox::Vector2&     value) { this->setValue(value); return *this; }        inline MultiTypeMath& operator=(const orxonox::Vector3&     value) { this->setValue(value); return *this; }        inline MultiTypeMath& operator=(const orxonox::Vector4&     value) { this->setValue(value); return *this; }        inline MultiTypeMath& operator=(const orxonox::ColourValue& value) { this->setValue(value); return *this; }        inline MultiTypeMath& operator=(const orxonox::Quaternion&  value) { this->setValue(value); return *this; }        inline MultiTypeMath& operator=(const orxonox::Radian&      value) { this->setValue(value); return *this; }        inline MultiTypeMath& operator=(const orxonox::Degree&      value) { this->setValue(value); return *this; }        inline MultiTypeMath& operator=(const MultiTypeMath& mtm)          { this->setValue(mtm);   return *this; }        inline MultiTypeMath& operator=(const MultiTypeString& mts)        { this->setValue(mts);   return *this; }        inline MultiTypeMath& operator=(const MultiTypePrimitive mtp)      { this->setValue(mtp);   return *this; }        using MultiTypeString::operator==;        inline bool operator==(const orxonox::Vector2&     value) const { return (this->vector2_     == value); }        inline bool operator==(const orxonox::Vector3&     value) const { return (this->vector3_     == value); }        inline bool operator==(const orxonox::Vector4&     value) const { return (this->vector4_     == value); }        inline bool operator==(const orxonox::ColourValue& value) const { return (this->colourvalue_ == value); }        inline bool operator==(const orxonox::Quaternion&  value) const { return (this->quaternion_  == value); }        inline bool operator==(const orxonox::Radian&      value) const { return (this->radian_      == value); }        inline bool operator==(const orxonox::Degree&      value) const { return (this->degree_      == value); }        bool operator==(const MultiTypeMath& mtm) const;        bool operator==(const MultiTypeString& mts) const;        bool operator==(const MultiTypePrimitive& mtp) const;        using MultiTypeString::operator!=;        inline bool operator!=(const orxonox::Vector2&     value) const { return (this->vector2_     != value); }        inline bool operator!=(const orxonox::Vector3&     value) const { return (this->vector3_     != value); }        inline bool operator!=(const orxonox::Vector4&     value) const { return (this->vector4_     != value); }        inline bool operator!=(const orxonox::ColourValue& value) const { return (this->colourvalue_ != value); }        inline bool operator!=(const orxonox::Quaternion&  value) const { return (this->quaternion_  != value); }        inline bool operator!=(const orxonox::Radian&      value) const { return (this->radian_      != value); }        inline bool operator!=(const orxonox::Degree&      value) const { return (this->degree_      != value); }        bool operator!=(const MultiTypeMath& mtm) const;        bool operator!=(const MultiTypeString& mts) const;        bool operator!=(const MultiTypePrimitive& mtp) const;        virtual operator void*()                const;        virtual operator int()                  const;        virtual operator unsigned int()         const;        virtual operator char()                 const;        virtual operator unsigned char()        const;        virtual operator short()                const;        virtual operator unsigned short()       const;        virtual operator long()                 const;        virtual operator unsigned long()        const;        virtual operator float ()               const;        virtual operator double ()              const;        virtual operator long double()          const;        virtual operator bool()                 const;        virtual operator std::string()          const;        virtual operator const char*()          const;        virtual operator orxonox::Vector2()     const;        virtual operator orxonox::Vector3()     const;        virtual operator orxonox::Vector4()     const;        virtual operator orxonox::ColourValue() const;        virtual operator orxonox::Quaternion()  const;        virtual operator orxonox::Radian()      const;        virtual operator orxonox::Degree()      const;        using MultiTypeString::setValue;        inline void setValue(const orxonox::Vector2&     value) { this->type_ = MT_vector2;     this->vector2_     = value; }        inline void setValue(const orxonox::Vector3&     value) { this->type_ = MT_vector3;     this->vector3_     = value; }        inline void setValue(const orxonox::Vector4&     value) { this->type_ = MT_vector4;     this->vector4_     = value; }        inline void setValue(const orxonox::ColourValue& value) { this->type_ = MT_colourvalue; this->colourvalue_ = value; }        inline void setValue(const orxonox::Quaternion&  value) { this->type_ = MT_quaternion;  this->quaternion_  = value; }        inline void setValue(const orxonox::Radian&      value) { this->type_ = MT_radian;      this->radian_      = value; }        inline void setValue(const orxonox::Degree&      value) { this->type_ = MT_degree;      this->degree_      = value; }        void setValue(const MultiTypeMath& mtm);        void setValue(const MultiTypeString& mts);        void setValue(const MultiTypePrimitive& mtp);        inline orxonox::Vector2     getVector2()     const { return this->vector2_;     }        inline orxonox::Vector3     getVector3()     const { return this->vector3_;     }        inline orxonox::Vector4     getVector4()     const { return this->vector4_;     }        inline orxonox::ColourValue getColourValue() const { return this->colourvalue_; }        inline orxonox::Quaternion  getQuaternion()  const { return this->quaternion_;  }        inline orxonox::Radian      getRadian()      const { return this->radian_;      }        inline orxonox::Degree      getDegree()      const { return this->degree_;      }        inline orxonox::Vector2&     getVector2()     { return this->vector2_;     }        inline orxonox::Vector3&     getVector3()     { return this->vector3_;     }        inline orxonox::Vector4&     getVector4()     { return this->vector4_;     }        inline orxonox::ColourValue& getColourValue() { return this->colourvalue_; }        inline orxonox::Quaternion&  getQuaternion()  { return this->quaternion_;  }        inline orxonox::Radian&      getRadian()      { return this->radian_;      }        inline orxonox::Degree&      getDegree()      { return this->degree_;      }        using MultiTypeString::getValue;        inline void getValue(orxonox::Vector2*     variable) const { (*variable) = orxonox::Vector2     (this->vector2_);     }        inline void getValue(orxonox::Vector3*     variable) const { (*variable) = orxonox::Vector3     (this->vector3_);     }        inline void getValue(orxonox::Vector4*     variable) const { (*variable) = orxonox::Vector4     (this->vector4_);     }        inline void getValue(orxonox::ColourValue* variable) const { (*variable) = orxonox::ColourValue (this->colourvalue_); }        inline void getValue(orxonox::Quaternion*  variable) const { (*variable) = orxonox::Quaternion  (this->quaternion_);  }        inline void getValue(orxonox::Radian*      variable) const { (*variable) = orxonox::Radian      (this->radian_);      }        inline void getValue(orxonox::Degree*      variable) const { (*variable) = orxonox::Degree      (this->degree_);      }        virtual std::string getTypename() const;        virtual std::string toString() const;        virtual bool fromString(const std::string value);        virtual bool assimilate(const MultiTypeMath& mtm, const MultiTypeMath& defvalue = MultiTypeMath());    protected:        orxonox::Vector2      vector2_;        orxonox::Vector3      vector3_;        orxonox::Vector4      vector4_;        orxonox::ColourValue  colourvalue_;        orxonox::Quaternion   quaternion_;        orxonox::Radian       radian_;        orxonox::Degree       degree_;};_UtilExport std::ostream& operator<<(std::ostream& out, MultiTypeMath& mtm);#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+
+class _UtilExport MultiTypeMath : public MultiTypeString
+{
+    public:
+        MultiTypeMath(MultiType type = MT_null);
+        inline MultiTypeMath(void*          value) : MultiTypeString(value) {}
+        inline MultiTypeMath(int            value) : MultiTypeString(value) {}
+        inline MultiTypeMath(unsigned int   value) : MultiTypeString(value) {}
+        inline MultiTypeMath(char           value) : MultiTypeString(value) {}
+        inline MultiTypeMath(unsigned char  value) : MultiTypeString(value) {}
+        inline MultiTypeMath(short          value) : MultiTypeString(value) {}
+        inline MultiTypeMath(unsigned short value) : MultiTypeString(value) {}
+        inline MultiTypeMath(long           value) : MultiTypeString(value) {}
+        inline MultiTypeMath(unsigned long  value) : MultiTypeString(value) {}
+        inline MultiTypeMath(float          value) : MultiTypeString(value) {}
+        inline MultiTypeMath(double         value) : MultiTypeString(value) {}
+        inline MultiTypeMath(long double    value) : MultiTypeString(value) {}
+        inline MultiTypeMath(bool           value) : MultiTypeString(value) {}
+        inline MultiTypeMath(const char*             value) : MultiTypeString(value) {}
+        inline MultiTypeMath(const std::string&      value) : MultiTypeString(value) {}
+        inline MultiTypeMath(const orxonox::Vector2&     value) { this->setValue(value); }
+        inline MultiTypeMath(const orxonox::Vector3&     value) { this->setValue(value); }
+        inline MultiTypeMath(const orxonox::Vector4&     value) { this->setValue(value); }
+        inline MultiTypeMath(const orxonox::ColourValue& value) { this->setValue(value); }
+        inline MultiTypeMath(const orxonox::Quaternion&  value) { this->setValue(value); }
+        inline MultiTypeMath(const orxonox::Radian&      value) { this->setValue(value); }
+        inline MultiTypeMath(const orxonox::Degree&      value) { this->setValue(value); }
+        inline MultiTypeMath(const MultiTypeMath& mtm)          { this->setValue(mtm);   }
+        inline MultiTypeMath(const MultiTypeString& mts)        { this->setValue(mts);   }
+        inline MultiTypeMath(const MultiTypePrimitive& mtp)     { this->setValue(mtp);   }
+        virtual inline ~MultiTypeMath() {}
+
+        using MultiTypeString::operator=;
+        inline MultiTypeMath& operator=(const orxonox::Vector2&     value) { this->setValue(value); return *this; }
+        inline MultiTypeMath& operator=(const orxonox::Vector3&     value) { this->setValue(value); return *this; }
+        inline MultiTypeMath& operator=(const orxonox::Vector4&     value) { this->setValue(value); return *this; }
+        inline MultiTypeMath& operator=(const orxonox::ColourValue& value) { this->setValue(value); return *this; }
+        inline MultiTypeMath& operator=(const orxonox::Quaternion&  value) { this->setValue(value); return *this; }
+        inline MultiTypeMath& operator=(const orxonox::Radian&      value) { this->setValue(value); return *this; }
+        inline MultiTypeMath& operator=(const orxonox::Degree&      value) { this->setValue(value); return *this; }
+        inline MultiTypeMath& operator=(const MultiTypeMath& mtm)          { this->setValue(mtm);   return *this; }
+        inline MultiTypeMath& operator=(const MultiTypeString& mts)        { this->setValue(mts);   return *this; }
+        inline MultiTypeMath& operator=(const MultiTypePrimitive mtp)      { this->setValue(mtp);   return *this; }
+
+        using MultiTypeString::operator==;
+        inline bool operator==(const orxonox::Vector2&     value) const { return (this->vector2_     == value); }
+        inline bool operator==(const orxonox::Vector3&     value) const { return (this->vector3_     == value); }
+        inline bool operator==(const orxonox::Vector4&     value) const { return (this->vector4_     == value); }
+        inline bool operator==(const orxonox::ColourValue& value) const { return (this->colourvalue_ == value); }
+        inline bool operator==(const orxonox::Quaternion&  value) const { return (this->quaternion_  == value); }
+        inline bool operator==(const orxonox::Radian&      value) const { return (this->radian_      == value); }
+        inline bool operator==(const orxonox::Degree&      value) const { return (this->degree_      == value); }
+        bool operator==(const MultiTypeMath& mtm) const;
+        bool operator==(const MultiTypeString& mts) const;
+        bool operator==(const MultiTypePrimitive& mtp) const;
+
+        using MultiTypeString::operator!=;
+        inline bool operator!=(const orxonox::Vector2&     value) const { return (this->vector2_     != value); }
+        inline bool operator!=(const orxonox::Vector3&     value) const { return (this->vector3_     != value); }
+        inline bool operator!=(const orxonox::Vector4&     value) const { return (this->vector4_     != value); }
+        inline bool operator!=(const orxonox::ColourValue& value) const { return (this->colourvalue_ != value); }
+        inline bool operator!=(const orxonox::Quaternion&  value) const { return (this->quaternion_  != value); }
+        inline bool operator!=(const orxonox::Radian&      value) const { return (this->radian_      != value); }
+        inline bool operator!=(const orxonox::Degree&      value) const { return (this->degree_      != value); }
+        bool operator!=(const MultiTypeMath& mtm) const;
+        bool operator!=(const MultiTypeString& mts) const;
+        bool operator!=(const MultiTypePrimitive& mtp) const;
+
+        virtual operator void*()                const;
+        virtual operator int()                  const;
+        virtual operator unsigned int()         const;
+        virtual operator char()                 const;
+        virtual operator unsigned char()        const;
+        virtual operator short()                const;
+        virtual operator unsigned short()       const;
+        virtual operator long()                 const;
+        virtual operator unsigned long()        const;
+        virtual operator float ()               const;
+        virtual operator double ()              const;
+        virtual operator long double()          const;
+        virtual operator bool()                 const;
+        virtual operator std::string()          const;
+        virtual operator const char*()          const;
+        virtual operator orxonox::Vector2()     const;
+        virtual operator orxonox::Vector3()     const;
+        virtual operator orxonox::Vector4()     const;
+        virtual operator orxonox::ColourValue() const;
+        virtual operator orxonox::Quaternion()  const;
+        virtual operator orxonox::Radian()      const;
+        virtual operator orxonox::Degree()      const;
+
+        using MultiTypeString::setValue;
+        inline void setValue(const orxonox::Vector2&     value) { this->type_ = MT_vector2;     this->vector2_     = value; }
+        inline void setValue(const orxonox::Vector3&     value) { this->type_ = MT_vector3;     this->vector3_     = value; }
+        inline void setValue(const orxonox::Vector4&     value) { this->type_ = MT_vector4;     this->vector4_     = value; }
+        inline void setValue(const orxonox::ColourValue& value) { this->type_ = MT_colourvalue; this->colourvalue_ = value; }
+        inline void setValue(const orxonox::Quaternion&  value) { this->type_ = MT_quaternion;  this->quaternion_  = value; }
+        inline void setValue(const orxonox::Radian&      value) { this->type_ = MT_radian;      this->radian_      = value; }
+        inline void setValue(const orxonox::Degree&      value) { this->type_ = MT_degree;      this->degree_      = value; }
+        void setValue(const MultiTypeMath& mtm);
+        void setValue(const MultiTypeString& mts);
+        void setValue(const MultiTypePrimitive& mtp);
+
+        inline orxonox::Vector2     getVector2()     const { return this->vector2_;     }
+        inline orxonox::Vector3     getVector3()     const { return this->vector3_;     }
+        inline orxonox::Vector4     getVector4()     const { return this->vector4_;     }
+        inline orxonox::ColourValue getColourValue() const { return this->colourvalue_; }
+        inline orxonox::Quaternion  getQuaternion()  const { return this->quaternion_;  }
+        inline orxonox::Radian      getRadian()      const { return this->radian_;      }
+        inline orxonox::Degree      getDegree()      const { return this->degree_;      }
+
+        inline orxonox::Vector2&     getVector2()     { return this->vector2_;     }
+        inline orxonox::Vector3&     getVector3()     { return this->vector3_;     }
+        inline orxonox::Vector4&     getVector4()     { return this->vector4_;     }
+        inline orxonox::ColourValue& getColourValue() { return this->colourvalue_; }
+        inline orxonox::Quaternion&  getQuaternion()  { return this->quaternion_;  }
+        inline orxonox::Radian&      getRadian()      { return this->radian_;      }
+        inline orxonox::Degree&      getDegree()      { return this->degree_;      }
+
+        using MultiTypeString::getValue;
+        inline void getValue(orxonox::Vector2*     variable) const { (*variable) = orxonox::Vector2     (this->vector2_);     }
+        inline void getValue(orxonox::Vector3*     variable) const { (*variable) = orxonox::Vector3     (this->vector3_);     }
+        inline void getValue(orxonox::Vector4*     variable) const { (*variable) = orxonox::Vector4     (this->vector4_);     }
+        inline void getValue(orxonox::ColourValue* variable) const { (*variable) = orxonox::ColourValue (this->colourvalue_); }
+        inline void getValue(orxonox::Quaternion*  variable) const { (*variable) = orxonox::Quaternion  (this->quaternion_);  }
+        inline void getValue(orxonox::Radian*      variable) const { (*variable) = orxonox::Radian      (this->radian_);      }
+        inline void getValue(orxonox::Degree*      variable) const { (*variable) = orxonox::Degree      (this->degree_);      }
+
+        virtual std::string getTypename() const;
+
+        virtual std::string toString() const;
+        virtual bool fromString(const std::string value);
+
+        virtual bool assimilate(const MultiTypeMath& mtm, const MultiTypeMath& defvalue = MultiTypeMath());
+
+    protected:
+        orxonox::Vector2      vector2_;
+        orxonox::Vector3      vector3_;
+        orxonox::Vector4      vector4_;
+        orxonox::ColourValue  colourvalue_;
+        orxonox::Quaternion   quaternion_;
+        orxonox::Radian       radian_;
+        orxonox::Degree       degree_;
+};
+
+_UtilExport std::ostream& operator<<(std::ostream& out, MultiTypeMath& mtm);
+
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
 #pragma warning(pop)
-#endif#endif /* _MultiTypeMath_H__ */
+#endif
+
+#endif /* _MultiTypeMath_H__ */
Index: /code/branches/network/src/util/MultiTypeString.h
===================================================================
--- /code/branches/network/src/util/MultiTypeString.h	(revision 1494)
+++ /code/branches/network/src/util/MultiTypeString.h	(revision 1495)
@@ -1,8 +1,136 @@
-/* *   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: *      Fabian 'x3n' Landau *   Co-authors: *      ... * *   Inspiration: MultiType by Benjamin Grauer */#ifndef _MultiTypeString_H__#define _MultiTypeString_H__#include "UtilPrereqs.h"#include <string>#include <iostream>#include "MultiTypePrimitive.h"// disable annoying warning about multiple assignment operators
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ *   Inspiration: MultiType by Benjamin Grauer
+ */
+
+#ifndef _MultiTypeString_H__
+#define _MultiTypeString_H__
+
+#include "UtilPrereqs.h"
+
+#include <string>
+#include <iostream>
+
+#include "MultiTypePrimitive.h"
+
+// disable annoying warning about multiple assignment operators
 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
 #pragma warning(push)
 #pragma warning(disable:4522)
 #endif
-class _UtilExport MultiTypeString : public MultiTypePrimitive{    public:        MultiTypeString(MultiType type = MT_null);        inline MultiTypeString(void*          value) : MultiTypePrimitive(value) {}        inline MultiTypeString(int            value) : MultiTypePrimitive(value) {}        inline MultiTypeString(unsigned int   value) : MultiTypePrimitive(value) {}        inline MultiTypeString(char           value) : MultiTypePrimitive(value) {}        inline MultiTypeString(unsigned char  value) : MultiTypePrimitive(value) {}        inline MultiTypeString(short          value) : MultiTypePrimitive(value) {}        inline MultiTypeString(unsigned short value) : MultiTypePrimitive(value) {}        inline MultiTypeString(long           value) : MultiTypePrimitive(value) {}        inline MultiTypeString(unsigned long  value) : MultiTypePrimitive(value) {}        inline MultiTypeString(float          value) : MultiTypePrimitive(value) {}        inline MultiTypeString(double         value) : MultiTypePrimitive(value) {}        inline MultiTypeString(long double    value) : MultiTypePrimitive(value) {}        inline MultiTypeString(bool           value) : MultiTypePrimitive(value) {}        inline MultiTypeString(const char*             value) { this->setValue(value); }        inline MultiTypeString(const std::string&      value) { this->setValue(value); }        inline MultiTypeString(const MultiTypeString&    mts)  { this->setValue(mts);   }        inline MultiTypeString(const MultiTypePrimitive& mtp)  { this->setValue(mtp);   }        virtual inline ~MultiTypeString() {}        using MultiTypePrimitive::operator=;        inline MultiTypeString& operator=(const char*             value) { this->setValue(value); return *this; }        inline MultiTypeString& operator=(const std::string&      value) { this->setValue(value); return *this; }        inline MultiTypeString& operator=(const MultiTypeString&    mts) { this->setValue(mts);   return *this; }        inline MultiTypeString& operator=(const MultiTypePrimitive& mtp) { this->setValue(mtp);   return *this; }        using MultiTypePrimitive::operator==;        inline bool operator==(const char*        value) const { return (this->string_ == std::string(value)); }        inline bool operator==(const std::string& value) const { return (this->string_ == value);              }        bool operator==(const MultiTypeString&    mts) const;        bool operator==(const MultiTypePrimitive& mtp) const;        using MultiTypePrimitive::operator!=;        inline bool operator!=(const char*        value) const { return (this->string_ != std::string(value)); }        inline bool operator!=(const std::string& value) const { return (this->string_ != value);              }        bool operator!=(const MultiTypeString&    mts) const;        bool operator!=(const MultiTypePrimitive& mtp) const;        virtual operator void*()          const;        virtual operator int()            const;        virtual operator unsigned int()   const;        virtual operator char()           const;        virtual operator unsigned char()  const;        virtual operator short()          const;        virtual operator unsigned short() const;        virtual operator long()           const;        virtual operator unsigned long()  const;        virtual operator float ()         const;        virtual operator double ()        const;        virtual operator long double()    const;        virtual operator bool()           const;        virtual operator std::string()    const;        virtual operator const char*()    const;        using MultiTypePrimitive::setValue;        inline void setValue(const char*        value) { this->type_ = MT_string; this->string_ = std::string(value); }        inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_ = value;              }        void setValue(const MultiTypeString&    mts);        void setValue(const MultiTypePrimitive& mtp);        inline std::string getString()     const { return this->string_;         }        inline const char*  getConstChar() const { return this->string_.c_str(); }        inline std::string& getString()    { return this->string_;         }        inline const char*  getConstChar() { return this->string_.c_str(); }        using MultiTypePrimitive::getValue;        inline void getValue(std::string* variable) const { (*variable) = this->string_;         }        inline void getValue(const char** variable) const { (*variable) = this->string_.c_str(); }        virtual std::string getTypename() const;        virtual std::string toString() const;        virtual bool fromString(const std::string value);        virtual bool assimilate(const MultiTypeString& mts, const MultiTypeString& defvalue = MultiTypeString());    protected:        std::string      string_;};_UtilExport std::ostream& operator<<(std::ostream& out, MultiTypeString& mts);#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+
+class _UtilExport MultiTypeString : public MultiTypePrimitive
+{
+    public:
+        MultiTypeString(MultiType type = MT_null);
+        inline MultiTypeString(void*          value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(int            value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(unsigned int   value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(char           value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(unsigned char  value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(short          value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(unsigned short value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(long           value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(unsigned long  value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(float          value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(double         value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(long double    value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(bool           value) : MultiTypePrimitive(value) {}
+        inline MultiTypeString(const char*             value) { this->setValue(value); }
+        inline MultiTypeString(const std::string&      value) { this->setValue(value); }
+        inline MultiTypeString(const MultiTypeString&    mts)  { this->setValue(mts);   }
+        inline MultiTypeString(const MultiTypePrimitive& mtp)  { this->setValue(mtp);   }
+        virtual inline ~MultiTypeString() {}
+
+        using MultiTypePrimitive::operator=;
+        inline MultiTypeString& operator=(const char*             value) { this->setValue(value); return *this; }
+        inline MultiTypeString& operator=(const std::string&      value) { this->setValue(value); return *this; }
+        inline MultiTypeString& operator=(const MultiTypeString&    mts) { this->setValue(mts);   return *this; }
+        inline MultiTypeString& operator=(const MultiTypePrimitive& mtp) { this->setValue(mtp);   return *this; }
+
+        using MultiTypePrimitive::operator==;
+        inline bool operator==(const char*        value) const { return (this->string_ == std::string(value)); }
+        inline bool operator==(const std::string& value) const { return (this->string_ == value);              }
+        bool operator==(const MultiTypeString&    mts) const;
+        bool operator==(const MultiTypePrimitive& mtp) const;
+
+        using MultiTypePrimitive::operator!=;
+        inline bool operator!=(const char*        value) const { return (this->string_ != std::string(value)); }
+        inline bool operator!=(const std::string& value) const { return (this->string_ != value);              }
+        bool operator!=(const MultiTypeString&    mts) const;
+        bool operator!=(const MultiTypePrimitive& mtp) const;
+
+        virtual operator void*()          const;
+        virtual operator int()            const;
+        virtual operator unsigned int()   const;
+        virtual operator char()           const;
+        virtual operator unsigned char()  const;
+        virtual operator short()          const;
+        virtual operator unsigned short() const;
+        virtual operator long()           const;
+        virtual operator unsigned long()  const;
+        virtual operator float ()         const;
+        virtual operator double ()        const;
+        virtual operator long double()    const;
+        virtual operator bool()           const;
+        virtual operator std::string()    const;
+        virtual operator const char*()    const;
+
+        using MultiTypePrimitive::setValue;
+        inline void setValue(const char*        value) { this->type_ = MT_string; this->string_ = std::string(value); }
+        inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_ = value;              }
+        void setValue(const MultiTypeString&    mts);
+        void setValue(const MultiTypePrimitive& mtp);
+
+        inline std::string getString()     const { return this->string_;         }
+        inline const char*  getConstChar() const { return this->string_.c_str(); }
+
+        inline std::string& getString()    { return this->string_;         }
+        inline const char*  getConstChar() { return this->string_.c_str(); }
+
+        using MultiTypePrimitive::getValue;
+        inline void getValue(std::string* variable) const { (*variable) = this->string_;         }
+        inline void getValue(const char** variable) const { (*variable) = this->string_.c_str(); }
+
+        virtual std::string getTypename() const;
+
+        virtual std::string toString() const;
+        virtual bool fromString(const std::string value);
+
+        virtual bool assimilate(const MultiTypeString& mts, const MultiTypeString& defvalue = MultiTypeString());
+
+    protected:
+        std::string      string_;
+};
+
+_UtilExport std::ostream& operator<<(std::ostream& out, MultiTypeString& mts);
+
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
 #pragma warning(pop)
-#endif#endif /* _MultiTypeString_H__ */
+#endif
+
+#endif /* _MultiTypeString_H__ */
Index: /code/branches/network/src/util/OrxonoxPlatform.h
===================================================================
--- /code/branches/network/src/util/OrxonoxPlatform.h	(revision 1494)
+++ /code/branches/network/src/util/OrxonoxPlatform.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -25,4 +26,5 @@
  *
  */
+
 /**
  @file
@@ -30,8 +32,167 @@
         copy of the file found in the Ogre source code (OgrePlatform.h).
  */
-#ifndef _OrxonoxPlatform_H__#define _OrxonoxPlatform_H__/* Initial platform/compiler-related stuff to set.*/#define ORXONOX_PLATFORM_WIN32 1#define ORXONOX_PLATFORM_LINUX 2#define ORXONOX_PLATFORM_APPLE 3#define ORXONOX_COMPILER_MSVC 1#define ORXONOX_COMPILER_GNUC 2#define ORXONOX_COMPILER_BORL 3#define ORXONOX_ENDIAN_LITTLE 1#define ORXONOX_ENDIAN_BIG 2#define ORXONOX_ARCHITECTURE_32 1#define ORXONOX_ARCHITECTURE_64 2/* Finds the compiler type and version.*/#if defined( _MSC_VER )#  define ORXONOX_COMPILER ORXONOX_COMPILER_MSVC#  define ORXONOX_COMP_VER _MSC_VER#elif defined( __GNUC__ )#  define ORXONOX_COMPILER ORXONOX_COMPILER_GNUC#  define ORXONOX_COMP_VER (((__GNUC__)*100) + \        (__GNUC_MINOR__*10) + \        __GNUC_PATCHLEVEL__)#elif defined( __BORLANDC__ )#  define ORXONOX_COMPILER ORXONOX_COMPILER_BORL#  define ORXONOX_COMP_VER __BCPLUSPLUS__#else#  pragma error "No known compiler. Abort! Abort!"#endif/* See if we can use __forceinline or if we need to use __inline instead */#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC#  if ORXONOX_COMP_VER >= 1200#    define FORCEINLINE __forceinline#  endif#elif defined(__MINGW32__)#  if !defined(FORCEINLINE)#    define FORCEINLINE __inline#  endif#else#  define FORCEINLINE __inline#endif/* Finds the current platform */#if defined( __WIN32__ ) || defined( _WIN32 )#  define ORXONOX_PLATFORM ORXONOX_PLATFORM_WIN32#elif defined( __APPLE_CC__)#  define ORXONOX_PLATFORM ORXONOX_PLATFORM_APPLE#else#  define ORXONOX_PLATFORM ORXONOX_PLATFORM_LINUX#endif    /* Find the arch type */#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)#  define ORXONOX_ARCH_TYPE ORXONOX_ARCHITECTURE_64#else#  define ORXONOX_ARCH_TYPE ORXONOX_ARCHITECTURE_32#endif// For generating compiler warnings - should work on any compiler// As a side note, if you start your message with 'Warning: ', the MSVC// IDE actually does catch a warning :)// FIXME: Try this on linux box. Doesn't work with msvc//#define ORXONOX_QUOTE_INPLACE(x) # x//#define ORXONOX_QUOTE(x) ORXONOX_QUOTE_INPLACE(x)//#define ORXONOX_WARN( x )  message( __FILE__ "(" QUOTE( __LINE__ ) ") : " x "\n" )//----------------------------------------------------------------------------// Windows Settings#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32// Win32 compilers use _DEBUG for specifying debug builds.#  ifdef _DEBUG#    define ORXONOX_DEBUG_MODE 1#  else#    define ORXONOX_DEBUG_MODE 0#  endif// Disable unicode support on MingW at the moment, poorly supported in stdlibc++// STLPORT fixes this though so allow if found// MinGW C++ Toolkit supports unicode and sets the define __MINGW32_TOOLKIT_UNICODE__ in _mingw.h#  if defined( __MINGW32__ ) && !defined(_STLPORT_VERSION)#    include<_mingw.h>#    if defined(__MINGW32_TOOLBOX_UNICODE__)#      define ORXONOX_UNICODE_SUPPORT 1#    else#      define ORXONOX_UNICODE_SUPPORT 0#    endif#  else#    define ORXONOX_UNICODE_SUPPORT 1#  endif#endif /* Platform Win32 *///----------------------------------------------------------------------------//----------------------------------------------------------------------------// Linux/Apple Settings#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_LINUX || ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE// A quick define to overcome different names for the same function#  define stricmp strcasecmp// Unlike the Win32 compilers, Linux compilers seem to use DEBUG for when// specifying a debug build.// (??? this is wrong, on Linux debug builds aren't marked in any way unless// you mark it yourself any way you like it -- zap ???)#  ifdef DEBUG#    define ORXONOX_DEBUG_MODE 1#  else#    define ORXONOX_DEBUG_MODE 0#  endif/* FIXME: Check what this actually is and whether we need it or not#  if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE#    define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle"#  else// ORXONOX_PLATFORM_LINUX#    define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so"#  endif*/// Always enable unicode support for the moment// Perhaps disable in old versions of gcc if necessary#  define ORXONOX_UNICODE_SUPPORT 1#endif /* Patform Linux/Apple *///For apple, we always have a custom config.h file#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE#  include "config.h"#endif//----------------------------------------------------------------------------//----------------------------------------------------------------------------// Endian Settings// check for BIG_ENDIAN config flag, set ORXONOX_ENDIAN correctly#ifdef ORXONOX_CONFIG_BIG_ENDIAN#  define ORXONOX_ENDIAN ORXONOX_ENDIAN_BIG#else#  define ORXONOX_ENDIAN ORXONOX_ENDIAN_LITTLE#endif//-----------------------------------------------------------------------
+
+#ifndef _OrxonoxPlatform_H__
+#define _OrxonoxPlatform_H__
+
+/* Initial platform/compiler-related stuff to set.
+*/
+#define ORXONOX_PLATFORM_WIN32 1
+#define ORXONOX_PLATFORM_LINUX 2
+#define ORXONOX_PLATFORM_APPLE 3
+
+#define ORXONOX_COMPILER_MSVC 1
+#define ORXONOX_COMPILER_GNUC 2
+#define ORXONOX_COMPILER_BORL 3
+
+#define ORXONOX_ENDIAN_LITTLE 1
+#define ORXONOX_ENDIAN_BIG 2
+
+#define ORXONOX_ARCHITECTURE_32 1
+#define ORXONOX_ARCHITECTURE_64 2
+
+/* Finds the compiler type and version.
+*/
+#if defined( _MSC_VER )
+#  define ORXONOX_COMPILER ORXONOX_COMPILER_MSVC
+#  define ORXONOX_COMP_VER _MSC_VER
+
+#elif defined( __GNUC__ )
+#  define ORXONOX_COMPILER ORXONOX_COMPILER_GNUC
+#  define ORXONOX_COMP_VER (((__GNUC__)*100) + \
+        (__GNUC_MINOR__*10) + \
+        __GNUC_PATCHLEVEL__)
+
+#elif defined( __BORLANDC__ )
+#  define ORXONOX_COMPILER ORXONOX_COMPILER_BORL
+#  define ORXONOX_COMP_VER __BCPLUSPLUS__
+
+#else
+#  pragma error "No known compiler. Abort! Abort!"
+
+#endif
+
+/* See if we can use __forceinline or if we need to use __inline instead */
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+#  if ORXONOX_COMP_VER >= 1200
+#    define FORCEINLINE __forceinline
+#  endif
+#elif defined(__MINGW32__)
+#  if !defined(FORCEINLINE)
+#    define FORCEINLINE __inline
+#  endif
+#else
+#  define FORCEINLINE __inline
+#endif
+
+/* Finds the current platform */
+
+#if defined( __WIN32__ ) || defined( _WIN32 )
+#  define ORXONOX_PLATFORM ORXONOX_PLATFORM_WIN32
+
+#elif defined( __APPLE_CC__)
+#  define ORXONOX_PLATFORM ORXONOX_PLATFORM_APPLE
+
+#else
+#  define ORXONOX_PLATFORM ORXONOX_PLATFORM_LINUX
+#endif
+
+    /* Find the arch type */
+#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
+#  define ORXONOX_ARCH_TYPE ORXONOX_ARCHITECTURE_64
+#else
+#  define ORXONOX_ARCH_TYPE ORXONOX_ARCHITECTURE_32
+#endif
+
+// For generating compiler warnings - should work on any compiler
+// As a side note, if you start your message with 'Warning: ', the MSVC
+// IDE actually does catch a warning :)
+// FIXME: Try this on linux box. Doesn't work with msvc
+//#define ORXONOX_QUOTE_INPLACE(x) # x
+//#define ORXONOX_QUOTE(x) ORXONOX_QUOTE_INPLACE(x)
+//#define ORXONOX_WARN( x )  message( __FILE__ "(" QUOTE( __LINE__ ) ") : " x "\n" )
+
+//----------------------------------------------------------------------------
+// Windows Settings
+#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
+
+// Win32 compilers use _DEBUG for specifying debug builds.
+#  ifdef _DEBUG
+#    define ORXONOX_DEBUG_MODE 1
+#  else
+#    define ORXONOX_DEBUG_MODE 0
+#  endif
+
+// Disable unicode support on MingW at the moment, poorly supported in stdlibc++
+// STLPORT fixes this though so allow if found
+// MinGW C++ Toolkit supports unicode and sets the define __MINGW32_TOOLKIT_UNICODE__ in _mingw.h
+#  if defined( __MINGW32__ ) && !defined(_STLPORT_VERSION)
+#    include<_mingw.h>
+#    if defined(__MINGW32_TOOLBOX_UNICODE__)
+#      define ORXONOX_UNICODE_SUPPORT 1
+#    else
+#      define ORXONOX_UNICODE_SUPPORT 0
+#    endif
+#  else
+#    define ORXONOX_UNICODE_SUPPORT 1
+#  endif
+
+#endif /* Platform Win32 */
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// Linux/Apple Settings
+#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_LINUX || ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
+
+
+// A quick define to overcome different names for the same function
+#  define stricmp strcasecmp
+
+// Unlike the Win32 compilers, Linux compilers seem to use DEBUG for when
+// specifying a debug build.
+// (??? this is wrong, on Linux debug builds aren't marked in any way unless
+// you mark it yourself any way you like it -- zap ???)
+#  ifdef DEBUG
+#    define ORXONOX_DEBUG_MODE 1
+#  else
+#    define ORXONOX_DEBUG_MODE 0
+#  endif
+
+/* FIXME: Check what this actually is and whether we need it or not
+#  if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
+#    define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle"
+#  else
+// ORXONOX_PLATFORM_LINUX
+#    define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so"
+#  endif
+*/
+
+// Always enable unicode support for the moment
+// Perhaps disable in old versions of gcc if necessary
+#  define ORXONOX_UNICODE_SUPPORT 1
+
+#endif /* Patform Linux/Apple */
+
+//For apple, we always have a custom config.h file
+#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
+#  include "config.h"
+#endif
+
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// Endian Settings
+// check for BIG_ENDIAN config flag, set ORXONOX_ENDIAN correctly
+#ifdef ORXONOX_CONFIG_BIG_ENDIAN
+#  define ORXONOX_ENDIAN ORXONOX_ENDIAN_BIG
+#else
+#  define ORXONOX_ENDIAN ORXONOX_ENDIAN_LITTLE
+#endif
+
+//-----------------------------------------------------------------------
 // fixed width integers
 //-----------------------------------------------------------------------
-#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVCtypedef __int8            int8_t;
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+typedef __int8            int8_t;
 typedef __int16           int16_t;
 typedef __int32           int32_t;
@@ -41,3 +202,81 @@
 typedef unsigned __int32  uint32_t;
 typedef unsigned __int64  uint64_t;
-#else# include "inttypes.h"#endifnamespace orxonox {#ifdef ORXONOX_DOUBLE_PRECISIONtypedef double Real;#elsetypedef float Real;#endif}#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC// Turn off warnings generated by long std templates// This warns about truncation to 255 characters in debug/browse info//#   pragma warning (disable : 4786)// Turn off warnings generated by long std templates// This warns about truncation to 255 characters in debug/browse info//#   pragma warning (disable : 4503)// disable: conversion from 'double' to 'float', possible loss of data// disable: conversion from 'ogg_int64_t' to 'long', possible loss of data// This has been dealt with in base_properties of the solution since the// warning primarily occurs in library header files (which are mostly// included before OrxonoxPlatform.h is)//#   pragma warning (disable : 4244)// disable: "conversion from 'size_t' to 'unsigned int', possible loss of data//#   pragma warning (disable : 4267)// disable: "truncation from 'double' to 'float'//#   pragma warning (disable : 4305)// set to level 4: "<type> needs to have dll-interface to be used by clients'// Happens on STL member variables which are not public therefore is ok#   pragma warning (disable : 4251)// disable: 'MultiTypeString' : multiple assignment operators specified// Used in MultiType and works fine so far//#   pragma warning (disable : 4522)// disable: "non dll-interface class used as base for dll-interface class"// Happens when deriving from Singleton because bug in compiler ignores// template export//#   pragma warning (disable : 4275)// disable: "C++ Exception Specification ignored"// This is because MSVC 6 did not implement all the C++ exception// specifications in the ANSI C++ draft.//#   pragma warning( disable : 4290 )// disable: "no suitable definition provided for explicit template// instantiation request" Occurs in VC7 for no justifiable reason on all// #includes of Singleton//#   pragma warning( disable: 4661)// disable: deprecation warnings when using CRT calls in VC8// These show up on all C runtime lib code in VC8, disable since they clutter// the warnings with things we may not be able to do anything about (e.g.// generated code from nvparse etc). I doubt very much that these calls// will ever be actually removed from VC anyway, it would break too much code.//#	pragma warning( disable: 4996)// disable: "conditional expression constant", always occurs on// ORXONOX_MUTEX_CONDITIONAL when no threading enabled//#   pragma warning (disable : 201)// Define the english written operators like and, or, xor#include <iso646.h>#endif /* ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC */// include visual leak detector to search for memory leaks//#include <vld.h>#endif /* _OrxonoxPlatform_H__ */
+#else
+# include "inttypes.h"
+#endif
+
+namespace orxonox {
+#ifdef ORXONOX_DOUBLE_PRECISION
+typedef double Real;
+#else
+typedef float Real;
+#endif
+}
+
+
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+// Turn off warnings generated by long std templates
+// This warns about truncation to 255 characters in debug/browse info
+//#   pragma warning (disable : 4786)
+
+// Turn off warnings generated by long std templates
+// This warns about truncation to 255 characters in debug/browse info
+//#   pragma warning (disable : 4503)
+
+// disable: conversion from 'double' to 'float', possible loss of data
+// disable: conversion from 'ogg_int64_t' to 'long', possible loss of data
+// This has been dealt with in base_properties of the solution since the
+// warning primarily occurs in library header files (which are mostly
+// included before OrxonoxPlatform.h is)
+//#   pragma warning (disable : 4244)
+
+// disable: "conversion from 'size_t' to 'unsigned int', possible loss of data
+//#   pragma warning (disable : 4267)
+
+// disable: "truncation from 'double' to 'float'
+//#   pragma warning (disable : 4305)
+
+// set to level 4: "<type> needs to have dll-interface to be used by clients'
+// Happens on STL member variables which are not public therefore is ok
+#   pragma warning (disable : 4251)
+
+// disable: 'MultiTypeString' : multiple assignment operators specified
+// Used in MultiType and works fine so far
+//#   pragma warning (disable : 4522)
+
+// disable: "non dll-interface class used as base for dll-interface class"
+// Happens when deriving from Singleton because bug in compiler ignores
+// template export
+//#   pragma warning (disable : 4275)
+
+// disable: "C++ Exception Specification ignored"
+// This is because MSVC 6 did not implement all the C++ exception
+// specifications in the ANSI C++ draft.
+//#   pragma warning( disable : 4290 )
+
+// disable: "no suitable definition provided for explicit template
+// instantiation request" Occurs in VC7 for no justifiable reason on all
+// #includes of Singleton
+//#   pragma warning( disable: 4661)
+
+// disable: deprecation warnings when using CRT calls in VC8
+// These show up on all C runtime lib code in VC8, disable since they clutter
+// the warnings with things we may not be able to do anything about (e.g.
+// generated code from nvparse etc). I doubt very much that these calls
+// will ever be actually removed from VC anyway, it would break too much code.
+//#	pragma warning( disable: 4996)
+
+// disable: "conditional expression constant", always occurs on
+// ORXONOX_MUTEX_CONDITIONAL when no threading enabled
+//#   pragma warning (disable : 201)
+
+
+// Define the english written operators like and, or, xor
+#include <iso646.h>
+
+#endif /* ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC */
+
+// include visual leak detector to search for memory leaks
+//#include <vld.h>
+
+#endif /* _OrxonoxPlatform_H__ */
Index: /code/branches/network/src/util/Sleep.h
===================================================================
--- /code/branches/network/src/util/Sleep.h	(revision 1494)
+++ /code/branches/network/src/util/Sleep.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -25,4 +26,5 @@
  *
  */
+
 /**
  @file  Sleep.h
@@ -32,5 +34,9 @@
 #include "UtilPrereqs.h"
 
-#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32#  ifndef WIN32_LEAN_AND_MEAN#    define WIN32_LEAN_AND_MEAN#  endif#  include <windows.h>
+#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
+#  include <windows.h>
 inline void usleep(DWORD dwMicroseconds)
 {
Index: /code/branches/network/src/util/SubString.cc
===================================================================
--- /code/branches/network/src/util/SubString.cc	(revision 1494)
+++ /code/branches/network/src/util/SubString.cc	(revision 1495)
@@ -1,3 +1,38 @@
-/* *   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: *      Christian Meyer *   Co-authors: *      Benjamin Grauer *////  splitLine//  STL string tokenizer////  Created by Clemens Wacha.//  Version 1.0//  Copyright (c) 2005 Clemens Wacha. All rights reserved.// */
+/*
+ *   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:
+ *      Christian Meyer
+ *   Co-authors:
+ *      Benjamin Grauer
+ *
+//
+//  splitLine
+//  STL string tokenizer
+//
+//  Created by Clemens Wacha.
+//  Version 1.0
+//  Copyright (c) 2005 Clemens Wacha. All rights reserved.
+//
+ */
+
 #include "SubString.h"
 
@@ -32,5 +67,6 @@
 SubString::SubString(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                     char escapeChar, bool removeEscapeChar, char safemode_char, bool removeSafemodeChar,                     char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
+                     char escapeChar, bool removeEscapeChar, char safemode_char, bool removeSafemodeChar,
+                     char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
 {
   SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeEscapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
@@ -44,6 +80,9 @@
 SubString::SubString(const SubString& subString, unsigned int subSetBegin)
 {
-  for (unsigned int i = subSetBegin; i < subString.size(); i++)  {
-    this->strings.push_back(subString[i]);    this->bInSafemode.push_back(subString.isInSafemode(i));  }
+  for (unsigned int i = subSetBegin; i < subString.size(); i++)
+  {
+    this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
 }
 
@@ -57,6 +96,9 @@
 SubString::SubString(const SubString& subString, unsigned int subSetBegin, unsigned int subSetEnd)
 {
-  for (unsigned int i = subSetBegin; i < subString.size() && i < subSetEnd; i++)  {
-    this->strings.push_back(subString[i]);    this->bInSafemode.push_back(subString.isInSafemode(i));  }
+  for (unsigned int i = subSetBegin; i < subString.size() && i < subSetEnd; i++)
+  {
+    this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
 }
 
@@ -68,6 +110,9 @@
 SubString::SubString(unsigned int argc, const char** argv)
 {
-  for(unsigned int i = 0; i < argc; ++i)  {
-    this->strings.push_back(std::string(argv[i]));    this->bInSafemode.push_back(false);  }
+  for(unsigned int i = 0; i < argc; ++i)
+  {
+    this->strings.push_back(std::string(argv[i]));
+    this->bInSafemode.push_back(false);
+  }
 }
 
@@ -94,5 +139,6 @@
 SubString& SubString::operator=(const SubString& subString)
 {
-  this->strings = subString.strings;  this->bInSafemode = subString.bInSafemode;
+  this->strings = subString.strings;
+  this->bInSafemode = subString.bInSafemode;
   return *this;
 }
@@ -155,6 +201,9 @@
 SubString& SubString::operator+=(const SubString& subString)
 {
-  for (unsigned int i = 0; i < subString.size(); i++)  {
-    this->strings.push_back(subString[i]);    this->bInSafemode.push_back(subString.isInSafemode(i));  }
+  for (unsigned int i = 0; i < subString.size(); i++)
+  {
+    this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
   return *this;
 }
@@ -168,5 +217,6 @@
 unsigned int SubString::split(const std::string& string, char splitter)
 {
-  this->strings.clear();  this->bInSafemode.clear();
+  this->strings.clear();
+  this->bInSafemode.clear();
   char split[2];
   split[0] = splitter;
@@ -189,7 +239,9 @@
 unsigned int SubString::split(const std::string& string,
                               const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                              char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,                              char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
-{
-  this->strings.clear();  this->bInSafemode.clear();
+                              char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                              char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
+{
+  this->strings.clear();
+  this->bInSafemode.clear();
   SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
   return this->strings.size();
@@ -257,5 +309,9 @@
  * @param emptyEntries: if empty Strings are added to the List of Strings.
  * @param escape_char: Escape carater (escapes splitters)
- * @param safemode_char: the beginning of the safemode is marked with this * @param removeSafemodeChar removes the safemode_char from the beginning and the ending of a token * @param openparenthesis_char the beginning of a safemode is marked with this * @param closeparenthesis_char the ending of a safemode is marked with this * @param removeParenthesisChars removes the parenthesis from the beginning and the ending of a token
+ * @param safemode_char: the beginning of the safemode is marked with this
+ * @param removeSafemodeChar removes the safemode_char from the beginning and the ending of a token
+ * @param openparenthesis_char the beginning of a safemode is marked with this
+ * @param closeparenthesis_char the ending of a safemode is marked with this
+ * @param removeParenthesisChars removes the parenthesis from the beginning and the ending of a token
  * @param comment_char: the beginning of a comment is marked with this: (until the end of a Line)
  * @param start_state: the Initial state on how to parse the String.
@@ -267,11 +323,17 @@
  */
 SubString::SPLIT_LINE_STATE
-SubString::splitLine(std::vector<std::string>& ret,                     std::vector<bool>& bInSafemode,
+SubString::splitLine(std::vector<std::string>& ret,
+                     std::vector<bool>& bInSafemode,
                      const std::string& line,
                      const std::string& delimiters,
                      const std::string& delimiterNeighbours,
                      bool emptyEntries,
-                     char escape_char,                     bool removeExcapeChar,
-                     char safemode_char,                     bool removeSafemodeChar,                     char openparenthesis_char,                     char closeparenthesis_char,                     bool removeParenthesisChars,
+                     char escape_char,
+                     bool removeExcapeChar,
+                     char safemode_char,
+                     bool removeSafemodeChar,
+                     char openparenthesis_char,
+                     char closeparenthesis_char,
+                     bool removeParenthesisChars,
                      char comment_char,
                      SPLIT_LINE_STATE start_state)
@@ -281,8 +343,18 @@
   unsigned int fallBackNeighbours = 0;
 
-  std::string token;  bool inSafemode = false;
-
-  if(start_state != SL_NORMAL && ret.size() > 0)  {    token = ret[ret.size()-1];
-    ret.pop_back();  }  if(start_state != SL_NORMAL && bInSafemode.size() > 0)  {    inSafemode = bInSafemode[bInSafemode.size()-1];    bInSafemode.pop_back();  }
+  std::string token;
+  bool inSafemode = false;
+
+  if(start_state != SL_NORMAL && ret.size() > 0)
+  {
+    token = ret[ret.size()-1];
+    ret.pop_back();
+  }
+  if(start_state != SL_NORMAL && bInSafemode.size() > 0)
+  {
+    inSafemode = bInSafemode[bInSafemode.size()-1];
+    bInSafemode.pop_back();
+  }
+
   while(i < line.size())
   {
@@ -292,10 +364,22 @@
         if(line[i] == escape_char)
         {
-          state = SL_ESCAPE;          if (!removeExcapeChar)            token += line[i];
+          state = SL_ESCAPE;
+          if (!removeExcapeChar)
+            token += line[i];
         }
         else if(line[i] == safemode_char)
         {
-          state = SL_SAFEMODE;          inSafemode = true;          if (!removeSafemodeChar)            token += line[i];
-        }        else if(line[i] == openparenthesis_char)        {          state = SL_PARENTHESES;          inSafemode = true;          if (!removeParenthesisChars)            token += line[i];        }
+          state = SL_SAFEMODE;
+          inSafemode = true;
+          if (!removeSafemodeChar)
+            token += line[i];
+        }
+        else if(line[i] == openparenthesis_char)
+        {
+          state = SL_PARENTHESES;
+          inSafemode = true;
+          if (!removeParenthesisChars)
+            token += line[i];
+        }
         else if(line[i] == comment_char)
         {
@@ -305,5 +389,9 @@
           if(emptyEntries || token.size() > 0)
           {
-            ret.push_back(token);            token.clear();            bInSafemode.push_back(inSafemode);            inSafemode = false;          }
+            ret.push_back(token);
+            token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
+          }
           token += line[i];       // EAT
           state = SL_COMMENT;
@@ -319,5 +407,7 @@
             ret.push_back(token);
             token.clear();
-            bInSafemode.push_back(inSafemode);            inSafemode = false;          }
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
+          }
           state = SL_NORMAL;
         }
@@ -339,5 +429,9 @@
         }
         break;
-      case SL_ESCAPE:        if (!removeSafemodeChar)          token += line[i];        else        {
+      case SL_ESCAPE:
+        if (!removeSafemodeChar)
+          token += line[i];
+        else
+        {
           if(line[i] == 'n') token += '\n';
           else if(line[i] == 't') token += '\t';
@@ -348,5 +442,6 @@
           else if(line[i] == 'a') token += '\a';
           else if(line[i] == '?') token += '\?';
-          else token += line[i];  // EAT        }
+          else token += line[i];  // EAT
+        }
         state = SL_NORMAL;
         break;
@@ -355,5 +450,7 @@
         {
           state = SL_NORMAL;
-          if (!removeSafemodeChar)            token += line[i];        }
+          if (!removeSafemodeChar)
+            token += line[i];
+        }
         else if(line[i] == escape_char)
         {
@@ -364,5 +461,7 @@
           token += line[i];       // EAT
         }
-        break;      case SL_SAFEESCAPE:
+        break;
+
+      case SL_SAFEESCAPE:
         if(line[i] == 'n') token += '\n';
         else if(line[i] == 't') token += '\t';
@@ -376,5 +475,35 @@
         state = SL_SAFEMODE;
         break;
-      case SL_PARENTHESES:        if(line[i] == closeparenthesis_char)        {          state = SL_NORMAL;          if (!removeParenthesisChars)            token += line[i];        }        else if(line[i] == escape_char)        {          state = SL_PARENTHESESESCAPE;        }        else        {          token += line[i];       // EAT        }        break;      case SL_PARENTHESESESCAPE:        if(line[i] == 'n') token += '\n';        else if(line[i] == 't') token += '\t';        else if(line[i] == 'v') token += '\v';        else if(line[i] == 'b') token += '\b';        else if(line[i] == 'r') token += '\r';        else if(line[i] == 'f') token += '\f';        else if(line[i] == 'a') token += '\a';        else if(line[i] == '?') token += '\?';        else token += line[i];  // EAT        state = SL_PARENTHESES;        break;
+
+      case SL_PARENTHESES:
+        if(line[i] == closeparenthesis_char)
+        {
+          state = SL_NORMAL;
+          if (!removeParenthesisChars)
+            token += line[i];
+        }
+        else if(line[i] == escape_char)
+        {
+          state = SL_PARENTHESESESCAPE;
+        }
+        else
+        {
+          token += line[i];       // EAT
+        }
+        break;
+
+      case SL_PARENTHESESESCAPE:
+        if(line[i] == 'n') token += '\n';
+        else if(line[i] == 't') token += '\t';
+        else if(line[i] == 'v') token += '\v';
+        else if(line[i] == 'b') token += '\b';
+        else if(line[i] == 'r') token += '\r';
+        else if(line[i] == 'f') token += '\f';
+        else if(line[i] == 'a') token += '\a';
+        else if(line[i] == '?') token += '\?';
+        else token += line[i];  // EAT
+        state = SL_PARENTHESES;
+        break;
+
       case SL_COMMENT:
         if(line[i] == '\n')
@@ -385,5 +514,7 @@
             ret.push_back(token);
             token.clear();
-            bInSafemode.push_back(inSafemode);            inSafemode = false;          }
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
+          }
           state = SL_NORMAL;
         }
@@ -408,5 +539,7 @@
     ret.push_back(token);
     token.clear();
-    bInSafemode.push_back(inSafemode);    inSafemode = false;  }
+    bInSafemode.push_back(inSafemode);
+    inSafemode = false;
+  }
   return(state);
 }
Index: /code/branches/network/src/util/SubString.h
===================================================================
--- /code/branches/network/src/util/SubString.h	(revision 1494)
+++ /code/branches/network/src/util/SubString.h	(revision 1495)
@@ -1,3 +1,41 @@
-/* *   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: *      Christian Meyer *   Co-authors: *      Benjamin Grauer *      Fabian 'x3n' Landau *//  splitLine//  STL string tokenizer////  Created by Clemens Wacha.//  Version 1.0//  Copyright (c) 2005 Clemens Wacha. All rights reserved. * Extended by Fabian 'x3n' Landau with the SL_PARENTHESES mode. */ /*!
+/*
+ *   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:
+ *      Christian Meyer
+ *   Co-authors:
+ *      Benjamin Grauer
+ *      Fabian 'x3n' Landau
+ *
+
+//  splitLine
+//  STL string tokenizer
+//
+//  Created by Clemens Wacha.
+//  Version 1.0
+//  Copyright (c) 2005 Clemens Wacha. All rights reserved.
+
+ * Extended by Fabian 'x3n' Landau with the SL_PARENTHESES mode.
+ */
+
+ /*!
  * @file substring.h
  * @brief a small class to get the parts of a string separated by commas
@@ -22,4 +60,5 @@
 
 #include "UtilPrereqs.h"
+
 #include <vector>
 #include <string>
@@ -39,5 +78,7 @@
     SL_SAFEMODE,          //!< In safe mode (between "" mostly).
     SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
-    SL_COMMENT,           //!< In Comment mode.    SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')    SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
+    SL_COMMENT,           //!< In Comment mode.
+    SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')
+    SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
   } SPLIT_LINE_STATE;
 
@@ -48,5 +89,6 @@
   SubString(const std::string& string,
             const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
-            char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
+            char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   SubString(unsigned int argc, const char** argv);
   /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
@@ -71,5 +113,6 @@
   unsigned int split(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
-                     char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,                     char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
+                     char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+                     char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   std::string join(const std::string& delimiter = " ") const;
   ////////////////////////////////////////
@@ -87,5 +130,7 @@
   inline const std::string& operator[](unsigned int i) const { return this->strings[i]; };
   /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
-  inline const std::string& getString(unsigned int i) const { return (*this)[i]; };  /** @brief Returns true if the token is in safemode. @param i the i'th token */  inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
+  inline const std::string& getString(unsigned int i) const { return (*this)[i]; };
+  /** @brief Returns true if the token is in safemode. @param i the i'th token */
+  inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
   /** @brief Returns the front of the StringList. */
   inline const std::string& front() const { return this->strings.front(); };
@@ -96,12 +141,18 @@
 
   // the almighty algorithm.
-  static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,                                    std::vector<bool>& bInSafemode,
+  static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,
+                                    std::vector<bool>& bInSafemode,
                                     const std::string& line,
                                     const std::string& delimiters = SubString::WhiteSpaces,
                                     const std::string& delimiterNeighbours = "",
                                     bool emptyEntries = false,
-                                    char escape_char = '\\',                                    bool removeExcapeChar = true,
+                                    char escape_char = '\\',
+                                    bool removeExcapeChar = true,
                                     char safemode_char = '"',
-                                    bool removeSafemodeChar = true,                                    char openparenthesis_char = '(',                                    char closeparenthesis_char = ')',                                    bool removeParenthesisChars = true,                                    char comment_char = '\0',
+                                    bool removeSafemodeChar = true,
+                                    char openparenthesis_char = '(',
+                                    char closeparenthesis_char = ')',
+                                    bool removeParenthesisChars = true,
+                                    char comment_char = '\0',
                                     SPLIT_LINE_STATE start_state = SL_NORMAL);
   // debugging.
@@ -114,5 +165,6 @@
 
 private:
-  std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings  std::vector<bool>         bInSafemode;
+  std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings
+  std::vector<bool>         bInSafemode;
 };
 
Index: /code/branches/network/src/util/UtilPrereqs.h
===================================================================
--- /code/branches/network/src/util/UtilPrereqs.h	(revision 1494)
+++ /code/branches/network/src/util/UtilPrereqs.h	(revision 1495)
@@ -1,5 +1,6 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net < *
+ *                    > www.orxonox.net <
+ *
  *
  *   License notice:
@@ -30,4 +31,5 @@
   @brief Contains all the necessary forward declarations for all classes and structs.
 */
+
 #ifndef _UtilPrereqs_H__
 #define _UtilPrereqs_H__
@@ -58,5 +60,12 @@
 // Forward declarations
 //-----------------------------------------------------------------------
-class ArgReader;class Convert;class MultiTypePrimitive;class MultiTypeString;class MultiTypeMath;template <class T>class String2Number;class SubString;
+class ArgReader;
+class Convert;
+class MultiTypePrimitive;
+class MultiTypeString;
+class MultiTypeMath;
+template <class T>
+class String2Number;
+class SubString;
 
 #endif /* _UtilPrereqs_H__ */
