Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network5/src/libraries/network/NetworkPrereqs.h @ 7759

Last change on this file since 7759 was 7759, checked in by scheusso, 13 years ago

a lot of changes:

  • some fixes (mostly gamestate:diff)
  • FunctionCall buffering (if Gamestate is not recent enough)
  • Property svn:eol-style set to native
File size: 4.2 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  static const unsigned int CLIENTID_UNKNOWN        = static_cast<unsigned int>(-2);
68  extern const char* LAN_DISCOVERY_MESSAGE;
69  extern const char* LAN_DISCOVERY_ACK;
70  static const unsigned int LAN_DISCOVERY_PORT      = 55557;
71  static const unsigned int NETWORK_PEER_ID_SERVER = 0;
72}
73
74//-----------------------------------------------------------------------
75// Enums
76//-----------------------------------------------------------------------
77
78namespace orxonox
79{
80  namespace packet
81  {
82    namespace PacketFlag
83    {
84      enum Value
85      {
86        Reliable    = 1,
87        Unsequenced = 2,
88        NoAllocate  = 4
89      };
90    }
91  }
92}
93
94//-----------------------------------------------------------------------
95// Forward declarations
96//-----------------------------------------------------------------------
97
98// from ENet
99struct _ENetPeer;
100typedef _ENetPeer ENetPeer;
101struct _ENetPacket;
102typedef _ENetPacket ENetPacket;
103struct _ENetEvent;
104typedef _ENetEvent ENetEvent;
105struct _ENetHost;
106typedef _ENetHost ENetHost;
107struct _ENetAddress;
108typedef _ENetAddress ENetAddress;
109
110namespace orxonox
111{
112  class ChatListener;
113  class Client;
114  class ClientConnection;
115  class ClientConnectionListener;
116  class ClientInformation;
117  class Connection;
118  class FunctionCall;
119  class FunctionCallManager;
120  class GamestateClient;
121  class GamestateHandler;
122  class GamestateManager;
123  class Host;
124  class NetworkFunctionBase;
125  struct NetworkFunctionPointer;
126  class NetworkFunctionStatic;
127  template <class T>
128  class NetworkMemberFunction;
129  class NetworkMemberFunctionBase;
130  class Server;
131  class ServerConnection;
132  class TrafficControl;
133
134  // packet
135  namespace packet
136  {
137    class Acknowledgement;
138    class Chat;
139    class ClassID;
140    class DeleteObjects;
141    class FunctionCalls;
142    class FunctionIDs;
143    class Gamestate;
144    class Packet;
145    class Welcome;
146  }
147
148  // synchronisable
149  template <class T>
150  class NetworkCallback;
151  template <class T, class U>
152  class NetworkCallbackNotify;
153  class NetworkCallbackBase;
154  class NetworkCallbackManager;
155  class Synchronisable;
156  class SynchronisableHeader;
157  template <class T>
158  class SynchronisableVariable;
159  class SynchronisableVariableBase;
160  template <class T>
161  class SynchronisableVariableBidirectional;
162}
163
164#endif /* _NetworkPrereqs_H__ */
Note: See TracBrowser for help on using the repository browser.