mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix BloxstrapRPC not working in certain system locales
TIL String.IndexOf() is subject to the system locale :( https://discord.com/channels/1099468797410283540/1169289170024407102
This commit is contained in:
parent
facb992bf3
commit
2cc2373830
@ -17,6 +17,7 @@
|
|||||||
private const string GameJoiningEntryPattern = @"! Joining game '([0-9a-f\-]{36})' place ([0-9]+) at ([0-9\.]+)";
|
private const string GameJoiningEntryPattern = @"! Joining game '([0-9a-f\-]{36})' place ([0-9]+) at ([0-9\.]+)";
|
||||||
private const string GameJoiningUDMUXPattern = @"UDMUX Address = ([0-9\.]+), Port = [0-9]+ \| RCC Server Address = ([0-9\.]+), Port = [0-9]+";
|
private const string GameJoiningUDMUXPattern = @"UDMUX Address = ([0-9\.]+), Port = [0-9]+ \| RCC Server Address = ([0-9\.]+), Port = [0-9]+";
|
||||||
private const string GameJoinedEntryPattern = @"serverId: ([0-9\.]+)\|[0-9]+";
|
private const string GameJoinedEntryPattern = @"serverId: ([0-9\.]+)\|[0-9]+";
|
||||||
|
private const string GameMessageEntryPattern = @"\[BloxstrapRPC\] (.*)";
|
||||||
|
|
||||||
private int _gameClientPid;
|
private int _gameClientPid;
|
||||||
private int _logEntriesRead = 0;
|
private int _logEntriesRead = 0;
|
||||||
@ -243,7 +244,16 @@
|
|||||||
}
|
}
|
||||||
else if (entry.Contains(GameMessageEntry))
|
else if (entry.Contains(GameMessageEntry))
|
||||||
{
|
{
|
||||||
string messagePlain = entry.Substring(entry.IndexOf(GameMessageEntry) + GameMessageEntry.Length + 1);
|
var match = Regex.Match(entry, GameMessageEntryPattern);
|
||||||
|
|
||||||
|
if (match.Groups.Count != 2)
|
||||||
|
{
|
||||||
|
App.Logger.WriteLine(LOG_IDENT, $"Failed to assert format for RPC message entry");
|
||||||
|
App.Logger.WriteLine(LOG_IDENT, entry);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string messagePlain = match.Groups[1].Value;
|
||||||
Message? message;
|
Message? message;
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Received message: '{messagePlain}'");
|
App.Logger.WriteLine(LOG_IDENT, $"Received message: '{messagePlain}'");
|
||||||
|
Loading…
Reference in New Issue
Block a user