one MOTD for all mods and create a default motd.txt
This commit is contained in:
@@ -17,6 +17,8 @@ NEW:
|
|||||||
Added GainsUnitUpgrades trait for leveling specific unit upgrades - firepower, armor, speed.
|
Added GainsUnitUpgrades trait for leveling specific unit upgrades - firepower, armor, speed.
|
||||||
Added support for crates to level up specific unit upgrades.
|
Added support for crates to level up specific unit upgrades.
|
||||||
Added a new Launch.Replay=$FILEPATH parameter for OpenRA.Game.exe to instantly start watching a *.rep file.
|
Added a new Launch.Replay=$FILEPATH parameter for OpenRA.Game.exe to instantly start watching a *.rep file.
|
||||||
|
Server:
|
||||||
|
Message of the day is now shared between all mods and a default motd.txt gets created in the user directory.
|
||||||
Asset Browser:
|
Asset Browser:
|
||||||
Filenames are now listed in alphabetical order
|
Filenames are now listed in alphabetical order
|
||||||
Map Editor:
|
Map Editor:
|
||||||
|
|||||||
@@ -328,10 +328,13 @@ namespace OpenRA.Server
|
|||||||
// Send initial ping
|
// Send initial ping
|
||||||
SendOrderTo(newConn, "Ping", Environment.TickCount.ToString());
|
SendOrderTo(newConn, "Ping", Environment.TickCount.ToString());
|
||||||
|
|
||||||
var motdPath = Path.Combine(Platform.SupportDir, "motd_{0}.txt".F(ModData.Manifest.Mod.Id));
|
if (Settings.Dedicated)
|
||||||
if (File.Exists(motdPath))
|
|
||||||
{
|
{
|
||||||
var motd = System.IO.File.ReadAllText(motdPath);
|
var motdFile = Path.Combine(Platform.SupportDir, "motd.txt");
|
||||||
|
if (!File.Exists(motdFile))
|
||||||
|
System.IO.File.WriteAllText(motdFile, "Welcome, have fun and good luck!");
|
||||||
|
var motd = System.IO.File.ReadAllText(motdFile);
|
||||||
|
if (!string.IsNullOrEmpty(motd))
|
||||||
SendOrderTo(newConn, "Message", motd);
|
SendOrderTo(newConn, "Message", motd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user