Jump to content
  • We need you!

    You must register to discover all the features of our community!

  • 0

Syslog


gweilo321

Question

Hi guys, so im trying to put into a HackLog for example, and log if someone that is not GM, just a player uses a command /shutdown.

ACMD(do_shutdown)
{
    if (!ch->IsGM())
        LogManager::instance().HackLog("Used /shutdown command.", ch);
        return;



        if (NULL == ch)
        {
            sys_err("Shutdown started by %s.", ch->GetName());
        }
        TPacketGGShutdown p;
        p.bHeader = HEADER_GG_SHUTDOWN;
        P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown));

        Shutdown(10);
}

But its not working..

It keep says ingame that Command is not valid, and nothing goes into the log.

 

Help

Link to post

5 answers to this question

Recommended Posts

  • 1

Just think a little.

 

If you set the minimum for GM_IMPLEMENTOR then the  

if (!ch->IsGM())
        LogManager [...]

will never ever triggered since only an implementor character can go throguh the ACMD(do_shutdown) in cmd_gm.cpp.

 

So you should set it to GM_PLAYER and keep that if above. But then every GM can use shutdown command so maybe it would be nice to edit to check the gm level too there, if possible. I don't know if you can check the gm level by default in 40k source.

 

Edit: I quickly searched and you can, there is an ch->GetGMLevel() == GM_IMPLEMENTOR what you can use.

Edited by TMP4 (see edit history)
Link to post
  • 0

Why don't just set shutdown's minimum gm level in cmd.cpp?

Then if a player will try it will get "command not exist" or something, i'm not using english files.

Link to post
  • 0

Yes we do. It set to GM_IMPLEMENTOR. And yes thats how it is. But also what i want to achieve is to put into logs that a NON GM PLAYER has tried to use this command.

 

But with the code i applied in my topic it doesnt work.

Link to post
  • 0
6 hours ago, TMP4 said:

Just think a little.

 

If you set the minimum for GM_IMPLEMENTOR then the  

if (!ch->IsGM())
        LogManager [...]

will never ever triggered since only an implementor character can go throguh the ACMD(do_shutdown) in cmd_gm.cpp.

 

So you should set it to GM_PLAYER and keep that if above. But then every GM can use shutdown command so maybe it would be nice to edit to check the gm level too there, if possible. I don't know if you can check the gm level by default in 40k source.

 

Edit: I quickly searched and you can, there is an ch->GetGMLevel() == GM_IMPLEMENTOR what you can use.

Thanks. Do you think its a safe way to do it? I mean its still checking for IMPLEMENTOR.

Link to post
  • 0

If you  check for implementor it's as good as set the minimum to implementor at cmd.cpp like everyone do.

 

I just don't understand why do you need to log everyone who try /shutdown. There will be always someone to try, even normal players. 

If you want to ban them, it's not a good idea.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.