haxball / haxball-issues

114 stars 42 forks source link

HH request to prevent joins #1080

Open xbittencourt opened 4 years ago

xbittencourt commented 4 years ago

Hi, Basro!

First of all I would like to thank you for the features that you have added over time and that have been very useful for us.

Today I come here to request a new feature.

It would be very useful if we could block a player from joining the room before even notifying others of their join.

I have developed an advanced system for handling accounts and capturing fakes; and based on the nick, conn and auth, I can kick they out of the room. Useful for kick out previously caught spammers, etc.

It would help me if, e.g., I could return true / false in the onPlayerJoin event and prevent a specific player from joining the room, as it works in the onPlayerChat event.

Kick they works, however the other players receive two sound notifications and messages (join & kick) that could be avoided.


room.onPlayerJoin = function(player)
{
    if(player.name === "spammer")
    {
        return false
    }
    else
    {
        return true
    }
}

// OR with the typeof return

room.onPlayerJoin = function(player)
{
    if(player.name === "spammer")
    {
        return "reason"
    }
    else
    {
        return true
    }
}

// OR with other event

room.onPlayerConnect = function(player)
{
    if(player.name === "spammer")
    {
        return false
    }
    else
    {
        return true
    }
}

Thanks for your time.

Jacob-1998 commented 4 years ago

basro look

https://github.com/haxball/haxball-issues/issues/1054

AnddyAnddy commented 4 years ago

In addition of that, it would be cool if we could prevent a kick/ban BEFORE the player is banned