PGD Connect Removal

First pass on files to strip PGD Connect from the mod.
This commit is contained in:
Robert Fritzen 2021-01-13 12:41:00 -06:00
parent 42d636b4b8
commit 52ad2235c7
40 changed files with 234 additions and 2223 deletions

View file

@ -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

View file

@ -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, "</a>") - 1;
%PlayerName = getSubStr(%line, (%PlayerName1)+1, (%PlayerName2-(%PlayerName1)));
//Third, lets gather out the EXP
%EXP1 = strStr(%line, "</a>:") + 5;
%EXP2 = strStr(%line, "<p>") - 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);

View file

@ -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].");

View file

@ -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 *************");

View file

@ -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);
}
}

View file

@ -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...");
}
}

View file

@ -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();
}

View file

@ -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 @ ")" );
}

View file

@ -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;
}

View file

@ -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

View file

@ -1,3 +0,0 @@
All files in this folder are the basic functioning for PGD services.
Do not delete these files.

View file

@ -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);
}

View file

@ -10,8 +10,6 @@ function GenerateChallengesMenu(%client, %tag, %index) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:16>Select a category to view challenges:");
%index++;
//
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14><a:gamelink\tOtherTasksSub\t1>PGD Challenges (Daily/Weekly/Monthly)</a>");
%index++;
for(%i = 2; $Challenge::Category[%i] !$= ""; %i++) {
%categoryReq = getField($Challenge::Category[%i], 2);
if(getWord(%categoryReq, 0) $= "Officer") {

View file

@ -1,529 +0,0 @@
//Daily Challenge System
//Phantom139
//Handles PGD Issued daily challenges
//downloads challenges from PGD
function downloadChallenges() {
if($TWM2::PGDConnectDisabled) {
echo("PGD Connect is disabled.");
return;
}
if(!IsServerMain()) {
error("* Daily Challenges: Restricted To Core Servers Only");
return;
}
echo("* Downloading Challenge List, scheduling next download");
messageAll('MsgAdminForce', "\c3TWM2: Downloading challenges from PGD server.");
%connection = new TCPObject(ChallengeDownload);
%location = "/public/Univ/twm2/";
%host = $PGDServer;
//
%request = "GET" SPC %location SPC "HTTP/1.1\x0aHost: "@%host@"\r\n\r\n";
%connection.request = %request;
$ChallengeIndex = 0;
%connection.connect(%host @ ":80");
%connection.schedule(5000, "disconnect");
//
schedule(1000 * 60 * 60, 0, "downloadChallenges");
}
function downloadChallenges_Manual() {
if(!IsServerMain()) {
error("* Daily Challenges: Restricted To Core Servers Only");
return;
}
echo("* Downloading Challenge List, scheduling next download");
messageAll('MsgAdminForce', "\c3TWM2: Downloading challenges from PGD server.");
%connection = new TCPObject(ChallengeDownload);
%location = "/public/Univ/twm2/";
%host = $PGDServer;
//
%request = "GET" SPC %location SPC "HTTP/1.1\x0aHost: "@%host@"\r\n\r\n";
%connection.request = %request;
$ChallengeIndex = 0;
%connection.connect(%host @ ":80");
%connection.schedule(5000, "disconnect");
}
function ChallengeDownload::onConnected(%this) {
%this.send(%this.request);
}
function ChallengeDownload::onConnectFailed( %this ) {
error("Challenges: Connection failed");
}
function ChallengeDownload::onDisconnect(%this) {
$Challenge::PerformingTimeUpdateCall = 0;
%this.delete();
}
function ChallengeDownload::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.
}
//
if (strstr(%line, "#TIME ") != -1) {
//expire date line
%line = strReplace(%line, "#TIME ", "");
echo("* Time Line: "@getWord(%line, 0));
$TomorrowDate = getWord(%line, 0);
return;
}
else if (strstr(%line, "#CHLG ") != -1) {
//add the line
%line = strReplace(%line, "#CHLG ", "");
echo("* Add To Challenge Line: "@%line@"");
AddToChallenges(%line);
return;
}
else {
}
//
if (%line $= "#EOF") {
echo("*EOF Line, Disconnecting");
%this.disconnect();
return;
}
}
//////////////////////////////////////////////////
function doChallengeKillRecording(%sourceObject, %targetObject) {
if(%sourceObject $= "" || %targetObject $= "") {
return;
}
if(%sourceObject.team == %targetObject.team) {
//Teamkill = no recorded challenge :)
return;
}
//killed a player?
if(isClientControlledPlayer(%targetObject)) {
//echo("Kill: "@%sourceObject.client@"/"@%targetObject.lastDamagedImage@"");
recordAction(%sourceObject.client, "PKC", "single\t"@%targetObject.lastDamagedImage@"\t1");
recordAction(%sourceObject.client, "PKC", "total\t1");
}
else {
//killed a zombie
%zType = %targetObject.type;
if(!isSet(%zType)) {
//illegal target for challenge set, end here
return;
}
recordAction(%sourceObject.client, "ZKC", "total\t1");
recordAction(%sourceObject.client, "ZKC", "single\t"@%zType@"\t1");
recordAction(%sourceObject.client, "ZKC", "single\t"@%targetObject.lastDamagedImage@"\t"@%zType@"\t1");
}
}
function recordAction(%client, %action, %variables) {
if(!%client || %client $= "") {
return;
}
%ymd = formattimestring("yymmdd");
%so = %client.TWM2Controller;
checkDateOnChallenge(%client);
//echo(""@%client@" - "@%action@" - "@%variables@"");
//
switch$(%action) {
case "CCMP":
%so.completed[getField(%variables, 0), %ymd] = getField(%variables, 1);
case "BOSS":
%so.bossSlayCount[getField(%variables, 0), %ymd] += 1;
case "PKC":
//player kill count
if(getField(%variables, 0) $= "total") {
%so.totalPlayerKillCount[%ymd] += getField(%variables, 1);
}
else {
%so.PlayerKillCount[%ymd, getField(%variables, 1)] += getField(%variables, 2);
}
case "ZKC":
if(getField(%variables, 0) $= "total") {
%so.totalZombieKillCount[%ymd] += getField(%variables, 1);
}
else {
//a 3-case would have all of these filed
if(!isSet(getField(%variables, 3))) {
%so.ZombieKillCount[%ymd, 0, getField(%variables, 1)] += getField(%variables, 2);
}
else {
%so.ZombieKillCount[%ymd, getField(%variables, 1), getField(%variables, 2)] += getField(%variables, 3);
}
}
case "HSC":
if(getField(%variables, 0) !$= "zombie") {
%so.playerHeadshots[%ymd] += getField(%variables, 1);
}
else {
%so.zombieHeadshots[%ymd] += getField(%variables, 1);
}
case "KSCC":
%so.killstreakCalls[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "KSKC":
%so.killstreakKills[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "SKC":
%so.successiveSolo[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "SKSC":
%so.successiveStreak[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "BOMBARM":
%so.bombArm[%ymd, $CurrentMission] += 1;
%so.bombArmTotal[%ymd] += 1;
case "BOMBDIS":
%so.bombDisarm[%ymd, $CurrentMission] += 1;
%so.bombDisarmTotal[%ymd] += 1;
case "SABWIN":
%so.sabotageRoundWins[%ymd, $CurrentMission] += 1;
%so.sabotageRoundWinTotal[%ymd] += 1;
case "AREACAP":
%so.areaCapture[%ymd, $CurrentMission] += 1;
%so.areaCaptureTotal[%ymd] += 1;
case "HORDEWAVE":
%so.totalHordeWavesCompleted[%ymd] += 1;
%cWave = getField(%variables, 0);
if(%cWave > %so.highestHordeWave[%ymd]) {
%so.highestHordeWave[%ymd] = %cWave;
}
case "DOMWIN":
%so.dominationRoundWins[%ymd, $CurrentMission] += 1;
%so.dominationRoundWinTotal[%ymd] += 1;
case "EXPGAIN":
%so.dailyEXPGain[%ymd] += getField(%variables, 0);
case "BACK":
if(getField(%variables, 0) $= "zombie") {
%so.zombieBackstabs[%ymd] += 1;
}
else {
%so.playerBackstabs[%ymd] += 1;
}
default:
//no action recorded
}
allCheckCompletion(%client);
}
function cleanChallenges() {
%i = 1;
while(isSet($Challenges::Challenge[%i])) {
$Challenges::Challenge[%i] = "";
%i++;
}
}
function AddToChallenges(%line) {
//data prints like so:
//Type \t Name \t Descrip \t Condition \t Reward \t Expry
//%cType = getField(%line, 0);
//%cName = getField(%line, 1);
//%cDesc = getField(%line, 2);
//%cCond = getField(%line, 3);
//%CRewd = getField(%line, 4);
//%CExpy = getField(%line, 5);
//
$ChallengeIndex++;
$Challenges::Challenge[$ChallengeIndex] = %line;
}
function allCheckCompletion(%client) {
for(%i = 1; isSet($Challenges::Challenge[%i]); %i++) {
checkCompletion(%client, %i);
}
}
function checkCompletion(%client, %cID) {
if(!%client || %client $= "") {
return;
}
%challenge = $Challenges::Challenge[%cID];
%cType = trim(getField(%challenge, 0));
%cCond = getsubstr(getField(%challenge, 3), 1, strlen(getField(%challenge, 3)));
%so = %client.TWM2Controller;
%dateStr = formattimestring("yymmdd");
//cannot complete the same one twice :P
if(%so.completed[%cid, %dateStr]) {
return;
}
//
switch$(getWord(%cCond, 0)) {
case "E":
%killCount = getWord(%cCond, 1);
%killDB = getWord(%cCond, 2) $= "A" ? 0 : getWord(%cCond, 2);
if(%killDB != 0) {
if(%so.PlayerKillCount[%dateStr, %killDB] >= %killCount) {
%done = true;
}
}
else {
if(%so.totalPlayerKillCount[%dateStr] >= %killCount) {
%done = true;
}
}
case "Z":
%killCount = getWord(%cCond, 1);
%killedType = getWord(%cCond, 2) $= "A" ? -1 : getWord(%cCond, 2);
%killDB = getWord(%cCond, 3) $= "A" ? 0 : getWord(%cCond, 3);
if(%killDB != 0) {
if(%killedType != -1) {
if(%so.ZombieKillCount[%dateStr, %killDB, %killedType] >= %killCount) {
%done = true;
}
}
else {
if(%so.ZombieKillCount[%dateStr, %killDB, ""] >= %killCount) {
%done = true;
}
}
}
else {
if(%killedType != -1) {
if(%so.ZombieKillCount[%dateStr, 0, %killedType] >= %killCount) {
%done = true;
}
}
else {
if(%so.totalZombieKillCount[%dateStr] >= %killCount) {
%done = true;
}
}
}
case "HS":
%counter = getWord(%cCond, 1);
%type = getWord(%cCond, 2) $= "E" ? "E" : "Z";
if(%type $= "E") {
if(%so.playerHeadshots[%dateStr] >= %counter) {
%done = true;
}
}
else {
if(%so.zombieHeadshots[%dateStr] >= %counter) {
%done = true;
}
}
case "KS":
%type = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.killstreakCalls[%dateStr, %type] >= %amount) {
%done = true;
}
case "KSK":
%type = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.killstreakKills[%dateStr, %type] >= %amount) {
%done = true;
}
case "SK":
%soloType = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.successiveSolo[%dateStr, %soloType] >= %ammount) {
%done = true;
}
case "SKS":
%streakType = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.successiveStreak[%dateStr, %streakType] >= %ammount) {
%done = true;
}
case "Horde":
%waveNum = getWord(%cCond, 1);
if(%so.highestHordeWave[%dateStr] >= %waveNum) {
%done = true;
}
case "HordeWaves":
%amount = getWord(%cCond, 1);
if(%so.totalHordeWavesCompleted[%dateStr] >= %amount) {
%done = true;
}
case "Prestige":
%level = getWord(%cCond, 1);
if(%client.TWM2Core.officer >= %level) {
%done = true;
}
case "Boss":
%name = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.bossSlayCount[%name, %dateStr] >= %amount) {
%done = true;
}
case "Back":
%zOrA = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%zOrA $= "Z") {
if(%so.zombieBackstabs[%dateStr] >= %amount) {
%done = true;
}
}
else {
if(%so.playerBackstabs[%dateStr] >= %amount) {
%done = true;
}
}
default:
error("Unknown challenge in parser...");
}
if(%done) {
%cName = getField(%challenge, 1);
%CRewd = getField(%challenge, 4);
CenterPrint(%client, "CHALLENGE COMPLETED\n"@%cName@"", 3, 3);
GainExperience(%client, %cRewd, %cName@" Challenge Completed");
recordAction(%client, "CCMP", ""@%cid@"\t1");
}
}
function checkDateOnChallenge(%client) {
if(!%client || %client $= "") {
return;
}
%cDATE = formattimestring("yymmdd");
%so = NameToID("Container_"@%client.guid@"/CCD_"@%client.guid);
if(%so.expireDate == %cDATE) {
//Midnight?
if(!$Challenge::PerformingTimeUpdateCall) {
echo("Challenge expiration date matches current, check for midnight update, manually expiring challenge data.");
downloadChallenges_Manual();
$Challenge::PerformingTimeUpdateCall = 1;
//Manually expire the challenge data.
%so.expireDate = 0;
schedule(5000, 0, "checkDateOnChallenge", %client);
}
return;
}
if(%so.expireDate <= 0 || %so.expireDate < %cDATE) {
echo("Client daily challenge container is expired, cleaning..");
if(isObject(%so)) {
%so.delete();
}
%client.TWM2Controller = new ScriptObject("CCD_"@%client.guid@"") {};
%client.container.add(%client.TWM2Controller);
if(!isSet($TomorrowDate)) {
%setTo = %cDATE + 1;
}
else {
%setTo = $TomorrowDate;
}
%client.TWM2Controller.expireDate = %setTo;
SaveClientFile(%client); //give em a save
}
}
function loadChallengeData(%client) {
//Daily Challenges = Core Servers Only
if(!IsServerMain()) {
error("* Daily Challenges: Restricted To Core Servers Only");
return;
}
//
%cDATE = formattimestring("yymmdd");
echo("Updating daily challenge data for "@%client);
%so = NameToID("Container_"@%client.guid@"/CCD_"@%client.guid);
if(!isObject(%so)) {
%name = "CCD_"@%client.guid@"";
%client.TWM2Controller = new ScriptObject(%name) {};
%client.container.add(%client.TWM2Controller);
}
else {
if(%so.expireDate <= 0 || %so.expireDate < %cDATE) {
echo("Expired daily challenge data located for "@%client@", performing clean");
if(isObject(%so)) {
%so.delete();
}
%client.TWM2Controller = new ScriptObject("CCD_"@%client.guid@"") {};
%client.container.add(%client.TWM2Controller);
//
if(!isSet($TomorrowDate)) {
%setTo = %cDATE + 1;
}
else {
%setTo = $TomorrowDate;
}
%client.TWM2Controller.expireDate = %setTo;
SaveClientFile(%client); //give em a save
}
else {
%client.TWM2Controller = %so;
}
}
}
function GenerateDWMChallengeMenu(%client, %tag, %index) {
%dateStr = formattimestring("yymmdd");
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Green Indicates A Completed Challenge");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Uncolored Indicates An Active Challenge");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "PGD Daily Challenge News:");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "6/29/17: PGD Challenges reacitvated, now running 5x daily");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "4/20/16: New Daily Challenge System is Live!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "==========================");
%index++;
for(%i = 1; isSet($Challenges::Challenge[%i]); %i++) {
%challenge = $Challenges::Challenge[%i];
%cType = getField(%challenge, 0);
%cName = getField(%challenge, 1);
%cDesc = getField(%challenge, 2);
%CRewd = getField(%challenge, 4);
//
if(%cType == 1) {
if(%client.TWM2Controller.completed[%i, %dateStr]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>*DAILY* "@%cName@" - Completed");
%index+=2;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "=*DAILY* "@%cName@" - "@%cDesc@" *"@%CRewd@"EXP");
%index+=2;
}
}
}
return %index;
}
//Challenge List Conditions Generic
//E - Player Kills
// # Players
// Killed With Gun Datablock or A any gun
//Z - Zombie Kills
// # Zombies
// # Type or A any
// Killed With Gun Datablock or A any gun
//HS - Headshots
// # Headshots
// E Players or Z Zombies
//KS - Killstreak Usage
// # Killstreak ID
// # Ammount Used
//KSK - Killstreak Kills
// # Killstreak ID
// # Kills
//SK - Successive Solo Kills * like double kill, tripple kill, ect.
// # Kills in a row
// # Times
//SKS - Successive Kill Streaks
// # Kills in a row
// # Times
//SPECIAL CASES
//Prestige - Prestige
// # Prestige Promote To
//Back - Backstab
// E Player or Z Zombie
// # of backstabs

