Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show account on discord rich presence #2255

Merged
merged 49 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8656d9d
add functionality for grabbing userid
axellse Jul 5, 2024
4acab17
Create UserInfoResponse.cs
axellse Jul 5, 2024
62ccc1d
add user pfp small image thingy
axellse Jul 5, 2024
7005b44
add missing semicolons
axellse Jul 5, 2024
6b7f08b
get rid of semicolons
axellse Jul 6, 2024
9397ebe
debugging (remove later)
axellse Jul 6, 2024
e3cfbef
make properties nullable
axellse Jul 6, 2024
8f4117c
forgot to put dollar sign before interpolated string
axellse Jul 6, 2024
0c24753
make properties that cant be nullable not nullable
axellse Jul 6, 2024
acfd8ad
more debugging
axellse Jul 6, 2024
95e58d2
remove thing
axellse Jul 6, 2024
aac398e
remove other thing
axellse Jul 6, 2024
adc962f
remove thing (again) (again)
axellse Jul 6, 2024
2efb5fa
remove thing (again) (again) (again)
axellse Jul 6, 2024
0715cc0
add space between username and displayname to make it more visually p…
axellse Jul 6, 2024
2d41955
matt review changes (better code readability)
axellse Jul 6, 2024
1ce3879
add strings for show account on profile
axellse Jul 6, 2024
fffcbe2
add AccountShownOnProfile setting
axellse Jul 6, 2024
7b019d0
add DiscordActivityJoinEnabled to integrations viewmodel
axellse Jul 6, 2024
7cda0fb
fix accidentally swapping 2 variables
axellse Jul 6, 2024
36a6793
refrence correct variables
axellse Jul 6, 2024
3871f7a
refrence correct variables (again)
axellse Jul 6, 2024
97be636
add showaccountonprofile strings
axellse Jul 6, 2024
7aa5fc2
add option to integrations page
axellse Jul 6, 2024
1305ebe
add missing < that somehow got lost
axellse Jul 6, 2024
d6bc33d
make that its own option
axellse Jul 6, 2024
f07f1c1
dont invert that value
axellse Jul 6, 2024
04c67ea
dont invert that (again)
axellse Jul 6, 2024
e854b20
Update IntegrationsViewModel.cs
axellse Jul 6, 2024
63831dd
fix grammatical issue in string
axellse Jul 6, 2024
6b71aea
move else to new line
axellse Jul 8, 2024
2920955
Merge branch 'main' into user-pfp-discord-rpc
axellse Jul 29, 2024
11c9ae1
fix merge conflicts
axellse Aug 11, 2024
7c9c3d3
Merge branch 'main' into user-pfp-discord-rpc
axellse Aug 14, 2024
11b11e0
Merge branch 'main' into user-pfp-discord-rpc
axellse Aug 19, 2024
5d5726b
Merge branch 'main' into user-pfp-discord-rpc
axellse Aug 29, 2024
b61adf1
Merge branch 'main' into user-pfp-discord-rpc
axellse Aug 30, 2024
77262dc
Merge branch 'main' into user-pfp-discord-rpc
axellse Sep 3, 2024
abb08f1
Merge branch 'main' into user-pfp-discord-rpc
axellse Sep 3, 2024
e023fa4
fix merge conflicts
axellse Sep 4, 2024
3510730
Merge branch 'main' into user-pfp-discord-rpc
axellse Sep 4, 2024
cad4ba7
move gameJoinLoadTime check
axellse Sep 4, 2024
188242f
Merge branch 'user-pfp-discord-rpc' of https://github.com/axellse/blo…
axellse Sep 4, 2024
3855ac6
Merge branch 'main' into user-pfp-discord-rpc
axellse Sep 5, 2024
530bb84
Merge remote-tracking branch 'real/main' into user-pfp-discord-rpc
axellse Sep 21, 2024
5ff1901
matt review changes
axellse Sep 21, 2024
cf11cd8
Merge branch 'main' into user-pfp-discord-rpc
axellse Sep 21, 2024
8667167
handle if parsing userid fails
axellse Sep 22, 2024
5d79a95
Merge branch 'main' into user-pfp-discord-rpc
pizzaboxer Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Bloxstrap/Integrations/ActivityWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public class ActivityWatcher : IDisposable
private const string GameDisconnectedEntry = "[FLog::Network] Time to disconnect replication data:";
private const string GameTeleportingEntry = "[FLog::SingleSurfaceApp] initiateTeleport";
private const string GameLeavingEntry = "[FLog::SingleSurfaceApp] leaveUGCGameInternal";
private const string GameJoinLoadTimeEntry = "[FLog::GameJoinLoadTime] Report game_join_loadtime:";
private const string GameJoinLoadTimeEntry = "[FLog::GameJoinLoadTime] Report game_join_loadtime:";

private const string GameJoinLoadTimeEntryPattern = ", userid:([0-9]+)";
private const string GameJoinLoadTimeEntryPattern = ", userid:([0-9]+)";
private const string GameJoiningEntryPattern = @"! Joining game '([0-9a-f\-]{36})' place ([0-9]+) at ([0-9\.]+)";
private const string GameJoiningPrivateServerPattern = @"""accessCode"":""([0-9a-f\-]{36})""";
private const string GameJoiningUniversePattern = @"universeid:([0-9]+)";
Expand Down Expand Up @@ -217,13 +217,15 @@ private void ReadLogEntry(string entry)

if (match.Groups.Count != 2)
{
App.Logger.WriteLine(LOG_IDENT, $"Failed to assert format for game join load time entry");
App.Logger.WriteLine(LOG_IDENT, "Failed to assert format for game join load time entry");
App.Logger.WriteLine(LOG_IDENT, entry);
return;
}

Data.UserId = match.Groups[1].Value;
App.Logger.WriteLine(LOG_IDENT, $"Got userid as " + Data.UserId);
UInt64.TryParse(match.Groups[1].Value, out ulong result);
axellse marked this conversation as resolved.
Show resolved Hide resolved

Data.UserId = result;
App.Logger.WriteLine(LOG_IDENT, $"Got userid as {Data.UserId}");
}

if (entry.Contains(GameJoiningUniverseEntry))
Expand Down
3 changes: 2 additions & 1 deletion Bloxstrap/Integrations/DiscordRichPresence.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using Bloxstrap.Models.RobloxApi;
using DiscordRPC;

namespace Bloxstrap.Integrations
Expand Down Expand Up @@ -235,7 +236,7 @@ public async Task<bool> SetCurrentGame()
}
else
{
smallImage = userPfpResponse.Data.ToArray()[0].ImageUrl;
smallImage = userPfpResponse.Data.First().ImageUrl;
App.Logger.WriteLine(LOG_IDENT, $"Got user thumbnail as {smallImage}");
}

Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/Models/Entities/ActivityData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public long UniverseId
/// </summary>
public string AccessCode { get; set; } = string.Empty;

public string UserId { get; set; } = String.Empty;
public ulong UserId { get; set; } = 0;

public string MachineAddress { get; set; } = string.Empty;

Expand Down