Changeset - r25978:1911877bcb73
[Not reviewed]
src/lang/english.txt
Show inline comments
 
@@ -2403,24 +2403,25 @@ STR_COMPANY_VIEW_SET_PASSWORD           
 

	
 
# Network chat
 
STR_NETWORK_CHAT_SEND                                           :{BLACK}Send
 
STR_NETWORK_CHAT_COMPANY_CAPTION                                :[Team] :
 
STR_NETWORK_CHAT_CLIENT_CAPTION                                 :[Private] {RAW_STRING}:
 
STR_NETWORK_CHAT_ALL_CAPTION                                    :[All] :
 

	
 
STR_NETWORK_CHAT_COMPANY                                        :[Team] {RAW_STRING}: {WHITE}{RAW_STRING}
 
STR_NETWORK_CHAT_TO_COMPANY                                     :[Team] To {RAW_STRING}: {WHITE}{RAW_STRING}
 
STR_NETWORK_CHAT_CLIENT                                         :[Private] {RAW_STRING}: {WHITE}{RAW_STRING}
 
STR_NETWORK_CHAT_TO_CLIENT                                      :[Private] To {RAW_STRING}: {WHITE}{RAW_STRING}
 
STR_NETWORK_CHAT_ALL                                            :[All] {RAW_STRING}: {WHITE}{RAW_STRING}
 
STR_NETWORK_CHAT_EXTERNAL                                       :[{3:RAW_STRING}] {0:RAW_STRING}: {WHITE}{1:RAW_STRING}
 
STR_NETWORK_CHAT_OSKTITLE                                       :{BLACK}Enter text for network chat
 

	
 
# Network messages
 
STR_NETWORK_ERROR_NOTAVAILABLE                                  :{WHITE}No network devices found
 
STR_NETWORK_ERROR_NOCONNECTION                                  :{WHITE}Connection to the server timed out or was refused
 
STR_NETWORK_ERROR_NEWGRF_MISMATCH                               :{WHITE}Could not connect due to NewGRF mismatch
 
STR_NETWORK_ERROR_DESYNC                                        :{WHITE}Network-Game synchronisation failed
 
STR_NETWORK_ERROR_LOSTCONNECTION                                :{WHITE}Network-Game connection lost
 
STR_NETWORK_ERROR_SAVEGAMEERROR                                 :{WHITE}Could not load savegame
 
STR_NETWORK_ERROR_SERVER_START                                  :{WHITE}Could not start the server
 
STR_NETWORK_ERROR_SERVER_ERROR                                  :{WHITE}A protocol error was detected and the connection was closed
 
STR_NETWORK_ERROR_BAD_PLAYER_NAME                               :{WHITE}Your player name has not been set. The name can be set at the top of the Multiplayer window
src/network/core/tcp_admin.cpp
Show inline comments
 
@@ -44,24 +44,25 @@ NetworkRecvStatus NetworkAdminSocketHand
 
 * @return #NetworkRecvStatus of handling.
 
 */
 
NetworkRecvStatus NetworkAdminSocketHandler::HandlePacket(Packet *p)
 
{
 
	PacketAdminType type = (PacketAdminType)p->Recv_uint8();
 

	
 
	switch (this->HasClientQuit() ? INVALID_ADMIN_PACKET : type) {
 
		case ADMIN_PACKET_ADMIN_JOIN:             return this->Receive_ADMIN_JOIN(p);
 
		case ADMIN_PACKET_ADMIN_QUIT:             return this->Receive_ADMIN_QUIT(p);
 
		case ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY: return this->Receive_ADMIN_UPDATE_FREQUENCY(p);
 
		case ADMIN_PACKET_ADMIN_POLL:             return this->Receive_ADMIN_POLL(p);
 
		case ADMIN_PACKET_ADMIN_CHAT:             return this->Receive_ADMIN_CHAT(p);
 
		case ADMIN_PACKET_ADMIN_EXTERNAL_CHAT:    return this->Receive_ADMIN_EXTERNAL_CHAT(p);
 
		case ADMIN_PACKET_ADMIN_RCON:             return this->Receive_ADMIN_RCON(p);
 
		case ADMIN_PACKET_ADMIN_GAMESCRIPT:       return this->Receive_ADMIN_GAMESCRIPT(p);
 
		case ADMIN_PACKET_ADMIN_PING:             return this->Receive_ADMIN_PING(p);
 

	
 
		case ADMIN_PACKET_SERVER_FULL:            return this->Receive_SERVER_FULL(p);
 
		case ADMIN_PACKET_SERVER_BANNED:          return this->Receive_SERVER_BANNED(p);
 
		case ADMIN_PACKET_SERVER_ERROR:           return this->Receive_SERVER_ERROR(p);
 
		case ADMIN_PACKET_SERVER_PROTOCOL:        return this->Receive_SERVER_PROTOCOL(p);
 
		case ADMIN_PACKET_SERVER_WELCOME:         return this->Receive_SERVER_WELCOME(p);
 
		case ADMIN_PACKET_SERVER_NEWGAME:         return this->Receive_SERVER_NEWGAME(p);
 
		case ADMIN_PACKET_SERVER_SHUTDOWN:        return this->Receive_SERVER_SHUTDOWN(p);
 

	
 
@@ -123,24 +124,25 @@ NetworkRecvStatus NetworkAdminSocketHand
 
 */
 
NetworkRecvStatus NetworkAdminSocketHandler::ReceiveInvalidPacket(PacketAdminType type)
 
{
 
	Debug(net, 0, "[tcp/admin] Received illegal packet type {} from admin {} ({})", type, this->admin_name, this->admin_version);
 
	return NETWORK_RECV_STATUS_MALFORMED_PACKET;
 
}
 

	
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_JOIN(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_JOIN); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_QUIT(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_QUIT); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_UPDATE_FREQUENCY(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_POLL(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_POLL); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_CHAT(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_CHAT); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_EXTERNAL_CHAT(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_EXTERNAL_CHAT); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_RCON(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_RCON); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_GAMESCRIPT(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_GAMESCRIPT); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_ADMIN_PING(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_ADMIN_PING); }
 

	
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_FULL(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_FULL); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_BANNED(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_BANNED); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_ERROR(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_ERROR); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_PROTOCOL(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_PROTOCOL); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_WELCOME(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_WELCOME); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_NEWGAME(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_NEWGAME); }
 
NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_SHUTDOWN(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_SHUTDOWN); }
 

	
src/network/core/tcp_admin.h
Show inline comments
 
