haxball / haxball-issues

115 stars 43 forks source link

Abusive people spamming in rooms #1021

Open Gimenez20 opened 4 years ago

Gimenez20 commented 4 years ago

Hi, Is there a way to ban people without being able to enter with another IP? There is a player that whenever I ban him, after 30 minutes he comes back in and spammed the room and many players ask me to ban him but it is impossible. It is difficult to get people to register, people will not want to and will go to other rooms, the same thing will happen. Could Basro implement something to prevent that from happening? Could you also implement something for spam?

PD: I have bad English. I can speak to you in Spanish if necessary.

toderitagcristian commented 4 years ago

@Gimenez20 You need a register system and whitelist player.auth Look in my repositories. Got one with discord registration Medium javascript level required tho :)

Gimenez20 commented 4 years ago

It is very difficult for people to want to register. Wouldn't there be some other method?

toderitagcristian commented 4 years ago

@Gimenez20 with current game features, no. You have to implement some sort of registering system.

You could do a simple setup:

Gimenez20 commented 4 years ago

I have discord and I have registered users. The problem is worse. People who do not register, play in other rooms without registration and have the same problems. It cannot be that everything is solved by records. Why can't Basro put a global registry and so solve all those fake problems?

saviola777 commented 4 years ago

Because that is not in the spirit of the game he tried to create. It's a game that you are supposed to just be able to play right away, without any hurdles like registration.

iAmLuks commented 4 years ago

This guy stole my maps renamed them and made them public in his rooms as if he made them Also copied layout of my discord's server because he can't be original and has multiple copy pasted scripts that i can exploit his rooms within seconds. He's a massive troll, ignore him :)

Gimenez20 commented 4 years ago

Because that is not in the spirit of the game he tried to create. It's a game that you are supposed to just be able to play right away, without any hurdles like registration.

It should be done without registration, but I think Basro could solve that, limiting the use of nicknames to a nickname or something like that

TomasKavaliauskas commented 4 years ago

I use this code to detect spammers. It checks for multiple messages in a row + it checks if it is possible to write messages so quickly (based on how many characters user wrote and how much time passed since his last message)

`LAST_CHAT_MESSAGES = []; room.onPlayerChat = function (player, message) {

    var chatMessage = {
        'playerId': player.id,
        'playerName': player.name,
        'message': message,
        'time': Date.now()
    };

    LAST_CHAT_MESSAGES.unshift(chatMessage);

    if (LAST_CHAT_MESSAGES.length > 1) {

        if (LAST_CHAT_MESSAGES[1].playerId === player.id) {

            var timeDiff = LAST_CHAT_MESSAGES[0].time - LAST_CHAT_MESSAGES[1].time;
            var messageLength = message.length;

            if (messageLength * 100 > timeDiff) {

                kickForSpam(player);
                return true;

            }

        } else {

            var timeDiff = LAST_CHAT_MESSAGES[0].time - PLAYERS[player.id].date;
            var messageLength = message.length;

            if (messageLength * 100 > timeDiff) {

                kickForSpam(player);
                return true;

            }

        }

        if (LAST_CHAT_MESSAGES.length > 2) {

            if (LAST_CHAT_MESSAGES[1].playerId == LAST_CHAT_MESSAGES[2].playerId && LAST_CHAT_MESSAGES[1].playerId == player.id) {

                if (LAST_CHAT_MESSAGES[1].time - LAST_CHAT_MESSAGES[2].time < 2000 && LAST_CHAT_MESSAGES[0].time - LAST_CHAT_MESSAGES[1].time < 2000) {

                    kickForSpam(player);
                    return true;

                }

            }

        }

    } else {

        var timeDiff = LAST_CHAT_MESSAGES[0].time - PLAYERS[player.id].date;
        var messageLength = message.length;

        if (messageLength * 100 > timeDiff) {

            kickForSpam(player);
            return true;

        }

    }

    if (LAST_CHAT_MESSAGES.length > 10) {

        clearMessages();

    }

};`

kingjasko commented 4 years ago

Because that is not in the spirit of the game he tried to create. It's a game that you are supposed to just be able to play right away, without any hurdles like registration.

It should be done without registration, but I think Basro could solve that, limiting the use of nicknames to a nickname or something like that

I think registration should be optional and after someone registers a nickname it cannot be used for others, or it could say something beside his name so everyone knows it's not the real guy. But obviously there would be problems with people stealing other people's nicknames intentionally.