author | peter1138 |
Sun, 03 Aug 2008 17:35:08 +0000 | |
changeset 9834 | 7474149531c1 |
parent 9452 | d901f00aeed6 |
child 9844 | 705fc23bedba |
permissions | -rw-r--r-- |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
1 |
/* $Id$ */ |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
2 |
|
9111
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
8790
diff
changeset
|
3 |
/** @file network_internal.h Variables and function used internally. */ |
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
8790
diff
changeset
|
4 |
|
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
5 |
#ifndef NETWORK_INTERNAL_H |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
6 |
#define NETWORK_INTERNAL_H |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
7 |
|
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
8 |
#ifdef ENABLE_NETWORK |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
9 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
10 |
#include "network.h" |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
11 |
#include "network_func.h" |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
12 |
#include "core/os_abstraction.h" |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
13 |
#include "core/core.h" |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
14 |
#include "core/config.h" |
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
15 |
#include "core/packet.h" |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
16 |
#include "core/tcp.h" |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
17 |
|
8789
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
18 |
/** |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
19 |
* If this line is enable, every frame will have a sync test |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
20 |
* this is not needed in normal games. Normal is like 1 sync in 100 |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
21 |
* frames. You can enable this if you have a lot of desyncs on a certain |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
22 |
* game. |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
23 |
* Remember: both client and server have to be compiled with this |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
24 |
* option enabled to make it to work. If one of the two has it disabled |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
25 |
* nothing will happen. |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
26 |
*/ |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
27 |
//#define ENABLE_NETWORK_SYNC_EVERY_FRAME |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
28 |
|
8789
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
29 |
/** |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
30 |
* In theory sending 1 of the 2 seeds is enough to check for desyncs |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
31 |
* so in theory, this next define can be left off. |
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
32 |
*/ |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
33 |
//#define NETWORK_SEND_DOUBLE_SEED |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
34 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
35 |
#define MAX_TEXT_MSG_LEN 1024 /* long long long long sentences :-) */ |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
36 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
37 |
enum MapPacket { |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
38 |
MAP_PACKET_START, |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
39 |
MAP_PACKET_NORMAL, |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
40 |
MAP_PACKET_END, |
8790 | 41 |
}; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
42 |
|
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
43 |
|
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
44 |
enum NetworkJoinStatus { |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
45 |
NETWORK_JOIN_STATUS_CONNECTING, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
46 |
NETWORK_JOIN_STATUS_AUTHORIZING, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
47 |
NETWORK_JOIN_STATUS_WAITING, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
48 |
NETWORK_JOIN_STATUS_DOWNLOADING, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
49 |
NETWORK_JOIN_STATUS_PROCESSING, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
50 |
NETWORK_JOIN_STATUS_REGISTERING, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
51 |
|
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
52 |
NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
53 |
}; |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
54 |
|
8789
48c8f086b823
(svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents:
8730
diff
changeset
|
55 |
/** Language ids for server_lang and client_lang. Do NOT modify the order. */ |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
56 |
enum NetworkLanguage { |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
57 |
NETLANG_ANY = 0, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
58 |
NETLANG_ENGLISH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
59 |
NETLANG_GERMAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
60 |
NETLANG_FRENCH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
61 |
NETLANG_BRAZILIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
62 |
NETLANG_BULGARIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
63 |
NETLANG_CHINESE, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
64 |
NETLANG_CZECH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
65 |
NETLANG_DANISH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
66 |
NETLANG_DUTCH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
67 |
NETLANG_ESPERANTO, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
68 |
NETLANG_FINNISH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
69 |
NETLANG_HUNGARIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
70 |
NETLANG_ICELANDIC, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
71 |
NETLANG_ITALIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
72 |
NETLANG_JAPANESE, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
73 |
NETLANG_KOREAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
74 |
NETLANG_LITHUANIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
75 |
NETLANG_NORWEGIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
76 |
NETLANG_POLISH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
77 |
NETLANG_PORTUGUESE, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
78 |
NETLANG_ROMANIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
79 |
NETLANG_RUSSIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
80 |
NETLANG_SLOVAK, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
81 |
NETLANG_SLOVENIAN, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
82 |
NETLANG_SPANISH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
83 |
NETLANG_SWEDISH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
84 |
NETLANG_TURKISH, |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
85 |
NETLANG_UKRAINIAN, |
8730
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
86 |
NETLANG_AFRIKAANS, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
87 |
NETLANG_CROATIAN, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
88 |
NETLANG_CATALAN, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
89 |
NETLANG_ESTONIAN, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
90 |
NETLANG_GALICIAN, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
91 |
NETLANG_GREEK, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
92 |
NETLANG_LATVIAN, |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
93 |
NETLANG_COUNT |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
94 |
}; |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
95 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
96 |
extern NetworkPlayerInfo _network_player_info[MAX_PLAYERS]; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
97 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
98 |
extern uint32 _frame_counter_server; // The frame_counter of the server, if in network-mode |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
99 |
extern uint32 _frame_counter_max; // To where we may go with our clients |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
100 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
101 |
extern uint32 _last_sync_frame; // Used in the server to store the last time a sync packet was sent to clients. |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
102 |
|
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
103 |
// networking settings |
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
104 |
extern uint32 _broadcast_list[MAX_INTERFACES + 1]; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
105 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
106 |
extern uint32 _network_server_bind_ip; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
107 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
108 |
extern uint32 _sync_seed_1, _sync_seed_2; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
109 |
extern uint32 _sync_frame; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
110 |
extern bool _network_first_time; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
111 |
// Vars needed for the join-GUI |
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
112 |
extern NetworkJoinStatus _network_join_status; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
113 |
extern uint8 _network_join_waiting; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
114 |
extern uint16 _network_join_kbytes; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
115 |
extern uint16 _network_join_kbytes_total; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
116 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
117 |
extern uint32 _network_last_host_ip; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
118 |
extern uint8 _network_reconnect; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
119 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
120 |
extern bool _network_udp_server; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
121 |
extern uint16 _network_udp_broadcast; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
122 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
123 |
extern uint8 _network_advertise_retries; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
124 |
|
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
125 |
// following externs are instantiated at network.cpp |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
126 |
extern CommandPacket *_local_command_queue; |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
127 |
|
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
128 |
// Here we keep track of the clients |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
129 |
// (and the client uses [0] for his own communication) |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
130 |
extern NetworkTCPSocketHandler _clients[MAX_CLIENTS]; |
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
131 |
|
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
132 |
void NetworkTCPQueryServer(const char* host, unsigned short port); |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
133 |
|
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
134 |
void NetworkAddServer(const char *b); |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
135 |
void NetworkRebuildHostList(); |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
136 |
void UpdateNetworkGameWindow(bool unselect); |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
137 |
|
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
138 |
bool IsNetworkCompatibleVersion(const char *version); |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
139 |
|
9428
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
140 |
void NetworkExecuteCommand(CommandPacket *cp); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
141 |
void NetworkAddCommandQueue(NetworkTCPSocketHandler *cs, CommandPacket *cp); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
142 |
|
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
143 |
// from network.c |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
144 |
void NetworkCloseClient(NetworkTCPSocketHandler *cs); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
145 |
void CDECL NetworkTextMessage(NetworkAction action, ConsoleColour color, bool self_send, const char *name, const char *str, ...); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
146 |
void NetworkGetClientName(char *clientname, size_t size, const NetworkTCPSocketHandler *cs); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
147 |
uint NetworkCalculateLag(const NetworkTCPSocketHandler *cs); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
148 |
byte NetworkGetCurrentLanguageIndex(); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
149 |
NetworkTCPSocketHandler *NetworkFindClientStateFromIndex(uint16 client_index); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
150 |
unsigned long NetworkResolveHost(const char *hostname); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
151 |
char* GetNetworkErrorMsg(char* buf, NetworkErrorCode err, const char* last); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
152 |
bool NetworkFindName(char new_name[NETWORK_CLIENT_NAME_LENGTH]); |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
153 |
|
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
154 |
#define DEREF_CLIENT(i) (&_clients[i]) |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
155 |
// This returns the NetworkClientInfo from a NetworkClientState |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
156 |
#define DEREF_CLIENT_INFO(cs) (&_network_client_info[cs - _clients]) |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
157 |
|
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
158 |
// Macros to make life a bit more easier |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
159 |
#define DEF_CLIENT_RECEIVE_COMMAND(type) NetworkRecvStatus NetworkPacketReceive_ ## type ## _command(Packet *p) |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
160 |
#define DEF_CLIENT_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command() |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
161 |
#define DEF_CLIENT_SEND_COMMAND_PARAM(type) void NetworkPacketSend_ ## type ## _command |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
162 |
#define DEF_SERVER_RECEIVE_COMMAND(type) void NetworkPacketReceive_ ## type ## _command(NetworkTCPSocketHandler *cs, Packet *p) |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
163 |
#define DEF_SERVER_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command(NetworkTCPSocketHandler *cs) |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
164 |
#define DEF_SERVER_SEND_COMMAND_PARAM(type) void NetworkPacketSend_ ## type ## _command |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
165 |
|
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
166 |
#define SEND_COMMAND(type) NetworkPacketSend_ ## type ## _command |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
167 |
#define RECEIVE_COMMAND(type) NetworkPacketReceive_ ## type ## _command |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
168 |
|
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
169 |
#define FOR_ALL_CLIENTS(cs) for (cs = _clients; cs != endof(_clients) && cs->IsConnected(); cs++) |
1ba05b499957
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
rubidium
parents:
9420
diff
changeset
|
170 |
|
8276
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
171 |
#endif /* ENABLE_NETWORK */ |
245f1b131d64
(svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff
changeset
|
172 |
#endif /* NETWORK_INTERNAL_H */ |