Closed raphael12333 closed 11 months ago
Hi, about time to report it if you know known about it for a year.
I don't remember having a crash like this. You are probably sending a chat message before level.command
is defined. You can test by letting the server run a while before sending a chat message.
To fix this you can check if the level.command
call in callback.gsc
is defined using the isDefined()
function:
CodeCallback_PlayerCommand(str) // add to callback.gsc
{
if(isDefined(level.command))
[[ level.command ]](str);
}
I've had a look at the source code and it looks like level.commands
is not defined when groups/user is not set or if the scr_mm_commands
CVAR is not set. The above isDefined
should fix this issue.
Thank you for the fix proposal, I understand what is undefined now I'm not sure why I didn't talk about it before
If you use only the default
group, so no created user, the commands would not work with this fix, if i understand correctly
I think it's due to this: https://github.com/cato-a/CoDaM_MiscMod/blob/0dcee77651f6218f8e942556b18d0ca7da72787b/___CoDaM_MiscMod/codam/_mm_commands.gsc#L20
I guess maybe level.command
could be defined if scr_mm_groups != ""
What do you think about it? Would that require heavy changes in the code?
I intended to make it better at some point, just some basic checks to disable the commands if it's not configured, and I also think that the thought was you would never really use the command system without having at least 1 admin user.
But I guess you could remove the following 2 lines and see what happens. 🙂
And you can also try to remove these 2 lines to use the built-in default group.
Hello Since I started using MiscMod a year ago, i always struggled to understand how to make a freshly installed server not to crash when sending a chat message
I just noticed it crashes when using
developer "1"
and not defining any account with permissions It crashes even whenscr_mm_commands
is not enabledHere is the log part:
What do you think about it? It sounds really problematic to me, but maybe i didn't pay enough attention to the log and the reason for this crash is obvious for the people But in any case i think would be nice if MiscMod can run with
developer "1"
without the need to figure this out/modify the .cfgI'm sorry not to propose a solution right now, I will maybe try later Regards