more precise discord errors

This commit is contained in:
Yannik
2023-04-29 18:22:39 +02:00
parent 164f3fdbe3
commit f08c193455
10 changed files with 75 additions and 23 deletions

View File

@@ -1,4 +0,0 @@
extends Node
func _process(delta):
Discord_SDK.coreupdate()

View File

@@ -5,9 +5,9 @@ const ExportPlugin = preload("res://addons/discord-sdk-gd/export.gd")
var loaded_exportplugin = ExportPlugin.new()
func _enter_tree():
add_autoload_singleton("discord_coreupdater", "res://addons/discord-sdk-gd/discord_coreupdater.gd")
add_autoload_singleton("DiscordSDK", "res://addons/discord-sdk-gd/sdk_utility.gd")
add_export_plugin(loaded_exportplugin)
func disable_plugin():
remove_autoload_singleton("discord_coreupdater")
remove_autoload_singleton("DiscordSDK")
remove_export_plugin(loaded_exportplugin)

View File

@@ -0,0 +1,55 @@
extends Node
const result: Array[String] = [
"Ok",
"ServiceUnavailable",
"InvalidVersion",
"LockFailed",
"InternalError",
"InvalidPayload",
"InvalidCommand",
"InvalidPermissions",
"NotFetched",
"NotFound",
"Conflict",
"InvalidSecret",
"InvalidJoinSecret",
"NoEligibleActivity",
"InvalidInvite",
"NotAuthenticated",
"InvalidAccessToken",
"ApplicationMismatch",
"InvalidDataUrl",
"InvalidBase64",
"NotFiltered",
"LobbyFull",
"InvalidLobbySecret",
"InvalidFilename",
"InvalidFileSize",
"InvalidEntitlement",
"NotInstalled",
"NotRunning",
"InsufficientBuffer",
"PurchaseCanceled",
"InvalidGuild",
"InvalidEvent",
"InvalidChannel",
"InvalidOrigin",
"RateLimited",
"OAuth2Error",
"SelectChannelTimeout",
"GetGuildTimeout",
"SelectVoiceForceRequired",
"CaptureShortcutAlreadyListening",
"UnauthorizedForAchievement",
"InvalidGiftCode",
"PurchaseError",
"TransactionAborted",
"DrawingInitFailed"
]
func _process(delta):
Discord_SDK.coreupdate()
func get_sdk_info():
return result[Discord_SDK.get_result_int()]