diff --git a/Classic/evoClassicTaco.vl2 b/Classic/evoClassicTaco.vl2 index 42e4243..37ed4be 100644 Binary files a/Classic/evoClassicTaco.vl2 and b/Classic/evoClassicTaco.vl2 differ diff --git a/Classic/scripts/autoexec/GetTeamCounts.cs b/Classic/scripts/autoexec/GetTeamCounts.cs index cdb3116..566d8c1 100644 --- a/Classic/scripts/autoexec/GetTeamCounts.cs +++ b/Classic/scripts/autoexec/GetTeamCounts.cs @@ -56,6 +56,9 @@ function GetTeamCounts( %game, %client, %respawn ) if( %client.team == 1 && %team1random == $PlayerCount[1] ) $team1canidate = %client; if( %client.team == 2 && %team2random == $PlayerCount[2] ) $team2canidate = %client; + //Check ver + CheckVerObserver(%client); + //if(!%client.isAIControlled()) $PlayerCount[%client.team]++; } @@ -81,6 +84,7 @@ function GetTeamCounts( %game, %client, %respawn ) //Start MapRepetitionChecker schedule(2000, 0, "MapRepetitionChecker", %game); + //Set so counter wont run when it doesnt need to. $GetCountsClientTeamChange = false; } diff --git a/Classic/scripts/autoexec/checkver.cs b/Classic/scripts/autoexec/checkver.cs deleted file mode 100644 index d7873f6..0000000 --- a/Classic/scripts/autoexec/checkver.cs +++ /dev/null @@ -1,77 +0,0 @@ -// TribesNext Minimum Version Enforcement -// Written by Thyth -// 2014-08-18 - -// Updated on 2014-08-31 after testing/feedback from Heat Killer. - -// This script prevents clients from joining a non-observer team if they are not running -// TribesNext RC2a or newer, with the tournamentNetClient.vl2 installed. An early form of -// anticheat was added to the RC2 patch that kills HM2. This script allows detecting of -// a new enough version by the interaction with the TribesNext community/browser system. -// Support for clan tags (and account renaming) was added along with the HM2 killer in RC2, -// but no client side code to talk to the browser server was in yet. Now that the browser -// system backend is complete, all clients can install the tournamentNetClient to the -// browser, and users running RC2 (with HM2 killer) can be detected. - -// The variable on the client object: -// %client.t2csri_sentComCertDone -// Will be 1 if they are running RC2+ with tournamentNetClient.vl2 - -// Admins can override this restriction when forcing players to join a team. - -function checkVer_showBanner(%client) -{ - // customize me - commandToClient(%client, 'CenterPrint', "Version Check Failed!\nYou need the latest TribesNext patch and TournyNetClient to play.\n Download it from T2Discord.tk and drop it into your GameData/Base folder.", 10, 3); -} - -package checkver -{ - function serverCmdClientJoinTeam(%client, %team) - { - if (!%client.t2csri_sentComCertDone) - { - checkVer_showBanner(%client); - return; - } - Parent::serverCmdClientJoinTeam(%client, %team); - } - function serverCmdClientJoinGame(%client) - { - if (!%client.t2csri_sentComCertDone) - { - checkVer_showBanner(%client); - return; - } - Parent::serverCmdClientJoinGame(%client); - } - function serverCmdClientPickedTeam(%client, %option) - { - if (!%client.t2csri_sentComCertDone) - { - checkVer_showBanner(%client); - return; - } - Parent::serverCmdClientPickedTeam(%client, %option); - } - function serverCmdClientTeamChange(%client, %option) - { - if (!%client.t2csri_sentComCertDone) - { - checkVer_showBanner(%client); - return; - } - Parent::serverCmdClientTeamChange(%client, %option); - } - function Observer::onTrigger(%data, %obj, %trigger, %state) - { - %client = %obj.getControllingClient(); - if (!%client.t2csri_sentComCertDone) - { - checkVer_showBanner(%client); - return; - } - Parent::onTrigger(%data, %obj, %trigger, %state); - } -}; -activatePackage(checkver); diff --git a/Classic/scripts/autoexec/zCheckVer.cs b/Classic/scripts/autoexec/zCheckVer.cs new file mode 100644 index 0000000..8a04d47 --- /dev/null +++ b/Classic/scripts/autoexec/zCheckVer.cs @@ -0,0 +1,129 @@ +// TribesNext Minimum Version Enforcement +// Written by Thyth +// 2014-08-18 + +// Updated on 2014-08-31 after testing/feedback from Heat Killer. + +// This script prevents clients from joining a non-observer team if they are not running +// TribesNext RC2a or newer, with the tournamentNetClient.vl2 installed. An early form of +// anticheat was added to the RC2 patch that kills HM2. This script allows detecting of +// a new enough version by the interaction with the TribesNext community/browser system. +// Support for clan tags (and account renaming) was added along with the HM2 killer in RC2, +// but no client side code to talk to the browser server was in yet. Now that the browser +// system backend is complete, all clients can install the tournamentNetClient to the +// browser, and users running RC2 (with HM2 killer) can be detected. + +// The variable on the client object: +// %client.t2csri_sentComCertDone +// Will be 1 if they are running RC2+ with tournamentNetClient.vl2 + +// Admins can override this restriction when forcing players to join a team. + + +//Added -ChocoTaco +//Toggle Touney Net Client +//$Host::EnableNetTourneyClient = 1; +$CheckVerObserverRunOnce = false; +$CheckVerObserverTrys = 0; + +//Added -ChocoTaco +//Run in GetCounts.cs +//Coming from other modes, checks all %clients and put them into observer with a Version check fail +function CheckVerObserver(%client) +{ + if($CurrentMissionType $= "CTF" && $Host::EnableNetTourneyClient && !$CheckVerObserverRunOnce) + { + if (!%client.t2csri_sentComCertDone) + { + messageClient(%client, 'MsgClientCheckObserver', '\c2Tribesnext version check has failed.'); + serverCmdClientMakeObserver( %client ); + } + + $CheckVerObserverTrys++; if($CheckVerObserverTrys $= $AllPlayerCount) $CheckVerObserverRunOnce = true; + //echo($CheckVerObserverTrys); + } +} + +//Added -ChocoTaco +//Once per map +//Run at DefaultGame::gameOver(%game) in defaultGame.ovl evo +function CheckVerObserverReset() +{ + $CheckVerObserverRunOnce = false; + $CheckVerObserverTrys = 0; +} + + +//Original +function checkVer_showBanner(%client) +{ + // customize me + commandToClient(%client, 'CenterPrint', "Version Check Failed!\nYou need the latest TribesNext patch and TourneyNetClient2 to play.\n Download it from t2discord.tk and drop it into your GameData/Base folder.", 10, 3); +} + +package checkver +{ + function serverCmdClientJoinTeam(%client, %team) + { + if($CurrentMissionType $= "CTF" && $Host::EnableNetTourneyClient) //Added -ChocoTaco + { + if (!%client.t2csri_sentComCertDone) + { + checkVer_showBanner(%client); + return; + } + } + Parent::serverCmdClientJoinTeam(%client, %team); + } + function serverCmdClientJoinGame(%client) + { + if($CurrentMissionType $= "CTF" && $Host::EnableNetTourneyClient) //Added -ChocoTaco + { + if (!%client.t2csri_sentComCertDone) + { + checkVer_showBanner(%client); + return; + } + } + Parent::serverCmdClientJoinGame(%client); + } + function serverCmdClientPickedTeam(%client, %option) + { + if($CurrentMissionType $= "CTF" && $Host::EnableNetTourneyClient) //Added -ChocoTaco + { + if (!%client.t2csri_sentComCertDone) + { + checkVer_showBanner(%client); + return; + } + } + Parent::serverCmdClientPickedTeam(%client, %option); + } + function serverCmdClientTeamChange(%client, %option) + { + if($CurrentMissionType $= "CTF" && $Host::EnableNetTourneyClient) //Added -ChocoTaco + { + if (!%client.t2csri_sentComCertDone) + { + checkVer_showBanner(%client); + return; + } + } + Parent::serverCmdClientTeamChange(%client, %option); + } + function Observer::onTrigger(%data, %obj, %trigger, %state) + { + if($CurrentMissionType $= "CTF" && $Host::EnableNetTourneyClient) //Added -ChocoTaco + { + %client = %obj.getControllingClient(); + if (!%client.t2csri_sentComCertDone) + { + checkVer_showBanner(%client); + return; + } + } + Parent::onTrigger(%data, %obj, %trigger, %state); + } +}; + +activatePackage(checkver); diff --git a/Classic/scripts/serverDefaults.cs b/Classic/scripts/serverDefaults.cs index 865e392..329e24e 100644 --- a/Classic/scripts/serverDefaults.cs +++ b/Classic/scripts/serverDefaults.cs @@ -201,7 +201,8 @@ $Host::loadingmsgline2 = "Server Github: "; //Loading screen msg line 2 $Host::loadingmsgline2content = "https://github.com/ChocoTaco1/TacoServer"; //Loading screen msg content 2 $Host::loadingmsgline3 = "Hosted by: "; //Loading screen msg line 3 $Host::loadingmsgline3content = "Branzone"; //Loading screen msg content 3 +$Host::EnableNetTourneyClient = 1; //Enable or Disable Tourney Net Client checking //LakRabbit $Host::EnableLakUnlimitedDJ = 1; //Unlimited disc-jumps if enabled $Host::LakRabbitNoSplashDamage = 0; //Splash Damage enabled or not -$Host::ShowFlagIcon = 1; //Show flag Icon in lak \ No newline at end of file +$Host::ShowFlagIcon = 1; //Show flag Icon in lak