@@ -21,24 +21,25 @@
 
 * Enum with types of TCP packets specific to the admin network.
 
 * This protocol may only be extended to ensure stability.
 
 */
 
enum PacketAdminType {
 
	ADMIN_PACKET_ADMIN_JOIN,             ///< The admin announces and authenticates itself to the server.
 
	ADMIN_PACKET_ADMIN_QUIT,             ///< The admin tells the server that it is quitting.
 
	ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY, ///< The admin tells the server the update frequency of a particular piece of information.
 
	ADMIN_PACKET_ADMIN_POLL,             ///< The admin explicitly polls for a piece of information.
 
	ADMIN_PACKET_ADMIN_CHAT,             ///< The admin sends a chat message to be distributed.
 
	ADMIN_PACKET_ADMIN_RCON,             ///< The admin sends a remote console command.
 
	ADMIN_PACKET_ADMIN_GAMESCRIPT,       ///< The admin sends a JSON string for the GameScript.
 
	ADMIN_PACKET_ADMIN_PING,             ///< The admin sends a ping to the server, expecting a ping-reply (PONG) packet.
 
	ADMIN_PACKET_ADMIN_EXTERNAL_CHAT,    ///< The admin sends a chat message from external source.
 

	
 
	ADMIN_PACKET_SERVER_FULL = 100,      ///< The server tells the admin it cannot accept the admin.
 
	ADMIN_PACKET_SERVER_BANNED,          ///< The server tells the admin it is banned.
 
	ADMIN_PACKET_SERVER_ERROR,           ///< The server tells the admin an error has occurred.
 
	ADMIN_PACKET_SERVER_PROTOCOL,        ///< The server tells the admin its protocol version.
 
	ADMIN_PACKET_SERVER_WELCOME,         ///< The server welcomes the admin to a game.
 
	ADMIN_PACKET_SERVER_NEWGAME,         ///< The server tells the admin its going to start a new game.
 
	ADMIN_PACKET_SERVER_SHUTDOWN,        ///< The server tells the admin its shutting down.
 

	
 
	ADMIN_PACKET_SERVER_DATE,            ///< The server tells the admin what the current game date is.
 
	ADMIN_PACKET_SERVER_CLIENT_JOIN,     ///< The server tells the admin that a client has joined.
 
	ADMIN_PACKET_SERVER_CLIENT_INFO,     ///< The server gives the admin information about a client.
 
@@ -155,24 +156,35 @@ protected:
 
	/**
 
	 * Send chat as the server:
 
	 * uint8   Action such as NETWORK_ACTION_CHAT_CLIENT (see #NetworkAction).
 
	 * uint8   Destination type such as DESTTYPE_BROADCAST (see #DestType).
 
	 * uint32  ID of the destination such as company or client id.
 
	 * string  Message.
 
	 * @param p The packet that was just received.
 
	 * @return The state the network should have.
 
	 */
 
	virtual NetworkRecvStatus Receive_ADMIN_CHAT(Packet *p);
 

	
 
	/**
 
	 * Send chat from the external source:
 
	 * string  Name of the source this message came from.
 
	 * uint16  TextColour to use for the message.
 
	 * string  Name of the user who sent the messsage.
 
	 * string  Message.
 
	 * @param p The packet that was just received.
 
	 * @return The state the network should have.
 
	 */
 
	virtual NetworkRecvStatus Receive_ADMIN_EXTERNAL_CHAT(Packet *p);
 

	
 
	/**
 
	 * Execute a command on the servers console:
 
	 * string  Command to be executed.
 
	 * @param p The packet that was just received.
 
	 * @return The state the network should have.
 
	 */
 
	virtual NetworkRecvStatus Receive_ADMIN_RCON(Packet *p);
 

	
 
