src/network/core/config.h
author rubidium
Wed, 13 Aug 2008 06:05:01 +0000
changeset 9913 d9ce89020cc0
parent 9902 035856ac432b
child 10207 c291a21b304e
permissions -rw-r--r--
(svn r14063) -Codechange: replace some "magic" constants with enumified constants.
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
     1
/* $Id$ */
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
     2
6121
2aae24b0881f (svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents: 5959
diff changeset
     3
/**
9460
327c77a497ae (svn r13378) -Fix (r13375): compilation without network support was broken
smatz
parents: 8870
diff changeset
     4
 * @file config.h Configuration options of the network stuff. It is used even when compiling without network support.
6121
2aae24b0881f (svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents: 5959
diff changeset
     5
 */
2aae24b0881f (svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents: 5959
diff changeset
     6
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
     7
#ifndef NETWORK_CORE_CONFIG_H
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
     8
#define NETWORK_CORE_CONFIG_H
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
     9
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    10
/** DNS hostname of the masterserver */
5552
527df7300907 (svn r7932) -Fix (r7931): committed a few files too much :( (the ones I used to test the new masterserver)
rubidium
parents: 5551
diff changeset
    11
#define NETWORK_MASTER_SERVER_HOST "master.openttd.org"
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    12
/** Message sent to the masterserver to 'identify' this client as OpenTTD */
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    13
#define NETWORK_MASTER_SERVER_WELCOME_MESSAGE "OpenTTDRegister"
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    14
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    15
enum {
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    16
	NETWORK_MASTER_SERVER_PORT    = 3978, ///< The default port of the master server (UDP)
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    17
	NETWORK_DEFAULT_PORT          = 3979, ///< The default port of the game server (TCP & UDP)
5959
98a64c6e7f1f (svn r8631) -Add: added parameter -l ip[:port] to ./openttd, which redirects DEBUG() to a remote connection over TCP
truelight
parents: 5864
diff changeset
    18
	NETWORK_DEFAULT_DEBUGLOG_PORT = 3982, ///< The default port debug-log is sent too (TCP)
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    19
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    20
	SEND_MTU                      = 1460, ///< Number of bytes we can pack in a single packet
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    21
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    22
	NETWORK_GAME_INFO_VERSION     =    4, ///< What version of game-info do we use?
9646
8c5f5d33027d (svn r13713) -Fix: possible crash on creating a network packet.
rubidium
parents: 9645
diff changeset
    23
	NETWORK_COMPANY_INFO_VERSION  =    5, ///< What version of company info is this?
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    24
	NETWORK_MASTER_SERVER_VERSION =    1, ///< What version of master-server-protocol do we use?
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    25
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    26
	NETWORK_NAME_LENGTH           =   80, ///< The maximum length of the server name and map name, in bytes including '\0'
9913
d9ce89020cc0 (svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents: 9902
diff changeset
    27
	NETWORK_COMPANY_NAME_LENGTH   =   31, ///< The maximum length of the company name, in bytes including '\0'
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    28
	NETWORK_HOSTNAME_LENGTH       =   80, ///< The maximum length of the host name, in bytes including '\0'
7807
b10fc6c5d081 (svn r11357) -Fix: NetworkUniqueID could be 80 chars, while the max size we generate is 32. So reduce the size a bit. Pointed out by dihedral, so give him a big hug ;)
truelight
parents: 6780
diff changeset
    29
	NETWORK_UNIQUE_ID_LENGTH      =   33, ///< The maximum length of the unique id of the clients, in bytes including '\0'
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    30
	NETWORK_REVISION_LENGTH       =   15, ///< The maximum length of the revision, in bytes including '\0'
7999
bb3a1508fd71 (svn r11557) -Codechange: send and store the passwords a little more secure to/in the servers.
rubidium
parents: 7807
diff changeset
    31
	NETWORK_PASSWORD_LENGTH       =   33, ///< The maximum length of the password, in bytes including '\0' (must be >= NETWORK_UNIQUE_ID_LENGTH)
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    32
	NETWORK_PLAYERS_LENGTH        =  200, ///< The maximum length for the list of players that controls a company, in bytes including '\0'
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    33
	NETWORK_CLIENT_NAME_LENGTH    =   25, ///< The maximum length of a player, in bytes including '\0'
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    34
	NETWORK_RCONCOMMAND_LENGTH    =  500, ///< The maximum length of a rconsole command, in bytes including '\0'
9902
035856ac432b (svn r14052) -Codechange: make the size of the chat message "box" configurable and increase the default size slightly so it can hold the longest chat messages.
rubidium
parents: 9896
diff changeset
    35
	NETWORK_CHAT_LENGTH           =  900, ///< The maximum length of a chat message, in bytes including '\0'
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    36
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    37
	NETWORK_GRF_NAME_LENGTH       =   80, ///< Maximum length of the name of a GRF
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    38
	/**
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    39
	 * Maximum number of GRFs that can be sent.
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    40
	 * This value is related to number of handles (files) OpenTTD can open.
8870
b83a4174cf2d (svn r12637) -Fix [FS#1913]: possible NULL pointer dereference when reading some NewGRF data.
rubidium
parents: 8730
diff changeset
    41
	 * This is currently 64. Two are used for configuration and sound.
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    42
	 */
8870
b83a4174cf2d (svn r12637) -Fix [FS#1913]: possible NULL pointer dereference when reading some NewGRF data.
rubidium
parents: 8730
diff changeset
    43
	NETWORK_MAX_GRF_COUNT         =   62,
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    44
8730
525e63adca4f (svn r12407) -Add [FS#1866]: more language flags for servers
glx
parents: 7999
diff changeset
    45
	NETWORK_NUM_LANGUAGES         =   36, ///< Number of known languages (to the network protocol) + 1 for 'any'.
5810
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    46
	/**
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    47
	 * The number of landscapes in OpenTTD.
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    48
	 * This number must be equal to NUM_LANDSCAPE, but as this number is used
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    49
	 * within the network code and that the network code is shared with the
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    50
	 * masterserver/updater, it has to be declared in here too. In network.cpp
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    51
	 * there is a compile assertion to check that this NUM_LANDSCAPE is equal
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    52
	 * to NETWORK_NUM_LANDSCAPES.
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    53
	 */
d24e5ce302b9 (svn r8372) -Fix (8361): NUM_LANDSCAPE comes (via some detour) from openttd.h, which does not exist in the masterserver/updater.
rubidium
parents: 5552
diff changeset
    54
	NETWORK_NUM_LANDSCAPES        =    4,
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    55
};
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    56
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
diff changeset
    57
#endif /* NETWORK_CORE_CONFIG_H */