1 (edited by TuX. 2009-10-04 12:38:44)

Topic: [QUESTION] Adding a ban from game/server/hooks.cpp

Hi guys,

i want to add an IP-ban from hooks.cpp. My target is to ban all users that change their names to [bot]...

        if(msgtype == NETMSGTYPE_CL_CHANGEINFO && strcmp(oldname, server_clientname(client_id)) != 0)

        {

            char chattext[256];

            str_format(chattext, sizeof(chattext), "%s changed name to %s", oldname, server_clientname(client_id));
            if(strstr(server_clientname(client_id),"[bot]") != NULL) {
                // ban him!
            } else {
                game.send_chat(-1, GAMECONTEXT::CHAT_ALL, chattext);
            }

        }

I couldn't find any function to do this. Does only the es_server.c handle bans?

2 (edited by Slayer *gV* 2009-10-04 13:28:05)

Re: [QUESTION] Adding a ban from game/server/hooks.cpp

you may take a look here:
http://www.teeworlds.com/forum/viewtopic.php?id=3875
(PS: far down)