Disable chat for the first 5s (configurable) after joining a server.

This commit is contained in:
Paul Chote
2021-09-20 22:34:42 +01:00
committed by abcdefg30
parent 9eab92e90a
commit 8588af1001
9 changed files with 99 additions and 13 deletions

View File

@@ -34,6 +34,21 @@ namespace OpenRA.Network
TextNotificationsManager.AddSystemLine(order.TargetString);
break;
case "DisableChatEntry":
{
// Order must originate from the server
if (clientId != 0)
break;
// Server may send MaxValue to indicate that it is disabled until further notice
if (order.ExtraData == uint.MaxValue)
TextNotificationsManager.ChatDisabledUntil = uint.MaxValue;
else
TextNotificationsManager.ChatDisabledUntil = Game.RunTime + order.ExtraData;
break;
}
case "Chat":
{
var client = orderManager.LobbyInfo.ClientWithIndex(clientId);