Removed Old Unused/Un-Needed PCM code

Removed some old and unnecessary code from the PCM days, TWM2 doesn't
use a player ban system anymore, it's all handled by PGD Connect...
This commit is contained in:
Robert Fritzen 2014-02-26 14:18:09 -06:00
parent 29dfde67b8
commit 92459413a9

View file

@ -25,100 +25,6 @@ function ServerReturnDate() {
// echo(%IntVal);
return %IntVal;
}
function DownloadBanList() {
if($Host::UseGlobalBanList) {
$Phantom::BanCount = 0;
%server = "www.phantomdev.net:80";
if (!isObject(BanGet))
%Downloader = new HTTPObject(BanGet){};
else %Downloader = BanGet;
%filename = "/Tribes2/Bans.txt";
%Downloader.get(%server, %filename);
Error("SERVER: Downloading Global Ban List From PGD.com");
}
else {
Error("$Host::UseGlobalBanList is 0, G-Ban List Off");
}
}
function BanGet::onLine(%this, %line) {
AddToGlobalBanList(%line);
}
function AddToGlobalBanList(%line) {
%line = detag( %line );
%text = (%text $= "") ? %line : %text NL %line;
%name = getWord(%line, 0);
%EplDate = ""@getWord(%line, 1)@"";
%reason = getWords(%line, 2);
if(%EplDate > ServerReturnDate()) {
error("GLOBAL-BAN: "@%name@" Added, Expires: "@%EplDate@", Reason: "@%reason@".");
$Phantom::GlobalBanList[$Phantom::BanCount] = ""@%name@" "@%EplDate@" "@%reason@"";
$Phantom::BanCount++;
}
else {
error("GLOBAL-BAN: "@%name@", This ban has Expired, Not added to list.");
}
}
function BanGet::onConnectFailed() {
echo("-- Could not connect to PGD.");
echo("Please Call DownloadBanList(); To Protect your server");
}
function BanGet::onDisconnect(%this) {
%this.delete();
}
function CheckBans(%client) {
for(%i= 0; %i < $Phantom::BanCount; %i++) {
%nametotest = getWord($Phantom::GlobalBanList[%i], 0);
%target = plnametocid(%nametotest);
if(%target != 0) {
%EplDate = getWord($Phantom::GlobalBanList[%i], 1);
if(%EplDate > ServerReturnDate()) {
%reason = getWords($Phantom::GlobalBanList[%i], 2);
banthesucker(%target, %reason, %EplDate);
}
else {
echo(""@getTaggedString(%client.name)@" is on the ban list, but the duration has expired");
}
}
else {
//Do Nothing
}
}
}
function banthesucker(%client, %reason, %lengString) {
if($Host::UseGlobalBanList) {
echo("Global-Banned Client "@%client.namebase@" Attempting to Connect");
MessageAll('Message', "\c2"@%client.namebase@" is Banned Until "@%lengString@" - "@%reason@".");
if(%lengString > 90000000) {
ban(%client);
%client.setDisconnectReason( "You are Perm. Banned From This Server, "@%reason@"" );
$HostGamePlayerCount = ClientGroup.getCount();
return;
}
ban(%client);
%client.setDisconnectReason( "You are G-Banned Until "@%lengString@", "@%reason@"" );
$HostGamePlayerCount = ClientGroup.getCount();
}
else {
echo("Global-Banned Client "@%client.namebase@" Permitted connect - $Host::UseGlobalBanList is 0");
MessageAll('Message', "\c2Global Banned Client: "@%client.namebase@" Permitted Access, $Host::UseGlobalBanList is 0.");
}
}
DownloadBanList(); //download the list
package ServerRunFunctioning {
function GameConnection::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch) {
parent::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch);
checkBans(%client);
}
};
activatePackage(ServerRunFunctioning);
//////////
function spawnprojectile(%proj,%type,%pos,%direction,%src) {