author | celestar |
Thu, 11 Jan 2007 13:16:26 +0000 | |
branch | custombridgeheads |
changeset 5648 | 1608018c5ff2 |
parent 5643 | 3778051e8095 |
child 5875 | 4a1391019791 |
permissions | -rw-r--r-- |
5642 | 1 |
/* $Id$ */ |
2 |
||
3 |
#ifndef NETWORK_CORE_TCP_H |
|
4 |
#define NETWORK_CORE_TCP_H |
|
5 |
||
6 |
#ifdef ENABLE_NETWORK |
|
7 |
||
5648
1608018c5ff2
(svn r8059) [cbh] - Sync with r7788:8032 from trunk
celestar
parents:
5643
diff
changeset
|
8 |
#include "os_abstraction.h" |
1608018c5ff2
(svn r8059) [cbh] - Sync with r7788:8032 from trunk
celestar
parents:
5643
diff
changeset
|
9 |
#include "packet.h" |
1608018c5ff2
(svn r8059) [cbh] - Sync with r7788:8032 from trunk
celestar
parents:
5643
diff
changeset
|
10 |
|
5642 | 11 |
/** |
12 |
* @file tcp.h Basic functions to receive and send TCP packets. |
|
13 |
*/ |
|
14 |
||
15 |
/** |
|
16 |
* Enum with all types of UDP packets. |
|
17 |
* The order of the first 4 packets MUST not be changed, as |
|
18 |
* it protects old clients from joining newer servers |
|
19 |
* (because SERVER_ERROR is the respond to a wrong revision) |
|
20 |
*/ |
|
21 |
enum { |
|
22 |
PACKET_SERVER_FULL, |
|
23 |
PACKET_SERVER_BANNED, |
|
24 |
PACKET_CLIENT_JOIN, |
|
25 |
PACKET_SERVER_ERROR, |
|
26 |
PACKET_CLIENT_COMPANY_INFO, |
|
27 |
PACKET_SERVER_COMPANY_INFO, |
|
28 |
PACKET_SERVER_CLIENT_INFO, |
|
29 |
PACKET_SERVER_NEED_PASSWORD, |
|
30 |
PACKET_CLIENT_PASSWORD, |
|
31 |
PACKET_SERVER_WELCOME, |
|
32 |
PACKET_CLIENT_GETMAP, |
|
33 |
PACKET_SERVER_WAIT, |
|
34 |
PACKET_SERVER_MAP, |
|
35 |
PACKET_CLIENT_MAP_OK, |
|
36 |
PACKET_SERVER_JOIN, |
|
37 |
PACKET_SERVER_FRAME, |
|
38 |
PACKET_SERVER_SYNC, |
|
39 |
PACKET_CLIENT_ACK, |
|
40 |
PACKET_CLIENT_COMMAND, |
|
41 |
PACKET_SERVER_COMMAND, |
|
42 |
PACKET_CLIENT_CHAT, |
|
43 |
PACKET_SERVER_CHAT, |
|
44 |
PACKET_CLIENT_SET_PASSWORD, |
|
45 |
PACKET_CLIENT_SET_NAME, |
|
46 |
PACKET_CLIENT_QUIT, |
|
47 |
PACKET_CLIENT_ERROR, |
|
48 |
PACKET_SERVER_QUIT, |
|
49 |
PACKET_SERVER_ERROR_QUIT, |
|
50 |
PACKET_SERVER_SHUTDOWN, |
|
51 |
PACKET_SERVER_NEWGAME, |
|
52 |
PACKET_SERVER_RCON, |
|
53 |
PACKET_CLIENT_RCON, |
|
54 |
PACKET_END ///< Must ALWAYS be on the end of this list!! (period) |
|
55 |
}; |
|
56 |
||
57 |
void NetworkSend_Packet(Packet *packet, NetworkClientState *cs); |
|
58 |
Packet *NetworkRecv_Packet(NetworkClientState *cs, NetworkRecvStatus *status); |
|
59 |
bool NetworkSend_Packets(NetworkClientState *cs); |
|
60 |
||
61 |
#endif /* ENABLE_NETWORK */ |
|
62 |
||
63 |
#endif /* NETWORK_CORE_TCP_H */ |