Closed 3ddelano closed 2 years ago
If you run the project directly from a terminal do you get an error?
Crashes like this usually show up on Godot's terminal output instead of the in editor
After looking into this, I can confirm that the error occurs.
It looks like something strange is happening though, as the run_callbacks
function seems to give this error after a few calls:
SCRIPT ERROR: create_core: Invalid call. Nonexistent function 'run_callbacks' in base 'Reference (core.gdns)'.
At: res://addons/plugin_test/plugin.gd:26.
It will also occasionally crash with a Segmentation fault (core dumped)
error, which is slightly more concerning.
I'm going to attempt to debug the error but this codebase is a complete mess to begin with so I can't make any promises.
(Misclicked :P)
I give up, this codebase is a complete mess to be honest. I will be rewriting the library in Rust at some point in the future, most likely when GDExtension is released. GameSDK is becoming less and less supported as time goes on anyway, so the next library might just end up interfacing with IPC directly.
I might give this another look at some point, but I haven't got much free time to work on issues like this when the code is so awful. I'm not sure what motivated past-me to write this in C, but it was a mistake for sure.
Great. I'll close this for now
I created a quick test project to see how this would look in Rust, it is very promising so far. However, I tried testing this issue using that implementation, and even the most basic class yields the same error:
#[derive(NativeClass)]
#[inherit(Object)]
pub struct Test;
#[methods]
impl Test {
fn new(_owner: &Object) -> Self {
Test
}
#[export]
fn hello_world(&mut self, _owner: &Object) {
godot_print!("Hello World!");
}
}
It appears this may be an issue with GDNative in general, I will make a bug report on the Godot repo as soon as possible.
Hm, looks like it does work in some scenarios, I'm going to look into this more later.
Yes I too have some issues in trying to get the C++ version of the GameSDK binded in Godot. For some reason the godot editor says "Cant open dynamic library". It happens of if I try to call some method from discord.
System Info
Describe the bug
After calling core.get_activity_manager() the Godot editor hangs and crashes for an EditorPlugin.
To Reproduce
var core: Discord.Core var activities: Discord.ActivityManager
func _enter_tree() -> void: create_core()
func destroy_core(): core = null activities = null
func create_core(): destroy_core() core = Discord.Core.new() var result: int = core.create(928212232213520454, Discord.CreateFlags.DEFAULT)
func _process(delta: float) -> void: if core: var result: int = core.run_callbacks() if result != Discord.Result.OK: print("Callbacks failed: ")