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

Closed
opened 2024-08-29 23:34:31 +00:00 by LapisGit · 11 comments
LapisGit commented 2024-08-29 23:34:31 +00:00 (Migrated from github.com)

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

### 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 ```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 ```shell 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 - [X] I tried reinstalling the addon or tried to fix it myself with other methods. - [X] I tried restarting Discord and Godot completely. - [X] I did read the documentation https://vaporvee.com/docs/discord-rpc-godot/

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

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
LapisGit commented 2024-08-29 23:45:02 +00:00 (Migrated from github.com)

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.

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.
LapisGit commented 2024-08-30 02:21:39 +00:00 (Migrated from github.com)

Seems like now its straight up not even working?

Seems like now its straight up not even working?
LapisGit commented 2024-08-30 02:23:05 +00:00 (Migrated from github.com)

image

image

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

![image](https://github.com/user-attachments/assets/3acc97d7-c172-4fc3-9061-5bf87dac40b6) ![image](https://github.com/user-attachments/assets/c5a1d5ab-1f16-4fc0-a800-090dd9822fc4) this seems like discords fault here... update: just tried demo app and it works???

huh weird is the autoinstalled autoload still in there?

huh weird is the autoinstalled autoload still in there?
LapisGit commented 2024-09-03 17:15:32 +00:00 (Migrated from github.com)

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

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

wdym?

wdym?
LapisGit commented 2024-09-03 18:17:23 +00:00 (Migrated from github.com)

wdym?

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

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

so your issue is fixed completely?

so your issue is fixed completely?
LapisGit commented 2024-09-03 18:22:11 +00:00 (Migrated from github.com)

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

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

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

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
Sign in to join this conversation.
No description provided.