Author Topic: Blacklist script not reading person's blid.  (Read 847 times)

It doesn't read if the person's blid is on the blacklist and it lets the person join.
wat do
Code: [Select]
package Blacklist
{
    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)
    {
        %list = $Pref::Server::Blacklist;
%blid = %this.getBLID();
if(hasItemOnList(%list,%blid))
%k = true;

        if(%k == 1)
return "You are Blacklisted on this server, you will not be able to join, ever."; //or atleast until I remove you from the list
        else
return Parent::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb);
    }
};
activatepackage(Blacklist);
« Last Edit: September 20, 2012, 08:14:57 PM by tkepahama »

You don't need to ask this. Put a bunch of echos in there and figure it out. If you cant, that's when you would ask for help.

Also you should probably set %k to false, by default.

is gameConnection::getBLID a function
i've never used it but i would try getBL_ID


edit: also i have no idea what elm is talking about in his first line
« Last Edit: September 20, 2012, 09:03:38 PM by Munkey »

You don't need to ask this. Put a bunch of echos in there and figure it out. If you cant, that's when you would ask for help.

Also you should probably set %k to false, by default.
I posted it here for help because I couldn't figure it out.
Put a bunch of echos in there and figure it out.
???
Where and what should I even echo?



*EDIT: I echoed %this.getBLID() and it returned -1.  That's the problem, honestly I don't know what to do about that.  I don't want to change it to %name because if someone changes their name then they would be able to join.

*EDIT#2: I changed true to false instead and it won't let anyone in, I don't see how the blid can be the only issue because -1 isn't on the blacklist therefor I should be able to join.  Though it could be because I changed true to false
« Last Edit: September 20, 2012, 09:22:27 PM by tkepahama »

at the point of onConnectRequest, the client does not yet exist, and therefore does not have a BL_ID

You need to wait for the connect request to go through and for the master server to send you his BL_ID (assuming its a valid connection) before you can do anything with BL_IDs

at the point of onConnectRequest, the client does not yet exist, and therefore does not have a BL_ID

You need to wait for the connect request to go through and for the master server to send you his BL_ID (assuming its a valid connection) before you can do anything with BL_IDs
Is there any other function that I can use to make it work besides autoAdminCheck or onClientEnterGame?


What exactly are you trying to do that the default ban feature doesn't already do?

is there any way to check blid before the client creates the has connected message

ja, you can manually send a request to the master server to have their IP/name verified, and it will send you back a BLID, except the game does that anyway by default and you can always set up a proper tcp listening thing to intercept the BL_ID when it is sent, and ban them then

but yeah, what's wrong with the built in ban feature?

ja, you can manually send a request to the master server to have their IP/name verified, and it will send you back a BLID, except the game does that anyway by default and you can always set up a proper tcp listening thing to intercept the BL_ID when it is sent, and ban them then

but yeah, what's wrong with the built in ban feature?
Because I don't want any admins unbanning people without me knowing.  And don't say "just deadmin them" yeah well how would I know who did it if they didn't tell me? HM?
And it also tells me who I blacklist so I can just keep them blacklisted forever instead of the bans clearing somehow.

And I was thinking of putting in the ban feature but I don't know how to get it to say "CONSOLE has banned name time reason".

Then package the unban function so they can't unban?

Here's something I'm running on my server that makes admins unable to ban people that I've banned. You could modify it

Code: [Select]
package NoUnbanHostBans
{
function serverCmdUnban(%client,%posInList)
{
if(BanManagerSO.adminBL_ID[%posInList] == getNumKeyID() && %client.bl_id != getNumKeyID())
{
messageClient(%client,'','You can not unban people banned by the server owner!');
serverCmdRequestBanList(%client);
}
else
Parent::ServerCmdUnban(%client,%posInList);
}
};
ActivatePackage(NoUnbanHostBans);

I make it so banning and unbanning are super admin only functions, and I have exactly one super admin besides myself in my server, which is my co-host Rykuta.

Your problem likely stems from giving everyone you are friends with admin or super admin.


Why don't you just use Truce's Admin Controls Manager?

http://forum.returntoblockland.com/dlm/viewFile.php?id=80
I do and that's not what I was asking for but w/e, but thanks to Headcrab, the only one that actually gave me any help.
Better lock this since people will just say "use this addon"  "make banning and unbanning super admin only".  You are obviously missing what I was asking for.  So I think it's best to lock this.