diff --git a/scripts/TWM2/ChatCommands/Public.cs b/scripts/TWM2/ChatCommands/Public.cs index 41b4951..80c1f71 100644 --- a/scripts/TWM2/ChatCommands/Public.cs +++ b/scripts/TWM2/ChatCommands/Public.cs @@ -935,6 +935,10 @@ function parsePublicCommands(%sender, %command, %args) { //uSave: univerally save a building in a CSS slot case "usave": + if($TWM2::PGDConnectDisabled) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been disabled."); + return 1; + } if(!%sender.IsPGDConnected()) { messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); return 1; @@ -956,6 +960,10 @@ function parsePublicCommands(%sender, %command, %args) { //uLoad: load a universally saved building case "uload": + if($TWM2::PGDConnectDisabled) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been disabled."); + return 1; + } if(!%sender.IsPGDConnected()) { messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); return 1; @@ -973,6 +981,10 @@ function parsePublicCommands(%sender, %command, %args) { //saveRank: save your rank to PGD case "saverank": + if($TWM2::PGDConnectDisabled) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been disabled."); + return 1; + } if(!%sender.canSaveRank) { messageClient(%sender, 'MsgClient', "\c5PGD: You have only recently saved your rank."); return 1; @@ -993,6 +1005,10 @@ function parsePublicCommands(%sender, %command, %args) { //loadRank: load your rank from PGD case "loadrank": + if($TWM2::PGDConnectDisabled) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been disabled."); + return 1; + } if(!%sender.canLoadRank) { messageClient(%sender, 'MsgClient', "\c5PGD: You have only recently re-loaded your rank."); return 1; diff --git a/scripts/TWM2/PGDConnect/ServerInteraction.cs b/scripts/TWM2/PGDConnect/ServerInteraction.cs index dd4840b..3ba3484 100644 --- a/scripts/TWM2/PGDConnect/ServerInteraction.cs +++ b/scripts/TWM2/PGDConnect/ServerInteraction.cs @@ -17,6 +17,10 @@ $TWM2ServerInfo_Loc = "/ssiInterface.php"; //connects to the server function establishPGDConnection() { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } echo("ServerInteraction Initiated... wait for connection..."); if (!isObject(serverInterfacing)) { %connection = new TCPObject(serverInterfacing); diff --git a/scripts/TWM2/PGDConnect/UniversalLoading.cs b/scripts/TWM2/PGDConnect/UniversalLoading.cs index 0adc650..761f524 100644 --- a/scripts/TWM2/PGDConnect/UniversalLoading.cs +++ b/scripts/TWM2/PGDConnect/UniversalLoading.cs @@ -1,5 +1,9 @@ // ---- PGD Loader ------------------------------------------------------------- function LoadUniversalBuilding(%client, %file) { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } %server = ""@$PGDServer@":"@$PGDPort@""; %filename = "/public/Univ/Data/"@%client.guid@"/Buildings/"@%file@".cs"; if (!isObject(Univ_Loader)) { diff --git a/scripts/TWM2/PGDConnect/UniversalRanks.cs b/scripts/TWM2/PGDConnect/UniversalRanks.cs index 4c04850..a72a6c6 100644 --- a/scripts/TWM2/PGDConnect/UniversalRanks.cs +++ b/scripts/TWM2/PGDConnect/UniversalRanks.cs @@ -45,6 +45,10 @@ function IsServerMain() { //function GetKey(){CheckCore();} function CheckCore() { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } echo("*PGD: Performing Server Core Status Check"); $TCP::ConnectionContainer.addTaskToList($PGDServer, $PGDKeyHandler, @@ -91,6 +95,10 @@ function PGDConnection::validatePGDCore(%this, %line) { //------------------------------------------------------------------------ function LoadUniversalRank(%client) { + if($TWM2::PGDConnectDisabled) { + schedule(500, 0, "LoadClientRankfile", %client); + return; + } //A Little PGD Connect Ad. %client.donotupdate = 1; if(!%client.IsPGDConnected()) { @@ -150,6 +158,10 @@ function PGDConnection_HTTP::onCompleteRankDownload(%this) { //------------------------------------------------------------------------ function PrepareUpload(%client) { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } if (!isServerMain()) { return; } diff --git a/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs b/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs index 64111cd..2c4bba1 100644 --- a/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs +++ b/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs @@ -9,6 +9,10 @@ //5. Deletes Saved Files on the Server function GameConnection::IsPGDConnected(%client) { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return 0; + } %guid = %client.guid; if(!%client) { return 0; @@ -49,6 +53,10 @@ function GUIDGrabber::onLine(%this, %line) { } function Univ_ServerConnect(%client, %file, %svDl) { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } %connection = Univ_SaveClient; if(!%client || %client $= "") { error("Error: No Client Specified"); diff --git a/scripts/TWM2/PGDConnect/UniversalSupport.cs b/scripts/TWM2/PGDConnect/UniversalSupport.cs index 9c3f5ec..395599a 100644 --- a/scripts/TWM2/PGDConnect/UniversalSupport.cs +++ b/scripts/TWM2/PGDConnect/UniversalSupport.cs @@ -15,6 +15,10 @@ $PGDServer = "www.phantomdev.net"; //PGD IS FILE function PGD_IsFile(%file) { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return false; + } if($PGD::IsFile[%file] $= "" || $PGD::IsFile[%file] == -1) { PGD_IsFileDL(%file); return schedule(5000, 0, "PGD_IsFile", %file); @@ -25,6 +29,10 @@ function PGD_IsFile(%file) { } function PGD_IsFileDL(%file) { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } %server = ""@$PGDServer@":"@$PGDPort@""; %filename = "/public/Univ/IsFile.php?File="@%file@""; if (!isObject(PGDISFile)) { diff --git a/scripts/TWM2/Systems/AdvancedRankSystem.cs b/scripts/TWM2/Systems/AdvancedRankSystem.cs index e80351d..0361423 100644 --- a/scripts/TWM2/Systems/AdvancedRankSystem.cs +++ b/scripts/TWM2/Systems/AdvancedRankSystem.cs @@ -167,7 +167,9 @@ function runRankUpdateLoop(%client, %j, %continue) { //UpdateRankFile(%client); SaveClientFile(%client); // - PrepareUpload(%client); + if(!$TWM2::PGDConnectDisabled) { + PrepareUpload(%client); + } %j = 1; runRankUpdateLoop(%client, %j, 0); } diff --git a/scripts/TWM2/Systems/DChalg.cs b/scripts/TWM2/Systems/DChalg.cs index 48557a4..3c9aa91 100644 --- a/scripts/TWM2/Systems/DChalg.cs +++ b/scripts/TWM2/Systems/DChalg.cs @@ -5,6 +5,10 @@ //downloads challenges from PGD function downloadChallenges() { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } if(!IsServerMain()) { error("* Daily Challenges: Restricted To Core Servers Only"); return; diff --git a/scripts/TWM2/Systems/scoremenucmds.cs b/scripts/TWM2/Systems/scoremenucmds.cs index 35056e4..e913c76 100644 --- a/scripts/TWM2/Systems/scoremenucmds.cs +++ b/scripts/TWM2/Systems/scoremenucmds.cs @@ -270,6 +270,13 @@ switch$ (%arg1) case "PGDConn1": %client.SCMPage = "SM"; messageClient( %client, 'SetScoreHudSubheader', "", "PGD Connect" ); + if($TWM2::PGDConnectDisabled) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "PGD Connect is disabled on this server."); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + return; + } messageClient( %client, 'SetLineHud', "", %tag, %index, "Set email with: /setEmail"); %index++; messageClient( %client, 'SetLineHud', "", %tag, %index, "Current Email: "@%client.emailSet); @@ -283,6 +290,13 @@ switch$ (%arg1) case "PGDConn2": %client.SCMPage = "SM"; messageClient( %client, 'SetScoreHudSubheader', "", "PGD Connect" ); + if($TWM2::PGDConnectDisabled) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "PGD Connect is disabled on this server."); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + return; + } messageClient( %client, 'SetLineHud', "", %tag, %index, "Connecting... please wait for response"); %index++; messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); @@ -1214,6 +1228,10 @@ function RunDeleteCheck(%cl, %slot) { //------------------------------------ function PGDConnect_FromInGame(%client) { + if($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } %guid = %client.guid; %email = %client.emailSet; if(!isSet(%email)) {