Blockland Forums > Modification Help
Blocking Silent Connections
MegaScientifical:
Due to the problem with silent connections, I have been trying to figure out just how Badspot's server blocks them. I need to give this to someone so she isn't being eavesdropped by hidden connections. I already know how to tell a connection is silent connected, but I need a way to block it completely from connecting.
Apparently, the silent connections aren't calling autoAdminCheck. I've been told onConnectionRequest is blocked. I can't test because, currently, my internet is messed up where I can't host. Does anyone know a place in the code where a pure connection, without client, can be stopped before reading into the server?
For instance, what's the command for the password check?
Truce:
GameConnection::onConnectRequest isn't blocked and is called by the "silent connections".
MegaScientifical:
--- Quote from: Truce on August 27, 2010, 01:57:40 PM ---GameConnection::onConnectRequest isn't blocked and is called by the "silent connections".
--- End quote ---
--- Code: ---function GameConnection::onConnectRequest( %client, %netAddress, %name )
{
Echo("Connect request from: " @ %netAddress);
if($Server::PlayerCount >= $pref::Server::MaxPlayers)
return "CR_SERVERFULL";
return "";
}
--- End code ---
Syntax for the default command. This also functions like password checks? I'm curious how to adapt this with the check and all, considering how it seems to work from this command. And, as I said, I can't host to check this myself.
By this logic, I'd assume he just made a "CR_BADARGS" return in there for no name. Not taking advantage of the simple block method or something.
Edit:
--- Code: ---package NoSilent {
function GameConnection::onConnectionRequest(%this, %netAddress, %name) {
if(%this.CheckCommand()) {
echo("\c2Silent Connection Blocked: " @ %netAddress);
return "CR_BADARGS";
}
return Parent::onConnectionRequest(%this, %netAddress, %name);
}
};
activatePackage(NoSilent);
--- End code ---
Like that?
MegaScientifical:
--- Code: ---package NoSilent {
function GameConnection::onConnectRequest(%this, %netAddress, %lanName, %netName, %prefix, %suffix, %int) {
if(%this.CheckCommand()) {
echo("\c2Silent Connection Blocked: " @ %netAddress);
return "CR_SILENT";
}
return Parent::onConnectRequest(%this, %netAddress, %lanName, %netName, %prefix, %suffix, %int);
}
};
activatePackage(NoSilent);
--- End code ---
Like that?
lilboarder32:
What is a "silent connection"?