author | glx |
Mon, 24 Mar 2008 20:30:08 +0000 | |
changeset 8730 | 525e63adca4f |
parent 8276 | 245f1b131d64 |
child 8789 | 48c8f086b823 |
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 |
|
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
|
3 |
#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
|
4 |
#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
|
5 |
|
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 |
#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
|
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 |
#include "../player_type.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
|
9 |
#include "../economy_type.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
|
10 |
#include "core/config.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
|
11 |
#include "core/game.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
|
12 |
|
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
|
13 |
// If this line is enable, every frame will have a sync test |
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 |
// this is not needed in normal games. Normal is like 1 sync in 100 |
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
|
15 |
// frames. You can enable this if you have a lot of desyncs on a certain |
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
|
16 |
// game. |
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 |
// Remember: both client and server have to be compiled with this |
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
|
18 |
// option enabled to make it to work. If one of the two has it disabled |
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
|
19 |
// nothing will happen. |
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
|
20 |
//#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
|
21 |
|
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
|
22 |
// In theory sending 1 of the 2 seeds is enough to check for desyncs |
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
|
23 |
// so in theory, this next define can be left off. |
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
|
24 |
//#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
|
25 |
|
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
|
26 |
// How many clients can we have? Like.. MAX_PLAYERS - 1 is the amount of |
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 |
// players that can really play.. so.. a max of 4 spectators.. gives us.. |
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 |
// MAX_PLAYERS + 3 |
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
|
29 |
#define MAX_CLIENTS (MAX_PLAYERS + 3) |
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
|
30 |
|
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
|
31 |
|
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
|
32 |
// Do not change this next line. It should _ALWAYS_ be MAX_CLIENTS + 1 |
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 MAX_CLIENT_INFO (MAX_CLIENTS + 1) |
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 |
|
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
|
35 |
#define MAX_INTERFACES 9 |
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 |
|
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
|
37 |
|
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
|
38 |
// How many vehicle/station types we put over the 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
|
39 |
#define NETWORK_VEHICLE_TYPES 5 |
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
|
40 |
#define NETWORK_STATION_TYPES 5 |
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
|
41 |
|
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 |
struct NetworkPlayerInfo { |
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 |
char company_name[NETWORK_NAME_LENGTH]; // Company name |
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 |
char password[NETWORK_PASSWORD_LENGTH]; // The password for the player |
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 |
Year inaugurated_year; // What year the company started in |
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 |
Money company_value; // The company value |
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 |
Money money; // The amount of money the company has |
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 |
Money income; // How much did the company earned last year |
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 |
uint16 performance; // What was his performance last month? |
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 |
bool use_password; // Is there a password |
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 |
uint16 num_vehicle[NETWORK_VEHICLE_TYPES]; // How many vehicles are there of this type? |
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 |
uint16 num_station[NETWORK_STATION_TYPES]; // How many stations are there of this type? |
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 |
char players[NETWORK_PLAYERS_LENGTH]; // The players that control this company (Name1, name2, ..) |
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 |
uint16 months_empty; // How many months the company is empty |
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
|
55 |
}; |
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 |
|
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 |
struct NetworkClientInfo { |
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 |
uint16 client_index; // Index of the client (same as ClientState->index) |
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 |
char client_name[NETWORK_CLIENT_NAME_LENGTH]; // Name of the client |
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 |
byte client_lang; // The language of the client |
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 |
PlayerID client_playas; // As which player is this client playing (PlayerID) |
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 |
uint32 client_ip; // IP-address of the client (so he can be banned) |
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 |
Date join_date; // Gamedate the player has joined |
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 |
char unique_id[NETWORK_UNIQUE_ID_LENGTH]; // Every play sends an unique id so we can indentify him |
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 |
}; |
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 |
|
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 |
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
|
68 |
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
|
69 |
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
|
70 |
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
|
71 |
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
|
72 |
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
|
73 |
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
|
74 |
|
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 |
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
|
76 |
}; |
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 |
|
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 |
/* Language ids for server_lang and client_lang. Do NOT modify the order. */ |
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 |
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
|
80 |
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
|
81 |
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
|
82 |
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
|
83 |
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
|
84 |
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
|
85 |
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
|
86 |
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
|
87 |
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
|
88 |
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
|
89 |
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
|
90 |
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
|
91 |
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
|
92 |
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
|
93 |
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
|
94 |
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
|
95 |
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
|
96 |
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
|
97 |
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
|
98 |
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
|
99 |
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
|
100 |
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
|
101 |
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
|
102 |
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
|
103 |
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
|
104 |
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
|
105 |
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
|
106 |
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
|
107 |
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
|
108 |
NETLANG_UKRAINIAN, |
8730
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
109 |
NETLANG_AFRIKAANS, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
110 |
NETLANG_CROATIAN, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
111 |
NETLANG_CATALAN, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
112 |
NETLANG_ESTONIAN, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
113 |
NETLANG_GALICIAN, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
114 |
NETLANG_GREEK, |
525e63adca4f
(svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents:
8276
diff
changeset
|
115 |
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
|
116 |
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
|
117 |
}; |
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
|
118 |
|
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 |
VARDEF NetworkGameInfo _network_game_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
|
120 |
VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS]; |
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
|
121 |
VARDEF NetworkClientInfo _network_client_info[MAX_CLIENT_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
|
122 |
|
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
|
123 |
VARDEF char _network_player_name[NETWORK_CLIENT_NAME_LENGTH]; |
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
|
124 |
VARDEF char _network_default_ip[NETWORK_HOSTNAME_LENGTH]; |
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
|
125 |
|
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
|
126 |
VARDEF uint16 _network_own_client_index; |
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
|
127 |
VARDEF char _network_unique_id[NETWORK_UNIQUE_ID_LENGTH]; // Our own unique 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
|
128 |
|
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
|
129 |
VARDEF uint32 _frame_counter_server; // The frame_counter of the server, if in network-mode |
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
|
130 |
VARDEF uint32 _frame_counter_max; // To where we may go with our clients |
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 |
VARDEF uint32 _last_sync_frame; // Used in the server to store the last time a sync packet was sent to clients. |
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 |
// networking settings |
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 |
VARDEF uint32 _broadcast_list[MAX_INTERFACES + 1]; |
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 |
|
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 |
VARDEF uint16 _network_server_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
|
138 |
/* We use bind_ip and bind_ip_host, where bind_ip_host is the readable form of |
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 |
bind_ip_host, and bind_ip the numeric value, because we want a nice number |
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
|
140 |
in the openttd.cfg, but we wants to use the uint32 internally.. */ |
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
|
141 |
VARDEF uint32 _network_server_bind_ip; |
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
|
142 |
VARDEF char _network_server_bind_ip_host[NETWORK_HOSTNAME_LENGTH]; |
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
|
143 |
VARDEF bool _is_network_server; // Does this client wants to be a network-server? |
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
|
144 |
VARDEF char _network_server_name[NETWORK_NAME_LENGTH]; |
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
|
145 |
VARDEF char _network_server_password[NETWORK_PASSWORD_LENGTH]; |
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
|
146 |
VARDEF char _network_rcon_password[NETWORK_PASSWORD_LENGTH]; |
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
|
147 |
VARDEF char _network_default_company_pass[NETWORK_PASSWORD_LENGTH]; |
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
|
148 |
|
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
|
149 |
VARDEF uint16 _network_max_join_time; ///< Time a client can max take to join |
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
|
150 |
VARDEF bool _network_pause_on_join; ///< Pause the game when a client tries to join (more chance of succeeding join) |
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
|
151 |
|
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
|
152 |
VARDEF uint16 _redirect_console_to_client; |
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
|
153 |
|
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
|
154 |
VARDEF uint16 _network_sync_freq; |
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
|
155 |
VARDEF uint8 _network_frame_freq; |
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
|
156 |
|
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
|
157 |
VARDEF uint32 _sync_seed_1, _sync_seed_2; |
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
|
158 |
VARDEF uint32 _sync_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
|
159 |
VARDEF bool _network_first_time; |
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
|
160 |
// Vars needed for the join-GUI |
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
|
161 |
VARDEF NetworkJoinStatus _network_join_status; |
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
|
162 |
VARDEF uint8 _network_join_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
|
163 |
VARDEF uint16 _network_join_kbytes; |
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
|
164 |
VARDEF uint16 _network_join_kbytes_total; |
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
|
165 |
|
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
|
166 |
VARDEF char _network_last_host[NETWORK_HOSTNAME_LENGTH]; |
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
|
167 |
VARDEF short _network_last_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
|
168 |
VARDEF uint32 _network_last_host_ip; |
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
|
169 |
VARDEF uint8 _network_reconnect; |
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
|
170 |
|
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 |
VARDEF bool _network_udp_server; |
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 |
VARDEF uint16 _network_udp_broadcast; |
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
|
173 |
|
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
|
174 |
VARDEF byte _network_lan_internet; |
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
|
175 |
|
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
|
176 |
VARDEF bool _network_need_advertise; |
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
|
177 |
VARDEF uint32 _network_last_advertise_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
|
178 |
VARDEF uint8 _network_advertise_retries; |
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
|
179 |
|
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
|
180 |
VARDEF bool _network_autoclean_companies; |
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
|
181 |
VARDEF uint8 _network_autoclean_unprotected; // Remove a company after X months |
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
|
182 |
VARDEF uint8 _network_autoclean_protected; // Unprotect a company after X months |
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
|
183 |
|
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
|
184 |
VARDEF Year _network_restart_game_year; // If this year is reached, the server automaticly restarts |
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
|
185 |
VARDEF uint8 _network_min_players; // Minimum number of players for game to unpause |
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
|
186 |
|
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
|
187 |
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
|
188 |
|
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
|
189 |
byte NetworkSpectatorCount(); |
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
|
190 |
|
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
|
191 |
VARDEF char *_network_host_list[10]; |
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
|
192 |
VARDEF char *_network_ban_list[25]; |
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
|
193 |
|
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
|
194 |
void ParseConnectionString(const char **player, const char **port, char *connection_string); |
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
|
195 |
void NetworkUpdateClientInfo(uint16 client_index); |
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
|
196 |
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
|
197 |
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
|
198 |
bool NetworkChangeCompanyPassword(byte argc, char *argv[]); |
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
|
199 |
void NetworkPopulateCompanyInfo(); |
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
|
200 |
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
|
201 |
void CheckMinPlayers(); |
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
|
202 |
void NetworkStartDebugLog(const char *hostname, uint16 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
|
203 |
|
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
|
204 |
void NetworkUDPCloseAll(); |
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
|
205 |
void NetworkGameLoop(); |
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
|
206 |
void NetworkUDPGameLoop(); |
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
|
207 |
bool NetworkServerStart(); |
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
|
208 |
bool NetworkClientConnectGame(const char *host, uint16 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
|
209 |
void NetworkReboot(); |
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
|
210 |
void NetworkDisconnect(); |
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
|
211 |
|
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
|
212 |
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
|
213 |
|
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
|
214 |
#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
|
215 |
#endif /* NETWORK_INTERNAL_H */ |