From 5880f1479f21157158dbe862e4cb1118e0cfbfae Mon Sep 17 00:00:00 2001 From: Bjarni Thor Date: Tue, 21 Jan 2020 15:39:10 +0000 Subject: Feature #7756: Allow server to supply a reason to kicked/banned clients This commit adds the missing feature of allowing the server owner to provide a reason for kicking/banning a client, which the client sees in a pop-up window after being kicked. The implementation extends the network protocol by adding a new network action called NETWORK_ACTION_KICKED that is capable of having an error string, unlike the other network error packages. Additionally, the kick function broadcasts a message to all clients about the kicked client and the reason for the kick. --- src/network/network_func.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/network/network_func.h') diff --git a/src/network/network_func.h b/src/network/network_func.h index d4a62ddd3..cbb89820c 100644 --- a/src/network/network_func.h +++ b/src/network/network_func.h @@ -75,9 +75,9 @@ void NetworkServerDoMove(ClientID client_id, CompanyID company_id); void NetworkServerSendRcon(ClientID client_id, TextColour colour_code, const char *string); void NetworkServerSendChat(NetworkAction action, DestType type, int dest, const char *msg, ClientID from_id, int64 data = 0, bool from_admin = false); -void NetworkServerKickClient(ClientID client_id); -uint NetworkServerKickOrBanIP(ClientID client_id, bool ban); -uint NetworkServerKickOrBanIP(const char *ip, bool ban); +void NetworkServerKickClient(ClientID client_id, const char *reason); +uint NetworkServerKickOrBanIP(ClientID client_id, bool ban, const char *reason); +uint NetworkServerKickOrBanIP(const char *ip, bool ban, const char *reason); void NetworkInitChatMessage(); void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const char *message, ...) WARN_FORMAT(3, 4); -- cgit v1.2.3-54-g00ecf