Skip to content

Commit 926c38b

Browse files
Bugfix, small updates
1 parent fe8b65a commit 926c38b

File tree

1 file changed

+34
-14
lines changed

1 file changed

+34
-14
lines changed

UnrealDemoScanner/UnrealDemoScanner.cs

+34-14
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace DemoScanner.DG
2828
public static class DemoScanner
2929
{
3030
public const string PROGRAMNAME = "Unreal Demo Scanner";
31-
public const string PROGRAMVERSION = "1.75.1b";
31+
public const string PROGRAMVERSION = "1.75.2b";
3232

3333
public static string FoundNewVersion = "";
3434

@@ -1148,15 +1148,19 @@ public static void DemoScanner_AddTextMessage(string msg, string type, float tim
11481148
return;
11491149
}
11501150

1151-
11521151
msg = msg.Replace("\n", "^n").Replace("\r", "^n").Replace("\x01", "^1").Replace("\x02", "^2")
11531152
.Replace("\x03", "^3").Replace("\x04", "^4");
11541153
if (msg.Length == 0)
11551154
{
11561155
return;
11571156
}
11581157

1159-
OutTextMessages.Add("[" + type + "] : [" + msg + "]" + " at (" + time + ") " + timestring);
1158+
type = type.PadRight(20);
1159+
msg = msg.PadRight(25);
1160+
1161+
string frameId = CurrentFrameId.ToString().PadLeft(4);
1162+
1163+
OutTextMessages.Add("[" + type + "] " + " [FRAME NUMBER: " + frameId + "] : [" + msg + "]" + " at (" + time + ") " + timestring);
11601164
}
11611165

11621166
public static void DemoScanner_AddInfo(string info, bool is_plugin = false, bool no_prefix = false)
@@ -2785,23 +2789,40 @@ public static void RunDemoScanner(string[] args)
27852789
CurrentDir = CurrentDir.Remove(CurrentDir.Length - 1);
27862790
}
27872791

2792+
IsRussia = File.Exists(CurrentDir + "/lang.ru") || File.Exists("lang.ru");
2793+
27882794
try
27892795
{
27902796
if (!SKIP_RESULTS)
27912797
{
2792-
if (!File.Exists(CurrentDir + "/lang.ru") && !File.Exists(CurrentDir + "/lang.en"))
2798+
if (!File.Exists(CurrentDir + "/lang.ru") && !File.Exists(CurrentDir + "/lang.en") &&
2799+
!File.Exists( "lang.ru") && !File.Exists("lang.en"))
27932800
{
27942801
Console.Write("Enter language EN - Engish / RU - Russian:");
27952802
var lang = Console.ReadLine();
27962803
if (lang.ToLower() == "en")
27972804
{
27982805
IsRussia = false;
2799-
File.Create(CurrentDir + "/lang.en").Close();
2806+
try
2807+
{
2808+
File.Create(CurrentDir + "/lang.en").Close();
2809+
}
2810+
catch
2811+
{
2812+
File.Create("lang.en").Close();
2813+
}
28002814
}
28012815
else
28022816
{
28032817
IsRussia = true;
2804-
File.Create(CurrentDir + "/lang.ru").Close();
2818+
try
2819+
{
2820+
File.Create(CurrentDir + "/lang.ru").Close();
2821+
}
2822+
catch
2823+
{
2824+
File.Create("lang.ru").Close();
2825+
}
28052826
}
28062827
}
28072828
}
@@ -2830,6 +2851,8 @@ public static void RunDemoScanner(string[] args)
28302851
}
28312852
}
28322853

2854+
IsRussia = File.Exists(CurrentDir + "/lang.ru") || File.Exists("lang.ru");
2855+
28332856
try
28342857
{
28352858
string codestring = GetSourceCodeString();
@@ -8317,6 +8340,7 @@ следующий кадр изменение и 5 кадров нет движ
83178340
}
83188341

83198342
Console.ForegroundColor = ConsoleColor.Red;
8343+
83208344
if (IsRussia)
83218345
{
83228346
Console.WriteLine("ВАЖНО!");
@@ -8911,11 +8935,7 @@ следующий кадр изменение и 5 кадров нет движ
89118935
int prevFrameNum = 0;
89128936
foreach (var cmd in CommandHistory)
89138937
{
8914-
if (prevFrameNum != 0)
8915-
{
8916-
CommandsDump.Add("wait" + (cmd.frameNum - prevFrameNum) + ";");
8917-
}
8918-
8938+
89198939
string timeCmdStr = "[ERROR]";
89208940

89218941
try
@@ -8929,13 +8949,13 @@ следующий кадр изменение и 5 кадров нет движ
89298949

89308950
if (IsRussia)
89318951
{
8932-
CommandsDump.Add(timeCmdStr + " [НОМЕР КАДРА: " + cmd.frameNum + "] : " + cmd.cmdStr + "(" +
8952+
CommandsDump.Add(timeCmdStr + " [НОМЕР КАДРА: " + cmd.frameNum + "] : " + cmd.cmdStr + ";wait" + (cmd.frameNum - prevFrameNum) + ";" + "(" +
89338953
LastKnowRealTime + ")" + (cmd.cmdSource == 1 ?
89348954
" --> ВЫПОЛНЕНО СЕРВЕРОМ" : cmd.cmdSource == 2 ? " --> ВЫПОЛНЕНО ЧЕРЕЗ STUFFTEXT" : ""));
89358955
}
89368956
else
89378957
{
8938-
CommandsDump.Add(timeCmdStr + " [FRAME NUMBER: " + cmd.frameNum + "] : " + cmd.cmdStr + "(" +
8958+
CommandsDump.Add(timeCmdStr + " [FRAME NUMBER: " + cmd.frameNum + "] : " + cmd.cmdStr + ";wait" + (cmd.frameNum - prevFrameNum) + ";" + "(" +
89398959
LastKnowRealTime + ")" + (cmd.cmdSource == 1 ?
89408960
" --> EXECUTED BY SERVER" : cmd.cmdSource == 2 ? " --> EXECUTED BY SERVER" : ""));
89418961
}
@@ -9550,7 +9570,7 @@ следующий кадр изменение и 5 кадров нет движ
95509570
}
95519571
}
95529572

9553-
if (IsRussia)
9573+
if (!IsRussia)
95549574
{
95559575
if (PlayerSensUsageList.Count > 1)
95569576
{

0 commit comments

Comments
 (0)