Issue with message not being captured after using EngineDebugger.RegisterMessageCapture in C#

Godot Version

4.6

Question

Hello,

I’m doing a Debugger load as a singleton at the start of my game. → The load is correct and the function _Ready is called.

In my _Ready function I register my function Test to capture message starting with “my_plugin”. So before the EngineDebugger.RegisterMessageCapture function when I tested things I used EngineDebugger.HasCapture(“my_plugin”) before and after the precedent function and before it returns false and after it returns true. → normal behavior.

And we arrive at the problem, when I send a debug message with EngineDebugger.SendMessage the message was never captured in my function Test and even worse we never even entered the function Test.

So that makes we wandering if we cannot use EngineDebugger in C# but only in GDScript.

Thank you very much

public partial class DebuggerSingleton : Node
{
    public const String DEBUGGER_PREFIX = "my_plugin";

    public static DebuggerSingleton Singleton;
    
    public override void _Ready()
    {
        Singleton = this;
        EngineDebugger.RegisterMessageCapture("my_plugin", new Callable(this, nameof(Test)));
        EngineDebugger.SendMessage("my_plugin:test", []);
    }

    public bool Test(String message, GDArray array)
    {
        if (message == "test")
        {
            GD.Print("test is ok!");
            return true;
        }
        
        return false;
    }
}

P-S : sorry if my english is not good, if you have any question don’t hesitate to say them

EngineDebugger.send_message() sends the message to the editor and not to your running game.

EngineDebugger.register_message_capture() registers a callback for messages sent from the editor to your game.

You still need to implement an EditorDebuggerPlugin in the editor side to communicate with your game. Check the EditorDebuggerPlugin documentation for a full example.

Thank you very much for your response.

I didn’t saw that in the documentation the EditorDebuggerPlugin was sending one and receiving another and same for the node below.

I thought that was the same one send and receive :man_facepalming: .