Merge tag '14.0-beta3' into jgrpp

# Conflicts:
#	regression/regression/result.txt
#	src/industrytype.h
#	src/network/core/config.h
#	src/network/core/network_game_info.cpp
#	src/network/core/network_game_info.h
#	src/network/core/packet.cpp
#	src/network/core/packet.h
#	src/network/core/tcp.cpp
#	src/network/core/tcp.h
#	src/network/core/tcp_admin.cpp
#	src/network/core/tcp_content.cpp
#	src/network/core/tcp_coordinator.cpp
#	src/network/core/tcp_game.cpp
#	src/network/core/tcp_game.h
#	src/network/core/tcp_turn.cpp
#	src/network/core/udp.cpp
#	src/network/core/udp.h
#	src/network/network_admin.cpp
#	src/network/network_client.cpp
#	src/network/network_client.h
#	src/network/network_command.cpp
#	src/network/network_content.cpp
#	src/network/network_internal.h
#	src/network/network_query.cpp
#	src/network/network_query.h
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/network/network_turn.cpp
#	src/network/network_udp.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
This commit is contained in:
Jonathan G Rennison
2024-02-19 17:57:05 +00:00
67 changed files with 1463 additions and 1297 deletions

View File

@@ -21,7 +21,7 @@
* Enum with types of TCP packets specific to the admin network.
* This protocol may only be extended to ensure stability.
*/
enum PacketAdminType {
enum PacketAdminType : uint8_t {
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.
@@ -124,14 +124,14 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_JOIN(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_JOIN(Packet &p);
/**
* Notification to the server that this admin is quitting.
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_QUIT(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_QUIT(Packet &p);
/**
* Register updates to be sent at certain frequencies (as announced in the PROTOCOL packet):
@@ -140,7 +140,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_UPDATE_FREQUENCY(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_UPDATE_FREQUENCY(Packet &p);
/**
* Poll the server for certain updates, an invalid poll (e.g. not existent id) gets silently dropped:
@@ -151,7 +151,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_POLL(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_POLL(Packet &p);
/**
* Send chat as the server:
@@ -162,7 +162,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_CHAT(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_CHAT(Packet &p);
/**
* Send chat from the external source:
@@ -173,7 +173,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_EXTERNAL_CHAT(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_EXTERNAL_CHAT(Packet &p);
/**
* Execute a command on the servers console:
@@ -181,7 +181,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_RCON(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_RCON(Packet &p);
/**
* Send a JSON string to the current active GameScript.
@@ -189,7 +189,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_GAMESCRIPT(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_GAMESCRIPT(Packet &p);
/**
* Ping the server, requiring the server to reply with a pong packet.
@@ -197,21 +197,21 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_ADMIN_PING(Packet *p);
virtual NetworkRecvStatus Receive_ADMIN_PING(Packet &p);
/**
* The server is full (connection gets closed).
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_FULL(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_FULL(Packet &p);
/**
* The source IP address is banned (connection gets closed).
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_BANNED(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_BANNED(Packet &p);
/**
* An error was caused by this admin connection (connection gets closed).
@@ -219,7 +219,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_ERROR(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_ERROR(Packet &p);
/**
* Inform a just joined admin about the protocol specifics:
@@ -230,7 +230,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_PROTOCOL(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_PROTOCOL(Packet &p);
/**
* Welcome a connected admin to the game:
@@ -246,21 +246,21 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_WELCOME(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_WELCOME(Packet &p);
/**
* Notification about a newgame.
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_NEWGAME(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_NEWGAME(Packet &p);
/**
* Notification about the server shutting down.
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_SHUTDOWN(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_SHUTDOWN(Packet &p);
/**
* Send the current date of the game:
@@ -268,7 +268,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_DATE(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_DATE(Packet &p);
/**
* Notification of a new client:
@@ -276,7 +276,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CLIENT_JOIN(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CLIENT_JOIN(Packet &p);
/**
* Client information of a specific client:
@@ -289,7 +289,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CLIENT_INFO(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CLIENT_INFO(Packet &p);
/**
* Client update details on a specific client (e.g. after rename or move):
@@ -299,7 +299,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CLIENT_UPDATE(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CLIENT_UPDATE(Packet &p);
/**
* Notification about a client leaving the game.
@@ -307,7 +307,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CLIENT_QUIT(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CLIENT_QUIT(Packet &p);
/**
* Notification about a client error (and thus the clients disconnection).
@@ -316,7 +316,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CLIENT_ERROR(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CLIENT_ERROR(Packet &p);
/**
* Notification of a new company:
@@ -324,7 +324,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_COMPANY_NEW(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_COMPANY_NEW(Packet &p);
/**
* Company information on a specific company:
@@ -338,7 +338,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_COMPANY_INFO(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_COMPANY_INFO(Packet &p);
/**
* Company information of a specific company:
@@ -355,7 +355,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet &p);
/**
* Notification about a removed company (e.g. due to bankruptcy).
@@ -364,7 +364,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_COMPANY_REMOVE(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_COMPANY_REMOVE(Packet &p);
/**
* Economy update of a specific company:
@@ -382,7 +382,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_COMPANY_ECONOMY(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_COMPANY_ECONOMY(Packet &p);
/**
* Company statistics on stations and vehicles:
@@ -400,7 +400,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_COMPANY_STATS(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_COMPANY_STATS(Packet &p);
/**
* Send chat from the game into the admin network:
@@ -412,7 +412,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CHAT(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CHAT(Packet &p);
/**
* Result of an rcon command:
@@ -421,7 +421,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_RCON(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_RCON(Packet &p);
/**
* Send what would be printed on the server's console also into the admin network.
@@ -430,7 +430,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CONSOLE(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CONSOLE(Packet &p);
/**
* Send DoCommand names to the bot upon request only.
@@ -449,7 +449,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CMD_NAMES(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CMD_NAMES(Packet &p);
/**
* Send incoming command packets to the admin network.
@@ -471,7 +471,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_CMD_LOGGING(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_CMD_LOGGING(Packet &p);
/**
* Send a ping-reply (pong) to the admin that sent us the ping packet.
@@ -479,7 +479,7 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_PONG(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_PONG(Packet &p);
/**
* Notify the admin connection that the rcon command has finished.
@@ -487,9 +487,9 @@ protected:
* @param p The packet that was just received.
* @return The state the network should have.
*/
virtual NetworkRecvStatus Receive_SERVER_RCON_END(Packet *p);
virtual NetworkRecvStatus Receive_SERVER_RCON_END(Packet &p);
NetworkRecvStatus HandlePacket(Packet *p);
NetworkRecvStatus HandlePacket(Packet &p);
public:
NetworkRecvStatus CloseConnection(bool error = true) override;