src/network/network_internal.h
author rubidium
Sun, 25 May 2008 19:17:03 +0000
changeset 9354 845e07db4549
parent 9111 48ce04029fe4
child 9420 8a38703928e8
permissions -rw-r--r--
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
-Codechange: move all Settings into substructs of _settings in a way that they are logically grouped.
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
245f1b131d64 (svn r11840) -Codechange: split 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 "../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
    11
#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
    12
#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
    13
#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
    14
8789
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    15
/**
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    16
 * 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
    17
 *  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
    18
 *  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
    19
 *  game.
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    20
 * 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
    21
 *  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
    22
 *  nothing will happen.
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    23
 */
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
    24
//#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
    25
8789
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    26
/**
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    27
 * 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
    28
 *   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
    29
 */
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
    30
//#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
    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
8789
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    33
enum {
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    34
	/**
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    35
	 * How many clients can we have? Like.. MAX_PLAYERS - 1 is the amount of
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    36
	 *  players that can really play.. so.. a max of 4 spectators.. gives us..
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    37
	 *  MAX_PLAYERS + 3
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    38
	 */
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    39
	MAX_CLIENTS = MAX_PLAYERS + 3,
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
    40
8789
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    41
	/** Do not change this next line. It should _ALWAYS_ be MAX_CLIENTS + 1 */
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    42
	MAX_CLIENT_INFO = MAX_CLIENTS + 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
    43
8789
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    44
	/** Maximum number of internet interfaces supported. */
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    45
	MAX_INTERFACES = 9,
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    46
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    47
	/** How many vehicle/station types we put over the network */
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    48
	NETWORK_VEHICLE_TYPES = 5,
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    49
	NETWORK_STATION_TYPES = 5,
8790
4a7a796b3976 (svn r12501) -Codechange: split signs.h.
rubidium
parents: 8789
diff changeset
    50
};
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
    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
struct NetworkPlayerInfo {
8789
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    53
	char company_name[NETWORK_NAME_LENGTH];         ///< Company name
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    54
	char password[NETWORK_PASSWORD_LENGTH];         ///< The password for the player
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    55
	Year inaugurated_year;                          ///< What year the company started in
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    56
	Money company_value;                            ///< The company value
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    57
	Money money;                                    ///< The amount of money the company has
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    58
	Money income;                                   ///< How much did the company earned last year
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    59
	uint16 performance;                             ///< What was his performance last month?
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    60
	bool use_password;                              ///< Is there a password
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    61
	uint16 num_vehicle[NETWORK_VEHICLE_TYPES];      ///< How many vehicles are there of this type?
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    62
	uint16 num_station[NETWORK_STATION_TYPES];      ///< How many stations are there of this type?
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    63
	char players[NETWORK_PLAYERS_LENGTH];           ///< The players that control this company (Name1, name2, ..)
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    64
	uint16 months_empty;                            ///< How many months the company is empty
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
    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
struct NetworkClientInfo {
8789
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    68
	uint16 client_index;                            ///< Index of the client (same as ClientState->index)
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    69
	char client_name[NETWORK_CLIENT_NAME_LENGTH];   ///< Name of the client
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    70
	byte client_lang;                               ///< The language of the client
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    71
	PlayerID client_playas;                         ///< As which player is this client playing (PlayerID)
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    72
	uint32 client_ip;                               ///< IP-address of the client (so he can be banned)
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    73
	Date join_date;                                 ///< Gamedate the player has joined
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    74
	char unique_id[NETWORK_UNIQUE_ID_LENGTH];       ///< Every play sends an unique id so we can indentify him
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
    75
};
245f1b131d64 (svn r11840) -Codechange: split 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
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
    78
	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
    79
	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
    80
	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
    81
	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
    82
	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
    83
	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
    84
245f1b131d64 (svn r11840) -Codechange: split 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
	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
    86
};
245f1b131d64 (svn r11840) -Codechange: split 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
8789
48c8f086b823 (svn r12499) -Codechange: some coding style tweaks for network_internal.h.
rubidium
parents: 8730
diff changeset
    88
/** 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
    89
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
    90
	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
    91
	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
    92
	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
    93
	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
    94
	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
    95
	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
    96
	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
    97
	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
    98
	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
    99
	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
   100
	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
   101
	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
   102
	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
   103
	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
   104
	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
   105
	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
   106
	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
   107
	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
   108
	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
   109
	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
   110
	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
   111
	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
   112
	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
   113
	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
   114
	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
   115
	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
   116
	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
   117
	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
   118
	NETLANG_UKRAINIAN,
8730
525e63adca4f (svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents: 8276
diff changeset
   119
	NETLANG_AFRIKAANS,
525e63adca4f (svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents: 8276
diff changeset
   120
	NETLANG_CROATIAN,
525e63adca4f (svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents: 8276
diff changeset
   121
	NETLANG_CATALAN,
525e63adca4f (svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents: 8276
diff changeset
   122
	NETLANG_ESTONIAN,
525e63adca4f (svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents: 8276
diff changeset
   123
	NETLANG_GALICIAN,
525e63adca4f (svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents: 8276
diff changeset
   124
	NETLANG_GREEK,
525e63adca4f (svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents: 8276
diff changeset
   125
	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
   126
	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
   127
};
245f1b131d64 (svn r11840) -Codechange: split 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 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
   130
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
   131
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
   132
245f1b131d64 (svn r11840) -Codechange: split 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
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
   134
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
   135
245f1b131d64 (svn r11840) -Codechange: split 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
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
   137
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
   138
245f1b131d64 (svn r11840) -Codechange: split 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
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
   140
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
   141
245f1b131d64 (svn r11840) -Codechange: split 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 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
   143
245f1b131d64 (svn r11840) -Codechange: split 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
// 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
   145
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
   146
245f1b131d64 (svn r11840) -Codechange: split 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 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
   148
/* 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
   149
    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
   150
    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
   151
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
   152
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
   153
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
   154
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
   155
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
   156
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
   157
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
   158
245f1b131d64 (svn r11840) -Codechange: split 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 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
   160
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
   161
245f1b131d64 (svn r11840) -Codechange: split 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 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
   163
245f1b131d64 (svn r11840) -Codechange: split 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_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
   165
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
   166
245f1b131d64 (svn r11840) -Codechange: split 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 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
   168
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
   169
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
   170
// 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
   171
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
   172
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
   173
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
   174
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
   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 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
   177
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
   178
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
   179
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
   180
245f1b131d64 (svn r11840) -Codechange: split 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 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
   182
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
   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 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
   185
245f1b131d64 (svn r11840) -Codechange: split 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
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
   187
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
   188
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
   189
245f1b131d64 (svn r11840) -Codechange: split 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
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
   191
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
   192
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
   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
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
   195
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
   196
245f1b131d64 (svn r11840) -Codechange: split 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 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
   198
245f1b131d64 (svn r11840) -Codechange: split 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
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
   200
245f1b131d64 (svn r11840) -Codechange: split 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
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
   202
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
   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 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
   205
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
   206
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
   207
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
   208
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
   209
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
   210
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
   211
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
   212
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
   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
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
   215
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
   216
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
   217
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
   218
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
   219
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
   220
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
   221
245f1b131d64 (svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff changeset
   222
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
   223
245f1b131d64 (svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents:
diff changeset
   224
#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
   225
#endif /* NETWORK_INTERNAL_H */