mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
Changed the online player count alert message
This commit is contained in:
parent
e671abd640
commit
5d58f51e42
2 changed files with 12 additions and 8 deletions
|
|
@ -333,13 +333,15 @@ namespace ServerManagerTool.Lib
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Players != update.OnlinePlayerCount)
|
var previousOnlinePlayerCount = this.Players;
|
||||||
{
|
|
||||||
PluginHelper.Instance.ProcessAlert(AlertType.OnlinePlayerCountChanged, this.ProfileSnapshot.ProfileName, $"{Config.Default.Alert_OnlinePlayerCountChange} {update.OnlinePlayerCount}");
|
|
||||||
}
|
|
||||||
this.Players = update.OnlinePlayerCount;
|
this.Players = update.OnlinePlayerCount;
|
||||||
this.MaxPlayers = update.ServerInfo?.MaxPlayers ?? this.ProfileSnapshot.MaxPlayerCount;
|
this.MaxPlayers = update.ServerInfo?.MaxPlayers ?? this.ProfileSnapshot.MaxPlayerCount;
|
||||||
|
|
||||||
|
if (previousOnlinePlayerCount != this.Players)
|
||||||
|
{
|
||||||
|
PluginHelper.Instance.ProcessAlert(AlertType.OnlinePlayerCountChanged, this.ProfileSnapshot.ProfileName, $"{Config.Default.Alert_OnlinePlayerCountChange} {this.Players} / {this.MaxPlayers}");
|
||||||
|
}
|
||||||
|
|
||||||
if (update.ServerInfo != null)
|
if (update.ServerInfo != null)
|
||||||
{
|
{
|
||||||
var match = Regex.Match(update.ServerInfo.Name, @"\(v([0-9]+\.[0-9]*)\)");
|
var match = Regex.Match(update.ServerInfo.Name, @"\(v([0-9]+\.[0-9]*)\)");
|
||||||
|
|
|
||||||
|
|
@ -332,13 +332,15 @@ namespace ServerManagerTool.Lib
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Players != update.OnlinePlayerCount)
|
var previousOnlinePlayerCount = this.Players;
|
||||||
{
|
|
||||||
PluginHelper.Instance.ProcessAlert(AlertType.OnlinePlayerCountChanged, this.ProfileSnapshot.ProfileName, $"{Config.Default.Alert_OnlinePlayerCountChange} {update.OnlinePlayerCount}");
|
|
||||||
}
|
|
||||||
this.Players = update.OnlinePlayerCount;
|
this.Players = update.OnlinePlayerCount;
|
||||||
this.MaxPlayers = update.ServerInfo?.MaxPlayers ?? this.ProfileSnapshot.MaxPlayerCount;
|
this.MaxPlayers = update.ServerInfo?.MaxPlayers ?? this.ProfileSnapshot.MaxPlayerCount;
|
||||||
|
|
||||||
|
if (previousOnlinePlayerCount != this.Players)
|
||||||
|
{
|
||||||
|
PluginHelper.Instance.ProcessAlert(AlertType.OnlinePlayerCountChanged, this.ProfileSnapshot.ProfileName, $"{Config.Default.Alert_OnlinePlayerCountChange} {this.Players} / {this.MaxPlayers}");
|
||||||
|
}
|
||||||
|
|
||||||
var serverExeFile = Path.Combine(this.ProfileSnapshot.InstallDirectory, Config.Default.ServerBinaryRelativePath, Config.Default.ServerExeFile);
|
var serverExeFile = Path.Combine(this.ProfileSnapshot.InstallDirectory, Config.Default.ServerBinaryRelativePath, Config.Default.ServerExeFile);
|
||||||
if (!string.IsNullOrWhiteSpace(serverExeFile) && File.Exists(serverExeFile))
|
if (!string.IsNullOrWhiteSpace(serverExeFile) && File.Exists(serverExeFile))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue