vaporvee / discord-rpc-godot

Discord RPC Plugin for GDScript with an easy-to-use code pattern in Godot Engine 4, with optional Editor Rich Presence! (Compatible with Linux, Windows, & MacOS)
https://docs.vaporvee.com/discord-rpc-godot
MIT License
195 stars 10 forks source link

[Issue/Bug]: When switching through multiple scenes which all change the RPC on Awake, some get completely ignored. #64

Closed LiamMGit closed 2 months ago

LiamMGit commented 2 months ago

What happened?

When switching through multiple scenes which all change the RPC on Awake, some get completely ignored. I have tested this using the normal discord client and also the PTB client.

Version

1.3.1

Godot Version

4.2.1-stable

Exact steps to reproduce this error

  1. Write multiple RPC changes between scenes
  2. Make the RPC change on Awake
  3. Switch scenes a few times

GDScript

# scene 1
# Called when the node enters the scene tree for the first time.
func _ready():
# other code would be here, but its useless to RPC.
    UpdateRPC()

# other code would be here, but its useless to RPC.

func UpdateRPC():
    print("updating RPC!")
    DiscordRPC.app_id = 1278704447715016817
    DiscordRPC.details = ""
    DiscordRPC.state = "In Main Menu"
    DiscordRPC.large_image = "newlogo"
    DiscordRPC.large_image_text = "BFDI: Branches"
    DiscordRPC.small_image = "profilemenu"
    DiscordRPC.small_image_text = str(global.accountinfo["username"])
    DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system())
    DiscordRPC.refresh()
    print("finished attempting to update RPC!")

# Scene 2

# Called when the node enters the scene tree for the first time.
func _ready():
# other code would be here, but its useless to RPC.
    UpdateRPC()

func UpdateRPC():
    print("trying to update rpc!")
    DiscordRPC.app_id = 1278704447715016817 # Application ID
    DiscordRPC.details = ""
    DiscordRPC.state = "In Profile Menu"
    DiscordRPC.large_image = "newlogo" # Image key from "Art Assets"
    DiscordRPC.large_image_text = "BFDI: Branches"
    DiscordRPC.small_image = "profilemenu" # Image key from "Art Assets"
    DiscordRPC.small_image_text = str(global.accountinfo["username"])
    DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system()) # "02:46 elapsed"
    DiscordRPC.refresh() # Always refresh after changing the values!
    print("done attempting to update rpc!")

Godot output

Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 560.81 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 2060

updating RPC!
updated RPC!
trying to update rpc!
updated rpc!

(not really useful but i thought i should still include it)

Additional information

The RPC can update at the start of about 8 Scenes, only included 2 for demonstration purposes.

Checks

vaporvee commented 2 months ago

Are you switching between the scenes fast? And did you test if it updates directly for other users who see your profile? Maybe try that with an alt account in the browser because discord updates it slower locally for some weird reason i think. I had this issue before but maybe its something else

LiamMGit commented 2 months ago

I am switching relatively fast, but once I get into a level scene I usually stay for about 60-120 seconds, I have gotten to try to get people to look at it, but its the same as me, I even had other people try it on their devices and it happened on their profiles too, I also tried looking at it on my profile through other devices such as my phone, and also web browser. Maybe it's just Discord's fault? I don't know.

LiamMGit commented 2 months ago

Seems like now its straight up not even working?

LiamMGit commented 2 months ago

image

image

this seems like discords fault here... update: just tried demo app and it works???

vaporvee commented 2 months ago

huh weird is the autoinstalled autoload still in there?

LiamMGit commented 2 months ago

Yup, It’s there, problem with it fully not popping up fixed itself though

vaporvee commented 2 months ago

wdym?

LiamMGit commented 2 months ago

wdym?

The RPC was just not showing up for a bit on my profile, but that fixed itself.

vaporvee commented 2 months ago

so your issue is fixed completely?

LiamMGit commented 2 months ago

Not really, it still delays the RPC changed by a ton after a bit of use, but I just think thats Discord’s fault

vaporvee commented 2 months ago

yeah should update faster on friends clients but i cant confirm if its still the case. Will look out for that in future updates if possible though. i even have a github tag for it how often stuff its discords fault lol