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.
This commit is contained in:
Bjarni Thor
2020-01-21 15:39:10 +00:00
committed by Charles Pigott
parent b5d56559d2
commit 5880f1479f
9 changed files with 66 additions and 26 deletions

View File

@@ -248,6 +248,7 @@ void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send,
case NETWORK_ACTION_GIVE_MONEY: strid = self_send ? STR_NETWORK_MESSAGE_GAVE_MONEY_AWAY : 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;
default: strid = STR_NETWORK_CHAT_ALL; break;
}