View file

@ -7,9 +7,7 @@ function TWM2Lib_MainControl(%functionName, %arguments) {
case "clientconnectionfunction":
%client = %arguments;
$XPArray[%client] = 0;
%client.CheckPGDConnect(); // <-- Used for Universal features
TWM2Lib_PGDConnect_Support("performFileCheck", "Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave");
schedule(5000, 0, "LoadUniversalRank", %client);
schedule(100, 0, LoadClientRankFile, %client);
setDefaultInventory(%client);
TWM2Lib_MainControl("CheckGUID", %client);
@ -28,7 +26,6 @@ function TWM2Lib_MainControl(%functionName, %arguments) {
case "clientdropfunction_preclientkill":
%client = %arguments;
SaveClientFile(%client);
PrepareUpload(%client); //universally upload it (if we can)
LogConnection(%client, 4);
MessageAll('MsgAllPlayers', "\c4"@$ChatBot::Name@": Removing Orphaned Deployables in "@MFloor($TWM2::RemoveOrphansTime / 60)@" Minutes");
schedule(1000, 0, "TWM2Lib_MainControl", "RemoveOrphansLoop", 1);

View file

@ -1,60 +0,0 @@
function DownloadNewsPage() {
$TWM::Ticks = 0;
%server = "www.forums.phantomdev.net:80"; //
if (!isObject(PageGrabber))
%Downloader = new HTTPObject(PageGrabber){};
else %Downloader = PageGrabber;
%filename = "/viewtopic.php?f=11&t=416"; //File Location
%Downloader.get(%server, %filename);
}
function PageGrabber::onLine(%this, %line) {
%line = StrReplace(%line, "<br />", "");
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();
}

View file

@ -176,44 +176,6 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return;
case "PGDConn1":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "PGD Connect" );
if($TWM2::PGDConnectDisabled) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "PGD Connect is disabled on this server.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "Set email with: /setEmail");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Current Email: "@%client.emailSet);
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPGDConn2\t1>Connect Account</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return;
case "PGDConn2":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "PGD Connect" );
if($TWM2::PGDConnectDisabled) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "PGD Connect is disabled on this server.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "Connecting... please wait for response");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
PGDConnect_FromInGame(%client);
return;
case "TWM":
%client.SCMPage = "SM";
@ -531,15 +493,6 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
%index++;
case 2:
if(fetchCap("Officer", %next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "Although you will restart at the level 1, you gain");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "the "@trim($Prestige::Name[%scriptController.officer + 1])@" title with your rank.");
@ -563,16 +516,7 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t3>Yes</a>');
%index++;
case 3:
if(fetchCap("Officer", %next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
case 3:
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:FF0000>WARNING</color> This action CANNOT be undone!!!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "This is your last chance to turn back");
@ -582,16 +526,7 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t4>Shut Up And Promote Me Now!</a>');
%index++;
case 4:
if(fetchCap("Officer", %next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
case 4:
PromoteToPrestige(%client);
messageClient( %client, 'SetLineHud', "", %tag, %index, "Congratulations, you have promoted to a new officer rank!!!");
%index++;
@ -635,14 +570,6 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tUpdateSettings\t1>Save Game Settings</a>');
%index++;
if(!%client.IsPGDConnected()) {
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPGDConn1\t1>PGD Connect - In Game</a>');
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, 'PGD Connect Status: <color:33FF00>Connected');
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
@ -947,26 +874,6 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
%index++;
return;
case "BL15":
messageClient( %client, 'SetScoreHudSubheader', "", "The Blacklist 15" );
%client.SCMPage = "SM";
messageClient( %client, 'SetLineHud', "", %tag, %index, "Top 15 Ranks");
%index++;
for(%i = 1; %i < 16; %i++) {
if(%client.namebase $= $Rank::Top[%i]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>"@%i@". "@$Rank::Top[%i]@" - "@$Rank::TopRank[%i]@" - "@$Rank::TopXP[%i]@"XP");
%index++;
//CompleteNWChallenge(%client, "Acceptance");
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, ""@%i@". "@$Rank::Top[%i]@" - "@$Rank::TopRank[%i]@" - "@$Rank::TopXP[%i]@"XP");
%index++;
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return;
case "PC":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Piece Count" );
@ -1047,66 +954,66 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
}
//Skin & bot set
function SetSkin(%client,%newskin) {
if (!IsObject(%client))
return "Invalid client!";
function SetSkin(%client, %newskin) {
if (!IsObject(%client))
return "Invalid client!";
FreeClientTarget(%client);
%client.skin = addtaggedstring(%newskin);
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', %client.team, 0, %client.voicePitch);
FreeClientTarget(%client);
%client.skin = addtaggedstring(%newskin);
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', %client.team, 0, %client.voicePitch);
if (IsObject(%client.player))
%client.player.setTarget(%client.target);
if (IsObject(%client.player))
%client.player.setTarget(%client.target);
return %client SPC %newskin;
return %client SPC %newskin;
}
function customizebot(%bot,%race,%sex,%name,%skin,%voicetag,%pitch)
{
%bot.race = %race;
%bot.sex = %sex;
%bot.voice = addtaggedstring(%voicetag);
freeclienttarget(%bot);
%bot.target = allocClientTarget(%bot, %bot.name, %bot.skin, %bot.voiceTag, '_ClientConnection', 0, 0, %bot.voicePitch);
function customizebot(%bot, %race, %sex, %name, %skin, %voicetag, %pitch) {
%bot.race = %race;
%bot.sex = %sex;
%bot.voice = addtaggedstring(%voicetag);
freeclienttarget(%bot);
%bot.target = allocClientTarget(%bot, %bot.name, %bot.skin, %bot.voiceTag, '_ClientConnection', 0, 0, %bot.voicePitch);
}
//End
function closeScoreHudFSERV(%client) {
serverCmdHideHud(%client, 'scoreScreen');
//ResetQuiz(%client, $TagToUseForScoreMenu, "ALL", 1);
commandToClient(%client, 'setHudMode', 'Standard', "", 0);
%client.SCMPage = 1;
%client.notFirstUse = 1;
serverCmdHideHud(%client, 'scoreScreen');
//ResetQuiz(%client, $TagToUseForScoreMenu, "ALL", 1);
commandToClient(%client, 'setHudMode', 'Standard', "", 0);
%client.SCMPage = 1;
%client.notFirstUse = 1;
}
function scoreCmdMainMenu(%game,%client,%tag,%page) {
messageClient( %client, 'ClearHud', "", %tag, 1 );
if (!isobject(cmdobject)) generateCMDObj();
messageClient( %client, 'SetScoreHudSubheader', "", "Main Menu Page " @ %page);
if (%page > 1) {
%pgToGo = %page - 1;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t%1>Previous Page</a>',%pgToGo);
%index++;
}
%cmdsToDisp = 15 * %page;
%start = (%page - 1) * 15;
for (%i=%start; %i < %cmdsToDisp;%i++) {
%line = CmdObject.cmd[%i];
if (%line !$= "") {
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\t%1>%2</a>',getword(%line,0),getwords(%line,1));
%index++;
}
}
if (%cmdsToDisp < (CmdObject.commands + 1)) {
%pgToGo = %page + 1;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t%1>Next Page</a>',%pgToGo);
%index++;
}
if (%page > 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>First Page</a>");
%index++;
}
messageClient( %client, 'ClearHud', "", %tag, %index );
messageClient( %client, 'ClearHud', "", %tag, 1 );
if (!isobject(cmdobject))
generateCMDObj();
messageClient( %client, 'SetScoreHudSubheader', "", "Main Menu Page " @ %page);
if (%page > 1) {
%pgToGo = %page - 1;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t%1>Previous Page</a>',%pgToGo);
%index++;
}
%cmdsToDisp = 15 * %page;
%start = (%page - 1) * 15;
for (%i = %start; %i < %cmdsToDisp; %i++) {
%line = CmdObject.cmd[%i];
if (%line !$= "") {
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\t%1>%2</a>',getword(%line,0),getwords(%line,1));
%index++;
}
}
if (%cmdsToDisp < (CmdObject.commands + 1)) {
%pgToGo = %page + 1;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t%1>Next Page</a>',%pgToGo);
%index++;
}
if (%page > 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>First Page</a>");
%index++;
}
messageClient( %client, 'ClearHud', "", %tag, %index );
}
@ -1116,20 +1023,22 @@ messageClient( %client, 'ClearHud', "", %tag, %index );
//after noobs get their hands on the base script first
function GenerateCMDObj() {
new fileobject("fIn");
fIn.openforread("scripts/TWM2/cmddisplaylist.txt");
if (isobject(cmdobject)) cmdobject.delete();
new scriptObject("CmdObject") {commands=0;};
while (!fIn.iseof()) {
%line = fIn.readline();
if (getword(%line,0) $= "CMD") {
CmdObject.cmd[CmdObject.commands] = getwords(%line,1);
CmdObject.commands++;
}
}
fIn.close();
fIn.delete();
new fileobject("fIn");
fIn.openforread("scripts/TWM2/cmddisplaylist.txt");
if (isobject(cmdobject))
cmdobject.delete();
new scriptObject("CmdObject") {
commands=0;
};
while (!fIn.iseof()) {
%line = fIn.readline();
if (getword(%line,0) $= "CMD") {
CmdObject.cmd[CmdObject.commands] = getwords(%line,1);
CmdObject.commands++;
}
}
fIn.close();
fIn.delete();
}
// CONTENT SAVING
@ -1146,115 +1055,37 @@ function CheckSlotStatus(%cl,%slot) {
//Checks to see if the file CAN, or Should be loaded
function RunLoadCheck(%cl, %slot, %PC) {
if(%cl.cantLoad || $SaveFile::PieceCT[%client.guid,%slot] > %PC) {
%str = "<color:FF0000><a:gamelink\tLoad\t"@%slot@">Load</a>"; //Return the Red Link
return %str;
%str = "<color:FF0000><a:gamelink\tLoad\t"@%slot@">Load</a>"; //Return the Red Link
return %str;
}
else {
%str = "<color:33FF00><a:gamelink\tLoad\t"@%slot@">Load</a>"; //Return the Green Link
return %str;
%str = "<color:33FF00><a:gamelink\tLoad\t"@%slot@">Load</a>"; //Return the Green Link
return %str;
}
}
function RunSaveCheck(%cl, %slot) {
if(%cl.cantSave) {
%str = "<color:FF0000><a:gamelink\tSaveWarn\t"@%slot@">Save</a>"; //Return the Red Link
return %str;
%str = "<color:FF0000><a:gamelink\tSaveWarn\t"@%slot@">Save</a>"; //Return the Red Link
return %str;
}
else if($SaveFile::Save[%cl.guid,%slot] $= "" && !%cl.cantSave && $Phantom::CSSEnabled) {
%str = "<color:33FF00><a:gamelink\tSaveWarn\t"@%slot@">Save</a>"; //Return the Green Link
return %str;
%str = "<color:33FF00><a:gamelink\tSaveWarn\t"@%slot@">Save</a>"; //Return the Green Link
return %str;
}
else {
%str = "<color:FFFF66><a:gamelink\tSaveWarn\t"@%slot@">Save</a>"; //Return the Yellow Link
return %str;
%str = "<color:FFFF66><a:gamelink\tSaveWarn\t"@%slot@">Save</a>"; //Return the Yellow Link
return %str;
}
}
function RunDeleteCheck(%cl, %slot) {
if($SaveFile::Save[%cl.guid,%slot] $= "") {
%str = "<color:FF0000><a:gamelink\tDeleteWarn\t"@%slot@">Delete</a>"; //Return the Red Link
return %str;
%str = "<color:FF0000><a:gamelink\tDeleteWarn\t"@%slot@">Delete</a>"; //Return the Red Link
return %str;
}
else {
%str = "<color:FFFF66><a:gamelink\tDeleteWarn\t"@%slot@">Delete</a>"; //Return the Yellow Link
return %str;
%str = "<color:FFFF66><a:gamelink\tDeleteWarn\t"@%slot@">Delete</a>"; //Return the Yellow Link
return %str;
}
}
//------------------------------------
function PGDConnect_FromInGame(%client) {
if($TWM2::PGDConnectDisabled) {
echo("PGD Connect is disabled.");
return;
}
%guid = %client.guid;
%email = %client.emailSet;
if(!isSet(%email)) {
MessageClient(%client, 'msgClient', "\c3SERVER: Must set an email address");
return;
}
//======
$PGD::IsPGDConnected[%guid] = 0; //some funky setting always brings this to 1 before reg. happens
%tcp = new TCPObject(TCPIGCObject);
%tcp.client = %client;
%tcp.guid = %client.guid;
%tcp.email = %client.emailSet;
%tcp.connect("www.phantomdev.net:80");
%tcp.timeout = %tcp.schedule(10000, disconnect);
}
function TCPIGCObject::onConnected(%this) {
%sep = getRandomSeparator(16);
%loc = "/public/Univ/submit.php";
%header1 = "POST" SPC %loc SPC "HTTP/1.1\r\n";
%host = "Host: www.phantomdev.net\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@"";
%emailReq = "--"@%sep@"\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\n"@%this.email@"";
%payload = %guidReq@"\r\n"@%emailReq@"\r\n--"@%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 Connection Data...");
if($debugmode == 1) {
echo(%query);
}
%this.send(%query);
}
function TCPIGCObject::onLine(%this, %line) {
echo(%line);
if(strstr(%line, "Data added to PGD Connect") != -1) {
MessageClient(%this.client, 'msgClient', "\c3SERVER: Data registered to PGD Connect...");
%this.disconnect();
$PGD::IsPGDConnected[%this.guid] = 1;
}
else if(strstr(%line, "This account is already registered") != -1) {
MessageClient(%this.client, 'msgClient', "\c3SERVER: You have already registered to PGD connect.");
%this.disconnect();
$PGD::IsPGDConnected[%this.guid] = 1;
}
else {
}
}
function TCPIGCObject::onDisconnect(%this) {
closeScoreHudFSERV(%this.client);
%this.delete();
}
}

View file

@ -25,6 +25,7 @@ datablock PlayerData(DemonZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Fire] = 0.001;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -25,6 +25,7 @@ datablock PlayerData(DemonMotherZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Burn] = 0.001;
damageScale[$DamageType::Fire] = 0.001;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -29,6 +29,7 @@ datablock PlayerData(DemonUltraZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -22,6 +22,7 @@ datablock PlayerData(EliteDemonZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Napalm] = 0.1;
damageScale[$DamageType::Plasma] = 0.1;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -42,6 +42,7 @@ datablock PlayerData(LordZombieArmor) : HeavyMaleBiodermArmor {
damageScale[$DamageType::SA2400] = 5.0;
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -31,6 +31,7 @@ datablock PlayerData(ZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -27,6 +27,7 @@ datablock PlayerData(RapierZombieArmor) : LightMaleBiodermArmor {
damageScale[$DamageType::Missile] = 100.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -12,6 +12,7 @@ datablock PlayerData(RavagerZombieArmor) : LightMaleBiodermArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -31,6 +31,7 @@ datablock PlayerData(ShifterZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -10,6 +10,7 @@ datablock PlayerData(SSZombieArmor) : LightMaleBiodermArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -45,6 +45,7 @@ datablock PlayerData(SniperZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -31,7 +31,8 @@ datablock PlayerData(SummonerZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;
max[Grenade] = 0;

View file

@ -10,6 +10,7 @@ datablock PlayerData(VolatileRavagerZombieArmor) : LightMaleBiodermArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -23,6 +23,7 @@ datablock PlayerData(WraithZombieArmor) : LightMaleHumanArmor {
damageScale[$DamageType::Model1887] = 4.0;
damageScale[$DamageType::CrimsonHawk] = 1.9;
damageScale[$DamageType::AcidCannon] = 3.0;
damageScale[$DamageType::deserteagle] = 2.5;
max[RepairKit] = 0;
max[Mine] = 0;

View file

@ -4,7 +4,6 @@ CMD PersControl Settings
CMD Missions Operations
CMD PC Piece Count
CMD ContSave Content Saving System
CMD BL15 Blacklist 15
CMD Challenge Challenges
CMD Ranks Player Info Listings
CMD TWM TWM Mod Website

View file

@ -60,16 +60,9 @@ package loadmodinfo
messageClient( %client, 'MsgGameOver', "");
messageClient( %client, 'MsgClearDebrief', "" );
if($ServerType $= "") {
%STO = "Checking PGD...";
}
else {
%STO = $ServerType;
}
messageClient(%client, 'MsgDebriefResult', "", "<Font:Arial Bold:18><Just:CENTER>"@$Host::GameName);
messageClient(%client, 'MsgDebriefResult', "", "<Font:Arial Bold:14><Just:CENTER>Total Warfare Mod 2 : Advanced Warfare");
messageClient(%client, 'MsgDebriefResult', "", "<Font:Arial Bold:14><Just:CENTER>Server Type: "@%STO@"");
messageClient(%client, 'MsgDebriefResult', "", "<Font:Arial Bold:14><Just:CENTER>Mod Version: "@$TWM2::ModVersionString);
%Credits = "\n<Font:Arial:16>Version v"@$TWM2::ModVersionString@"" @
"\n<Font:Arial:14>TWM 2 Creator (Lead Developer): Phantom139"@
@ -79,7 +72,7 @@ package loadmodinfo
// this callback adds content to the bulk of the gui
messageClient(%client, 'MsgDebriefAddLine', "", %Credits);
%Site = "\n<Font:Arial:16>Site: Http://www.phantomdev.net\n";
%Site = "\n<Font:Arial:16>Site: https://github.com/PhantomGamesDevelopment/TWM2\n";
// this callback adds content to the bulk of the gui
messageClient(%client, 'MsgDebriefAddLine', "", %Site);
@ -88,26 +81,6 @@ package loadmodinfo
"\n";
messageClient(%client, 'MsgDebriefAddLine', "", %Thanks);
if($Rank::Top[1] $= "") {
%TopRanks = "\n<Font:Arial:14>Top 5 Ranks:" @
"\nRanks Not Yet Discovered, run FindTopRanks(); in console";
messageClient(%client, 'MsgDebriefAddLine', "", %TopRanks);
}
else {
%TopRanks = "\n<Font:Arial:14>Top 5 Ranks" @
"\n<Font:Arial:12>First: "@$Rank::Top[1]@", "@$Rank::TopRank[1]@" ,"@$Rank::TopXP[1]@"XP"@
"\nSecond: "@$Rank::Top[2]@", "@$Rank::TopRank[2]@" ,"@$Rank::TopXP[2]@"XP"@
"\nThird: "@$Rank::Top[3]@", "@$Rank::TopRank[3]@" ,"@$Rank::TopXP[3]@"XP";
messageClient(%client, 'MsgDebriefAddLine', "", %TopRanks);
//It cuts off sometimes, so this prevents that from happening
%TopRanks2 = "<Font:Arial:12>Fourth: "@$Rank::Top[4]@", "@$Rank::TopRank[4]@" ,"@$Rank::TopXP[4]@"XP"@
"\nFifth: "@$Rank::Top[5]@", "@$Rank::TopRank[5]@" ,"@$Rank::TopXP[5]@"XP"@
"\n";
messageClient(%client, 'MsgDebriefAddLine', "", %TopRanks2);
}
%tip = GetTipMessage();
%tipMsg = "\n<Font:Arial:14>Heres a tip for you:" @
"\n<Font:Arial:12>"@%tip@"."@
@ -118,10 +91,6 @@ package loadmodinfo
"\n<Font:Arial:12>"@$Server::MOTD@"."@
"\n\n\n";
messageClient(%client, 'MsgDebriefAddLine', "", %MOTDMsg);
%PGDMsg = "\n<Font:Arial:14>Join the Phantom Games Development community for up to the minute news on TWM2 and our other projects! " @
"\n http://www.forums.phantomdev.net";
messageClient(%client, 'MsgDebriefAddLine', "", %PGDMsg);
%gettingStarted = "\n<Font:Arial:14>First time playing TWM2? Use the /help command for a list of chat commands and access the " @
"\n Command menu with your [F2] key to get started!";

View file

@ -91,7 +91,7 @@ datablock LinearFlareProjectileData(FlamethrowerBolt) {
projectileShapeName = "turret_muzzlepoint.dts";
scale = "1.0 1.0 1.0";
faceViewer = true;
directDamage = 0.02;
directDamage = 0.07;
hasDamageRadius = true;
indirectDamage = 0.02;
damageRadius = 4.0;

View file

@ -11,7 +11,7 @@ datablock AudioProfile(PistolFireSound) {
datablock TracerProjectileData(coltBullet) {
doDynamicClientHits = true;
directDamage = 0.15; // z0dd - ZOD, 9-27-02. Was 0.0825
directDamage = 0.15;
directDamageType = $DamageType::pistol;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;

View file

@ -8,7 +8,7 @@ datablock TracerProjectileData(DeagleBullet)
{
doDynamicClientHits = true;
directDamage = 0.3; //reduced .6
directDamage = 0.38;
directDamageType = $DamageType::deserteagle;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
@ -99,7 +99,7 @@ datablock ShapeBaseImageData(DeagleImage) {
projectile = DeagleBullet;
projectileType = tracerProjectile;
ProjectileSpread = 6.0 / 1000.0; //2.5 spread added
ProjectileSpread = 4.0 / 1000.0; //2.5 spread added
//ClipStuff
ClipName = "DesertEagleClip";

View file

@ -99,7 +99,7 @@ datablock ShapeBaseImageData(G41RifleImage) {
shellExitVariance = 15.0;
shellVelocity = 3.0;
projectileSpread = 2.0 / 1000.0;
projectileSpread = 3.0 / 1000.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
@ -128,7 +128,7 @@ datablock ShapeBaseImageData(G41RifleImage) {
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.15;
stateTimeoutValue[4] = 0.25;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";

View file

@ -121,7 +121,7 @@ datablock ShapeBaseImageData(PulseRifleImage) {
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.1;
stateTimeoutValue[4] = 0.2;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";

View file

@ -7,14 +7,14 @@ datablock AudioProfile(S3FireSound) {
datablock TracerProjectileData(S3Bullet) {
doDynamicClientHits = true;
directDamage = 0.5;
directDamage = 0.44;
directDamageType = $DamageType::S3;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
HeadMultiplier = 1.5;
HeadMultiplier = 1.7;
LegsMultiplier = 0.35;
HeadShotKill = 1;
HeadShotKill = 0;
kickBackStrength = 15.0;
sound = ChaingunProjectile;
@ -107,7 +107,7 @@ datablock ShapeBaseImageData(S3RifleImage) {
shellExitVariance = 15.0;
shellVelocity = 3.0;
projectileSpread = 2.5 / 1000.0;
projectileSpread = 5.0 / 1000.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";

View file

@ -1,14 +1,14 @@
datablock TracerProjectileData(S3SBullet) {
doDynamicClientHits = true;
directDamage = 0.45;
directDamage = 0.44;
directDamageType = $DamageType::S3;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
HeadMultiplier = 1.5;
HeadMultiplier = 1.7;
LegsMultiplier = 0.35;
HeadShotKill = 1;
HeadShotKill = 0;
kickBackStrength = 15.0;
sound = ChaingunProjectile;
@ -83,7 +83,7 @@ datablock ShapeBaseImageData(S3SRifleImage) {
shellExitVariance = 15.0;
shellVelocity = 3.0;
projectileSpread = 2.0 / 1000.0;
projectileSpread = 4.0 / 1000.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
@ -132,7 +132,7 @@ datablock ShapeBaseImageData(S3SRifleImage) {
stateName[6] = "Reload";
stateTransitionOnNoAmmo[6] = "NoAmmo";
stateTransitionOnTimeout[6] = "Ready";
stateTimeoutValue[6] = 0.9;
stateTimeoutValue[6] = 0.4;
stateAllowImageChange[6] = false;
stateSequence[6] = "Reload";