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

[crash] mapserver_mod causes crashloop on EdenLost #20

Open
dennisjenkins75 opened this issue Jan 26, 2022 · 2 comments
Open

[crash] mapserver_mod causes crashloop on EdenLost #20

dennisjenkins75 opened this issue Jan 26, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dennisjenkins75
Copy link

I've got the mapserver binary running on EdenLost. However, when I add the mapserver_mod for its features, the server crashloops when loading the mod:

ServerError: AsyncErr: environment_Step: Runtime error from mod 'mapserver' in callback environment_Step(): ...worlds/world/worldmods/mapserver_mod/bridge/defaults.lua:5: bad argument #1 to 'gmatch' (string expected, got nil)
stack traceback:
        [C]: in function 'gmatch'
        ...worlds/world/worldmods/mapserver_mod/bridge/defaults.lua:5: in function 'explode'
        ...worlds/world/worldmods/mapserver_mod/bridge/defaults.lua:14: in function 'get_max_lag'
        ...worlds/world/worldmods/mapserver_mod/bridge/defaults.lua:22: in function 'add_defaults'
        ...hit/worlds/world/worldmods/mapserver_mod/bridge/init.lua:43: in function 'func'
        /home/1hit/multicraft/bin/../builtin/common/after.lua:20: in function </home/1hit/multicraft/bin/../builtin/common/after.lua:5>
        /home/1hit/multicraft/bin/../builtin/game/register.lua:441: in function </home/1hit/multicraft/bin/../builtin/game/register.lua:425>
@dennisjenkins75
Copy link
Author

dennisjenkins75 commented Jan 26, 2022

Looks line minetest.get_server_status() returns nil (the server is "Multicraft" and not "minetest"), and the mod is not prepared to handle that.

From the API doc

* `minetest.get_server_status(name, joined)`
    * Returns the server status string when a player joins or when the command
      `/status` is called. Returns `nil` or an empty string when the message is
      disabled.

Well, /status is disabled. IDK why. I see nothing in the minetest.conf that explicitly disables /status. Maybe it defaults to disabled, and since not specified, is disabled. I'll keep digging.

@dennisjenkins75
Copy link
Author

dennisjenkins75 commented Jan 26, 2022

Well, it looks like "/status" is actually intentionally nerfed in the C++ code for Multicraft.

MultiCraft/MultiCraft@2aa0400 (committed 2021-02-14 as part of a mass code change merge into multicraft).

From multicraft/src/server.cpp

std::string Server::getStatusString()
{
        std::ostringstream os(std::ios_base::binary);

        // Disabled due to misuse.
        /*os << "# Server: ";
        // Version
        os << "version=" << g_version_string;
        // Uptime
        os << ", uptime=" << m_uptime_counter->get();
        // Max lag estimate
        os << ", max_lag=" << (m_env ? m_env->getMaxLagEstimate() : 0);

So we need to make mapserver_mod robust when minetest.get_server_status() returns nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants