summaryrefslogtreecommitdiff
path: root/src/network/network_server.h
diff options
context:
space:
mode:
authorBjarni Thor <bjarni@bjarnithor.com>2020-01-21 15:39:10 +0000
committerCharles Pigott <charlespigott@googlemail.com>2020-02-04 22:17:39 +0000
commit5880f1479f21157158dbe862e4cb1118e0cfbfae (patch)
tree83597e5e42c96594646ccc548a915f303488b044 /src/network/network_server.h
parentb5d56559d2ec16512dd8a0346406bf36486ebf7c (diff)
downloadopenttd-5880f1479f21157158dbe862e4cb1118e0cfbfae.tar.xz
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.
Diffstat (limited to 'src/network/network_server.h')
-rw-r--r--src/network/network_server.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/network_server.h b/src/network/network_server.h
index 9a1873520..3dfcf5594 100644
--- a/src/network/network_server.h
+++ b/src/network/network_server.h
@@ -89,7 +89,7 @@ public:
NetworkRecvStatus SendMove(ClientID client_id, CompanyID company_id);
NetworkRecvStatus SendClientInfo(NetworkClientInfo *ci);
- NetworkRecvStatus SendError(NetworkErrorCode error);
+ NetworkRecvStatus SendError(NetworkErrorCode error, const char *reason = nullptr);
NetworkRecvStatus SendChat(NetworkAction action, ClientID client_id, bool self_send, const char *msg, int64 data);
NetworkRecvStatus SendJoin(ClientID client_id);
NetworkRecvStatus SendFrame();