add EventName settings variable

This commit is contained in:
Robert Paciorek 2024-04-10 20:47:37 +00:00
parent dcb0644af4
commit 7288957a78
3 changed files with 7 additions and 3 deletions

View File

@ -29,6 +29,7 @@ internal static class Configuration {
internal sealed class ServerConfiguration { internal sealed class ServerConfiguration {
public string ListenIP { get; set; } = string.Empty; public string ListenIP { get; set; } = string.Empty;
public int Port { get; set; } = 9933; public int Port { get; set; } = 9933;
public string EventName { get; set; } = "ScoutAttack";
public int EventTimer { get; set; } = 30; public int EventTimer { get; set; } = 30;
public int FirstEventTimer { get; set; } = 10; public int FirstEventTimer { get; set; } = 10;
public int RacingMaxPlayers { get; set; } = 6; public int RacingMaxPlayers { get; set; } = 6;

View File

@ -161,7 +161,7 @@ class WorldEvent {
// send reward info // send reward info
private void PostEndEvent1(Object? source, ElapsedEventArgs e) { private void PostEndEvent1(Object? source, ElapsedEventArgs e) {
NetworkPacket packet = Utils.VlNetworkPacket( NetworkPacket packet = Utils.VlNetworkPacket(
"WE_ScoutAttack_End", "WE_" + Configuration.ServerConfiguration.EventName + "_End",
lastResults, lastResults,
room.Id room.Id
); );
@ -218,10 +218,10 @@ class WorldEvent {
public NetworkArray EventInfoArray(bool WE = true, bool WEN = true) { public NetworkArray EventInfoArray(bool WE = true, bool WEN = true) {
NetworkArray vl = new(); NetworkArray vl = new();
if (WE) { if (WE) {
vl.Add(NetworkArray.VlElement("WE_ScoutAttack", EventInfo(), isPersistent:true)); vl.Add(NetworkArray.VlElement("WE_" + Configuration.ServerConfiguration.EventName, EventInfo(), isPersistent:true));
} }
if (WEN) { if (WEN) {
vl.Add(NetworkArray.VlElement("WEN_ScoutAttack", nextStartTimeString, isPersistent:true)); vl.Add(NetworkArray.VlElement("WEN_" + Configuration.ServerConfiguration.EventName, nextStartTimeString, isPersistent:true));
} }
return vl; return vl;
} }

View File

@ -12,6 +12,9 @@
"// EnableChat": "When true, in-game chat will be enabled", "// EnableChat": "When true, in-game chat will be enabled",
"EnableChat": true, "EnableChat": true,
"// EventName": "World event name send to client (can be used to select ship type after modding WorldEventScoutAttack in client)",
"EventName": "ScoutAttack",
"// FirstEventTimer": "time to start of first world event (battle ship event) after start MMO server", "// FirstEventTimer": "time to start of first world event (battle ship event) after start MMO server",
"FirstEventTimer": 3, "FirstEventTimer": 3,