	/**
 
	 * Send a JSON string to the current active GameScript.
 
	 * json  JSON string for the GameScript.
 
	 * @param p The packet that was just received.
 
	 * @return The state the network should have.
src/network/core/tcp_game.cpp
Show inline comments
 
@@ -85,24 +85,25 @@ NetworkRecvStatus NetworkGameSocketHandl
 
		case PACKET_SERVER_MAP_SIZE:              return this->Receive_SERVER_MAP_SIZE(p);
 
		case PACKET_SERVER_MAP_DATA:              return this->Receive_SERVER_MAP_DATA(p);
 
		case PACKET_SERVER_MAP_DONE:              return this->Receive_SERVER_MAP_DONE(p);
 
		case PACKET_CLIENT_MAP_OK:                return this->Receive_CLIENT_MAP_OK(p);
 
		case PACKET_SERVER_JOIN:                  return this->Receive_SERVER_JOIN(p);
 
		case PACKET_SERVER_FRAME:                 return this->Receive_SERVER_FRAME(p);
 
		case PACKET_SERVER_SYNC:                  return this->Receive_SERVER_SYNC(p);
 
		case PACKET_CLIENT_ACK:                   return this->Receive_CLIENT_ACK(p);
 
		case PACKET_CLIENT_COMMAND:               return this->Receive_CLIENT_COMMAND(p);
 
		case PACKET_SERVER_COMMAND:               return this->Receive_SERVER_COMMAND(p);
 
		case PACKET_CLIENT_CHAT:                  return this->Receive_CLIENT_CHAT(p);
 
		case PACKET_SERVER_CHAT:                  return this->Receive_SERVER_CHAT(p);
 
		case PACKET_SERVER_EXTERNAL_CHAT:         return this->Receive_SERVER_EXTERNAL_CHAT(p);
 
		case PACKET_CLIENT_SET_PASSWORD:          return this->Receive_CLIENT_SET_PASSWORD(p);
 
		case PACKET_CLIENT_SET_NAME:              return this->Receive_CLIENT_SET_NAME(p);
 
		case PACKET_CLIENT_QUIT:                  return this->Receive_CLIENT_QUIT(p);
 
		case PACKET_CLIENT_ERROR:                 return this->Receive_CLIENT_ERROR(p);
 
		case PACKET_SERVER_QUIT:                  return this->Receive_SERVER_QUIT(p);
 
		case PACKET_SERVER_ERROR_QUIT:            return this->Receive_SERVER_ERROR_QUIT(p);
 
		case PACKET_SERVER_SHUTDOWN:              return this->Receive_SERVER_SHUTDOWN(p);
 
		case PACKET_SERVER_NEWGAME:               return this->Receive_SERVER_NEWGAME(p);
 
		case PACKET_SERVER_RCON:                  return this->Receive_SERVER_RCON(p);
 
		case PACKET_CLIENT_RCON:                  return this->Receive_CLIENT_RCON(p);
 
		case PACKET_SERVER_CHECK_NEWGRFS:         return this->Receive_SERVER_CHECK_NEWGRFS(p);
 
		case PACKET_CLIENT_NEWGRFS_CHECKED:       return this->Receive_CLIENT_NEWGRFS_CHECKED(p);
 
@@ -171,24 +172,25 @@ NetworkRecvStatus NetworkGameSocketHandl
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_MAP_SIZE(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_MAP_SIZE); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_MAP_DATA(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_MAP_DATA); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_MAP_DONE(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_MAP_DONE); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_MAP_OK(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_MAP_OK); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_JOIN(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_JOIN); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_FRAME(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_FRAME); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_SYNC(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_SYNC); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_ACK(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_ACK); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_COMMAND(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_COMMAND); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_COMMAND(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_COMMAND); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_CHAT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_CHAT); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_CHAT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_CHAT); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_EXTERNAL_CHAT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_EXTERNAL_CHAT); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_SET_PASSWORD(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_SET_PASSWORD); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_SET_NAME(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_SET_NAME); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_QUIT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_QUIT); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_ERROR(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_ERROR); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_QUIT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_QUIT); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_ERROR_QUIT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_ERROR_QUIT); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_SHUTDOWN(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_SHUTDOWN); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_NEWGAME(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_NEWGAME); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_RCON(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_RCON); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_RCON(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_RCON); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_CHECK_NEWGRFS(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_CHECK_NEWGRFS); }
 
NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_NEWGRFS_CHECKED(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_NEWGRFS_CHECKED); }
src/network/core/tcp_game.h
Show inline comments
 
@@ -90,24 +90,25 @@ enum PacketGameType {
 
	/* Game progress monitoring. */
 
	PACKET_SERVER_FRAME,                 ///< Server tells the client what frame it is in, and thus to where the client may progress.
 
	PACKET_CLIENT_ACK,                   ///< The client tells the server which frame it has executed.
 
	PACKET_SERVER_SYNC,                  ///< Server tells the client what the random state should be.
 

	
 
	/* Sending commands around. */
 
	PACKET_CLIENT_COMMAND,               ///< Client executed a command and sends it to the server.
 
