Fix: Data races on cursor state in OpenGL backends
[openttd-github.git] / src / network / core / config.h
blob3488b1ff28f16c8f6948793647be74a6f1a97887
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /**
9 * @file config.h Configuration options of the network stuff. It is used even when compiling without network support.
12 #ifndef NETWORK_CORE_CONFIG_H
13 #define NETWORK_CORE_CONFIG_H
15 /** DNS hostname of the masterserver */
16 static const char * const NETWORK_MASTER_SERVER_HOST = "master.openttd.org";
17 /** DNS hostname of the content server */
18 static const char * const NETWORK_CONTENT_SERVER_HOST = "content.openttd.org";
19 /** DNS hostname of the HTTP-content mirror server */
20 static const char * const NETWORK_CONTENT_MIRROR_HOST = "binaries.openttd.org";
21 /** URL of the HTTP mirror system */
22 static const char * const NETWORK_CONTENT_MIRROR_URL = "/bananas";
23 /** Message sent to the masterserver to 'identify' this client as OpenTTD */
24 static const char * const NETWORK_MASTER_SERVER_WELCOME_MESSAGE = "OpenTTDRegister";
26 static const uint16 NETWORK_MASTER_SERVER_PORT = 3978; ///< The default port of the master server (UDP)
27 static const uint16 NETWORK_CONTENT_SERVER_PORT = 3978; ///< The default port of the content server (TCP)
28 static const uint16 NETWORK_CONTENT_MIRROR_PORT = 80; ///< The default port of the content mirror (TCP)
29 static const uint16 NETWORK_DEFAULT_PORT = 3979; ///< The default port of the game server (TCP & UDP)
30 static const uint16 NETWORK_ADMIN_PORT = 3977; ///< The default port for admin network
31 static const uint16 NETWORK_DEFAULT_DEBUGLOG_PORT = 3982; ///< The default port debug-log is sent to (TCP)
33 static const uint16 SEND_MTU = 1460; ///< Number of bytes we can pack in a single packet
35 static const byte NETWORK_GAME_ADMIN_VERSION = 1; ///< What version of the admin network do we use?
36 static const byte NETWORK_GAME_INFO_VERSION = 4; ///< What version of game-info do we use?
37 static const byte NETWORK_COMPANY_INFO_VERSION = 6; ///< What version of company info is this?
38 static const byte NETWORK_MASTER_SERVER_VERSION = 2; ///< What version of master-server-protocol do we use?
40 static const uint NETWORK_NAME_LENGTH = 80; ///< The maximum length of the server name and map name, in bytes including '\0'
41 static const uint NETWORK_COMPANY_NAME_LENGTH = 128; ///< The maximum length of the company name, in bytes including '\0'
42 static const uint NETWORK_HOSTNAME_LENGTH = 80; ///< The maximum length of the host name, in bytes including '\0'
43 static const uint NETWORK_SERVER_ID_LENGTH = 33; ///< The maximum length of the network id of the servers, in bytes including '\0'
44 static const uint NETWORK_REVISION_LENGTH = 33; ///< The maximum length of the revision, in bytes including '\0'
45 static const uint NETWORK_PASSWORD_LENGTH = 33; ///< The maximum length of the password, in bytes including '\0' (must be >= NETWORK_SERVER_ID_LENGTH)
46 static const uint NETWORK_CLIENTS_LENGTH = 200; ///< The maximum length for the list of clients that controls a company, in bytes including '\0'
47 static const uint NETWORK_CLIENT_NAME_LENGTH = 25; ///< The maximum length of a client's name, in bytes including '\0'
48 static const uint NETWORK_RCONCOMMAND_LENGTH = 500; ///< The maximum length of a rconsole command, in bytes including '\0'
49 static const uint NETWORK_GAMESCRIPT_JSON_LENGTH = SEND_MTU - 3; ///< The maximum length of a gamescript json string, in bytes including '\0'. Must not be longer than SEND_MTU including header (3 bytes)
50 static const uint NETWORK_CHAT_LENGTH = 900; ///< The maximum length of a chat message, in bytes including '\0'
52 static const uint NETWORK_GRF_NAME_LENGTH = 80; ///< Maximum length of the name of a GRF
54 /**
55 * Maximum number of GRFs that can be sent.
56 * This limit is reached when PACKET_UDP_SERVER_RESPONSE reaches the maximum size of SEND_MTU bytes.
58 static const uint NETWORK_MAX_GRF_COUNT = 62;
60 static const uint NETWORK_NUM_LANGUAGES = 36; ///< Number of known languages (to the network protocol) + 1 for 'any'.
62 /**
63 * The number of landscapes in OpenTTD.
64 * This number must be equal to NUM_LANDSCAPE, but as this number is used
65 * within the network code and that the network code is shared with the
66 * masterserver/updater, it has to be declared in here too. In network.cpp
67 * there is a compile assertion to check that this NUM_LANDSCAPE is equal
68 * to NETWORK_NUM_LANDSCAPES.
70 static const uint NETWORK_NUM_LANDSCAPES = 4;
72 #endif /* NETWORK_CORE_CONFIG_H */