diff --git a/README.md b/README.md index c77732e..cdac688 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Total Warfare Mod 2 for Tribes 2, Conversion mod built on a base mix of Construc Web Sites/Pages: * http://www.tribesnext.com : Tribes 2 / TN Page * https://github.com/PhantomGamesDevelopment/TWM2/ : Official Git Repostitory -* http://www.phantomdev.net : Offical Website Current Version: 3.92 {Development} @@ -50,15 +49,6 @@ objects to modify server settings. For starters, set the host GUID to your GUID. start up the dedicated server. Join it, once in game, type ListGUIDS(); in the server console to obtain your GUID. Then modify the line: $TWM2::HostGUID = "SetMeUp";, to match your GUID. -TWM2 Servers: - -TWM2 uses a inter-server connectivity system known as PGD Connect. This system will allow users who -play TWM2 to transfer their rank/progression as well as load in buildings created in other servers -in your server. While PGD Connect itself is manditory across all TWM2 servers, saving information is -only permitted in what we designate as a "Core Server". This requires the server host to abide by the -TWM2 PGD Connect Core rules established by Phantom139. If you are interested in hosting a server with -this level of authority, please contact Phantom139 on the PGD Forums, or by email. - ==== MOD DEVELOPMENT HISTORY (GIT VERSIONS): @@ -66,6 +56,16 @@ MOD DEVELOPMENT HISTORY (GIT VERSIONS): PLEASE NOTE: I've moved all old changelogs into the version_history folder. This file will now only track the current update's changes 3.91 -> 3.92 (In Progress): +* PGD Connect + * As I have closed down the Phantom Games Development website, PGD Connect services are no longer active, I have removed all functioning of PGD Connect from the mod to allow users to continue to enjoy TWM2 without requiring this. + * The Mod Load Menu has been updated, removing old links to PGD and now showing the mod's GitHub Repository Page. + * The following mod features have been depricated and no longer available due to the removal of PGD Connect: + * Cross-Server Rank Files + * Cross-Server Buildings + * Daily Challenges + * PGD Events (Including XP Events) + * News Panel + * Top-15 Players List * Zombie Changes * Global * Massive "spring cleaning" of the zombie code files, fixing a bunch of bad coding practices and a few logic errors. @@ -144,6 +144,9 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This * The Helljump 'Oh Lordy' modifier has been changed to 'Reduces the cooldown time of the Zombie Lord's Photon Cannon by 50%'. * The RSA Laser Rifle has been renamed to the 'UR-22 Laser Rifle' * The Pistol Weapon Slot is now called the Sidearm Slot + * Adjusted the mod's XP table: + * The final rank (Master Commander) now only requires 2,500,000 XP + * The earlier ranks will now progress much more quickly, with the mid-point now occuring at 14,000 XP instead of 20,000 XP * General Bug Fixes * Addressed the issue when gaining more than 1 million EXP that would result in your total EXP being reset by the difference between 1 million exp and your current exp. * Fixed the bug in which picking up weapon clips with an empty weapon would not automatically trigger weapon reload on that weapon. @@ -182,7 +185,7 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This * This works out to ~0.32 damage per shot which is about a 40% damage increase against zombies * I want the Crimson Hawk to be a great PvE choice, but allow the other sidearms a chance to shine in PvP * ES-77 Pulse Phaser - * Last time I touched this weapon, I nearly started I riot amongst the entire Tribes 2 community, lol. + * Last time I touched this weapon, I nearly started a riot amongst the entire Tribes 2 community, lol. * Let's not do this again, but instead look at some easy to make and good adjustments * After looking at how this weapon has performed between 3.3 and 3.9.1, I feel it needs a slight bump in the damage department * Increased the base damage of the pulse phaser from 0.2 to 0.26 @@ -195,6 +198,10 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This * Increased the projectile base speed from 120 to 165 * Note: The Phaser Blades pulse is slightly slower at 160 base speed * The end result with be a stronger pulse phaser at the close range that loses out on the far reach aspect. + * Desert Eagle + * Increased bullet damage from 0.3 to 0.38 + * Reduced spread factor from 6:1000 to 4:1000 + * Added a damage multiplier of 2.5 against all Zombie types * Sniper Rifles * The sniper rifle class has always been one of the stronger ones in TWM2, and I feel no reason to neuter it now. * The goal of this update is to tweak the other sniper options to add more viable choices instead of just dropping the R700 as soon as you get it. @@ -220,8 +227,7 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This * For the most part, this rifle has been collecting dust in the bin of unused weapons due to other tools such as the S3 and R700 in the pool * This weapon has been in need of a long coming tweak of power to make it a more viable choice * Increased the bullet impact damage from 0.3 to 0.44 - * Reduced the round rechamber time from 0.3 seconds to 0.15 seconds - * Reduced the spread factor of the weapon from 3:1000 to 2:1000 + * Reduced the round rechamber time from 0.3 seconds to 0.25 seconds * M4A1 * This jack of all trades weapon currently sits as a power outlier in the assault rifle bin due to the various attachments it has * Coupled with a high base round damage, this weapon would have turned into the go-to gun without adjustments @@ -231,19 +237,22 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This * As it stands right now, the pulse rifle is one of the weakest weapons in the mod, with the only advantage being the fastest and most accurate semi-auto in the pool * With the enhancements to the G-41, the pulse rifle will also follow suit, which should make it a more viable choice in mid to long range fights * Increased the shot damage from 0.2 to 0.38 - * Reduced the round rechamber time from 0.3 seconds to 0.1 seconds + * Reduced the round rechamber time from 0.3 seconds to 0.2 seconds * S3 Rifle * The weapon every player starts with in the mod has remained untouched since the first release of the mod. * However, after a long hard thought on this one, I feel as if this weapon has actually been acting more like a sniper rifle than a semi-auto. * With the changes to the G-41 and the Pulse Rifle however, the S3 still needs to be a viable tool, otherwise it will fall flat in the endgame * The following adjustments have been made - * Reduced the direct impact damage from 0.7 to 0.5 + * Reduced the direct impact damage from 0.7 to 0.44 + * Increased the headshot multiplier from 1.5 to 1.7 + * Removed the OSK from S3 Rifle Headshots (Sorry!) * Reduced the round rechamber time from 0.9 seconds to 0.4 seconds * Removed the delay between round fire and round rechambering (Shaving another 0.2 seconds off the rechamber time) - * Reduced the spread factor from 3:1000 to 2.5:1000 + * Increased the spread factor from 3:1000 to 5:1000 + * The Specialist S3 Rifle (S3S) for Helljump has recieved the same adjustments * Shotguns * The buckshot tools of TWM2 have always been in a good place in terms of PvP, however I've noticed a sad trend of these being tossed aside in PvE aspects - * This update will mainly focus on tuning the damage up a bit in PvE, but balancing the range and spread for PvP. + * This update will mainly focus on tuning the damage up a bit in PvE, but balancing the range and spread for PvP. * M1700 * The mod's first shotgun is a powerhouse in close range, with a heavy hitting OHK lurking for anyone foolish enough to come close. * It's a bit strong in PvP right now, but it doesn't do quite enough in PvE @@ -251,7 +260,7 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This * Increased the clip reload time from 2 seconds to 3 seconds * Increased the damage modifier against zombies from 2.0/3.0 (Depending on the type) to a flat 4.5 across all types * Cut the projectile lifetime from 1 second to 0.15 seconds - * Wp-400 + * Wp-400 / LD06 Savager (Sidearm) * The semi-auto powerhouse shotgun is also getting some tuning done on it. * Reduced the projectile lifetime from 1 second to 0.1 seconds (Slightly less range than the M1700) * Increased the spread factor from 10:1000 to 15:1000 @@ -277,7 +286,11 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This * Increased the number of pellets from 14 to 18 * Reduced the projectile lifetime from 0.5 s to 0.15 seconds * Added a damage factor of 4.0 to all zombie types - * Misc Weapons + * Other Weapons + * Flamethrower + * Although "pretty" in the effects department, and with a powerful burn effect, the Flamethrower itself is rather weak in terms of damage. + * Increased the direct impact damage of fire "bolts" from 0.02 to 0.07. + * This is kind of a "first pass" test to see how it feels. * Acid Cannon * The weapon that players could only obtain from zombie lords was more of a novelty toy players could pick up an fire back at zombies with * In 3.9.2, players will find the Acid Cannon as an officer promotion award, so therefore some adjustments were made to this weapon diff --git a/scripts/RankStuff.cs b/scripts/RankStuff.cs index f114808..4d33d34 100644 --- a/scripts/RankStuff.cs +++ b/scripts/RankStuff.cs @@ -47,312 +47,243 @@ $Ranks::MinPoints[2] = 50; $Ranks::NewRank[2] = "Private Grade II"; $Ranks::RankTag[2] = "[Pvt2]"; -$Ranks::MinPoints[3] = 100; +$Ranks::MinPoints[3] = 75; $Ranks::NewRank[3] = "Private Grade III"; $Ranks::RankTag[3] = "[Pvt3]"; -$Ranks::MinPoints[4] = 150; +$Ranks::MinPoints[4] = 100; $Ranks::NewRank[4] = "Gunnary Private"; $Ranks::RankTag[4] = "[GPvt]"; -$Ranks::MinPoints[5] = 200; +$Ranks::MinPoints[5] = 150; $Ranks::NewRank[5] = "Gunnary Private Grade I"; $Ranks::RankTag[5] = "[GPvt1]"; -$Ranks::MinPoints[6] = 250; +$Ranks::MinPoints[6] = 200; $Ranks::NewRank[6] = "Gunnary Private Grade II"; $Ranks::RankTag[6] = "[GPvt2]"; -$Ranks::MinPoints[7] = 300; +$Ranks::MinPoints[7] = 250; $Ranks::NewRank[7] = "Gunnary Private Grade III"; $Ranks::RankTag[7] = "[GPvt3]"; -$Ranks::MinPoints[8] = 400; +$Ranks::MinPoints[8] = 300; $Ranks::NewRank[8] = "Corporal"; $Ranks::RankTag[8] = "[Cpl]"; -$Ranks::MinPoints[9] = 500; +$Ranks::MinPoints[9] = 400; $Ranks::NewRank[9] = "Corporal Grade I"; $Ranks::RankTag[9] = "[Cpl1]"; -$Ranks::MinPoints[10] = 600; +$Ranks::MinPoints[10] = 500; $Ranks::NewRank[10] = "Corporal Grade II"; $Ranks::RankTag[10] = "[Cpl2]"; -$Ranks::MinPoints[11] = 700; +$Ranks::MinPoints[11] = 600; $Ranks::NewRank[11] = "Corporal Grade III"; $Ranks::RankTag[11] = "[Cpl3]"; -$Ranks::MinPoints[12] = 900; +$Ranks::MinPoints[12] = 700; $Ranks::NewRank[12] = "Corporal Grade IV"; $Ranks::RankTag[12] = "[Cpl4]"; -$Ranks::MinPoints[13] = 1150; +$Ranks::MinPoints[13] = 800; $Ranks::NewRank[13] = "Sergeant"; $Ranks::RankTag[13] = "[Sgt]"; -$Ranks::MinPoints[14] = 1400; +$Ranks::MinPoints[14] = 1000; $Ranks::NewRank[14] = "Sergeant Grade I"; $Ranks::RankTag[14] = "[Sgt1]"; -$Ranks::MinPoints[15] = 1700; +$Ranks::MinPoints[15] = 1200; $Ranks::NewRank[15] = "Sergeant Grade II"; $Ranks::RankTag[15] = "[Sgt2]"; -$Ranks::MinPoints[16] = 2000; +$Ranks::MinPoints[16] = 1400; $Ranks::NewRank[16] = "Sergeant Grade III"; $Ranks::RankTag[16] = "[Sgt3]"; -$Ranks::MinPoints[17] = 2500; +$Ranks::MinPoints[17] = 1600; $Ranks::NewRank[17] = "Sergeant Grade IV"; $Ranks::RankTag[17] = "[Sgt4]"; -$Ranks::MinPoints[18] = 3000; +$Ranks::MinPoints[18] = 2000; $Ranks::NewRank[18] = "Gunnary Sergeant"; $Ranks::RankTag[18] = "[GSgt]"; -$Ranks::MinPoints[19] = 3500; +$Ranks::MinPoints[19] = 2500; $Ranks::NewRank[19] = "Gunnary Sergeant Grade I"; $Ranks::RankTag[19] = "[GSgt1]"; -$Ranks::MinPoints[20] = 4000; +$Ranks::MinPoints[20] = 3000; $Ranks::NewRank[20] = "Gunnary Sergeant Grade II"; $Ranks::RankTag[20] = "[GSgt2]"; -$Ranks::MinPoints[21] = 4500; +$Ranks::MinPoints[21] = 3500; $Ranks::NewRank[21] = "Gunnary Sergeant Grade III"; $Ranks::RankTag[21] = "[GSgt3]"; -$Ranks::MinPoints[22] = 5000; +$Ranks::MinPoints[22] = 4000; $Ranks::NewRank[22] = "Gunnary Sergeant Grade IV"; $Ranks::RankTag[22] = "[GSgt4]"; -$Ranks::MinPoints[23] = 6000; +$Ranks::MinPoints[23] = 5000; $Ranks::NewRank[23] = "Lieutenant"; $Ranks::RankTag[23] = "[Lt]"; -$Ranks::MinPoints[24] = 7000; +$Ranks::MinPoints[24] = 6000; $Ranks::NewRank[24] = "Lieutenant Grade I"; $Ranks::RankTag[24] = "[Lt1]"; -$Ranks::MinPoints[25] = 8000; +$Ranks::MinPoints[25] = 7000; $Ranks::NewRank[25] = "Lieutenant Grade II"; $Ranks::RankTag[25] = "[Lt2]"; -$Ranks::MinPoints[26] = 9000; +$Ranks::MinPoints[26] = 8000; $Ranks::NewRank[26] = "Lieutenant Grade III"; $Ranks::RankTag[26] = "[Lt3]"; -$Ranks::MinPoints[27] = 10000; +$Ranks::MinPoints[27] = 9000; $Ranks::NewRank[27] = "Lieutenant Grade IV"; $Ranks::RankTag[27] = "[Lt4]"; -$Ranks::MinPoints[28] = 12500; +$Ranks::MinPoints[28] = 10000; $Ranks::NewRank[28] = "Captain"; $Ranks::RankTag[28] = "[Cpt]"; -$Ranks::MinPoints[29] = 15000; +$Ranks::MinPoints[29] = 12000; $Ranks::NewRank[29] = "Captain Grade I"; $Ranks::RankTag[29] = "[Cpt1]"; -$Ranks::MinPoints[30] = 20000; +$Ranks::MinPoints[30] = 14000; $Ranks::NewRank[30] = "Captain Grade II"; $Ranks::RankTag[30] = "[Cpt2]"; -$Ranks::MinPoints[31] = 25000; +$Ranks::MinPoints[31] = 16000; $Ranks::NewRank[31] = "Captain Grade III"; $Ranks::RankTag[31] = "[Cpt3]"; -$Ranks::MinPoints[32] = 30000; +$Ranks::MinPoints[32] = 20000; $Ranks::NewRank[32] = "Major"; $Ranks::RankTag[32] = "[Maj]"; -$Ranks::MinPoints[33] = 37500; +$Ranks::MinPoints[33] = 25000; $Ranks::NewRank[33] = "Major Grade I"; $Ranks::RankTag[33] = "[Maj1]"; -$Ranks::MinPoints[34] = 45000; +$Ranks::MinPoints[34] = 30000; $Ranks::NewRank[34] = "Major Grade II"; $Ranks::RankTag[34] = "[Maj2]"; -$Ranks::MinPoints[35] = 52500; +$Ranks::MinPoints[35] = 35000; $Ranks::NewRank[35] = "Major Grade III"; $Ranks::RankTag[35] = "[Maj3]"; -$Ranks::MinPoints[36] = 60000; +$Ranks::MinPoints[36] = 40000; $Ranks::NewRank[36] = "Lieutenant Colonel"; $Ranks::RankTag[36] = "[LCol]"; -$Ranks::MinPoints[37] = 70000; +$Ranks::MinPoints[37] = 50000; $Ranks::NewRank[37] = "Lieutenant Colonel Grade I"; $Ranks::RankTag[37] = "[LCol1]"; -$Ranks::MinPoints[38] = 80000; +$Ranks::MinPoints[38] = 60000; $Ranks::NewRank[38] = "Lieutenant Colonel Grade II"; $Ranks::RankTag[38] = "[LCol2]"; -$Ranks::MinPoints[39] = 90000; +$Ranks::MinPoints[39] = 70000; $Ranks::NewRank[39] = "Lieutenant Colonel Grade III"; $Ranks::RankTag[39] = "[LCol3]"; -$Ranks::MinPoints[40] = 100000; +$Ranks::MinPoints[40] = 80000; $Ranks::NewRank[40] = "Colonel"; $Ranks::RankTag[40] = "[Col]"; -$Ranks::MinPoints[41] = 125000; +$Ranks::MinPoints[41] = 100000; $Ranks::NewRank[41] = "Colonel Grade I"; $Ranks::RankTag[41] = "[Col1]"; -$Ranks::MinPoints[42] = 150000; +$Ranks::MinPoints[42] = 120000; $Ranks::NewRank[42] = "Colonel Grade II"; $Ranks::RankTag[42] = "[Col2]"; -$Ranks::MinPoints[43] = 175000; +$Ranks::MinPoints[43] = 140000; $Ranks::NewRank[43] = "Brigadier"; $Ranks::RankTag[43] = "[Bri]"; -$Ranks::MinPoints[44] = 200000; +$Ranks::MinPoints[44] = 160000; $Ranks::NewRank[44] = "Brigadier Grade I"; $Ranks::RankTag[44] = "[Bri1]"; -$Ranks::MinPoints[45] = 250000; +$Ranks::MinPoints[45] = 180000; $Ranks::NewRank[45] = "Brigadier Grade II"; $Ranks::RankTag[45] = "[Bri2]"; -$Ranks::MinPoints[46] = 300000; +$Ranks::MinPoints[46] = 200000; $Ranks::NewRank[46] = "Brigadier General"; $Ranks::RankTag[46] = "[BriGn]"; -$Ranks::MinPoints[47] = 350000; +$Ranks::MinPoints[47] = 225000; $Ranks::NewRank[47] = "Brigadier General I"; $Ranks::RankTag[47] = "[BriGn1]"; -$Ranks::MinPoints[48] = 425000; +$Ranks::MinPoints[48] = 250000; $Ranks::NewRank[48] = "Brigadier General II"; $Ranks::RankTag[48] = "[BriGn2]"; -$Ranks::MinPoints[49] = 500000; +$Ranks::MinPoints[49] = 300000; $Ranks::NewRank[49] = "General"; $Ranks::RankTag[49] = "[Gen]"; -$Ranks::MinPoints[50] = 575000; +$Ranks::MinPoints[50] = 400000; $Ranks::NewRank[50] = "2 Star General"; $Ranks::RankTag[50] = "[2Gen]"; -$Ranks::MinPoints[51] = 650000; +$Ranks::MinPoints[51] = 500000; $Ranks::NewRank[51] = "3 Star General"; $Ranks::RankTag[51] = "[3Gen]"; -$Ranks::MinPoints[52] = 800000; +$Ranks::MinPoints[52] = 600000; $Ranks::NewRank[52] = "4 Star General"; $Ranks::RankTag[52] = "[4Gen]"; -$Ranks::MinPoints[53] = 1000000; +$Ranks::MinPoints[53] = 750000; $Ranks::NewRank[53] = "5 Star General"; $Ranks::RankTag[53] = "[5Gen]"; -$Ranks::MinPoints[54] = 1250000; +$Ranks::MinPoints[54] = 900000; $Ranks::NewRank[54] = "Master General"; $Ranks::RankTag[54] = "[MGen]"; -$Ranks::MinPoints[55] = 1500000; +$Ranks::MinPoints[55] = 1100000; $Ranks::NewRank[55] = "Master General I"; $Ranks::RankTag[55] = "[MGen1]"; -$Ranks::MinPoints[56] = 1750000; +$Ranks::MinPoints[56] = 1300000; $Ranks::NewRank[56] = "Master General II"; $Ranks::RankTag[56] = "[MGen2]"; -$Ranks::MinPoints[57] = 2000000; +$Ranks::MinPoints[57] = 1500000; $Ranks::NewRank[57] = "Commanding General"; $Ranks::RankTag[57] = "[ComGen]"; -$Ranks::MinPoints[58] = 2250000; +$Ranks::MinPoints[58] = 1750000; $Ranks::NewRank[58] = "Fleet Commander"; $Ranks::RankTag[58] = "[FltCom]"; -$Ranks::MinPoints[59] = 2500000; +$Ranks::MinPoints[59] = 2000000; $Ranks::NewRank[59] = "Commanding Officer"; $Ranks::RankTag[59] = "[ComOcr]"; -$Ranks::MinPoints[60] = 2750000; +$Ranks::MinPoints[60] = 2250000; $Ranks::NewRank[60] = "Commander"; $Ranks::RankTag[60] = "[Cmdr]"; -$Ranks::MinPoints[61] = 3000000; +$Ranks::MinPoints[61] = 2500000; $Ranks::NewRank[61] = "Master Commander"; $Ranks::RankTag[61] = "[MCmdr]"; $Rank::RankCount = 61; -//TOP RANKS -function findTopRanks() { - %server = ""@$PGDServer@":"@$PGDPort@""; - %filename = "/public/Univ/Ranks/TWM2/top.php"; - if (!isObject(Top_Rank_Grab)) { - %Downloader = new HTTPObject(Top_Rank_Grab){}; - } - else { - %Downloader = Top_Rank_Grab; - } - $TopRanks::LineCount = 0; - //If the server crashes here, let everyone know why - MessageAll('MsgAdminForce', "\c5SERVER: Downloading Top Ranks, Possible Lag."); - %Downloader.get(%server, %filename); - %Downloader.schedule(10000, 0, "Disconnect"); -} - -function Top_Rank_Grab::onLine(%this, %line) { - %strPos = strStr(%line, " Registered Players*"); - %star1 = strStr(%line, "*"); - if(%this.count !$= "") { - $TopRanks::LineCount++; - $TopRanks::Line[$TopRanks::LineCount] = %line; - } - if(%strPos != -1 && %star1 != -1) { - %this.count = getSubStr(%line, %star1+1, %strPos-(%star1+1)); - } -} - -function Top_Rank_Grab::onConnectFailed(%this) { - error("-- Could not connect to PGD."); - error("Top Rank Download: fail (connection)"); -} - -function Top_Rank_Grab::onDisconnect(%this) { - echo("Top Rank Download: OK, "@%this.count@" ranks"); - SortTopRanks(%this); - %this.delete(); -} - -function SortTopRanks(%dlOBJ) { - for(%i = 1; %i <= %dlOBJ.count; %i++) { - %line = $TopRanks::Line[%i]; - //First, lets gather out the rank - %RankName1 = strStr(%line, "title=\""); - %RankName2 = strStr(%line, "width=") - 2; - %RankName = getSubStr(%line, (%rankName1+7), (%rankName2-(%rankName1+7))); - //Second, lets get the name and guid - //GUID is not currently used, but hey, we may need it one day - %GUID1 = strStr(%line, "guid=") + 5; - %GUID2 = strStr(%line, "guid=") + 12; - %GUID = getSubStr(%line, (%GUID1), (%GUID2-(%GUID1))); - // - %PlayerName1 = strStr(%line, "guid=") + 12; - %PlayerName2 = strStr(%line, "") - 1; - %PlayerName = getSubStr(%line, (%PlayerName1)+1, (%PlayerName2-(%PlayerName1))); - //Third, lets gather out the EXP - %EXP1 = strStr(%line, ":") + 5; - %EXP2 = strStr(%line, "
") - 4;
- %EXP = getSubStr(%line, (%EXP1), (%EXP2-(%EXP1)));
- %EXP = Trim(stripChars(%EXP, ","));
- //Lastly, lets sort the needed data
- %rPos = %i;
- $Rank::Top[%i] = ""@%PlayerName@"";
- $Rank::TopXP[%i] = %EXP;
- $Rank::TopRank[%i] = ""@%RankName@"";
- }
-}
-
function DoNameChangeChecks(%client) {
if(!$TWM2::UseRankTags) {
TWM2Lib_MainControl("CheckGUID", %client);
diff --git a/scripts/TWM2/ChatCommands/Public.cs b/scripts/TWM2/ChatCommands/Public.cs
index b847cae..4cc6d2f 100644
--- a/scripts/TWM2/ChatCommands/Public.cs
+++ b/scripts/TWM2/ChatCommands/Public.cs
@@ -997,7 +997,6 @@ function parsePublicCommands(%sender, %command, %args) {
messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name @ "'s GUID is" SPC %guid);
messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC "is connecting from" SPC %ip);
messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC (%reqcl.isAIControlled() ? "is" : "isn't") SPC "a bot");
- messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC (%reqcl.isPGDConnected() ? "is" : "isn't") SPC "PGD Connected");
messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC "last connected on" SPC %lastjoin);
messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC %isastr);
}
@@ -1012,92 +1011,23 @@ 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;
- }
- else {
- echo("Client:" SPC %sender.namebase SPC "requests universal save.");
- %file = strReplace(%args, ".cs", "");
- %file = %file @ ".cs";
- %file = "Buildings/Admin/"@%sender.guid@"/" @ %file;
- if(isFile(%file)) {
- MessageAll('MsgAdminForce', "\c3"@%sender.namebase@" is universally saving a building.");
- Univ_ServerConnect(%sender, %file, "Save");
- }
- else {
- messageClient(%client, 'msgPGDRequired', "\c5PGD: That slot/file does not exist");
- }
- return 1;
- }
+ messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been shut down as of June 2019, this command no longer functions.");
+ return 1;
//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;
- }
- if(%sender.cantLoad) {
- messageClient(%sender, 'msgPGDRequired', "\c5PGD: You have only recently loaded.");
- return 1;
- }
- $SaveTime::TimeLeft[%sender.guid, "Load"] = $TWM::CSSTimeLoad*60; //5 mins
- %sender.cantLoad = 1;
- schedule(1,0,"ResetLoad",%sender);
- %args = strReplace(%args, ".cs", "");
- LoadUniversalBuilding(%sender, %args);
- return 1;
+ messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been shut down as of June 2019, this command no longer functions.");
+ return 1;
//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;
- }
- if(!%sender.IsPGDConnected()) {
- messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action.");
- return;
- }
- if($IsAuthed $= false) {
- messageClient(%sender, 'msgPGDRequired', "\c5PGD: This is a Satellite Server, only core servers can save ranks.");
- return;
- }
- SaveClientFile(%sender);
- PrepareUpload(%sender);
- %sender.canSaveRank = 0;
- schedule(60000 * 5, 0, "eval", ""@%sender@".canSaveRank = 1;");
- return 1;
+ messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been shut down as of June 2019, this command no longer functions.");
+ return 1;
//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;
- }
- if(!%sender.IsPGDConnected()) {
- messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action.");
- return;
- }
- LoadUniversalRank(%sender);
- %sender.canLoadRank = 0;
- schedule(60000 * 5, 0, "eval", ""@%sender@".canLoadRank = 1;");
- return 1;
+ messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been shut down as of June 2019, this command no longer functions.");
+ return 1;
//checkStats: check the current rank information on a player
case "checkstats":
@@ -1146,12 +1076,8 @@ function parsePublicCommands(%sender, %command, %args) {
//setEmail: used for the PGD IGC interface
case "setemail":
- if(!isSet(%args)) {
- return 1;
- }
- %sender.emailSet = %args;
- messageClient(%sender, 'msgSent', "\c3SERVER: Email set to "@%args@"");
- return 1;
+ messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect has been shut down as of June 2019, this command no longer functions.");
+ return 1;
//None Matching Case:
default:
@@ -1200,8 +1126,8 @@ addCMD("Public", "Timer", "Usage: /Timer [time > 1.5]: sets the switch delay on
addCMD("Public", "DepSec", "Usage: /DepSec: secure deploy rights on your pieces.");
addCMD("Public", "undo", "Usage: /undo: undo your last construction action.");
addCMD("Public", "checkStats", "Usage: /checkStats [name or blank]: check the current rank info on a player.");
-addCMD("Public", "uSave", "Usage: /uSave [slot #]: Save a building on the PGD server for loading in other servers.");
-addCMD("Public", "uLoad", "Usage: /uLoad [slot #]: Load a universally saved building.");
-addCMD("Public", "LoadRank", "Usage: /LoadRank: load your universal rank if it failed.");
-addCMD("Public", "SaveRank", "Usage: /SaveRank: save your universal rank if it failed.");
-addCMD("Public", "setEmail", "Usage: /setEmail [email]: set email for PGD IGC.");
+addCMD("Public", "uSave", "[Depricated].");
+addCMD("Public", "uLoad", "[Depricated].");
+addCMD("Public", "LoadRank", "[Depricated].");
+addCMD("Public", "SaveRank", "[Depricated].");
+addCMD("Public", "setEmail", "[Depricated].");
diff --git a/scripts/TWM2/LoadMod.cs b/scripts/TWM2/LoadMod.cs
index b537d49..798f73a 100644
--- a/scripts/TWM2/LoadMod.cs
+++ b/scripts/TWM2/LoadMod.cs
@@ -17,7 +17,6 @@ exec("scripts/TWM2/Systems/ObjectDamage.cs"); //Object Damage Functioning
exec("scripts/TWM2/Systems/Scoremenucmds.cs"); //Score Menu
exec("scripts/TWM2/Systems/BossSystem.cs"); //Bosses
exec("scripts/TWM2/Systems/Medals.cs"); //Medals
-exec("scripts/TWM2/Systems/NewsPanel.cs"); //Scoremenu News Page
exec("scripts/TWM2/Systems/Perks.cs"); //Special Perks
exec("scripts/TWM2/Systems/WeaponChallenges.cs"); //Weapon Challenges
exec("scripts/TWM2/Systems/NWChallengeIndex.cs"); //Non-Weapon Challenges
@@ -32,7 +31,6 @@ exec("scripts/TWM2/Missions/MissionCore.cs"); //Missions
exec("scripts/TWM2/Systems/Scoremenucmds.cs"); //Score Menu load again to update the inv. changes
exec("scripts/TWM2/Systems/SuccessiveKills.cs"); //Successive Kills
exec("scripts/TWM2/Systems/PieceData.cs"); //Piece Data, /undo Command
-exec("scripts/TWM2/Systems/DChalg.cs"); //Daily Challenges
exec("scripts/TWM2/Systems/ArmorEnergyShields.cs"); //Armor Shields
exec("scripts/TWM2/Systems/weaponModes.cs"); //Global Defines for Weapon Modes
exec("scripts/TWM2/AI/DroneAI.cs"); //Drones
@@ -51,16 +49,6 @@ exec("scripts/TWM2/CustomArmors.cs"); //TWM2 Armors
exec("scripts/TWM2/ArmorFunctions.cs"); //TWM2 Armors Functions
exec("scripts/TWM2/VehicleReticles.cs"); //Vehicle Reticles
- //Universal Systems
-exec("scripts/TWM2/PGDConnect/ConnectionQueue.cs"); //TCP Connection List
-exec("scripts/TWM2/PGDConnect/UniversalSupport.cs"); //Support Script
-exec("scripts/TWM2/PGDConnect/UniversalSaving_Client.cs");//Saver
-exec("scripts/TWM2/PGDConnect/UniversalLoading.cs"); //Loading
-exec("scripts/TWM2/PGDConnect/UniversalRanks.cs"); //Ranks
-exec("scripts/TWM2/PGDConnect/ServerInteraction.cs"); //Server Connection
-
-schedule(1000, 0, "CheckCore");
-
//Exterior Functioning
exec("scripts/TWM2/ExteriorFunctioning/PulseStuff.cs"); //Aid Pulses
@@ -77,10 +65,6 @@ exec("scripts/TWM2/ChatCommands/Admin.cs"); //Admin CCs
exec("scripts/TWM2/ChatCommands/SuperAdmin.cs"); //SuperAdmin CCs
exec("scripts/TWM2/ChatCommands/DevAndHost.cs"); //Dev/Host CCs
- //Server Dependancies
-LoadRanksBase(); //Load Ranks
-DownloadNewsPage(); //Load News Page
-
//Weapons
exec("scripts/weapons/Pistols/Colt.cs"); //Colt Pistol
exec("scripts/weapons/Melee/melee.cs"); //Gun Blade
@@ -141,12 +125,6 @@ exec("scripts/TWM2/Bosses/LordVardison.cs"); //load him last
echo("Loading custom scripts");
exec("scripts/Customize/CustomScripts.cs");
-schedule(5500, 0, "establishPGDConnection");
-
-cleanChallenges();
-$ChallengeIndex = 0;
-schedule(7000, 0, "downloadChallenges");
-
echo("********************************************");
echo("********************************************");
echo("************* EXECUTE COMPLETE *************");
diff --git a/scripts/TWM2/PGDConnect/ConnectionQueue.cs b/scripts/TWM2/PGDConnect/ConnectionQueue.cs
deleted file mode 100644
index 938d7bb..0000000
--- a/scripts/TWM2/PGDConnect/ConnectionQueue.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-//ConnectionQueue.cs
-//Phantom139 for TWM2
-//This script manages multiple connection handlers.
-
-$TCP::GenericServerPort = 80;
-$TCP::ConnectionContainer = new ScriptObject() {
- class = "TCPConnectionList";
-
- connectionStatus = 0; //Current status indicated by object
- currentConnection = ""; //Current web address connected to
- currentSeparator = ""; //Used for FORM POST data separation
- currentTask = ""; //Current function being used by the container
- dropConnection = 1; //Auto Drop after task completion
- dropTimer = 7500; //time in MS until autoDrop is performed
-
- useHTTP = 0; //switch to the HTTP Object
-
- requestData = "";
-
- //create the inner TCP object for controlling the connections
- //TCPConnection = new TCPObject(PGDConnection) {};
- TCPQueue[0] = "";
-};
-$TCP::ConnectionObject = new TCPObject(PGDConnection);
-$HTTP::ConnectionObject = new HTTPObject(PGDConnection_HTTP);
-$BufferLine = 0;
-
-//control functions for the connection list
-function TCPConnectionList::establishConnection(%this) {
- %this.currentTask = %this@".establishConnection();";
- if(%this.TCPQueue[0] $= "") {
- error("Task breakoff, queue slot 0 is empty but attempt to a connection?");
- return;
- }
-
- if(%this.useHTTP) {
- //echo("* Switching to HTTP Object connection for file download");
- echo("Getting: "@getField(%this.TCPQueue[0], 0)@" => "@getField(%this.TCPQueue[0], 1)@"");
- $Buffer[$HTTP::ConnectionObject] = -1;
- $HTTP::ConnectionObject.get(getField(%this.TCPQueue[0], 0)@":80", getField(%this.TCPQueue[0], 1));
- %this.useHTTP = 0;
- }
- else {
- //%request = %this.call(getField(%this.TCPQueue[0], 2), getField(%this.TCPQueue[0], 3));
- //echo(%this@"."@getField(%this.TCPQueue[0], 2)@"("@getField(%this.TCPQueue[0], 3)@");");
- %request = eval(%this@"."@getField(%this.TCPQueue[0], 2)@"("@getField(%this.TCPQueue[0], 3)@");");
- //echo("Request: "@%request);
- %this.requestData = %request;
-
- if(%this.requestData $= "NIL_REQUEST") {
- //task has been invalidated for some reason, push next one on the queue
- %this.performNextTask();
- return;
- }
-
- $TCP::ConnectionObject.connect(getField(%this.TCPQueue[0], 0) @ ":" @ $TCP::GenericServerPort);
- if(%this.dropConnection) {
- %this.autoDrop = $TCP::ConnectionObject.schedule(%this.dropTimer, "disconnect");
- }
- }
-}
-
-function TCPConnectionList::addTaskToList(%this, %host, %location, %task, %args) {
- %this.currentTask = %this@".addTaskToList("@%host@", "@%location@", "@%task@", "@%args@");";
- //echo("Adding TCP: "@%host@":"@%location@" === "@%task@" ("@%args@")");
-
- if(%this.TCPQueue[0] $= "") {
- //front of the list.
- %this.TCPQueue[0] = %host TAB %location TAB %task TAB %args;
- if(%task $= "http") {
- %this.useHTTP = 1;
- }
- %this.establishConnection(); //connect now.
- }
- else {
- %check = 1;
- while(%this.TCPQueue[%check] !$= "") {
- %check++;
- }
- %this.TCPQueue[%check] = %host TAB %location TAB %task TAB %args;
- }
-}
-
-function TCPConnectionList::performNextTask(%this) {
- cancel(%this.autoDrop);
- %this.currentTask = %this@".performNextTask();";
-
- if(%this.TCPQueue[1] !$= "") {
- //there is another task in the list, update the list
- %this.TCPQueue[0] = ""; //this task is complete
- %check = 1;
- while(%this.TCPQueue[%check] !$= "") {
- %this.TCPQueue[%check-1] = %this.TCPQueue[%check];
- %this.TCPQueue[%check] = "";
- %check++;
- }
- echo("Performing next task");
- if(getField(%this.TCPQueue[0], 2) $= "http") {
- %this.useHTTP = 1;
- }
- %this.establishConnection();
- }
- else {
- echo("No next task, completing");
- %this.TCPQueue[0] = "";
- }
-}
-
-function TCPConnectionList::getRandomSeperator(%this, %length) {
- %this.currentTask = %this@".getRandomSeperator("@%length@");";
-
- %alphanumeric = "abcdefghijklmnopqrstuvwxyz0123456789";
- for(%i = 0; %i < %length; %i++) {
- %index = getRandom(strLen(%alphanumeric));
- %letter = getSubStr(%alphanumeric, %index, 1);
- %UpperC = getRandom(0, 1);
- if(%UpperC) {
- %letter = strUpr(%letter);
- }
- else {
- %letter = strLwr(%letter);
- }
- %seq = %seq @ %letter;
- }
-
- %this.currentSeparator = %seq;
-}
-
-function TCPConnectionList::makeDisposition(%this, %_name, %_content, %_isEnd) {
- %this.currentTask = %this@".makeDisposition("@%_name@", "@%_content@", "@%_isEnd@");";
-
- if(%_isEnd) {
- %dispo = "--" @ %this.currentSeparator @ "\r\nContent-Disposition: form-data; name=\""@%_name@"\"\r\n\r\n"@%_content@"\r\n--" @ %this.currentSeparator @ "--";
- }
- else {
- %dispo = "--" @ %this.currentSeparator @ "\r\nContent-Disposition: form-data; name=\""@%_name@"\"\r\n\r\n"@%_content@"\r\n";
- }
- return %dispo;
-}
-
-function TCPConnectionList::makeUploadDisposition(%this, %_name, %_content, %_fileContent, %_isEnd) {
- %this.currentTask = %this@".makeUploadDisposition("@%_name@", "@%_content@", "@%_fileContent@", "@%_isEnd@");";
-
- if(%_isEnd) {
- %dispo = "--" @ %this.currentSeparator @ "\r\nContent-Disposition: form-data; name=\""@%_name@"\"; filename=\""@%_content@"\"\r\nContent-Type: application/octet-stream\r\n"@%_fileContent@"\r\n--" @ %this.currentSeparator @ "--";
- }
- else {
- %dispo = "--" @ %this.currentSeparator @ "\r\nContent-Disposition: form-data; name=\""@%_name@"\"; filename=\""@%_content@"\"\r\nContent-Type: application/octet-stream\r\n"@%_fileContent@"\r\n";
- }
- return %dispo;
-}
-
-function TCPConnectionList::assembleHTTP1_1Header(%this, %_command, %_userAgent, %_extra) {
- %this.currentTask = %this@".assembleHTTP1_1Header("@%_command@", "@%_userAgent@", "@%_extra@");";
- %header = %_command SPC getField(%this.TCPQueue[0], 1) SPC "HTTP/1.1\r\n" @
- "Host: "@getField(%this.TCPQueue[0], 0)@"\r\n" @
- "User-Agent: "@%_userAgent@"\r\nConnection: close\r\n" @
- %_extra;
- return %header;
-}
-
-function TCPConnectionList::dropConnection(%this) {
- %this.currentTask = %this@".dropConnection();";
- $TCP::ConnectionObject.disconnect();
-}
-
-//functions for the TCP object alone
-function PGDConnection::onConnected(%this) {
- //--$PGDConnection::Connected = true;
- if($DebugMode) {
- echo("DEBUG: "@$TCP::ConnectionContainer.requestData);
- }
- $TCP::ConnectionContainer.connectionStatus = 0;
- %this.doingSomething = true;
- %this.response = "";
- %this.send($TCP::ConnectionContainer.requestData);
-}
-
-function PGDConnection::onConnectFailed( %this ) {
- //--$PGDConnection::Connected = false;
- $TCP::ConnectionContainer.connectionStatus = 1;
- %this.response = "CERROR_CONNECTFAILED";
- //CloseMessagePopup();
- //MessageBoxOK("Connection Error", "Unable to connect to a server \nPlease try again later.");
- error("Connection Error Occured");
- //move up the task list
- $TCP::ConnectionContainer.currentConnection = "";
- $TCP::ConnectionContainer.currentTask = "";
- $TCP::ConnectionContainer.performNextTask();
-}
-
-function PGDConnection::onDNSFailed( %this ) {
- //--$PGDConnection::Connected = false;
- $TCP::ConnectionContainer.connectionStatus = 2;
- %this.response = "CERROR_DNSFAIL";
- //CloseMessagePopup();
- //MessageBoxOK("DNS Error", "Your DNS server was unable to resolve a host name \nPlease try again later.");
- error("DNS Error Occured");
- //move up the task list
- $TCP::ConnectionContainer.currentConnection = "";
- $TCP::ConnectionContainer.currentTask = "";
- $TCP::ConnectionContainer.performNextTask();
-}
-
-function PGDConnection::onLine(%this, %line) {
- if($debugMode) {
- echo(%line);
- }
-
- if (trim(%line) $= "") { //is the line a HTTP header?
- if (!%this.readyToRead) {
- %this.readyToRead = true;
- }
- }
- if(!%this.readyToRead) {
- return; //we have no use for this.
- }
-
- %this.response = %this.response @ %line;
- if(%this.lineEval !$= "") {
- eval(%this@"."@%this.lineEval@"("@%line@");");
- //%this.call(%this.lineEval, %line);
- }
-}
-
-function PGDConnection::onDisconnect(%this) {
- $TCP::ConnectionContainer.connectionStatus = 0;
- $TCP::ConnectionContainer.currentConnection = "";
- $TCP::ConnectionContainer.currentTask = "";
- //
- $TCP::ConnectionContainer.performNextTask();
- //
- if(isSet(%this.finishFunction)) {
- eval(%this@"."@%this.finishFunction@"("@%this.response@");");
- //%this.call(%this.finishFunction, %this.response);
- }
-}
-
-//===== HTTP =====
-function PGDConnection_HTTP::onLine(%this, %line) {
- if($debugMode) {
- echo(%line);
- }
-
- //full line evaluations are not supported by HTTP objects
- //we must use a buffer to safely transmit data instead
- $Buffer[%this, $Buffer[%this]++] = %line;
- if(%this.lineEval !$= "") {
- eval(%this@"."@%this.lineEval@"("@%line@");");
- //%this.call(%this.lineEval, %line);
- }
-}
-
-function PGDConnection_HTTP::onDisconnect(%this) {
- $TCP::ConnectionContainer.connectionStatus = 0;
- $TCP::ConnectionContainer.currentConnection = "";
- $TCP::ConnectionContainer.currentTask = "";
- //
- $TCP::ConnectionContainer.performNextTask();
- //
- if(isSet(%this.finishFunction)) {
- eval(%this@"."@%this.finishFunction@"();");
- //%this.call(%this.finishFunction, %this.response);
- }
-}
diff --git a/scripts/TWM2/PGDConnect/ServerInteraction.cs b/scripts/TWM2/PGDConnect/ServerInteraction.cs
deleted file mode 100644
index bb8dcbc..0000000
--- a/scripts/TWM2/PGDConnect/ServerInteraction.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//ServerInteraction.cs
-//Updated TWM2 3.9a, removed depricated EXP Cap commands
-
-$TWM2Core_Interface = "www.phantomdev.net" TAB "www.public.phantomdev.net"; //don't touch, server connections
-$TWM2ServerInfo_Loc = "/Univ/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);
- }
- else {
- %connection = serverInterfacing;
- }
- %connection.connect(getField($TWM2Core_Interface, 1) @ ":" @ $PGDPort);
- //set the code!
- $TWM2Core_Code = sha1sum($TWM2Core_Interface TAB formattimestring("yymmdd"));
- //schedule next interaction with the server
- schedule(60000 * 30, 0, "establishPGDConnection"); //every 30 minutes is good.
-}
-
-function establishPGDConnection_manual() {
- echo("ServerInteraction Initiated... wait for connection...");
- if (!isObject(serverInterfacing)) {
- %connection = new TCPObject(serverInterfacing);
- }
- else {
- %connection = serverInterfacing;
- }
- %connection.connect(getField($TWM2Core_Interface, 1) @ ":" @ $PGDPort);
- //set the code!
- $TWM2Core_Code = sha1sum($TWM2Core_Interface TAB formattimestring("yymmdd"));
-}
-
-//
-function serverInterfacing::onConnected(%this) {
- echo("Connection established with Phantom Games Development (www.phantomdev.net)");
- %this.schedule(15000, "disconnect");
- %loc = $TWM2ServerInfo_Loc;
- %query = "GET" SPC %loc SPC "HTTP/1.1\x0aHost: "@getField($TWM2Core_Interface, 1)@"\r\n\r\n";
-
- echo("Sending Request Query to Phantom Games Server.");
- %this.send(%query);
-}
-
-function serverInterfacing::onLine(%this, %line) {
- if (trim(%line) $= "") { //is the line a HTTP header?
- if (!%this.readyToRead) {
- %this.readyToRead = true;
- }
- }
- if(!%this.readyToRead) {
- return; //we have no use for this.
- }
- //read necessary data
- switch$(getWord(%line, 0)) {
- case "ApplyDevList":
- %list = getWords(%line, 1);
- %list = strreplace(%list, "TAB", "\t"); //boom!
- for(%i = 0; %i < getFieldCount(%list); %i++) {
- %FieldGUID = getSubStr(getField(%list, %i), 0, strstr(getField(%list, %i), ":"));
- %FieldLEVEL = getSubStr(getField(%list, %i), strLen(%FieldGUID) + 1, strLen(getField(%list, %i)));
- $DeveloperList[%i] = %FieldGUID;
- $DeveloperLevel[%i] = %FieldLEVEL;
- echo("Developers "@%i@": "@$DeveloperList[%i]@" -> "@$DeveloperLevel[%i]@"");
- }
-
- case "SetHighRank":
- $RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] = getWord(%line, 1);
- echo("PGD: Highest Rank Set To "@getWord(%line, 1)@"");
-
- case "SetHighOfficer":
- $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] = getWord(%line, 1);
- echo("PGD: Highest Officer Rank Set To "@getWord(%line, 1)@"");
-
- case "SetEXPMultiplier":
- $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB TWM2Lib_MainControl("FormatTWM2Time" , formattimestring("yymmdd")))] = getWord(%line, 1);
- echo("PGD: EXP Multiplier is now: "@getWord(%line, 1)@"");
-
- default:
- echo("PGD: Depricated command "@getWord(%line, 0)@" issued, ignored...");
- }
-}
diff --git a/scripts/TWM2/PGDConnect/UniversalLoading.cs b/scripts/TWM2/PGDConnect/UniversalLoading.cs
deleted file mode 100644
index 3aaed4b..0000000
--- a/scripts/TWM2/PGDConnect/UniversalLoading.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// ---- 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)) {
- %Downloader = new HTTPObject(Univ_Loader){};
- }
- else {
- %Downloader = Univ_Loader;
- }
- //If the server crashes here, let everyone know why
- MessageAll('MsgAdminForce', "\c3"@%client.namebase@" is loading a universally saved building.");
- echo("Client:" SPC %client.namebase SPC "requests universal load.");
- %Downloader.client = %client;
- %Downloader.load = %file;
- %Downloader.valid = 1;
- $PGDBuffer[%client, %file] = "";
- %Downloader.get(%server, %filename);
-}
-
-function Univ_Loader::onLine(%this, %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) {
- error("-- Could not connect to PGD.");
- messageClient(%this.client, 'MsgClient', "\c5PGD: Your Building could not be loaded, the server may be offline or going through maintenance.");
- error("Universal Load: fail (connection)");
-}
-
-function Univ_Loader::onDisconnect(%this) {
- if(!%this.valid) {
- echo("Universal Load: Corrupt File");
- $PGDBuffer[%this.client, %this.load] = ""; //clear the buffer.
- %this.delete();
- return;
- }
- eval($PGDBuffer[%this.client, %this.load]); //evaluate the buffer here, which will make things much faster.
- $PGDBuffer[%this.client, %this.load] = ""; //clear the buffer.
- echo("Universal Load: OK");
- %this.delete();
-}
diff --git a/scripts/TWM2/PGDConnect/UniversalRanks.cs b/scripts/TWM2/PGDConnect/UniversalRanks.cs
deleted file mode 100644
index cf9947d..0000000
--- a/scripts/TWM2/PGDConnect/UniversalRanks.cs
+++ /dev/null
@@ -1,285 +0,0 @@
-//UniversalRanks.cs
-//Coded: 1-2-10
-//By: Phantom139, And alot of improvements by Signal360
-
-//This script handles all TCP Object related code for the Universal Rank System
-//It will access the server to check for a universal rank file, if it exists, it
-//deletes the local file and downloads the unioversal one for use, if it does not
-//exist it scans the server to see if it is a "Main" Server. If the server is "Main",
-//The rank is saved to the universal server for usage in other servers.
-
-//------------------------------------------------------------------------
-//This first part of the script is the IsServerMain Handler.
-//It Downloads the server key from PGD and verifies it to the key
-//The Server Host Specifies.
-//------------------------------------------------------------------------
-$ServerType = "Satellite Server";
-$PGDDebugMode = 0;
-function currentEpochTime() {
- rubyEval("tsEval '$temp=' + Time.now.to_i.to_s + ';'");
- return $temp;
-}
-
-function CreateHash(%user, %password, %name) {
- //%salt = base64_encode(formatTimeString("dd.mm.yy-nn")); //prevent a replay attack?
- %epoch = currentEpochTime(); //now using epoch time for a better salt
- %salt = base64_encode(getSubStr(%epoch, 0, strLen(%epoch)-3)); // removing last second to prevent problems
- %nonce = sha1sum(%user @ %name); // if there is a small delay, it also means
- %str = %user @ ":" @ %password; // the hash will be different every 10 secs.
- %hash = sha1sum(%nonce @ sha1sum(%str) @ %salt);
- if($PGDDebugMode == 1) {
- MessageDevs("\c3Epoch: "@getSubStr(%epoch, 0, strLen(%epoch)-2)@"");
- MessageDevs("\c3Salt: "@%salt@"");
- MessageDevs("\c3Nonce: "@%nonce@"");
- MessageDevs("\c3Hash: "@%hash@"");
- }
- return %hash;
-}
-
-function IsServerMain() {
- if($ServerType $= "Core Server")
- return 1;
- else
- return 0;
-}
-//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,
- "generatePGDCoreCheck",
- "");
-}
-
-function TCPConnectionList::generatePGDCoreCheck(%this) {
- echo("*Generating Request");
- %user = getField($TWM2::PGDCredentials, 0);
- %password = getField($TWM2::PGDCredentials, 1);
- %name = sha1Sum($Host::GameName);
- %hash = CreateHash(%user, %password, %name);
-
- %this.getRandomSeperator(16);
- %header = %this.assembleHTTP1_1Header("POST", "Tribes 2", "Content-Type: multipart/form-data; boundary="@%this.currentSeparator@"\r\n");
- %dispo = %this.makeDisposition(user, %user);
- %dispo = %dispo @ %this.makeDisposition(hash, %hash);
- %dispo = %dispo @ %this.makeDisposition(gname, %name, 1);
-
- %header = %header @ "Content-Length: " @ strLen(%dispo) @ "\r\n\r\n";
-
- $TCP::ConnectionObject.serverIndex = %counter;
- $TCP::ConnectionObject.lineEval = "validatePGDCore";
- return %header @ %dispo;
-}
-
-function PGDConnection::validatePGDCore(%this, %line) {
- if(strStr(%line, "pgd_debug") != -1) {
- if($PGDDebugMode == 1) {
- MessageDevs("\c5PGD DEBUG:" SPC %line);
- }
- }
- if (trim(%line) $= "yes")
- $ServerType = "Core Server";
- else if (trim(%line) $= "no")
- $ServerType = "Satellite Server";
-}
-
-//------------------------------------------------------------------------
-//This second part of the script handles the downloading of existing files
-//It uses the PGDISFile from UniversalSupport.cs as well as scans for a current
-//file.
-//------------------------------------------------------------------------
-
-function LoadUniversalRank(%client) {
- if($TWM2::PGDConnectDisabled) {
- schedule(500, 0, "LoadClientRankfile", %client);
- return;
- }
- //A Little PGD Connect Ad.
- %client.donotupdate = 1;
- if(!%client.IsPGDConnected()) {
- %client.donotupdate = 0;
- messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to load universal ranks.");
- messageClient(%client, 'msgPGDRequired', "\c5PGD: Sign up for PGD Connect today, It's Fast, Easy, and FREE!");
- messageClient(%client, 'msgPGDRequired', "\c5See: www.forums.phantomdev.net in the Tribes 2 Section");
- messageClient(%client, 'msgPGDRequired', "\c5For more details.");
- schedule(500, 0, "LoadClientRankfile", %client);
- return 1;
- }
- //IS FILE
- 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!");
- messageClient(%client, 'msgPGDRequired', "\c5PGD: Loading your local rank file for the time being...");
- schedule(500, 0, "LoadClientRankfile", %client);
- return 1;
- }
- //Passed, we have a universal rank, time to loady :)
- MessageClient(%client, 'msgAccess', "\c5PGD: Universal Rank Load Requested, adding to connection queue, please standby.");
- echo("Client:" SPC %client.namebase SPC "needs universal rank load. It will be stored locally.");
- //Cache Create
- %file = "/public/Univ/Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave";
- $HTTP::ConnectionObject.client = %client;
- $HTTP::ConnectionObject.finishFunction = "onCompleteRankDownload";
- $TCP::ConnectionContainer.addTaskToList($PGDServer,
- %file,
- "http",
- "");
-}
-
-function PGDConnection_HTTP::onCompleteRankDownload(%this) {
- echo("download complete... evaluating and applying rank");
- %client = %this.client;
-
- 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);
-
- messageClient(%client, 'msgComplete', "\c3PGD: Your rank has been successfully downloaded.");
-}
-
-//------------------------------------------------------------------------
-//This third part of the script handles the uploading of rank files
-//It uses the IsServerMain above to check if the server is "Allowed" to upload
-//rank files. If it can, it handles the uploading.
-//------------------------------------------------------------------------
-
-function PrepareUpload(%client) {
- if($TWM2::PGDConnectDisabled) {
- echo("PGD Connect is disabled.");
- return;
- }
- if (!isServerMain()) {
- return;
- }
- if(!%client.IsPGDConnected()) {
- messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action.");
- }
- else {
- messageClient(%client, 'msgPGDRequired', "\c5PGD: Adding your upload request to the connection queue list.");
- $TCP::ConnectionContainer.client = %client;
- $TCP::ConnectionContainer.addTaskToList($PGDServer,
- $PGDPHPRankUploadHandler,
- "GeneratePGDUploadRequest",
- "");
- }
-}
-
-function TCPConnectionList::GeneratePGDUploadRequest(%this) {
- //pre-generation stuff
-
- %client = %this.client;
- %file = $TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave";
- %fileBase = FileBase(%file) @ ".TWMSave";
- %fileCont = TWM2Lib_PGDConnect_Support("fileContents", %file);
-
- %user = getField($TWM2::PGDCredentials, 0);
- %password = getField($TWM2::PGDCredentials, 1);
- %name = sha1Sum($Host::GameName);
- %hash = CreateHash(%user, %password, %name);
-
- %this.getRandomSeperator(16);
- %header = %this.assembleHTTP1_1Header("POST", "Tribes 2", "Content-Type: multipart/form-data; boundary="@%this.currentSeparator@"\r\n");
- %dispo = %this.makeDisposition(guid, %client.guid);
- %dispo = %dispo @ %this.makeDisposition(user, %user);
- %dispo = %dispo @ %this.makeDisposition(hash, %hash);
- %dispo = %dispo @ %this.makeDisposition(gname, %name);
- %dispo = %dispo @ %this.makeDisposition(version, $TWM2::Version);
- %dispo = %dispo @ %this.makeDisposition(mod, "TWM2");
- %dispo = %dispo @ %this.makeUploadDisposition(uploadedfile, %fileBase, %fileCont, 1);
-
- %header = %header @ "Content-Length: " @ strLen(%dispo) @ "\r\n\r\n";
-
- $TCP::ConnectionObject.client = %client;
- $TCP::ConnectionObject.lineEval = "evalRankUpload";
- return %header @ %dispo;
-}
-
-//Handle Errors
-function PGDConnection::evalRankUpload(%this, %line) {
- if($PGDDebugMode)
- echo(%line);
- %ok = false;
- if(strStr(%line, "pgd_ban") != -1) {
- messageClient(%this.client, 'msgPGDRequired', "\c2PGD: You are banned. \c3"@%line@".");
- }
- if(strStr(%line, "pgd_debug") != -1) {
- if($PGDDebugMode == 1) {
- MessageDevs("\c5PGD DEBUG:" SPC %line);
- }
- }
- switch$ (%line) {
- case "file_upload_ok":
- %ok = true;
- messageClient(%this.client, 'msgdone', "\c5PGD: Your Rank was saved successfully.");
- case "not_registered":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action.");
- case "incompatible_version":
- error("PGD: This version is no longer supported by PGD Ranks");
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: This version of TWM2 is no longer supported.");
- case "invalid_hash":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The authentication hash sent to the server"NL
- "was not valid. (invalid characters, or no input!)");
- $ServerType = "Satellite Server";
- case "incorrect_hash":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The authentication hash sent to the server"NL
- "was not correct.");
- $ServerType = "Satellite Server";
- case "invalid_guid":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: Your GUID had invalid characters in it,"NL
- "try again, when it hasn't been tampered with >_>");
- case "no_guid_input":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: No GUID was sent to the server. Try again!");
- case "bad_user":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The username for this server was not filled"NL
- "in, or it had invalid characters in it.");
- $ServerType = "Satellite Server";
- case "bad_version_input":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The version field was not filled in.");
- case "save_denied":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The server has denied your file save request.");
- case "sql_error":
- messageClient(%this.client, 'msgPGDRequired', "\c5PGD: There is a problem with the SQL database on the server!");
- default:
- return;
- }
- if ( %ok )
- echo( "Universal Rank Save: OK" );
- else
- error( "Universal Rank Save: fail (" @ %line @ ")" );
-}
diff --git a/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs b/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs
deleted file mode 100644
index 3b8640b..0000000
--- a/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//Universal Saving System
-//By Phantom139
-
-//Client Script
-//1. Creates and Manages the connection to the PGD Server.
-//2. Handles Clients Trying To Save.
-//3. Handles the file to be saved.
-//4. Sends the File to the server.
-//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;
- }
- if($PGD::IsPGDConnected[%guid] $= "") {
- %client.CheckPGDConnect();
- return %client.schedule(2000, "IsPGDConnected");
- }
- else {
- return $PGD::IsPGDConnected[%guid];
- }
-}
-//---------- PGD Saving --------------------------------------------------------
-
-function GameConnection::CheckPGDConnect(%client) {
- %guid = %client.guid;
- %server = ""@$PGDServer@":"@$PGDPort@"";
- if (!isObject(GUIDGrabber))
- %Downloader = new HTTPObject(GUIDGrabber){};
- else %Downloader = GUIDGrabber;
- %filename = "/Univ/IsConnected.php?guid="@%guid@""; //File Location
- %Downloader.guid = %guid;
- %Downloader.get(%server, %filename);
-}
-
-function GUIDGrabber::onLine(%this, %line) {
- %txt = deTag(%line);
- if (strstr(%txt, "yes")) {
- $PGD::IsPGDConnected[%this.guid] = 1;
- %this.disconnect();
- %this.schedule(1000, delete);
- }
- else {
- $PGD::IsPGDConnected[%this.guid] = 0;
- %this.disconnect();
- %this.schedule(1000, delete);
- }
-}
-
-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");
- return;
- }
- if(!isFile(%file)) {
- error("Error: File specified does not exist, or is a non permitted file type");
- return;
- }
- //We already have an existing connection, Lets Delete it
- if (isObject(%connection)) {
- %connection.disconnect();
- %connection.delete();
- }
- new TCPObject(%connection);
- %connection.client = %client;
- %connection.guid = %client.guid;
- if(%svDl $= "Save") {
- %connection.save = 1;
- if(!%client.IsPGDConnected()) {
- messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action.");
- return;
- }
- else {
- %len = TWM2Lib_PGDConnect_Support("fileLength", %file);
- %connection.orgfile = %file;
- %connection.file = %file; //what are we sending?
- %connection.filebase = FileBase(%file) @ ".cs";
- }
- %connection.connect(""@$PGDServer@":"@$PGDPort@"");
- }
- else {
- %connection.fileTag = FileBase(%file); //what are we sending?
- %connection.delete = 1;
- %connection.connect(""@$PGDServer@":"@$PGDPort@"");
- }
-}
-
-function Univ_SaveClient::onConnected(%this) {
- %this.schedule(15000, "disconnect");
- if(%this.save == 1) {
- %sep = getRandomSeparator(16);
- %filecont = TWM2Lib_PGDConnect_Support("fileContents", %this.orgfile);
- %loc = $PGDPHPUploadHandler;
- %header1 = "POST" SPC %loc SPC "HTTP/1.1\r\n";
- %host = "Host: "@$PGDServer@"\r\n";
- %header2 = "Connection: close\r\nUser-Agent: Tribes 2\r\n";
- %contType = "Content-Type: multipart/form-data; boundary="@%sep@"\r\n";
- %guidReq = "--"@%sep@"\r\nContent-Disposition: form-data; name=\"guid\"\r\n\r\n"@%this.guid@"";
- %fileReq = "--"@%sep@"\r\nContent-Disposition: form-data; name=\"uploadedfile\"; filename=\""@%this.filebase@"\"\r\nContent-Type: application/octet-stream";
- %payload = %guidReq@"\r\n"@%filereq@"\r\n"@%filecont@"--"@%sep@"--";
- %qlen = strLen(%payload);
- %contentLeng = "Content-Length: "@%qlen@"\r\n\r\n";
- %query = %header1@%host@%header2@%contType@%contentLeng@%payload;
- echo("Connected to Phantom Games Server, Sending File Data...");
- %this.send(%query);
- }
- else {
- %loc = $PGDPHPDelHandler@"?guid="@%this.guid@"&filetokill="@%this.file@"";
- %query = "GET" SPC %loc SPC "HTTP/1.1\x0aHost: "@$PGDServer@"\r\n\r\n";
- echo("Sending:"SPC%query);
- echo("Connected to Phantom Games Server, Deleting File");
- %this.send(%query);
- }
-}
-
-function Univ_SaveClient::get(%connection, %server, %query) {
- %connection.server = %server;
- %connection.query = %query;
- %connection.connect(%server);
-}
-
-//Handle Errors
-function Univ_SaveClient::onLine(%this, %line) {
- //echo("PGD Server Response: "@%line@".");
- if(strstr(%line, "file_upload_ok") != -1) {
- messageClient(%this.client, 'msgdone', "\c5PGD: Your File was Saved Successfully.");
- echo("Universal Save: OK");
- }
- else if(strstr(%line, "not_registered") != -1)
- {
- messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action.");
- }
- else
- {
- error("PGD Error: "@%line);
- }
-}
-
-function Univ_SaveClient::onDisconnect(%this) {
- %this.delete();
-}
-
-function Univ_SaveClient::onConnectFailed(%this) {
- error("-- Could not connect to PGD.");
- messageClient(%this.client, 'MsgClient', "\c5PGD: Your Building could not be saved, the server may be offline or going through maintenance.");
- error("Universal Save: fail (connection)");
- %this.delete();
- return;
-}
diff --git a/scripts/TWM2/PGDConnect/UniversalSupport.cs b/scripts/TWM2/PGDConnect/UniversalSupport.cs
deleted file mode 100644
index 8bb7e42..0000000
--- a/scripts/TWM2/PGDConnect/UniversalSupport.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-//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 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";
-$PGDEMailHandler = "/public/Univ/Ranks/antiTamperDispatch.php";
-
-$PGDPHPRankUploadHandler = "/public/Univ/Ranks/upload.php";
-
-$PGDPort = 80; //TCP
-$PGDServer = "www.phantomdev.net";
-
-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) {
- $PGD::IsFile[%this.File] = 0;
- %this.schedule(1000, disconnect);
- %this.schedule(1500, delete);
- }
- else {
- $PGD::IsFile[%this.File] = 1;
- %this.schedule(1000, disconnect);
- %this.schedule(1500, delete);
- }
-}
-
-function PGDISFile::onConnectFailed(%this) {
- error("-- Could not connect to PGD Is File, re-attempt, 30 sec.");
- $PGD::IsFile[%this.File] = -1;
- //
- schedule(30000, 0, "PGD_IsFile", %this.File);
- %this.disconnect();
- %this.delete();
-}
-
-function PGDISFile::onDisconnect(%this) {
-
-}
-//END
\ No newline at end of file
diff --git a/scripts/TWM2/PGDConnect/Warning.txt b/scripts/TWM2/PGDConnect/Warning.txt
deleted file mode 100644
index de8fcbe..0000000
--- a/scripts/TWM2/PGDConnect/Warning.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-All files in this folder are the basic functioning for PGD services.
-
-Do not delete these files.
\ No newline at end of file
diff --git a/scripts/TWM2/Systems/AdvancedRankSystem.cs b/scripts/TWM2/Systems/AdvancedRankSystem.cs
index 891f9ce..6182fb7 100644
--- a/scripts/TWM2/Systems/AdvancedRankSystem.cs
+++ b/scripts/TWM2/Systems/AdvancedRankSystem.cs
@@ -2,12 +2,6 @@ $TWM::RanksDirectory = "Server/TWM/Saved";
// This is where all of the ranks will be saved
// I highly recommend leaving this alone
-function LoadRanksBase() {
- echo("Loading The Ranking System Base");
- findTopRanks();
- //Modified 2.6, top ranks handled by PGD now
-}
-
function CreateClientRankFile(%client) {
if(!isSet(%client) || %client.guid $= "") {
return;
@@ -131,7 +125,7 @@ function runRankUpdateLoop(%client, %j, %continue) {
%scriptController = %client.TWM2Core;
//perform rank update
if(getCurrentEXP(%client) >= $Ranks::MinPoints[%j]){
- if(%scriptController.rank !$= $Ranks::NewRank[%j] && !fetchCap("Level", ((%scriptController.officer)*$Rank::RankCount)+%j)) {
+ if(%scriptController.rank !$= $Ranks::NewRank[%j]) {
%scriptController.rankNumber = %j;
if($TWM2::UseRankTags) {
DoNameChangeChecks(%client);
@@ -148,13 +142,6 @@ function runRankUpdateLoop(%client, %j, %continue) {
messageclient(%client, 'Msgclient', "\c5Congratulations, you have reached the maximum rank in TWM2 and have unlocked the ability to enter an officer rank. To proceed, open the [F2] menu and select the Settings option.");
}
SaveClientFile(%client);
- //
- if(!$TWM2::PGDConnectDisabled) {
- PrepareUpload(%client);
- }
- //Phantom139: 10/17/17: Why is this block here??? It's just a NOP on the next call...
- //%j = 1;
- //runRankUpdateLoop(%client, %j, 0);
}
}
else {
@@ -163,39 +150,6 @@ function runRankUpdateLoop(%client, %j, %continue) {
}
}
-function fetchCap(%type, %index) {
- if(%type $= "Officer") {
- if(!isSet($OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) || $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] <= 0) {
- return false;
- }
- else {
- if(%index >= $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) {
- return true;
- }
- else {
- return false;
- }
- }
- }
- else if(%type $= "Level") {
- if(!isSet($RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) || $RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] <= 0) {
- return false;
- }
- else {
- if(%index >= $RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) {
- return true;
- }
- else {
- return false;
- }
- }
- }
- else if(%type $= "EXP") {
- echo("fetchCap(): Call to EXP cap made, however the EXP cap has been depricated. use trace(1) to log the call stack.");
- return false;
- }
-}
-
function checkForXPAwards(%client) {
%scriptController = %client.TWM2Core;
%xp = getCurrentEXP(%client);
@@ -236,14 +190,6 @@ function PromoteToPrestige(%client) {
else {
%next = %scriptController.officer++;
}
-
- if(fetchCap("Officer", %next)) {
- error("Client "@%client@"["@%client.getAddress()@"]("@%client.namebase@":"@%client.guid@") attempting to hack past cap.");
- error("It is recommended you report these details to Phantom139 (phantom139@phantomdev.net) ASAP.");
- error("Client has been informed of this, if it is reported to be a mistake, inform Phantom139 of possible code error");
- messageClient(%client, 'msgAlert', "\c3Alert! You have performed an Illegal action(trying to promote to an officer rank beyond cap level)\nIf you believe this is a mistake, you should inform the server host ASAP.");
- return;
- }
//Phantom139 TWM2 3.9.2: Removed the "reset" of progression, we only reset EXP and the rank for office progression now.
//DumpStats(%client);
@@ -294,22 +240,22 @@ function DumpStats(%c) {
//Direct calls to needed function, replaces
//old system.
function GainExperience(%client, %variable, %tagToGain) {
- %todaysDate = sha1sum(formattimestring("yymmdd"));
+ //%todaysDate = sha1sum(formattimestring("yymmdd"));
%script = %client.TWM2Core;
//
- %multi = $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB TWM2Lib_MainControl("FormatTWM2Time", formattimestring("yymmdd")))];
- if(!isSet(%multi) || %multi < 1) {
- %multi = 1;
- }
- %variable *= %multi;
+ //%multi = $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB TWM2Lib_MainControl("FormatTWM2Time", formattimestring("yymmdd")))];
+ //if(!isSet(%multi) || %multi < 1) {
+ // %multi = 1;
+ //}
+ //%variable *= %multi;
%variable = mFloor(%variable);
//
- if(%multi > 1) {
- messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3+"@%variable@" EXP (Bonus Multiplier: "@%multi@")");
- }
- else {
- messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3+"@%variable@" EXP");
- }
+ //if(%multi > 1) {
+ // messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3+"@%variable@" EXP (Bonus Multiplier: "@%multi@")");
+ //}
+ //else {
+ messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3+"@%variable@" EXP");
+ //}
$XPArray[%client] += %variable;
updateClientRank(%client);
}
\ No newline at end of file
diff --git a/scripts/TWM2/Systems/ChallengeMenus.cs b/scripts/TWM2/Systems/ChallengeMenus.cs
index fad3e1e..acc3ef6 100644
--- a/scripts/TWM2/Systems/ChallengeMenus.cs
+++ b/scripts/TWM2/Systems/ChallengeMenus.cs
@@ -10,8 +10,6 @@ function GenerateChallengesMenu(%client, %tag, %index) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "
", "");
- if (strstr(%line, "*Start") != -1) {
- //
- %moduPosition = strPos(%text, "%"); //gets first occurance
- %text = getSubStr(%text, %moduPosition+1, (strlen(%text)));
- %moduPosition = strPos(%text, "%"); //gets first occurance
- %i = 0;
- while(%moduPosition != -1) {
- %text[%i] = getSubStr(%text, 0, %moduPosition);
- %text = getSubStr(%text, %moduPosition+1, (strlen(%text)));
- %moduPosition = strPos(%text, "%"); //gets first occurance
- //
- %i++;
- }
- %text = StrReplace(%text, "%", "");
- %x = 0;
- while(isSet(%text[%x])) {
- echo(%text[%x]);
- %text[%x] = detag( %text[%x] );
- %textf = (%text $= "") ? %text[%x] : %textf NL %text[%x];
- $TWM::Ticks++;
- $TWM::Page[$TWM::Ticks] = ""@%textf@"";
- %x++;
- }
- //======= GMessage
- if(strPos(%text, "$") != -1 && strPos(%text, "*$") != -1) {
- %begin = strPos(%text, "$")+1;
- %end = strPos(%text, "*$");
- %textLine = getSubStr(%text, %begin, %end);
- echo(" *** MOTD GLOBAL: "@%textLine@"");
- $TWM2::MOTDGlobal = %textLine;
- }
- }
-}
-
-function PageGrabber::onConnectFailed() {
- echo("-- Could not connect to server.");
- echo("Using Page Specified In NewsPanel.cs");
-
- $TWM::Ticks = 2;
- $TWM::Page[1] = "Welcome To "@$Host::GameName@"";
- $TWM::Page[2] = "Total Warfare Mod 2 V"@$TWM::Version@"";
-
-}
-
-function PageGrabber::onDisconnect(%this) {
- %this.delete();
-}
-
diff --git a/scripts/TWM2/Systems/scoremenucmds.cs b/scripts/TWM2/Systems/scoremenucmds.cs
index 5b6bb9b..9e2779c 100644
--- a/scripts/TWM2/Systems/scoremenucmds.cs
+++ b/scripts/TWM2/Systems/scoremenucmds.cs
@@ -176,44 +176,6 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
messageClient( %client, 'SetLineHud', "", %tag, %index, '