dedicated: configurable MOTD
This commit is contained in:
@@ -36,6 +36,7 @@ namespace OpenRA.GameRules
|
|||||||
public int TimeOut = 0;
|
public int TimeOut = 0;
|
||||||
public bool Dedicated = false;
|
public bool Dedicated = false;
|
||||||
public bool DedicatedLoop = true;
|
public bool DedicatedLoop = true;
|
||||||
|
public string DedicatedMOTD = null;
|
||||||
|
|
||||||
public ServerSettings() { }
|
public ServerSettings() { }
|
||||||
|
|
||||||
@@ -53,6 +54,7 @@ namespace OpenRA.GameRules
|
|||||||
TimeOut = other.TimeOut;
|
TimeOut = other.TimeOut;
|
||||||
Dedicated = other.Dedicated;
|
Dedicated = other.Dedicated;
|
||||||
DedicatedLoop = other.DedicatedLoop;
|
DedicatedLoop = other.DedicatedLoop;
|
||||||
|
DedicatedMOTD = other.DedicatedMOTD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ namespace OpenRA.Network
|
|||||||
public bool LockTeams = true; // don't allow team changes after game start.
|
public bool LockTeams = true; // don't allow team changes after game start.
|
||||||
public bool AllowCheats = false;
|
public bool AllowCheats = false;
|
||||||
public bool Dedicated;
|
public bool Dedicated;
|
||||||
|
public string DedicatedMOTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Session(string[] mods)
|
public Session(string[] mods)
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ namespace OpenRA.Server
|
|||||||
lobbyInfo.GlobalSettings.ServerName = settings.Name;
|
lobbyInfo.GlobalSettings.ServerName = settings.Name;
|
||||||
lobbyInfo.GlobalSettings.Ban = settings.Ban;
|
lobbyInfo.GlobalSettings.Ban = settings.Ban;
|
||||||
lobbyInfo.GlobalSettings.Dedicated = settings.Dedicated;
|
lobbyInfo.GlobalSettings.Dedicated = settings.Dedicated;
|
||||||
|
lobbyInfo.GlobalSettings.DedicatedMOTD = settings.DedicatedMOTD;
|
||||||
|
|
||||||
foreach (var t in ServerTraits.WithInterface<INotifyServerStart>())
|
foreach (var t in ServerTraits.WithInterface<INotifyServerStart>())
|
||||||
t.ServerStarted(this);
|
t.ServerStarted(this);
|
||||||
@@ -330,7 +331,8 @@ namespace OpenRA.Server
|
|||||||
|
|
||||||
if ( lobbyInfo.GlobalSettings.Dedicated )
|
if ( lobbyInfo.GlobalSettings.Dedicated )
|
||||||
{
|
{
|
||||||
SendChatTo(newConn, "You have joined the dedicated server!");
|
if (lobbyInfo.GlobalSettings.DedicatedMOTD != null)
|
||||||
|
SendChatTo(newConn, lobbyInfo.GlobalSettings.DedicatedMOTD);
|
||||||
if (client.IsAdmin)
|
if (client.IsAdmin)
|
||||||
SendChatTo(newConn, " You are admin now!");
|
SendChatTo(newConn, " You are admin now!");
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user