ListPlayers Change

- added regex handling of the listplayer RCON command.
- tr-TR language file added
This commit is contained in:
Brett Hewitson 2022-07-11 15:55:30 +10:00
parent 3e25077cc7
commit 11c411a557
5 changed files with 5830 additions and 13 deletions

View file

@ -413,6 +413,10 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Globalization\tr-TR\tr-TR.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="Windows\AddUserWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

File diff suppressed because it is too large Load diff

View file

@ -13,6 +13,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
@ -338,29 +339,31 @@ namespace ServerManagerTool.Lib
0. Bletch, 76561197991984752 <- steam
0. Bletch, 7171521174456260817 <- epic
*/
var matchRegex = new Regex(@"^(?<index>\d*)\. (?<playerName>.*), (?<playerId>\d*)$");
var output = new List<string>();
var onlinePlayers = new List<PlayerInfo>();
var playerLines = commandLines?.ToList() ?? new List<string>();
var playerLines = commandLines?.ToList() ?? new List<string>();
if (playerLines.Count > 0)
{
foreach (var line in playerLines)
{
var elements = line.Split(',', '.');
if (elements.Length != 3)
// Invalid data. Ignore it.
var isMatch = matchRegex.IsMatch(line);
if (!isMatch)
continue;
var id = elements[2].Trim();
var match = matchRegex.Match(line);
var playerName = match.Groups["playerName"].Value.Trim();
var playerId = match.Groups["playerId"].Value.Trim();
if (onlinePlayers.FirstOrDefault(p => p.PlayerId.Equals(id, StringComparison.OrdinalIgnoreCase)) != null)
if (onlinePlayers.FirstOrDefault(p => p.PlayerId.Equals(playerId, StringComparison.OrdinalIgnoreCase)) != null)
// Duplicate data. Ignore it.
continue;
var newPlayer = new PlayerInfo()
{
PlayerId = id,
PlayerName = elements[1].Trim(),
PlayerId = playerId,
PlayerName = playerName,
IsOnline = true,
};
onlinePlayers.Add(newPlayer);

View file

@ -5,14 +5,14 @@
<title>Ark Server Manager Version Feed</title>
<subtitle>This is the Ark Server Manager release version feed.</subtitle>
<link href="http://arkservermanager.freeforums.net/" />
<updated>2022-07-08T00:00:00Z</updated>
<updated>2022-07-11T00:00:00Z</updated>
<entry>
<id>urn:uuid:7E95E486-1977-42F0-9AD6-8DB89A81A877</id>
<title>1.1.435 (1.1.435.3)</title>
<summary>1.1.435.3</summary>
<title>1.1.435 (1.1.435.4)</title>
<summary>1.1.435.4</summary>
<link href="" />
<updated>2022-07-08T00:00:00Z</updated>
<updated>2022-07-11T00:00:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p>
@ -21,6 +21,12 @@
<ul>
<li>Server Settings - Rules Section - Enable Tribe Alliance - fixed the checkbox, so that it enables/disables per profile.</li>
<li>Server Settings - Environment Section - Custom Harvest Amount Multiplier - fixed the checkbox, so that it enables/disables when there are changes or unknown resources.</li>
<li>RCON - changed the way the online players are handled when they contain a '.' character.</li>
</ul>
<u style="font-size: .9em;">NEW</u>
<br/>
<ul>
<li>tr-TR Translation file added.</li>
</ul>
<u style="font-size: .9em;">CHANGE</u>
<br/>

View file

@ -5,7 +5,35 @@
<title>Ark Server Manager Version Feed</title>
<subtitle>This is the Ark Server Manager beta version feed.</subtitle>
<link href="http://arkservermanager.freeforums.net/" />
<updated>2022-07-08T00:00:00Z</updated>
<updated>2022-07-11T00:00:00Z</updated>
<entry>
<id>urn:uuid:7E95E486-1977-42F0-9AD6-8DB89A81A877</id>
<title>1.1.435 (1.1.435.4)</title>
<summary>1.1.435.4</summary>
<link href="" />
<updated>2022-07-11T00:00:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p>
<u style="font-size: .9em;">BUGFIX</u>
<br/>
<ul>
<li>RCON - changed the way the online players are handled when they contain a '.' character.</li>
</ul>
<u style="font-size: .9em;">NEW</u>
<br/>
<ul>
<li>tr-TR Translation file added.</li>
</ul>
</p>
</div>
</content>
<author>
<name>bletch</name>
<email>bletch1971@hotmail.com</email>
</author>
</entry>
<entry>
<id>urn:uuid:7E95E486-1977-42F0-9AD6-8DB89A81A877</id>