| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | /*! |
|---|
| 4 | * @file network_manager.h |
|---|
| 5 | * Main interface for the network module. Manages all the modules |
|---|
| 6 | |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | #ifndef _NETDEFS |
|---|
| 10 | #define _NETDEFS |
|---|
| 11 | |
|---|
| 12 | #ifdef HAVE_SDL_NET_H |
|---|
| 13 | #include <SDL_net.h> |
|---|
| 14 | #else |
|---|
| 15 | #include <SDL/SDL_net.h> |
|---|
| 16 | #endif |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | #define MAX_CONNECTIONS 1000 |
|---|
| 20 | |
|---|
| 21 | #define NETWORK_FREQUENCY 66 |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | typedef unsigned char byte; |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | //!< enum indicating the type of the node |
|---|
| 28 | typedef enum { |
|---|
| 29 | NET_SERVER, |
|---|
| 30 | NET_CLIENT |
|---|
| 31 | } NodeType; |
|---|
| 32 | |
|---|
| 33 | //!< enum indicating the type of the network connection (2 protocols supported) |
|---|
| 34 | typedef enum ConnectionType { |
|---|
| 35 | NET_UDP = 0, |
|---|
| 36 | NET_TCP |
|---|
| 37 | }; |
|---|
| 38 | |
|---|
| 39 | //!< the type of the user id (special number never used elsewhere) |
|---|
| 40 | typedef enum { |
|---|
| 41 | NET_UID_UNASSIGNED = -1, |
|---|
| 42 | |
|---|
| 43 | NET_UID_NUMBER |
|---|
| 44 | } UidType; |
|---|
| 45 | |
|---|
| 46 | #endif /* _NETWORK_MANAGER */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.