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

feat: port to Godot 4 #11

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: port to Godot 4 #11

wants to merge 2 commits into from

Conversation

yuna0x0
Copy link

@yuna0x0 yuna0x0 commented Jan 26, 2023

Windows port is done and tested on my side.

Unix-based port is currently blocked by Abdera7mane/Godot-UnixSocket. Need to port it from GDNative to GDExtension.

@3ddelano
Copy link
Owner

3ddelano commented Feb 1, 2023

Error when trying to run on G4B4 Win11 x64

SCRIPT ERROR: Parse Error: "StreamPeerUnix" was not found in the current scope.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/pipe/UnixPipe.gd:3)
SCRIPT ERROR: Parse Error: Identifier "StreamPeerUnix" not declared in the current scope.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/pipe/UnixPipe.gd:6)
SCRIPT ERROR: Parse Error: Constant value uses script from "res://addons/godot_editor_discord_presence/Discord RPC/ipc/pipe/UnixPipe.gd" which is loaded but not compiled.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/IPC.gd:9)
SCRIPT ERROR: Parse Error: "StreamPeerUnix" was not found in the current scope.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/pipe/UnixPipe.gd:3)
SCRIPT ERROR: Parse Error: Identifier "StreamPeerUnix" not declared in the current scope.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/pipe/UnixPipe.gd:6)
SCRIPT ERROR: Parse Error: Constant value uses script from "res://addons/godot_editor_discord_presence/Discord RPC/ipc/IPC.gd" which is loaded but not compiled.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/module/IPCModule.gd:1)
SCRIPT ERROR: Parse Error: Could not parse script from "res://addons/godot_editor_discord_presence/Discord RPC/ipc/IPC.gd".
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/module/IPCModule.gd:3)
SCRIPT ERROR: Parse Error: Could not parse script from "res://addons/godot_editor_discord_presence/Discord RPC/ipc/IPC.gd".
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/module/IPCModule.gd:10)
SCRIPT ERROR: Parse Error: "StreamPeerUnix" was not found in the current scope.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/pipe/UnixPipe.gd:3)
SCRIPT ERROR: Parse Error: Identifier "StreamPeerUnix" not declared in the current scope.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/Discord RPC/ipc/pipe/UnixPipe.gd:6)
ERROR: Parser bug (please report): Trying to check compatibility of unset target type
   at: (modules/gdscript/gdscript_analyzer.cpp:4097)
SCRIPT ERROR: Parse Error: Could not parse global class "DiscordRPC" from "res://addons/godot_editor_discord_presence/Discord RPC/DiscordRPC.gd".
          at: GDScript::reload (res://addons/godot_editor_discord_presence/plugin.gd:43)
SCRIPT ERROR: Parse Error: Could not resolve class "DiscordRPC", because of a parser error.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/plugin.gd:104)
SCRIPT ERROR: Parse Error: Could not resolve class "DiscordRPC", because of a parser error.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/plugin.gd:117)
SCRIPT ERROR: Parse Error: Could not resolve class "DiscordRPC", because of a parser error.
          at: GDScript::reload (res://addons/godot_editor_discord_presence/plugin.gd:128)
ERROR: Transient parent has another exclusive child.
   at: (scene/main/window.cpp:466)```

@yuna0x0
Copy link
Author

yuna0x0 commented Feb 1, 2023

The main branch's Unix code is blocked by the Godot-UnixSocket, which needs to port to GDExtension. It will not work currently.

I have opened a Windows branch which removes Unix-related code. If you want to test it out on Windows.

https://github.com/edisonlee55/godot-editor-discord-presence/tree/windows

@3ddelano 3ddelano mentioned this pull request Mar 12, 2023
@Abdera7mane
Copy link

Abdera7mane commented May 7, 2023

I have ported Abdera7mane/discord-rpc-gdscript@203f6d5 to Godot 4 and Abdera7mane/Godot-UnixSocket@9e3e106 to GDExtension however MacOS support is lacking.

I also took this as an opportunity to rework on the Discord RPC implementation and made it way simpler. Here is an example of rich presence update:

var discord := DiscordRPC.new()

# establish a connection and wait for rpc_ready signal

discord.update_presence({
  details = "In menu",
  state = "AFK",
  assets = {
    large_image = "icon"
  }
})

I still have some things to add before v2 release.

@3ddelano 3ddelano mentioned this pull request May 15, 2023
3 tasks
@Mickeon
Copy link

Mickeon commented Sep 8, 2023

It would be nice to have this working again. I tested @edisonlee55 's branch and it seems to be working fine (aside from one parameter that needed to be removed) just for Windows, which is just enough for my use-case. Still would be nice to be able to download this from the AssetLib.

@3ddelano 3ddelano mentioned this pull request Sep 21, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants