mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Fix some usernames breaking ParseUserInfo (#1020)
* Fix some usernames breaking ParseUserInfo * Switch other indexes to ordinal
This commit is contained in:
@@ -462,7 +462,7 @@ namespace VRCX
|
|||||||
|
|
||||||
if (line.Contains("[Behaviour] OnPlayerJoined") && !line.Contains("] OnPlayerJoined:"))
|
if (line.Contains("[Behaviour] OnPlayerJoined") && !line.Contains("] OnPlayerJoined:"))
|
||||||
{
|
{
|
||||||
var lineOffset = line.LastIndexOf("] OnPlayerJoined");
|
var lineOffset = line.LastIndexOf("] OnPlayerJoined", StringComparison.Ordinal);
|
||||||
if (lineOffset < 0)
|
if (lineOffset < 0)
|
||||||
return true;
|
return true;
|
||||||
lineOffset += 17;
|
lineOffset += 17;
|
||||||
@@ -1236,10 +1236,10 @@ namespace VRCX
|
|||||||
private bool ParseVoteKickInitiation(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
private bool ParseVoteKickInitiation(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||||
{
|
{
|
||||||
// 2024.08.29 02:04:47 Log - [ModerationManager] A vote kick has been initiated against בורקס במאווררים 849d, do you agree?
|
// 2024.08.29 02:04:47 Log - [ModerationManager] A vote kick has been initiated against בורקס במאווררים 849d, do you agree?
|
||||||
if (!line.Contains("[ModerationManager] A vote kick has been initiated against "))
|
if (!line.Contains("[ModerationManager] A vote kick has been initiated against ", StringComparison.Ordinal))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int index = line.IndexOf("[ModerationManager] A vote kick has been initiated against ") + 20;
|
int index = line.IndexOf("[ModerationManager] A vote kick has been initiated against ", StringComparison.Ordinal) + 20;
|
||||||
|
|
||||||
AppendLog(new[]
|
AppendLog(new[]
|
||||||
{
|
{
|
||||||
@@ -1255,10 +1255,10 @@ namespace VRCX
|
|||||||
private bool ParseVoteKickSuccess(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
private bool ParseVoteKickSuccess(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||||
{
|
{
|
||||||
// 2024.08.29 02:05:21 Log - [ModerationManager] Vote to kick בורקס במאווררים 849d succeeded
|
// 2024.08.29 02:05:21 Log - [ModerationManager] Vote to kick בורקס במאווררים 849d succeeded
|
||||||
if (!line.Contains("[ModerationManager] Vote to kick "))
|
if (!line.Contains("[ModerationManager] Vote to kick ", StringComparison.Ordinal))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int index = line.IndexOf("[ModerationManager] Vote to kick ") + 20;
|
int index = line.IndexOf("[ModerationManager] Vote to kick ", StringComparison.Ordinal) + 20;
|
||||||
|
|
||||||
AppendLog(new[]
|
AppendLog(new[]
|
||||||
{
|
{
|
||||||
@@ -1337,7 +1337,7 @@ namespace VRCX
|
|||||||
string userDisplayName;
|
string userDisplayName;
|
||||||
string userId;
|
string userId;
|
||||||
|
|
||||||
int pos = userInfo.LastIndexOf(" (");
|
int pos = userInfo.LastIndexOf(" (", StringComparison.Ordinal);
|
||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
{
|
{
|
||||||
userDisplayName = userInfo.Substring(0, pos);
|
userDisplayName = userInfo.Substring(0, pos);
|
||||||
|
|||||||
Reference in New Issue
Block a user