HimbeerserverDE / mt-multiserver-chatcommands

mt-multiserver-chatcommands provides a useful chat command interface for mt-multiserver-proxy.
MIT License
5 stars 2 forks source link

"Invalid command" for chat commands #12

Open ricardoglc opened 3 weeks ago

ricardoglc commented 3 weeks ago

Hi, maybe I'm missing something, but I'm unable to use any of the chat commands from the game client. I type a command like "/players" in the game and I get the message "players: invalid command".

I've compiled minetest server, mt-multiserver-proxy and chatcommands from source using the commits for 5.8 and following the instructions in the docs. The plugin is built under plugins/mt-multiserver-chatcommands/ and the mt-multiserver-chatcommands.so file is there. Both the game and the proxy run without errors, and I'm able to connect with user qwerty to the game via the proxy:

~$ ./mt-multiserver-proxy
2024/10/30 23:33:48 load config
2024/10/30 23:33:48 [proxy] version: (devel)
2024/10/30 23:33:48 [proxy] load plugins
2024/10/30 23:33:48 [proxy] listen [::]:40000
2024/10/30 23:34:37 [179.xxxx] -> connect
2024/10/30 23:34:39 [179.xxxx qwerty] <-> handshake completed
2024/10/30 23:34:39 [server QServer] -> connect
2024/10/30 23:34:40 [server QServer] <-> handshake completed

This is my config.json:

{
        "NoAutoPlugins": true,
        "Servers": {
                "QServer": {
                        "Addr": "172.xxxx:30000"
                }
        },
        "DefaultSrv": "QServer",
        "ForceDefaultSrv": true,
        "AuthBackend": "mtsqlite3",
        "Groups": {
                "admins": [ "cmd_*" ]
        },
        "UserGroups": {
                "qwerty": "admins"
        }
}

Is there anything wrong or that I may be missing? Thanks!

HimbeerserverDE commented 3 weeks ago

Thanks for the detailed information. The default command character for the proxy is >, not /, to avoid collisions with Minetest server commands. You can try again with >players. You can also set CmdPrefix to / in the config which will prioritize proxy commands over server commands if there is a collision.

HimbeerserverDE commented 1 week ago

I just noticed that you wrote the plugin file is at plugins/mt-multiserver-chatcommands/mt-multiserver-chatcommands.so. This won't work, .so files are only loaded if they are located at the root of the plugins/ directory, i.e. plugins/mt-multiserver-chatcommands.so. You can symlink or move the file to the correct location to fix this. Also note that the plugins/ directory needs to be located in the same directory the mt-multiserver-proxy executable is in (symlinks to the executable are followed so only the true executable will work; this should probably be changed).

Maybe printing plugin names as they're loaded would be a good idea as it would allow us to see whether the proxy is even trying to load them (currently, only errors are printed).

Please let me know if you manage to get it to work. I can run >players in my setup without any issues.