Skip to content

Commit fdce68e

Browse files
committed
修复启动信息错位
1 parent e048bc8 commit fdce68e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

mod/WorldLink/FutariPatch.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static class Futari
3939
private static System.Threading.Thread onlineUserCountThread;
4040
private static System.Threading.Thread recruitListThread;
4141

42-
public static bool Debug = false;
42+
public static bool Debug => WorldLink.Core.Config.Debug;
4343

4444
#region Init
4545

@@ -394,9 +394,10 @@ public static bool preRecvStartRecruit(Packet packet)
394394
[HarmonyPatch(nameof(StartupProcess), nameof(StartupProcess.OnUpdate))]
395395
public static void postStartupOnUpdate(ref byte ____state, string[] ____statusMsg, string[] ____statusSubMsg)
396396
{
397+
var msgCount = ____statusMsg.Length;
397398
// Status code
398-
____statusMsg[7] = "NyanLink";
399-
____statusSubMsg[7] = client.StatusCode switch
399+
____statusMsg[msgCount - 3] = "NyanLink";
400+
____statusSubMsg[msgCount - 3] = client.StatusCode switch
400401
{
401402
-1 => "BAD",
402403
0 => "Not Connect",
@@ -406,10 +407,13 @@ public static void postStartupOnUpdate(ref byte ____state, string[] ____statusMs
406407
};
407408

408409
// Delay
409-
____statusMsg[8] = "PING";
410-
____statusSubMsg[8] = client._delayAvg == 0 ? "N/A" : $"{client._delayAvg} ms";
411-
____statusMsg[9] = "CAT :3";
412-
____statusSubMsg[9] = client._delayIndex % 2 == 0 ? "" : "MEOW";
410+
____statusMsg[msgCount - 2] = "PING";
411+
____statusSubMsg[msgCount - 2] = client._delayAvg == 0 ? "N/A" : $"{client._delayAvg} ms";
412+
413+
var isThursday = DateTime.Now.DayOfWeek == DayOfWeek.Thursday;
414+
415+
____statusMsg[msgCount - 1] = isThursday ? "CRAZY THURSDAY" : "CAT :3";
416+
____statusSubMsg[msgCount - 1] = client._delayIndex % 2 == 0 ? "" : (isThursday ? "V50" : "MEOW");
413417

414418
// If it is in the wait link delivery state, change to ready immediately
415419
if (____state != 0x04) return;

0 commit comments

Comments
 (0)