From c270a1c343b4a2feb03c3e2fe1b787cffc5ac640 Mon Sep 17 00:00:00 2001 From: Robert Fritzen Date: Thu, 22 Jun 2017 19:12:13 -0500 Subject: [PATCH] 6/22 Changes Changes from 6/22, print command adjustments, Universal support library-ification, and new rank file load script preventer. --- scripts/TWM2/ChatCommands/Public.cs | 44 ++-- scripts/TWM2/LoadMod.cs | 3 - scripts/TWM2/PGDConnect/UniversalLoading.cs | 21 +- scripts/TWM2/PGDConnect/UniversalRanks.cs | 52 +++-- .../TWM2/PGDConnect/UniversalSaving_Client.cs | 4 +- scripts/TWM2/PGDConnect/UniversalSupport.cs | 196 ++++++++++-------- scripts/TWM2/Systems/AdvancedRankSystem.cs | 14 +- scripts/TWM2/Systems/MainControl.cs | 2 +- scripts/TWM2/Systems/scoremenucmds.cs | 4 +- scripts/TWM2/loadMenu.cs | 101 +++++---- 10 files changed, 240 insertions(+), 201 deletions(-) diff --git a/scripts/TWM2/ChatCommands/Public.cs b/scripts/TWM2/ChatCommands/Public.cs index 993e235..542641f 100644 --- a/scripts/TWM2/ChatCommands/Public.cs +++ b/scripts/TWM2/ChatCommands/Public.cs @@ -1097,51 +1097,51 @@ function parsePublicCommands(%sender, %command, %args) { //checkStats: check the current rank information on a player case "checkstats": - %clientController = %sender.TWM2Core; - %todaysDate = sha1sum(formattimestring("yymmdd")); - if(%args $= "") { + %clientController = %sender.TWM2Core; + %todaysDate = sha1sum(formattimestring("yymmdd")); + if(%args $= "") { if(%clientController.officer $= "") { - %clientController.officer = 0; + %clientController.officer = 0; } %name = %sender.NameBase; %Rank = ""@$Prestige::Name[%clientController.officer]@""@%clientController.rank@""; %Stats = getCurrentEXP(%sender); for(%i = $Rank::RankCount; %i >= 0; %i--){ - if(%stats >= $Ranks::MinPoints[%i]){ - %nextrank = ""@$Prestige::Name[%clientController.officer]@""@$Ranks::NewRank[(%i + 1)]@""; - %nextrankXP = $Ranks::MinPoints[(%i + 1)]; - %i = 0; - } + if(%stats >= $Ranks::MinPoints[%i]){ + %nextrank = ""@$Prestige::Name[%clientController.officer]@""@$Ranks::NewRank[(%i + 1)]@""; + %nextrankXP = $Ranks::MinPoints[(%i + 1)]; + %i = 0; + } } if(%Stats >= $Ranks::MinPoints[$Rank::RankCount]) { - messageClient(%sender, 'MsgClient', "\c2Your Rank is "@%Rank@", You Currently Have "@%stats@" XP, and you have gained "@%clientController.xpGain[%todaysDate]@" EXP today."); - return 1; + messageClient(%sender, 'MsgClient', "\c2Your Rank is "@%Rank@", You Currently Have "@printCurrentEXP(%sender)@" XP."); + return 1; } else { - messageClient(%sender, 'MsgClient', "\c2Your Rank is "@%Rank@", You Currently Have "@%stats@" XP, and you have gained "@%clientController.xpGain[%todaysDate]@" EXP today. Your next rank is "@%nextrank@" and you need "@(%nextrankXP - %stats)@" XP."); - return 1; + messageClient(%sender, 'MsgClient', "\c2Your Rank is "@%Rank@", You Currently Have "@printCurrentEXP(%sender)@" XP. Your next rank is "@%nextrank@" and you need "@(%nextrankXP - %stats)@" XP."); + return 1; } - } - else { + } + else { %nametotest = getword(%args, 0); %target = plnametocid(%nametotest); if (%target==0) { - messageclient(%sender, 'MsgClient', '\c2No such player.'); - return 1; + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; } // %targetController = %target.TWM2Core; if(%targetController.officer $= "") { - %targetController.officer = 0; + %targetController.officer = 0; } %Rank = ""@$Prestige::Name[%targetController.officer]@""@%targetController.rank@""; - %Stats = getCurrentEXP(%target); + %Stats = printCurrentEXP(%target); messageClient(%sender, 'MsgClient', "\c2"@%target.namebase@"'s Rank is "@%Rank@" and "@%target.namebase@"'s XP is "@%stats@"."); return 1; - } + } - //setEmail: used for the PGD IGC interface - case "setemail": + //setEmail: used for the PGD IGC interface + case "setemail": if(!isSet(%args)) { return 1; } diff --git a/scripts/TWM2/LoadMod.cs b/scripts/TWM2/LoadMod.cs index 39245ee..86fccfe 100644 --- a/scripts/TWM2/LoadMod.cs +++ b/scripts/TWM2/LoadMod.cs @@ -32,10 +32,7 @@ exec("scripts/TWM2/Systems/DChalg.cs"); //Daily Challenges exec("scripts/TWM2/Systems/ArmorEnergyShields.cs"); //Armor Shields exec("scripts/TWM2/Systems/Store.cs"); //Mula exec("scripts/TWM2/Systems/weaponModes.cs"); //Global Defines for Weapon Modes - exec("scripts/TWM2/AI/DroneAI.cs"); //Drones - -exec("scripts/TWM2/Objects/MissileSatellite.cs"); //Missile Satellite exec("scripts/TWM2/Systems/HarbingersWrath.cs"); //Harbinger's Wrath //Mod Dependancies diff --git a/scripts/TWM2/PGDConnect/UniversalLoading.cs b/scripts/TWM2/PGDConnect/UniversalLoading.cs index 761f524..3aaed4b 100644 --- a/scripts/TWM2/PGDConnect/UniversalLoading.cs +++ b/scripts/TWM2/PGDConnect/UniversalLoading.cs @@ -23,16 +23,17 @@ function LoadUniversalBuilding(%client, %file) { } function Univ_Loader::onLine(%this, %line) { - %validity = ScanForValidLine(%line); - if(!%validity) { - messageClient(%this.client, 'MsgClient', "\c5PGD: ERROR, you are requesting a corrupted file."); - messageClient(%this.client, 'MsgClient', "\c5Corrupted files contain custom content not signed by the server."); - messageClient(%this.client, 'MsgClient', "\c5ABORTING CONNECTION."); - %this.valid = 0; - %this.disconnect(); - return; - } - $PGDBuffer[%this.client, %this.load] = $PGDBuffer[%this.client, %this.load] @ "\n" @ %line; + %validity = TWM2Lib_PGDConnect_Support("fileValidator_Building", %line); + if(!%validity) { + error("Building load validity check failed for "@ %this.client.namebase @" ("@%this.client@"), client may be attempting to load unfriendly code."); + messageClient(%this.client, 'MsgClient', "\c5PGD: ERROR, you are requesting a corrupted file."); + messageClient(%this.client, 'MsgClient', "\c5Corrupted files contain custom content not signed by the server."); + messageClient(%this.client, 'MsgClient', "\c5ABORTING CONNECTION."); + %this.valid = 0; + %this.disconnect(); + return; + } + $PGDBuffer[%this.client, %this.load] = $PGDBuffer[%this.client, %this.load] @ "\n" @ %line; } function Univ_Loader::onConnectFailed(%this) { diff --git a/scripts/TWM2/PGDConnect/UniversalRanks.cs b/scripts/TWM2/PGDConnect/UniversalRanks.cs index 30cd0a4..cf9947d 100644 --- a/scripts/TWM2/PGDConnect/UniversalRanks.cs +++ b/scripts/TWM2/PGDConnect/UniversalRanks.cs @@ -111,7 +111,7 @@ function LoadUniversalRank(%client) { return 1; } //IS FILE - if(!PGD_IsFile("Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave")) { + if(!TWM2Lib_PGDConnect_Support("isServerFile", "Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave")) { %client.donotupdate = 0; messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect confirms you do not have a universal rank."); messageClient(%client, 'msgPGDRequired', "\c5PGD: Play on a |CORE| server to start progressing one today!"); @@ -133,22 +133,44 @@ function LoadUniversalRank(%client) { } function PGDConnection_HTTP::onCompleteRankDownload(%this) { - echo("download complete... evaluating and applying rank"); - %client = %this.client; + echo("download complete... evaluating and applying rank"); + %client = %this.client; - %fileO = new FileObject(); - %fileO.openForWrite($TWM::RanksDirectory@"/"@%this.client.guid@"/Saved.TWMSave"); - for (%i = 0; %i < $Buffer[%this]; %i++) { - %fileO.writeLine($Buffer[%this, %i]); - $Buffer[%this, %i] = ""; - } - $Buffer[%this] = 0; - %fileO.close(); - %fileO.delete(); + for (%i = 0; %i < $Buffer[%this]; %i++) { + //Scan the line + if (!TWM2Lib_PGDConnect_Support("fileValidator_Rank", $Buffer[%this, %i])) { + error("Rank load validity check failed for "@ %this.client.namebase @" ("@%this.client@"), client may be attempting to load unfriendly code."); + messageClient(%client, 'msgComplete', "\c3PGD Error: Your rank file has failed load validation, and cannot load..."); + messageClient(%client, 'msgComplete', "\c3A backup copy of your file has been saved to the local server, please contact Phantom139 to address..."); + messageClient(%client, 'msgComplete', "\c3In the mean time, a blank file has been created so you may continue playing..."); + %fileOB = new FileObject(); + %fileOB.openForWrite($TWM::RanksDirectory@"/"@%this.client.guid@"/Backup_Corrupted.TWMSave"); + for (%i = 0; %i < $Buffer[%this]; %i++) { + %fileOB.writeLine($Buffer[%this, %i]); + $Buffer[%this, %i] = ""; + } + $Buffer[%this] = 0; + %fileOB.close(); + %fileOB.delete(); + %client.donotupdate = 0; + CreateClientRankFile(%client); + return; + } + } + + %fileO = new FileObject(); + %fileO.openForWrite($TWM::RanksDirectory@"/"@%this.client.guid@"/Saved.TWMSave"); + for (%i = 0; %i < $Buffer[%this]; %i++) { + %fileO.writeLine($Buffer[%this, %i]); + $Buffer[%this, %i] = ""; + } + $Buffer[%this] = 0; + %fileO.close(); + %fileO.delete(); - schedule(100, 0, LoadClientRankFile, %client); + schedule(100, 0, LoadClientRankFile, %client); - messageClient(%client, 'msgComplete', "\c3PGD: Your rank has been successfully downloaded."); + messageClient(%client, 'msgComplete', "\c3PGD: Your rank has been successfully downloaded."); } //------------------------------------------------------------------------ @@ -184,7 +206,7 @@ function TCPConnectionList::GeneratePGDUploadRequest(%this) { %client = %this.client; %file = $TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; %fileBase = FileBase(%file) @ ".TWMSave"; - %fileCont = getFileContents(%file); + %fileCont = TWM2Lib_PGDConnect_Support("fileContents", %file); %user = getField($TWM2::PGDCredentials, 0); %password = getField($TWM2::PGDCredentials, 1); diff --git a/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs b/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs index 2c4bba1..3b8640b 100644 --- a/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs +++ b/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs @@ -81,7 +81,7 @@ function Univ_ServerConnect(%client, %file, %svDl) { return; } else { - %len = GetFileLength(%file); + %len = TWM2Lib_PGDConnect_Support("fileLength", %file); %connection.orgfile = %file; %connection.file = %file; //what are we sending? %connection.filebase = FileBase(%file) @ ".cs"; @@ -99,7 +99,7 @@ function Univ_SaveClient::onConnected(%this) { %this.schedule(15000, "disconnect"); if(%this.save == 1) { %sep = getRandomSeparator(16); - %filecont = getFileContents(%this.orgfile); + %filecont = TWM2Lib_PGDConnect_Support("fileContents", %this.orgfile); %loc = $PGDPHPUploadHandler; %header1 = "POST" SPC %loc SPC "HTTP/1.1\r\n"; %host = "Host: "@$PGDServer@"\r\n"; diff --git a/scripts/TWM2/PGDConnect/UniversalSupport.cs b/scripts/TWM2/PGDConnect/UniversalSupport.cs index 395599a..8bb7e42 100644 --- a/scripts/TWM2/PGDConnect/UniversalSupport.cs +++ b/scripts/TWM2/PGDConnect/UniversalSupport.cs @@ -1,8 +1,9 @@ -//Support Script, Allows this to work -//Updated 2.1, Signal360's Changes implemented -//Universal Ranks Implemented +//UniversalSupport.cs +//PGD Connect support functions library +//TWM2 3.9a Update, Library style function and new validation methods +//TWM2 2.1 Update, Signal360's Changes implemented -//We keep these files hidden so no outsiders can fuck with our stuff +//We keep these files hidden so no outsiders can mess with our stuff $PGDPHPUploadHandler = "/public/Univ/Buildings/upload.php"; //no touchy $PGDPHPDelHandler = "/public/Univ/Buildings/delete.php?Filetokill="; $PGDKeyHandler = "/public/Univ/Ranks/key.php"; @@ -13,39 +14,109 @@ $PGDPHPRankUploadHandler = "/public/Univ/Ranks/upload.php"; $PGDPort = 80; //TCP $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); - } - else { - return $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)) { - %Downloader = new HTTPObject(PGDISFile){}; - } - else { - %Downloader = PGDISFile; - } - %Downloader.File = %file; - echo("Getting"); - %Downloader.get(%server, %filename); +function TWM2Lib_PGDConnect_Support(%functionName, %arg1, %arg2, %arg3, %arg4) { + switch$(strlwr(%functionName)) { + case "isserverfile": + if ($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return false; + } + %file = %arg1; + if ($PGD::IsFile[%file] $= "" || $PGD::IsFile[%file] == -1) { + TWM2Lib_PGDConnect_Support("performFileCheck", %file); + return schedule(5000, 0, "TWM2Lib_PGDConnect_Support", "isServerFile", %file); + } + else { + return $PGD::IsFile[%file]; + } + + case "performfilecheck": + if ($TWM2::PGDConnectDisabled) { + echo("PGD Connect is disabled."); + return; + } + %file = %arg1; + %server = $PGDServer@":"@$PGDPort; + %filename = "/public/Univ/IsFile.php?File="@%file; + if (!isObject(PGDISFile)) { + %Downloader = new HTTPObject(PGDISFile) { }; + } + else { + %Downloader = PGDISFile; + } + %Downloader.File = %file; + echo("Connecting to PGD, testing file "@ %file); + %Downloader.get(%server, %filename); + + case "filelength": + %file = %arg1; + new fileobject(LengthReader); + LengthReader.openforread(%file); + %bool = 0; + while (!%bool) { + %bool = LengthReader.isEOF(); + %Msg = LengthReader.readLine(); + $message = $message@"\n"@%Msg; + } + %count = strLen($message); + $message = ""; + return %count; + + case "filecontents": + %file = %arg1; + new fileobject(filereader); + filereader.openforread(%file); + %bool = 0; + while (!%bool) { + %bool = filereader.isEOF(); + %Msgget = filereader.readLine(); + %msg = %msg @ "\n" @ %Msgget; + } + return %msg; + + case "filevalidator_building": + %line = %arg1; + if (getsubstr(%line, 0, 2) $= "//") { + //commented lines like this cannot possibly deliver custom content. + //thus they must be alloted. + return 1; + } + else if (getsubstr(trim(%line), 0, 1) $= "") { + //Blank lines are completely harmless + return 1; + } + else if (getsubstr(%line, 0, 29) $= "%building = new (StaticShape)" || + getsubstr(%line, 0, 32) $= "%building = new (ForceFieldBare)" || + getsubstr(%line, 0, 24) $= "%building = new (Turret)" || + getsubstr(%line, 0, 30) $= "%building = new (BeaconObject)") { + //this is our official line check, if it's a building DB line + //it is safe, and valid. + return 1; + } + else { + //this line has been tampered with, and is invalid. + return 0; + } + + case "filevalidator_rank": + %line = %arg1; + %trimmed = strlwr(stripChars(trim(%line), " ")); + if(getsubstr(%trimmed, 0, 7) $= "phrase=" || getsubstr(%trimmed, 0, 2) $= "//") { + return 1; + } + else { + if (!strStr(%line, "function") || !strStr(%line, "eval") || !strStr(%line, "call") || !strStr(%line, "schedule")) { + return 0; + } + return 1; + } + + default: + error("TWM2Lib_PGDConnect_Support(): error, unknown function "@ %functionName @" called."); + } } +//PGDISFILE Object Functions function PGDISFile::onLine(%this, %line) { echo(%line); if(strStr(%line, "Not") != -1) { @@ -72,57 +143,4 @@ function PGDISFile::onConnectFailed(%this) { function PGDISFile::onDisconnect(%this) { } - -//END PGD IS FILE - -function GetFileLength(%file) { - new fileobject(LengthReader); - LengthReader.openforread(%file); - %bool = 0; - while(!%bool) { - %bool = LengthReader.isEOF(); - %Msg = LengthReader.readLine(); - $message = ""@$message@"\n"@%Msg@""; - } - %count = strLen($message); - $message = ""; - return %count; -} - -function getFileContents(%file) { - new fileobject(filereader); - filereader.openforread(%file); - %bool = 0; - while(!%bool) { - %bool = filereader.isEOF(); - %Msgget = filereader.readLine(); - %msg = ""@%msg@""NL""@%Msgget@""; - } - return %msg; -} - -//added 2.4 -//Prevent custom (unwanted) content in universal loads -function ScanForValidLine(%line) { - if (getsubstr(%line, 0, 2) $= "//") { - //commented lines like this cannot possibly deliver custom content. - //thus they must be alloted. - return 1; - } - else if(getsubstr(trim(%line), 0, 1) $= "") { - //Blank lines are completely harmless - return 1; - } - else if(getsubstr(%line, 0, 29) $= "%building = new (StaticShape)" || - getsubstr(%line, 0, 32) $= "%building = new (ForceFieldBare)" || - getsubstr(%line, 0, 24) $= "%building = new (Turret)" || - getsubstr(%line, 0, 30) $= "%building = new (BeaconObject)") { - //this is our official line check, if it's a building DB line - //it is safe, and valid. - return 1; - } - else { - //this line has been tampered with, and is invalid. - return 0; - } -} +//END \ No newline at end of file diff --git a/scripts/TWM2/Systems/AdvancedRankSystem.cs b/scripts/TWM2/Systems/AdvancedRankSystem.cs index 96be822..818fc00 100644 --- a/scripts/TWM2/Systems/AdvancedRankSystem.cs +++ b/scripts/TWM2/Systems/AdvancedRankSystem.cs @@ -87,7 +87,6 @@ function UpdateClientRank(%client) { %scriptController.officer = 0; } //anti-Hack system. - %todaysDate = sha1sum(formattimestring("yymmdd")); %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; //If I ever do so implement an EXP cap, here is where it is placed %multi = $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB TWM2Lib_MainControl("FormatTWM2Time", formattimestring("yymmdd")))]; @@ -103,8 +102,7 @@ function UpdateClientRank(%client) { %scriptController.millionxp++; } %scriptController.xp += $XPArray[%client]; - //%scriptController.xpGain[%todaysDate] += $XPArray[%client]; //Phantom139: Removed daily EXP Cap (TWM2 3.9) - //%scriptController.save(%file); + checkForXPAwards(%client); $XPArray[%client] = 0; %j = $Rank::RankCount; @@ -131,7 +129,7 @@ function runRankUpdateLoop(%client, %j, %continue) { if($Prestige::Name[%scriptController.officer] >= 1) { $Prestige::Name[%scriptController.officer] = ""; } - messageAll('msgclient',"\c2"@%name@" has become a "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@" with a XP of "@getCurrentEXP(%client)@"!"); + messageAll('msgclient',"\c2"@%name@" has become a "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@" with a XP of "@printCurrentEXP(%client)@"!"); messageclient(%client, 'Msgclient', "~wfx/Bonuses/Nouns/General.wav"); bottomPrint(%client, "Excelent work "@%name@", you have been promoted to the rank of: "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@"!", 5, 2 ); echo("Promotion: "@%name@" to Rank "@$Ranks::NewRank[%j]@", XP: "@getCurrentEXP(%client)@"."); @@ -207,6 +205,14 @@ function getCurrentEXP(%client) { return %xp; } +function printCurrentEXP(%client) { + //print function shows a more readable version of EXP + %scriptController = %client.TWM2Core; + %milXP = %scriptController.millionxp; + %nonMilXP = %scriptControler.xp; + return %milXP @ "" @ %nonMilXP; +} + //PRESTIGE RANKS function PromoteToPrestige(%client) { %scriptController = %client.TWM2Core; diff --git a/scripts/TWM2/Systems/MainControl.cs b/scripts/TWM2/Systems/MainControl.cs index 6d22053..3f459b7 100644 --- a/scripts/TWM2/Systems/MainControl.cs +++ b/scripts/TWM2/Systems/MainControl.cs @@ -8,7 +8,7 @@ function TWM2Lib_MainControl(%functionName, %arguments) { %client = %arguments; $XPArray[%client] = 0; %client.CheckPGDConnect(); // <-- Used for Universal features - PGD_IsFileDL("Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave"); + TWM2Lib_PGDConnect_Support("performFileCheck", "Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave"); schedule(5000, 0, "LoadUniversalRank", %client); setDefaultInventory(%client); diff --git a/scripts/TWM2/Systems/scoremenucmds.cs b/scripts/TWM2/Systems/scoremenucmds.cs index 9186064..f32b033 100644 --- a/scripts/TWM2/Systems/scoremenucmds.cs +++ b/scripts/TWM2/Systems/scoremenucmds.cs @@ -841,13 +841,13 @@ switch$ (%arg1) case "RanksSM": messageClient( %client, 'SetScoreHudSubheader', "", ""@%arg2.namebase@"'s Stats Card" ); %client.SCMPage = "SM"; - %targetController = %arg2.TWM2Core; + %targetController = %arg2.TWM2Core; //Specs if(%targetController.officer $= "") { %targetController.officer = 0; } %rank = ""@$Prestige::Name[%targetController.officer]@""@%targetController.rank@""; - %XP = ((%targetController.millionxp) * 1000000) + %targetController.xp; + %XP = printCurrentEXP(%arg2); %mula = %targetController.money; %phrs = %targetController.phrase; %gmeTime = %targetController.gameTime; diff --git a/scripts/TWM2/loadMenu.cs b/scripts/TWM2/loadMenu.cs index 7570827..e4f1b6f 100644 --- a/scripts/TWM2/loadMenu.cs +++ b/scripts/TWM2/loadMenu.cs @@ -7,48 +7,48 @@ package loadmodinfo { function GetTipMessage() { - %r = getRandom(1,19); - switch(%r) { - case 1: - %tip = "Watch the sniper trails, the R700 Leaves a trail, so you can easily find the shooter."; - case 2: - %tip = "Check your ammo! People with limited ammo on their primary weapons are more likely to be killed"; - case 3: - %tip = "Use /help to view commands. /Checkstats to view your Stats, and the [F2] Menu to check other info"; - case 4: - %tip = "To level up, Kill enemies and zombies. Killing teammates holds a harsh penalty! Use /checkstats to see your info"; - case 5: - %tip = "The easiest way to deal with a zombie lord is to deliver a head shot with a sniper rifle."; - case 6: - %tip = "To check what weapons you can use. Open up your [F2] Menu and select weapons information"; - case 7: - %tip = "Beware Demon Lord Zombies! They are quick, decisive, and are armed with many abilities"; - case 8: - %tip = "Prioritize your tasks! Focus on the greatest threats to you first"; - case 9: - %tip = "Watch your flanks in sabotage, if you have the bomb, you are visible to everyone, including the enemy"; - case 10: - %tip = "What weapons will work best for you? check out the Weapons information in your [F2] Menu"; - case 11: - %tip = "Enemies coming in a group? use the C4 Mines to blow them all up"; - case 12: - %tip = "Challenges are good! Complete them to unlock vehicles, weapon attachments, and more!"; - case 13: - %tip = "Ultra Drones, Killers of the SKY. To kill them, stay out of the sky, hit them with SAM's"; - case 14: - %tip = "Bothered by enemy vehicles? Grab the Javalin, and blast those suckers"; - case 15: - %tip = "Infected? use your health kit, it comes preloaded with an infection cure"; - case 16: - %tip = "XP Points are earned differently by killing players and zombies, stronger enemies give more XP."; - case 17: - %tip = "When do I get a certian weapon? check the [F2] Menu to find that out"; - case 18: - %tip = "Killstealing is bad, and should never be done, protection is enabled in horde/helljump to block those theives!"; - case 19: - %tip = "Perks and Killstreaks can be set in the [F2] Menu by clicking Settings and then the respective category"; - } - return %tip; + %r = getRandom(1,19); + switch(%r) { + case 1: + %tip = "High powered sniper rifles, such as the R700 leave a trail. This can help you to identify hostile snipers"; + case 2: + %tip = "Check your ammo! People with limited ammo on their weapons are more likely to be killed"; + case 3: + %tip = "Use /help to view commands. /Checkstats to view your Stats, and the [F2] Menu to check other info"; + case 4: + %tip = "Want to unlock new gear? Level up by defeating enemy combatants, or securing combat medals through tough tasks"; + case 5: + %tip = "Got zombie problems? Aim high! One shot to the head with a strong enough weapon will dispatch of most enemy combatants"; + case 6: + %tip = "Looking to earn a lot of XP points? Invite some of your friends and take on the bosses of TWM2 for large EXP sums"; + case 7: + %tip = "Be sure to frequently access the [F2] menu, additional player setting options such as perks and killstreaks can be found inside"; + case 8: + %tip = "Prioritize your tasks! Focus on the greatest threats to you first"; + case 9: + %tip = "Watch your flanks in sabotage, if you have the bomb, you are visible to everyone, including the enemy"; + case 10: + %tip = "What weapons will work best for you? check out the weapons information tab in your [F2] Menu"; + case 11: + %tip = "Large groups taking you on? Try using advanced equipment such as Satchel Charges, Mines, and C4 to dwindle enemy numbers"; + case 12: + %tip = "Try to tackle individual challenges at a time, challenges sometimes have unique awards such as weapons, armors, and even vehicles!"; + case 13: + %tip = "Ultra Drones are expert airhunters and should not be triffled with, if one is giving you problems, try using SAM weapons"; + case 14: + %tip = "Got vehicle problems? Try using a weapon like the Stinger or Javelin to pound it with heavy explosive damage"; + case 15: + %tip = "Zombie got you infected? use your health kit or the medic pack, both of which have a built in infection cure"; + case 16: + %tip = "XP Points are earned differently by killing players and zombies, stronger enemies give more XP."; + case 17: + %tip = "Want to know when you're going to unlock that next piece of sweet gear? Check out the weapon information page in the [F2] menu"; + case 18: + %tip = "Killstealing is bad, and should never be done, protection is enabled in horde/helljump to block those theives!"; + case 19: + %tip = "Air rapiers sometimes spell doom once grabbed, but if you aim directly up with a strong enough weapon, you can escape their lethal grasp!"; + } + return %tip; } function sendLoadInfoToClient( %client ) { @@ -72,8 +72,9 @@ package loadmodinfo messageClient(%client, 'MsgDebriefResult', "", "Server Type: "@%STO@""); %Credits = "\nVersion v"@$TWM2::ModVersionString@"" @ - "\nTWM 2 Developer: Phantom139"@ - "\nTWM 2 Co-Devs: Dark Dragon DX, DarknessOfLight, Signal360"; + "\nTWM 2 Creator (Lead Developer): Phantom139"@ + "\nTWM 2 Co-Devs: Dark Dragon DX, DarknessOfLight, and Signal360"@ + "\nCCM Developers: Dondelium_X, FalconBlade, and Ur_A_Dum"; // this callback adds content to the bulk of the gui messageClient(%client, 'MsgDebriefAddLine', "", %Credits); @@ -83,15 +84,9 @@ package loadmodinfo // this callback adds content to the bulk of the gui messageClient(%client, 'MsgDebriefAddLine', "", %Site); - %Thanks = "\nThanks: Thyth, -Linker-, Cons Mod Devs"@ + %Thanks = "\nAdditional Thanks: Thyth, -Linker-, Construction Mod Developers"@ "\n"; messageClient(%client, 'MsgDebriefAddLine', "", %Thanks); - - %MoreCredits = "\nCCM Developer: Dondelium_X" @ - "\nCCM Co-Devs: FalconBlade, Ur_A_Dum"@ - "\n"; - - messageClient(%client, 'MsgDebriefAddLine', "", %MoreCredits); if($Rank::Top[1] $= "") { %TopRanks = "\nTop 5 Ranks:" @ @@ -119,13 +114,13 @@ package loadmodinfo "\n"; messageClient(%client, 'MsgDebriefAddLine', "", %tipMsg); - %MOTDMsg = "\nMessage Of The Day:" @ + %MOTDMsg = "\nServer Message Of The Day:" @ "\n"@$Server::MOTD@"."@ "\n\n\n"; messageClient(%client, 'MsgDebriefAddLine', "", %MOTDMsg); %PGDMsg = "\nJoin the Phantom Games Development community for up to the minute news on TWM2 and our other projects! " @ - "\n http://www.public.phantomdev.net"; + "\n http://www.forums.phantomdev.net"; messageClient(%client, 'MsgDebriefAddLine', "", %PGDMsg); %gettingStarted = "\nFirst time playing TWM2? Use the /help command for a list of chat commands and access the " @