config option for canned chat

This commit is contained in:
Spirtix 2025-07-03 07:55:57 +02:00
parent a198bd8e9e
commit a94e5f75e0
3 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,7 @@ namespace sodoffmmo.CommandHandlers;
[CommandHandler(7)]
class GenericMessageHandler : CommandHandler {
public override Task Handle(Client client, NetworkObject receivedObject) {
if (!Configuration.ServerConfiguration.EnableChat && receivedObject.Get<string>("m").StartsWith("C:"))
if (!Configuration.ServerConfiguration.EnableCannedChat && receivedObject.Get<string>("m").StartsWith("C:"))
return Task.CompletedTask;
NetworkPacket packet = NetworkObject.WrapObject(0, 7, receivedObject).Serialize();
client.Room.Send(packet);

View File

@ -43,6 +43,7 @@ internal sealed class ServerConfiguration {
public int RacingMainLobbyTimer { get; set; } = 15;
public int PingDelay { get; set; } = 17;
public bool EnableChat { get; set; } = true;
public bool EnableCannedChat { get; set; } = true;
public bool AllowChaos { get; set; } = false;
public AuthenticationMode Authentication { get; set; } = AuthenticationMode.Disabled;
public string ApiUrl { get; set; } = "";

View File

@ -11,6 +11,7 @@
"// EnableChat": "When true, in-game chat will be enabled",
"EnableChat": true,
"EnableCannedChat": true,
"// EventName": "World event name send to client (can be used to select ship type after modding WorldEventScoutAttack in client)",
"EventName": "ScoutAttack",