	PACKET_SERVER_COMMAND,               ///< Server distributes a command to (all) the clients.
 

	
 
	/* Human communication! */
 
	PACKET_CLIENT_CHAT,                  ///< Client said something that should be distributed.
 
	PACKET_SERVER_CHAT,                  ///< Server distributing the message of a client (or itself).
 
	PACKET_SERVER_EXTERNAL_CHAT,         ///< Server distributing the message from external source.
 

	
 
	/* Remote console. */
 
	PACKET_CLIENT_RCON,                  ///< Client asks the server to execute some command.
 
	PACKET_SERVER_RCON,                  ///< Response of the executed command on the server.
 

	
 
	/* Moving a client.*/
 
	PACKET_CLIENT_MOVE,                  ///< A client would like to be moved to another company.
 
	PACKET_SERVER_MOVE,                  ///< Server tells everyone that someone is moved to another company.
 

	
 
	/* Configuration updates. */
 
	PACKET_CLIENT_SET_PASSWORD,          ///< A client (re)sets its company's password.
 
	PACKET_CLIENT_SET_NAME,              ///< A client changes its name.
 
@@ -370,24 +371,34 @@ protected:
 

	
 
	/**
 
	 * Sends a chat-packet to the client:
 
	 * uint8   ID of the action (see NetworkAction).
 
	 * uint32  ID of the client (origin of the chat).
 
	 * string  Message (max NETWORK_CHAT_LENGTH).
 
	 * uint64  data (used e.g. for 'give money' actions).
 
	 * @param p The packet that was just received.
 
	 */
 
	virtual NetworkRecvStatus Receive_SERVER_CHAT(Packet *p);
 

	
 
	/**
 
	 * Sends a chat-packet for external source to the client:
 
	 * string  Name of the source this message came from.
 
	 * uint16  TextColour to use for the message.
 
	 * string  Name of the user who sent the messsage.
 
	 * string  Message (max NETWORK_CHAT_LENGTH).
 
	 * @param p The packet that was just received.
 
	 */
 
	virtual NetworkRecvStatus Receive_SERVER_EXTERNAL_CHAT(Packet *p);
 

	
 
	/**
 
	 * Set the password for the clients current company:
 
	 * string  The password.
 
	 * @param p The packet that was just received.
 
	 */
 
	virtual NetworkRecvStatus Receive_CLIENT_SET_PASSWORD(Packet *p);
 

	
 
	/**
 
	 * Gives the client a new name:
 
	 * string  New name of the client.
 
	 * @param p The packet that was just received.
 
	 */
 
	virtual NetworkRecvStatus Receive_CLIENT_SET_NAME(Packet *p);
src/network/network.cpp
Show inline comments
 
@@ -208,25 +208,25 @@ std::string GenerateCompanyPasswordHash(
 
 * Check if the company we want to join requires a password.
 
 * @param company_id id of the company we want to check the 'passworded' flag for.
 
 * @return true if the company requires a password.
 
 */
 
bool NetworkCompanyIsPassworded(CompanyID company_id)
 
{
 
	return HasBit(_network_company_passworded, company_id);
 
}
 

	
 
/* This puts a text-message to the console, or in the future, the chat-box,
 
 *  (to keep it all a bit more general)
 
 * If 'self_send' is true, this is the client who is sending the message */
 
void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send, const std::string &name, const std::string &str, int64 data)
 
void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send, const std::string &name, const std::string &str, int64 data, const std::string &data_str)
 
