diff --git a/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding.dll b/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding.dll index 37b1b18..eb6518b 100644 Binary files a/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding.dll and b/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding.dll differ diff --git a/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding_debug.dll b/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding_debug.dll index 0c2c836..20b2ad8 100644 Binary files a/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding_debug.dll and b/project/addons/discord-sdk-gd/bin/windows/discord_game_sdk_binding_debug.dll differ diff --git a/project/main.gd b/project/main.gd index a507e53..7950ae5 100644 --- a/project/main.gd +++ b/project/main.gd @@ -1,18 +1,19 @@ extends Node func _ready(): - Discord_SDK.app_id = 1099618430065324082 - Discord_SDK.details = "A demo activity by vaporvee#1231" - Discord_SDK.state = "Checkpoint 23/23" + Discord_SDK.debug() + #Discord_SDK.app_id = 1099618430065324082 + #Discord_SDK.details = "A demo activity by vaporvee#1231" + #Discord_SDK.state = "Checkpoint 23/23" - Discord_SDK.large_image = "game" - Discord_SDK.large_image_text = "Try it now!" - Discord_SDK.small_image = "boss" - Discord_SDK.small_image_text = "Fighting the end boss! D:" + #Discord_SDK.large_image = "game" + #Discord_SDK.large_image_text = "Try it now!" + #Discord_SDK.small_image = "boss" + #Discord_SDK.small_image_text = "Fighting the end boss! D:" - Discord_SDK.start_timestamp = int(Time.get_unix_time_from_system()) + #Discord_SDK.start_timestamp = int(Time.get_unix_time_from_system()) # Discord_SDK.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time - Discord_SDK.refresh() + #Discord_SDK.refresh() $Info.text = $Info.text.replace("{isdiscordworking}",str(Discord_SDK.get_is_discord_working())).replace("{id}",str(Discord_SDK.app_id)).replace("{details}",Discord_SDK.details).replace("{state}",Discord_SDK.state).replace("{lkey}",Discord_SDK.large_image).replace("{ltext}",Discord_SDK.large_image_text).replace("{skey}",Discord_SDK.small_image).replace("{stext}",Discord_SDK.small_image_text).replace("{stimestamp}",str(Discord_SDK.start_timestamp)).replace("{etimestamp}",str(Discord_SDK.end_timestamp)) diff --git a/src/discordgodot.cpp b/src/discordgodot.cpp index 2f603a7..11df734 100644 --- a/src/discordgodot.cpp +++ b/src/discordgodot.cpp @@ -12,6 +12,7 @@ Discord_SDK *Discord_SDK::singleton = nullptr; discord::Core *core{}; discord::Result result; discord::Activity activity{}; +discord::User user{}; void Discord_SDK::_bind_methods() { @@ -70,6 +71,16 @@ Discord_SDK::~Discord_SDK() singleton = nullptr; } +void Discord_SDK::coreupdate() +{ + if (result == discord::Result::Ok) + { + ::core->RunCallbacks(); + core->UserManager().OnCurrentUserUpdate.Connect([]() + { core->UserManager().GetCurrentUser(&user); }); + } +} + void Discord_SDK::debug() { result = discord::Core::Create(1080224638845591692, DiscordCreateFlags_NoRequireDiscord, &core); @@ -88,12 +99,6 @@ void Discord_SDK::debug() UtilityFunctions::push_warning("Discord Activity couldn't be updated. It could be that Discord isn't running!"); } -void Discord_SDK::coreupdate() -{ - if (result == discord::Result::Ok) - ::core->RunCallbacks(); -} - void Discord_SDK::set_app_id(const int64_t &value) { app_id = value;