Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network6/src/libraries/network/NetworkPrereqs.h @ 8016

Last change on this file since 8016 was 7823, checked in by scheusso, 14 years ago

again some structural changes in network to increase modularity/encapsulation
precondition for fixing client-disconnect bug

  • Property svn:eol-style set to native
File size: 4.6 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30@file
31@brief
32    Shared library macros, enums, constants and forward declarations for the network library
33*/
34
35#ifndef _NetworkPrereqs_H__
36#define _NetworkPrereqs_H__
37
38#include "OrxonoxConfig.h"
39
40//-----------------------------------------------------------------------
41// Shared library settings
42//-----------------------------------------------------------------------
43
44#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined( NETWORK_STATIC_BUILD )
45#  ifdef NETWORK_SHARED_BUILD
46#    define _NetworkExport __declspec(dllexport)
47#  else
48#    if defined( __MINGW32__ )
49#      define _NetworkExport
50#    else
51#      define _NetworkExport __declspec(dllimport)
52#    endif
53#  endif
54#elif defined ( ORXONOX_GCC_VISIBILITY )
55#  define _NetworkExport  __attribute__ ((visibility("default")))
56#else
57#  define _NetworkExport
58#endif
59
60//-----------------------------------------------------------------------
61// Constants
62//-----------------------------------------------------------------------
63
64namespace orxonox
65{
66  static const unsigned int GAMESTATEID_INITIAL       = static_cast<unsigned int>(-1);
67  extern const char* LAN_DISCOVERY_MESSAGE;
68  extern const char* LAN_DISCOVERY_ACK;
69  static const unsigned int LAN_DISCOVERY_PORT          = 55558;
70  static const unsigned int NETWORK_PEER_ID_SERVER      = 0;
71  static const unsigned int NETWORK_PEER_ID_BROADCAST   = static_cast<unsigned int>(-1);
72  static const unsigned int NETWORK_PEER_ID_UNKNOWN     = static_cast<unsigned int>(-2);
73  static const unsigned int NETWORK_CHANNEL_DEFAULT     = 0;
74  static const unsigned int NETWORK_CHANNEL_UNRELIABLE  = 1;
75  static const unsigned int NETWORK_CHANNEL_COUNT       = 2;
76}
77
78//-----------------------------------------------------------------------
79// Enums
80//-----------------------------------------------------------------------
81
82namespace orxonox
83{
84  namespace packet
85  {
86    namespace PacketFlag
87    {
88      enum Value
89      {
90        Reliable    = 1,
91        Unsequenced = 2,
92        NoAllocate  = 4
93      };
94    }
95  }
96}
97
98//-----------------------------------------------------------------------
99// Forward declarations
100//-----------------------------------------------------------------------
101
102// from ENet
103struct _ENetPeer;
104typedef _ENetPeer     ENetPeer;
105struct _ENetPacket;
106typedef _ENetPacket   ENetPacket;
107struct _ENetEvent;
108typedef _ENetEvent    ENetEvent;
109struct _ENetHost;
110typedef _ENetHost     ENetHost;
111struct _ENetAddress;
112typedef _ENetAddress  ENetAddress;
113typedef uint8_t       ENetChannelID;
114
115namespace orxonox
116{
117  class ChatListener;
118  class Client;
119  class ClientConnection;
120  class ClientConnectionListener;
121  class ClientInformation;
122  class Connection;
123  class FunctionCall;
124  class FunctionCallManager;
125  class GamestateClient;
126  class GamestateHandler;
127  class GamestateManager;
128  class Host;
129  class NetworkFunctionBase;
130  struct NetworkFunctionPointer;
131  class NetworkFunctionStatic;
132  template <class T>
133  class NetworkMemberFunction;
134  class NetworkMemberFunctionBase;
135  class Server;
136  class ServerConnection;
137  class TrafficControl;
138
139  // packet
140  namespace packet
141  {
142    class Acknowledgement;
143    class Chat;
144    class ClassID;
145    class DeleteObjects;
146    class FunctionCalls;
147    class FunctionIDs;
148    class Gamestate;
149    class Packet;
150    class Welcome;
151  }
152
153  // synchronisable
154  template <class T>
155  class NetworkCallback;
156  template <class T, class U>
157  class NetworkCallbackNotify;
158  class NetworkCallbackBase;
159  class NetworkCallbackManager;
160  class Synchronisable;
161  class SynchronisableHeader;
162  template <class T>
163  class SynchronisableVariable;
164  class SynchronisableVariableBase;
165  template <class T>
166  class SynchronisableVariableBidirectional;
167}
168
169namespace boost
170{
171  class mutex;
172  class thread;
173}
174
175#endif /* _NetworkPrereqs_H__ */
Note: See TracBrowser for help on using the repository browser.