From 68fa419e5b49d5e2063e4285ecc99d7a6e86befd Mon Sep 17 00:00:00 2001
From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com>
Date: Sun, 8 Jan 2023 23:16:27 +0000
Subject: [PATCH] Improve Discord RP reliability when teleporting
Turns out the Client:Disconnect entry is not reliable at all whatsoever for determining game disconnects, so it's now replaced with a more reliable entry.
---
Bloxstrap/Bloxstrap.csproj | 4 ++--
Bloxstrap/Helpers/Integrations/DiscordRichPresence.cs | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Bloxstrap/Bloxstrap.csproj b/Bloxstrap/Bloxstrap.csproj
index 0a7de0f..e8c835a 100644
--- a/Bloxstrap/Bloxstrap.csproj
+++ b/Bloxstrap/Bloxstrap.csproj
@@ -10,8 +10,8 @@
AnyCPU
AnyCPU;x86
Bloxstrap.ico
- 1.6.1
- 1.6.1.0
+ 1.6.2
+ 1.6.2.0
diff --git a/Bloxstrap/Helpers/Integrations/DiscordRichPresence.cs b/Bloxstrap/Helpers/Integrations/DiscordRichPresence.cs
index 3bbf5dd..887534e 100644
--- a/Bloxstrap/Helpers/Integrations/DiscordRichPresence.cs
+++ b/Bloxstrap/Helpers/Integrations/DiscordRichPresence.cs
@@ -14,7 +14,7 @@ namespace Bloxstrap.Helpers.Integrations
const string GameJoiningEntry = "[FLog::Output] ! Joining game";
const string GameJoinedEntry = "[FLog::Network] serverId:";
- const string GameDisconnectedEntry = "[FLog::Network] Client:Disconnect";
+ const string GameDisconnectedEntry = "[FLog::Network] Time to disconnect replication data:";
const string GameJoiningEntryPattern = @"! Joining game '([0-9a-f\-]{36})' place ([0-9]+) at ([0-9\.]+)";
const string GameJoinedEntryPattern = @"serverId: ([0-9\.]+)\|([0-9]+)";
@@ -76,12 +76,12 @@ namespace Bloxstrap.Helpers.Integrations
{
// okay, here's the process:
//
- // - read the latest log file from %localappdata%\roblox\logs approx every 30 sec or so
+ // - tail the latest log file from %localappdata%\roblox\logs
// - check for specific lines to determine player's game activity as shown below:
//
// - get the place id, job id and machine address from '! Joining game '{{JOBID}}' place {{PLACEID}} at {{MACHINEADDRESS}}' entry
// - confirm place join with 'serverId: {{MACHINEADDRESS}}|{{MACHINEPORT}}' entry
- // - check for leaves/disconnects with 'Client:Disconnect' entry
+ // - check for leaves/disconnects with 'Time to disconnect replication data: {{TIME}}' entry
//
// we'll tail the log file continuously, monitoring for any log entries that we need to determine the current game activity
@@ -123,7 +123,6 @@ namespace Bloxstrap.Helpers.Integrations
}
// no need to close the event, its going to be finished with when the program closes anyway
- // ...rr im too lazy to fix the event still be updating when its closed... lol
}
public async Task SetPresence()
@@ -184,6 +183,7 @@ namespace Bloxstrap.Helpers.Integrations
public void Dispose()
{
+ RichPresence.ClearPresence();
RichPresence.Dispose();
}
}