Forums Index >> Modding >> Impersonator Blocker
Page : <1> :
Damnit... :(
So thats what nameregister does! :) what about userlog.cs? Whats that do? :o
^It logs the users that come in and leave.
Page : <1> :
Found this in an old Garage Games thread.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8897
Put this in main.cs in the main folder that contains the data, server, and client folders
function GameConnection::onConnectRequest( %client, %netAddress, %name )
{
echo("Connect request from: " @ %netAddress);
%client.name = %name;
//check ban list
%ip = getRawIP(%client);
%i = 0;
for(%i = 0; %i <= $Ban::numBans; %i++)
{
echo("checking banlist ", %i);
if(%ip $= $Ban::ip[%i])
{
return "You are banned.";
}
}
If($Server::PlayerCount >= $pref::Server::MaxPlayers)
return "CR_SERVERFULL";
Return "";
}
As you may probably guess this is from common/server/clientconnection.cs but to make the imposter blocker work you need to add this above echo("Connect request from: " @ %netAddress);
if(%name $= "Insert_name_here")
{
%ip = getRawIP(%client);
if(%ip !$= "put_your_ip_here")
{
%client.delete("Imposters Suck.");
$Ban::numBans++;
$Ban::ip[$Ban::numBans] = %ip;
But again this is for people with static IP's.
What this resource does is when someone joins a server it checks the name they are using and if the name matches one in the blocker's scripts it try's to match it with the IP it has been set with. If the IP and name are not the right pair it Kicks and bans the Imposter.