{
 
	StringID strid;
 
	switch (action) {
 
		case NETWORK_ACTION_SERVER_MESSAGE:
 
			/* Ignore invalid messages */
 
			strid = STR_NETWORK_SERVER_MESSAGE;
 
			colour = CC_DEFAULT;
 
			break;
 
		case NETWORK_ACTION_COMPANY_SPECTATOR:
 
			colour = CC_DEFAULT;
 
			strid = STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE;
 
			break;
 
@@ -239,42 +239,44 @@ void NetworkTextMessage(NetworkAction ac
 
			strid = STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW;
 
			break;
 
		case NETWORK_ACTION_JOIN:
 
			/* Show the Client ID for the server but not for the client. */
 
			strid = _network_server ? STR_NETWORK_MESSAGE_CLIENT_JOINED_ID :  STR_NETWORK_MESSAGE_CLIENT_JOINED;
 
			break;
 
		case NETWORK_ACTION_LEAVE:          strid = STR_NETWORK_MESSAGE_CLIENT_LEFT; break;
 
		case NETWORK_ACTION_NAME_CHANGE:    strid = STR_NETWORK_MESSAGE_NAME_CHANGE; break;
 
		case NETWORK_ACTION_GIVE_MONEY:     strid = STR_NETWORK_MESSAGE_GIVE_MONEY; break;
 
		case NETWORK_ACTION_CHAT_COMPANY:   strid = self_send ? STR_NETWORK_CHAT_TO_COMPANY : STR_NETWORK_CHAT_COMPANY; break;
 
		case NETWORK_ACTION_CHAT_CLIENT:    strid = self_send ? STR_NETWORK_CHAT_TO_CLIENT  : STR_NETWORK_CHAT_CLIENT;  break;
 
		case NETWORK_ACTION_KICKED:         strid = STR_NETWORK_MESSAGE_KICKED; break;
 
		case NETWORK_ACTION_EXTERNAL_CHAT:  strid = STR_NETWORK_CHAT_EXTERNAL; break;
 
		default:                            strid = STR_NETWORK_CHAT_ALL; break;
 
	}
 

	
 
	char message[1024];
 
	SetDParamStr(0, name);
 
	SetDParamStr(1, str);
 
	SetDParam(2, data);
 
	SetDParamStr(3, data_str);
 

	
 
	/* All of these strings start with "***". These characters are interpreted as both left-to-right and
 
	 * right-to-left characters depending on the context. As the next text might be an user's name, the
 
	 * user name's characters will influence the direction of the "***" instead of the language setting
 
	 * of the game. Manually set the direction of the "***" by inserting a text-direction marker. */
 
	char *msg_ptr = message + Utf8Encode(message, _current_text_dir == TD_LTR ? CHAR_TD_LRM : CHAR_TD_RLM);
 
	GetString(msg_ptr, strid, lastof(message));
 

	
 
	Debug(desync, 1, "msg: {:08x}; {:02x}; {}", _date, _date_fract, message);
 
	IConsolePrint(colour, message);
 
	NetworkAddChatMessage((TextColour)colour, _settings_client.gui.network_chat_timeout, message);
 
	NetworkAddChatMessage(colour, _settings_client.gui.network_chat_timeout, message);
 
}
 

	
 
/* Calculate the frame-lag of a client */
 
uint NetworkCalculateLag(const NetworkClientSocket *cs)
 
{
 
	int lag = cs->last_frame_server - cs->last_frame;
 
	/* This client has missed their ACK packet after 1 DAY_TICKS..
 
	 *  so we increase their lag for every frame that passes!
 
	 * The packet can be out by a max of _net_frame_freq */
 
	if (cs->last_frame_server + DAY_TICKS + _settings_client.network.frame_freq < _frame_counter) {
 
		lag += _frame_counter - (cs->last_frame_server + DAY_TICKS + _settings_client.network.frame_freq);
 
	}
src/network/network_admin.cpp
Show inline comments
 
@@ -781,24 +781,43 @@ NetworkRecvStatus ServerNetworkAdminSock
 
		case NETWORK_ACTION_SERVER_MESSAGE:
 
			NetworkServerSendChat(action, desttype, dest, msg, _network_own_client_id, 0, true);
 
			break;
 

	
 
		default:
 
			Debug(net, 1, "[admin] Invalid chat action {} from admin '{}' ({}).", action, this->admin_name, this->admin_version);
 
			return this->SendError(NETWORK_ERROR_ILLEGAL_PACKET);
 
	}
 

	
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_EXTERNAL_CHAT(Packet *p)
 
{
 
	if (this->status == ADMIN_STATUS_INACTIVE) return this->SendError(NETWORK_ERROR_NOT_EXPECTED);
 

	
 
	std::string source = p->Recv_string(NETWORK_CHAT_LENGTH);
 
	TextColour colour = (TextColour)p->Recv_uint16();
 
	std::string user = p->Recv_string(NETWORK_CHAT_LENGTH);
 
	std::string msg = p->Recv_string(NETWORK_CHAT_LENGTH);
 

	
 
	if (!IsValidConsoleColour(colour)) {
 
		Debug(net, 1, "[admin] Not supported chat colour {} ({}, {}, {}) from '{}' ({}).", (uint16)colour, source, user, msg, this->admin_name, this->admin_version);
 
		return this->SendError(NETWORK_ERROR_ILLEGAL_PACKET);
 
	}
 

	
 
	NetworkServerSendExternalChat(source, colour, user, msg);
 

	
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
/*
 
 * Useful wrapper functions
 
 */
 

	
 
/**
 
 * Notify the admin network of a new client (if they did opt in for the respective update).
 
 * @param cs the client info.
 
 * @param new_client if this is a new client, send the respective packet too.
 
 */
 
void NetworkAdminClientInfo(const NetworkClientSocket *cs, bool new_client)
 
{
 
	for (ServerNetworkAdminSocketHandler *as : ServerNetworkAdminSocketHandler::IterateActive()) {
src/network/network_admin.h
Show inline comments
 
@@ -20,24 +20,25 @@ class ServerNetworkAdminSocketHandler;
 
/** Pool with all admin connections. */
 
typedef Pool<ServerNetworkAdminSocketHandler, AdminIndex, 2, MAX_ADMINS, PT_NADMIN> NetworkAdminSocketPool;
 
extern NetworkAdminSocketPool _networkadminsocket_pool;
 

	
 
/** Class for handling the server side of the game connection. */
 
class ServerNetworkAdminSocketHandler : public NetworkAdminSocketPool::PoolItem<&_networkadminsocket_pool>, public NetworkAdminSocketHandler, public TCPListenHandler<ServerNetworkAdminSocketHandler, ADMIN_PACKET_SERVER_FULL, ADMIN_PACKET_SERVER_BANNED> {
 
protected:
 
	NetworkRecvStatus Receive_ADMIN_JOIN(Packet *p) override;
 
	NetworkRecvStatus Receive_ADMIN_QUIT(Packet *p) override;
 
	NetworkRecvStatus Receive_ADMIN_UPDATE_FREQUENCY(Packet *p) override;
 
	NetworkRecvStatus Receive_ADMIN_POLL(Packet *p) override;
 
	NetworkRecvStatus Receive_ADMIN_CHAT(Packet *p) override;
 
	NetworkRecvStatus Receive_ADMIN_EXTERNAL_CHAT(Packet *p) override;
 
	NetworkRecvStatus Receive_ADMIN_RCON(Packet *p) override;
 
	NetworkRecvStatus Receive_ADMIN_GAMESCRIPT(Packet *p) override;
 
	NetworkRecvStatus Receive_ADMIN_PING(Packet *p) override;
 

	
 
	NetworkRecvStatus SendProtocol();
 
	NetworkRecvStatus SendPong(uint32 d1);
 
public:
 
	AdminUpdateFrequency update_frequency[ADMIN_UPDATE_END]; ///< Admin requested update intervals.
 
	std::chrono::steady_clock::time_point connect_time;      ///< Time of connection.
 
	NetworkAddress address;                                  ///< Address of the admin.
 

	
 
	ServerNetworkAdminSocketHandler(SOCKET s);
src/network/network_chat_gui.cpp
Show inline comments
 
@@ -86,25 +86,25 @@ static inline bool HaveChatMessages(bool
 
 * @param colour The colour this message is to be shown in
 
 * @param duration The duration of the chat message in seconds
 
 * @param message message itself in printf() style
 
 */
 
void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const std::string &message)
 
{
 
	if (_chatmsg_list.size() == MAX_CHAT_MESSAGES) {
 
		_chatmsg_list.pop_back();
 
	}
 

	
 
	ChatMessage *cmsg = &_chatmsg_list.emplace_front();
 
	cmsg->message = message;
 
	cmsg->colour = (colour & TC_IS_PALETTE_COLOUR) ? colour : TC_WHITE;
 
	cmsg->colour = colour;
 
	cmsg->remove_time = std::chrono::steady_clock::now() + std::chrono::seconds(duration);
 

	
 
	_chatmessage_dirty_time = std::chrono::steady_clock::now();
 
	_chatmessage_dirty = true;
 
}
 

	
 
/** Initialize all font-dependent chat box sizes. */
 
void NetworkReInitChatBoxSize()
 
{
 
	_chatmsg_box.y       = 3 * FONT_HEIGHT_NORMAL;
 
	_chatmsg_box.height  = MAX_CHAT_MESSAGES * (FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING) + 4;
 
	_chatmessage_backup  = ReallocT(_chatmessage_backup, _chatmsg_box.width * _chatmsg_box.height * BlitterFactory::GetCurrentBlitter()->GetBytesPerPixel());
src/network/network_client.cpp
Show inline comments
 
@@ -954,24 +954,40 @@ NetworkRecvStatus ClientNetworkGameSocke
 
	} else {
 
		/* Display message from somebody else */
 
		name = ci_to->client_name;
 
		ci = ci_to;
 
	}
 

	
 
	if (ci != nullptr) {
 
		NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), self_send, name, msg, data);
 
	}
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_EXTERNAL_CHAT(Packet *p)
 
{
 
	if (this->status != STATUS_ACTIVE) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
 

	
 
	std::string source = p->Recv_string(NETWORK_CHAT_LENGTH);
 
	TextColour colour = (TextColour)p->Recv_uint16();
 
	std::string user = p->Recv_string(NETWORK_CHAT_LENGTH);
 
	std::string msg = p->Recv_string(NETWORK_CHAT_LENGTH);
 

	
 
	if (!IsValidConsoleColour(colour)) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
 

	
 
	NetworkTextMessage(NETWORK_ACTION_EXTERNAL_CHAT, colour, false, user, msg, 0, source);
 

	
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_ERROR_QUIT(Packet *p)
 
{
 
	if (this->status < STATUS_AUTHORIZED) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
 

	
 
	ClientID client_id = (ClientID)p->Recv_uint32();
 

	
 
	NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(client_id);
 
	if (ci != nullptr) {
 
		NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, ci->client_name, "", GetNetworkErrorMsg((NetworkErrorCode)p->Recv_uint8()));
 
		delete ci;
 
	}
 

	
src/network/network_client.h
Show inline comments
 
@@ -48,24 +48,25 @@ protected:
 
	NetworkRecvStatus Receive_SERVER_NEED_COMPANY_PASSWORD(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_WELCOME(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_WAIT(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_MAP_BEGIN(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_MAP_SIZE(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_MAP_DATA(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_MAP_DONE(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_JOIN(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_FRAME(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_SYNC(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_COMMAND(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_CHAT(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_EXTERNAL_CHAT(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_QUIT(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_ERROR_QUIT(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_SHUTDOWN(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_NEWGAME(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_RCON(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_CHECK_NEWGRFS(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_MOVE(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet *p) override;
 
	NetworkRecvStatus Receive_SERVER_CONFIG_UPDATE(Packet *p) override;
 

	
 
	static NetworkRecvStatus SendNewGRFsOk();
 
	static NetworkRecvStatus SendGetMap();
src/network/network_func.h
Show inline comments
 
@@ -69,24 +69,25 @@ void NetworkServerMonthlyLoop();
 
void NetworkServerYearlyLoop();
 
void NetworkServerSendConfigUpdate();
 
void NetworkServerUpdateGameInfo();
 
void NetworkServerShowStatusToConsole();
 
bool NetworkServerStart();
 
void NetworkServerNewCompany(const Company *company, NetworkClientInfo *ci);
 
bool NetworkServerChangeClientName(ClientID client_id, const std::string &new_name);
 

	
 

	
 
void NetworkServerDoMove(ClientID client_id, CompanyID company_id);
 
void NetworkServerSendRcon(ClientID client_id, TextColour colour_code, const std::string &string);
 
void NetworkServerSendChat(NetworkAction action, DestType type, int dest, const std::string &msg, ClientID from_id, int64 data = 0, bool from_admin = false);
 
void NetworkServerSendExternalChat(const std::string &source, TextColour colour, const std::string &user, const std::string &msg);
 

	
 
void NetworkServerKickClient(ClientID client_id, const std::string &reason);
 
uint NetworkServerKickOrBanIP(ClientID client_id, bool ban, const std::string &reason);
 
uint NetworkServerKickOrBanIP(const std::string &ip, bool ban, const std::string &reason);
 

	
 
void NetworkInitChatMessage();
 
void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const std::string &message);
 
void NetworkUndrawChatMessage();
 
void NetworkChatMessageLoop();
 

	
 
void NetworkAfterNewGRFScan();
 

	
src/network/network_internal.h
Show inline comments
 
@@ -110,23 +110,23 @@ struct CommandPacket : CommandContainer 
 
	CommandPacket *next; ///< the next command packet (if in queue)
 
	CompanyID company;   ///< company that is executing the command
 
	uint32 frame;        ///< the frame in which this packet is executed
 
	bool my_cmd;         ///< did the command originate from "me"
 
};
 

	
 
void NetworkDistributeCommands();
 
void NetworkExecuteLocalCommandQueue();
 
void NetworkFreeLocalCommandQueue();
 
void NetworkSyncCommandQueue(NetworkClientSocket *cs);
 

	
 
void ShowNetworkError(StringID error_string);
 
void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send, const std::string &name, const std::string &str = "", int64 data = 0);
 
void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send, const std::string &name, const std::string &str = "", int64 data = 0, const std::string &data_str = "");
 
uint NetworkCalculateLag(const NetworkClientSocket *cs);
 
StringID GetNetworkErrorMsg(NetworkErrorCode err);
 
bool NetworkMakeClientNameUnique(std::string &new_name);
 
std::string GenerateCompanyPasswordHash(const std::string &password, const std::string &password_server_id, uint32 password_game_seed);
 

	
 
std::string_view ParseCompanyFromConnectionString(const std::string &connection_string, CompanyID *company_id);
 
NetworkAddress ParseConnectionString(const std::string &connection_string, uint16 default_port);
 
std::string NormalizeConnectionString(const std::string &connection_string, uint16 default_port);
 

	
 
#endif /* NETWORK_INTERNAL_H */
src/network/network_server.cpp
Show inline comments
 
@@ -662,24 +662,46 @@ NetworkRecvStatus ServerNetworkGameSocke
 

	
 
	p->Send_uint8 (action);
 
	p->Send_uint32(client_id);
 
	p->Send_bool  (self_send);
 
	p->Send_string(msg);
 
	p->Send_uint64(data);
 

	
 
	this->SendPacket(p);
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
/**
 
 * Send a chat message from external source.
 
 * @param source Name of the source this message came from.
 
 * @param colour TextColour to use for the message.
 
 * @param user Name of the user who sent the messsage.
 
 * @param msg The actual message.
 
 */
 
NetworkRecvStatus ServerNetworkGameSocketHandler::SendExternalChat(const std::string &source, TextColour colour, const std::string &user, const std::string &msg)
 
{
 
	if (this->status < STATUS_PRE_ACTIVE) return NETWORK_RECV_STATUS_OKAY;
 

	
 
	Packet *p = new Packet(PACKET_SERVER_EXTERNAL_CHAT);
 

	
 
	p->Send_string(source);
 
	p->Send_uint16(colour);
 
	p->Send_string(user);
 
	p->Send_string(msg);
 

	
 
	this->SendPacket(p);
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
/**
 
 * Tell the client another client quit with an error.
 
 * @param client_id The client that quit.
 
 * @param errorno The reason the client quit.
 
 */
 
NetworkRecvStatus ServerNetworkGameSocketHandler::SendErrorQuit(ClientID client_id, NetworkErrorCode errorno)
 
{
 
	Packet *p = new Packet(PACKET_SERVER_ERROR_QUIT);
 

	
 
	p->Send_uint32(client_id);
 
	p->Send_uint8 (errorno);
 

	
 
	this->SendPacket(p);
 
@@ -1253,30 +1275,45 @@ void NetworkServerSendChat(NetworkAction
 
			Debug(net, 1, "Received unknown chat destination type {}; doing broadcast instead", desttype);
 
			FALLTHROUGH;
 

	
 
		case DESTTYPE_BROADCAST:
 
			for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) {
 
				cs->SendChat(action, from_id, false, msg, data);
 
			}
 

	
 
			NetworkAdminChat(action, desttype, from_id, msg, data, from_admin);
 

	
 
			ci = NetworkClientInfo::GetByClientID(from_id);
 
			if (ci != nullptr) {
 
				NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
 
				NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data, "");
 
			}
 
			break;
 
	}
 
}
 

	
 
/**
 
 * Send a chat message from external source.
 
 * @param source Name of the source this message came from.
 
 * @param colour TextColour to use for the message.
 
 * @param user Name of the user who sent the messsage.
 
 * @param msg The actual message.
 
 */
 
void NetworkServerSendExternalChat(const std::string &source, TextColour colour, const std::string &user, const std::string &msg)
 
{
 
	for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) {
 
		cs->SendExternalChat(source, colour, user, msg);
 
	}
 
	NetworkTextMessage(NETWORK_ACTION_EXTERNAL_CHAT, colour, false, user, msg, 0, source);
 
}
 

	
 
NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_CHAT(Packet *p)
 
{
 
	if (this->status < STATUS_PRE_ACTIVE) {
 
		/* Illegal call, return error and ignore the packet */
 
		return this->SendError(NETWORK_ERROR_NOT_AUTHORIZED);
 
	}
 

	
 
	NetworkAction action = (NetworkAction)p->Recv_uint8();
 
	DestType desttype = (DestType)p->Recv_uint8();
 
	int dest = p->Recv_uint32();
 

	
 
	std::string msg = p->Recv_string(NETWORK_CHAT_LENGTH);
src/network/network_server.h
Show inline comments
 
@@ -84,24 +84,25 @@ public:
 
	NetworkRecvStatus SendWait();
 
	NetworkRecvStatus SendMap();
 
	NetworkRecvStatus SendErrorQuit(ClientID client_id, NetworkErrorCode errorno);
 
	NetworkRecvStatus SendQuit(ClientID client_id);
 
	NetworkRecvStatus SendShutdown();
 
	NetworkRecvStatus SendNewGame();
 
	NetworkRecvStatus SendRConResult(uint16 colour, const std::string &command);
 
	NetworkRecvStatus SendMove(ClientID client_id, CompanyID company_id);
 

	
 
	NetworkRecvStatus SendClientInfo(NetworkClientInfo *ci);
 
	NetworkRecvStatus SendError(NetworkErrorCode error, const std::string &reason = {});
 
	NetworkRecvStatus SendChat(NetworkAction action, ClientID client_id, bool self_send, const std::string &msg, int64 data);
 
	NetworkRecvStatus SendExternalChat(const std::string &source, TextColour colour, const std::string &user, const std::string &msg);
 
	NetworkRecvStatus SendJoin(ClientID client_id);
 
	NetworkRecvStatus SendFrame();
 
	NetworkRecvStatus SendSync();
 
	NetworkRecvStatus SendCommand(const CommandPacket *cp);
 
	NetworkRecvStatus SendCompanyUpdate();
 
	NetworkRecvStatus SendConfigUpdate();
 

	
 
	static void Send();
 
	static void AcceptConnection(SOCKET s, const NetworkAddress &address);
 
	static bool AllowConnection();
 

	
 
	/**
src/network/network_type.h
Show inline comments
 
@@ -100,24 +100,25 @@ enum NetworkAction {
 
	NETWORK_ACTION_JOIN,
 
	NETWORK_ACTION_LEAVE,
 
	NETWORK_ACTION_SERVER_MESSAGE,
 
	NETWORK_ACTION_CHAT,
 
	NETWORK_ACTION_CHAT_COMPANY,
 
	NETWORK_ACTION_CHAT_CLIENT,
 
	NETWORK_ACTION_GIVE_MONEY,
 
	NETWORK_ACTION_NAME_CHANGE,
 
	NETWORK_ACTION_COMPANY_SPECTATOR,
 
	NETWORK_ACTION_COMPANY_JOIN,
 
	NETWORK_ACTION_COMPANY_NEW,
 
	NETWORK_ACTION_KICKED,
 
	NETWORK_ACTION_EXTERNAL_CHAT,
 
};
 

	
 
/**
 
 * The error codes we send around in the protocols.
 
 * @warning The values of the enum items are part of the admin network API. Only append at the end.
 
 */
 
enum NetworkErrorCode {
 
	NETWORK_ERROR_GENERAL, // Try to use this one like never
 

	
 
	/* Signals from clients */
 
	NETWORK_ERROR_DESYNC,
 
	NETWORK_ERROR_SAVEGAME_FAILED,
0 comments (0 inline, 0 general)