summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-07-17 11:19:20 +0000
committerrubidium <rubidium@openttd.org>2008-07-17 11:19:20 +0000
commit2e4f32023c8f8bb5e116d3779f1c90a33a823008 (patch)
tree99f9e6d200177e3369eb4e755598004f5bb54e2f /src/network
parent88848d78b5715854cf7788a83e83edeb084c9a9b (diff)
downloadopenttd-2e4f32023c8f8bb5e116d3779f1c90a33a823008.tar.xz
(svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/config.h1
-rw-r--r--src/network/network.cpp1
-rw-r--r--src/network/network_type.h2
3 files changed, 3 insertions, 1 deletions
diff --git a/src/network/core/config.h b/src/network/core/config.h
index 63ffb1c79..0a950d1f1 100644
--- a/src/network/core/config.h
+++ b/src/network/core/config.h
@@ -24,6 +24,7 @@ enum {
NETWORK_MASTER_SERVER_VERSION = 1, ///< What version of master-server-protocol do we use?
NETWORK_NAME_LENGTH = 80, ///< The maximum length of the server name and map name, in bytes including '\0'
+ NETWORK_COMPANY_NAME_LENGTH = 32, ///< The maximum length of the company name, in bytes including '\0'
NETWORK_HOSTNAME_LENGTH = 80, ///< The maximum length of the host name, in bytes including '\0'
NETWORK_UNIQUE_ID_LENGTH = 33, ///< The maximum length of the unique id of the clients, in bytes including '\0'
NETWORK_REVISION_LENGTH = 15, ///< The maximum length of the revision, in bytes including '\0'
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 56fe67e85..cd0b91408 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -70,6 +70,7 @@ uint8 _network_advertise_retries;
/* Check whether NETWORK_NUM_LANDSCAPES is still in sync with NUM_LANDSCAPE */
assert_compile((int)NETWORK_NUM_LANDSCAPES == (int)NUM_LANDSCAPE);
+assert_compile((int)NETWORK_COMPANY_NAME_LENGTH == MAX_LENGTH_COMPANY_NAME + 1);
// global variables (declared in network_data.h)
CommandPacket *_local_command_queue;
diff --git a/src/network/network_type.h b/src/network/network_type.h
index 17bf382dc..c05033696 100644
--- a/src/network/network_type.h
+++ b/src/network/network_type.h
@@ -35,7 +35,7 @@ enum {
};
struct NetworkPlayerInfo {
- char company_name[NETWORK_NAME_LENGTH]; ///< Company name
+ char company_name[NETWORK_COMPANY_NAME_LENGTH]; ///< Company name
char password[NETWORK_PASSWORD_LENGTH]; ///< The password for the player
Year inaugurated_year; ///< What year the company started in
Money company_value; ///< The company value