From 4b9486d765995c5c5367b68e0a7f4e352403d054 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Sun, 10 Apr 2022 14:41:30 -0400 Subject: [PATCH 01/65] Changed to Date Format --- Classic/scripts/autoexec/z_dtStats.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Classic/scripts/autoexec/z_dtStats.cs b/Classic/scripts/autoexec/z_dtStats.cs index a5b03b9..3c5293e 100644 --- a/Classic/scripts/autoexec/z_dtStats.cs +++ b/Classic/scripts/autoexec/z_dtStats.cs @@ -1733,7 +1733,7 @@ package dtStats{ if($dtStats::Enable){ dtSaveServerVars(); dtScanForRepair(); - $mapID::gameID = addNum($mapID::gameID,1); + $mapID::gameID = formattimestring("mddyHHnnss"); if($dtStats::debugEchos) error("GAME ID" SPC $mapID::gameID SPC "//////////////////////////////"); } @@ -4010,13 +4010,13 @@ function dtStatsMissionDropReady(%game, %client){ // called when client has fini } function dtStatsClientLeaveGame(%client){ $dtServerVars::lastPlayerCount = $HostGamePlayerCount - $HostGameBotCount; - + if(isGameRun()){// if they dc during game over dont count it $dtServer::mapDisconnects[cleanMapName($CurrentMission),Game.class]++; if(%client.score != 0) $dtServer::mapDisconnectsScore[cleanMapName($CurrentMission),Game.class]++; } - + if(isObject(%client.dtStats)){ %client.dtStats.clientLeft = 1; %client.dtStats.leftTime = getSimTime(); @@ -12647,7 +12647,7 @@ function startMonitor(){ } } -function dtSaveServerVars(){ +function dtSaveServerVars(){ $dtServerVars::lastSimTime = getSimTime(); $dtServerVars::lastDate = formattimestring("mm/dd/yy hh:nn:a"); $dtServerVars::lastMission = cleanMapName($CurrentMission); @@ -12995,4 +12995,4 @@ function testVarsRandomAll(%max){ // Server crash messsage fix // // 9.3 -// Stat format change for flag cap times, they now start at 0 \ No newline at end of file +// Stat format change for flag cap times, they now start at 0 \ No newline at end of file From 25681fd39cb418e8decacac51727c6e1647bed81 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Mon, 11 Apr 2022 16:38:46 -0400 Subject: [PATCH 02/65] Integrated multipleMapRotation --- Classic/prefs/serverPrefs.cs | 2 ++ Classic/scripts/autoexec/multipleMapRotation.cs | 8 ++++---- Classic/scripts/serverDefaults.cs | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Classic/prefs/serverPrefs.cs b/Classic/prefs/serverPrefs.cs index 987858b..1967cdb 100644 --- a/Classic/prefs/serverPrefs.cs +++ b/Classic/prefs/serverPrefs.cs @@ -149,6 +149,8 @@ $Host::MaxPlayers = 30; $Host::MinBotDifficulty = 0; $Host::MinFlagRecordPlayerCount = 6; $Host::MissionType = "LakRabbit"; +$Host::MultipleMapRotation = 0; +$Host::MultipleMapRotationCount = 3; $Host::NoBaseRapeEnabled = 1; $Host::NoBaseRapePlayerCount = 14; $Host::NoSmurfs = 0; diff --git a/Classic/scripts/autoexec/multipleMapRotation.cs b/Classic/scripts/autoexec/multipleMapRotation.cs index 4014961..c35740f 100644 --- a/Classic/scripts/autoexec/multipleMapRotation.cs +++ b/Classic/scripts/autoexec/multipleMapRotation.cs @@ -1,11 +1,11 @@ //$Host::ClassicRotationFile = "prefs/mapRotation1.cs"; //Enable/Disable -$EnableMultipleMapRotation = 0; +//$Host::MultipleMapRotation = 0; //How any mapRotation Files //Naming scheme mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc -$mapRotationFilesCount = 3; +//$Host::MultipleMapRotationCount = 3; function multipleMapRotation() { @@ -15,7 +15,7 @@ function multipleMapRotation() if(%var) //If number exists proceed { - if(%var $= $mapRotationFilesCount) + if(%var $= $Host::MultipleMapRotationCount) %var = 1; else %var = %var + 1; @@ -34,5 +34,5 @@ function multipleMapRotationEcho() } //Run -if($EnableMultipleMapRotation) +if($Host::MultipleMapRotation) multipleMapRotation(); diff --git a/Classic/scripts/serverDefaults.cs b/Classic/scripts/serverDefaults.cs index c4a395f..dca31e9 100755 --- a/Classic/scripts/serverDefaults.cs +++ b/Classic/scripts/serverDefaults.cs @@ -212,6 +212,8 @@ $Host::LoadScreenShowLogo = 0; $Host::LoadScreenShowLogoName = "dpub/DPUB_logo"; //Logo location Filename $Host::MapChangeMSG = 0; //Center Print between mapchanges $Host::MapChangeMSGContent = "Pickup Night\nSaturday, March 5th\nJoin discord for details"; +$Host::MultipleMapRotation = 0; //Rotate thru multiple map rotation files 1,2,3, etc +$Host::MultipleMapRotationCount = 3; //How many multiple map rotation files (mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc) //LakRabbit $Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled From 3b9984ee105c481d684d88bf6528f1074d836d3b Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Mon, 11 Apr 2022 16:39:37 -0400 Subject: [PATCH 03/65] Changed: Due to lockedteams --- Classic/scripts/defaultGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/defaultGame.cs b/Classic/scripts/defaultGame.cs index 0a12959..af79a38 100755 --- a/Classic/scripts/defaultGame.cs +++ b/Classic/scripts/defaultGame.cs @@ -1802,7 +1802,7 @@ function DefaultGame::clientMissionDropReady(%game, %client) %damMess = "DISABLED"; if(%game.numTeams > 1) - BottomPrint(%client, "Server is Running in Tournament Mode.\nPick a Team\nTeam Damage is " @ %damMess, 0, 3 ); + BottomPrint(%client, "Server is Running in Tournament Mode.\nGood luck and Have Fun!\nTeam Damage is " @ %damMess, 0, 3 ); } else { From 3d876eb0def6805e73901d866afd82abd3de73c6 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Mon, 11 Apr 2022 16:41:27 -0400 Subject: [PATCH 04/65] Disable teampickPopUpBox LockedTeams --- Classic/scripts/autoexec/VoteMenu.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 7bf3357..6ecf4e4 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -1562,6 +1562,12 @@ function serverCmdClientTeamChange(%client, %option) Parent::serverCmdClientTeamChange(%client, %option); } +//No Pick Team PopUp Box when LockedTeams is enabled +function serverCmdPlayContentSet( %client ) +{ + //nothing +} + }; // VoteSound Script From 4d7cc2cc557ba4a9fa1e9be62a7ec47a6baf77b1 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Mon, 11 Apr 2022 17:22:00 -0400 Subject: [PATCH 05/65] Remote Unbanning --- Classic/scripts/autoexec/dtBanSystem.cs | 230 +++++++++++++++++++---- Classic/scripts/autoexec/zzDiscordBot.cs | 33 +++- 2 files changed, 220 insertions(+), 43 deletions(-) mode change 100755 => 100644 Classic/scripts/autoexec/dtBanSystem.cs diff --git a/Classic/scripts/autoexec/dtBanSystem.cs b/Classic/scripts/autoexec/dtBanSystem.cs old mode 100755 new mode 100644 index f899e39..c09c519 --- a/Classic/scripts/autoexec/dtBanSystem.cs +++ b/Classic/scripts/autoexec/dtBanSystem.cs @@ -11,12 +11,12 @@ //$dtBanList::GUID3555379 = "4\t2021\t18\t31\t518400"; //TO UNBAN SOMEONE WITHOUT RESTARTING THE SERVER -//unban(%guid,%ip); in console +//banList();in console +//unbanIndex(%index) %index is the number next to the players name from listBans(); //Example: unban(555555,"22.222.222.222"); put ip in quotes package dtBan { - function ClassicLoadBanlist() { $ClassicPermaBans = 0; @@ -30,21 +30,35 @@ function BanList::add(%guid, %ipAddress, %time){ if(%time > 999999){ %time = "BAN"; } + %name = getClientBanName(%guid, %ipAddress); if (%guid > 0){ - $dtBanList::GUID[%guid] = dtBanMark() TAB %time; + $dtBanList::GUID[%guid] = dtBanMark() TAB %time TAB %name; } if (getSubStr(%ipAddress, 0, 3) $= "IP:"){ - // add IP ban %bareIP = getSubStr(%ipAddress, 3, strLen(%ipAddress)); %bareIP = getSubStr(%bareIP, 0, strstr(%bareIP, ":")); %bareIP = strReplace(%bareIP, ".", "_"); // variable access bug workaround - - $dtBanList::IP[%bareIP] = dtBanMark() TAB %time; - //error("ban" SPC %bareIP SPC $dtBanList::IP[%bareIP]); + // add IP ban + $dtBanList::IP[%bareIP] = dtBanMark() TAB %time TAB %name; + } + %found = 0; + for (%i = 0; %i < $dtBanList::NameListCount; %i++){ + if(getField($dtBanList::NameList[%i], 0) $= %name){ + %found =1; + if(%guid > 0) + $dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 1, %guid); + if(getSubStr(%ipAddress, 0, 3) $= "IP:") + $dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 2, %bareIP); + break; + } + } + if(!%found){ + $dtBanList::NameListCount = ($dtBanList::NameListCount > 0) ? $dtBanList::NameListCount : 0; + $dtBanList::NameList[$dtBanList::NameListCount] = %name TAB %guid TAB %bareIP; + $dtBanList::NameListCount++; } - // write out the updated bans to the file - export("$dtBanList*", $Host::dtBanlist); + saveBanList(); } function banList_checkIP(%client){ @@ -56,14 +70,19 @@ function banList_checkIP(%client){ %time = $dtBanList::IP[%ip]; if(%time $= "BAN") return 1; - if (%time !$= "" && %time != 0){ + if (getFieldCount(%time) > 0){ %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); if (%delta < getField(%time,4)) return 1; else{ + for (%i = 0; %i < $dtBanList::NameListCount; %i++){ + if(getField($dtBanList::NameList[%i], 2) $= %ip){ + unbanIndex(%i); + break; + } + } $dtBanList::IP[%ip] = ""; - schedule(1000,0,"export","$dtBanList*", $Host::dtBanlist); - //export("$dtBanList*", "prefs/dtBanlist.cs"); + saveBanList(); } } return 0; @@ -73,14 +92,19 @@ function banList_checkGUID(%guid){ %time = $dtBanList::GUID[%guid]; if(%time $= "BAN") return 1; - if (%time !$= "" && %time != 0){ + if (getFieldCount(%time) > 0){ %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); if (%delta < getField(%time,4)) return 1; else{ - $dtBanList::GUID[%guid] = ""; - schedule(500,0,"export","$dtBanList*", $Host::dtBanlist); - //export("$dtBanList*", "prefs/dtBanlist.cs"); + for (%i = 0; %i < $dtBanList::NameListCount; %i++){ + if(getField($dtBanList::NameList[%i], 1) $= %guid){ + unbanIndex(%i); + break; + } + } + $dtBanList::GUID[%guid] = ""; + saveBanList(); } } return 0; @@ -88,31 +112,63 @@ function banList_checkGUID(%guid){ }; -if (!isActivePackage(dtBan)) +if (!isActivePackage(dtBan)){ activatePackage(dtBan); +} +function saveBanList(){ + if(!isEventPending($banEvent)) + $banEvent = schedule(1000,0,"export","$dtBanList*", $Host::dtBanlist); +} +function getClientBanName(%guid, %ip){ + %found = 0; + for (%i = 0; %i < ClientGroup.getCount(); %i++){ + %client = ClientGroup.getObject(%i); + if(%guid > 0 && %client.guid $= %guid){ + %found = 1; + break; + } + else if(%client.getAddress() $= %ip){ + %found = 1; + break; + } + } + if(%found){ + %authInfo = %client.getAuthInfo(); + %realName = getField( %authInfo, 0 ); + if(%realName !$= "") + %name = %realName; + else + %name = stripChars( detag( getTaggedString( %client.name ) ), "\cp\co\c6\c7\c8\c9\c0" ); + return trim(%name); + } + return 0; +} function getBanCount(%d, %year, %h, %n){ - %dif = formattimestring("yy") - %year; - %days += 365 * (%dif-1); - %days += 365 - %d; - %days += dtBanDay(); - %ht = %nt = 0; - if(formattimestring("H") > %h){ - %ht = formattimestring("H") - %h; + if(%d && %year && %h && %n){ + %dif = formattimestring("yy") - %year; + %days += 365 * (%dif-1); + %days += 365 - %d; + %days += dtBanDay(); + %ht = %nt = 0; + if(formattimestring("H") > %h){ + %ht = formattimestring("H") - %h; + } + else if(formattimestring("H") < %h){ + %ht = 24 - %h; + %ht = formattimestring("H")+ %ht; + } + if(formattimestring("n") > %n){ + %nt = formattimestring("n") - %n; + } + else if(formattimestring("n") < %n){ + %nt = 60 - %n; + %nt = formattimestring("n") + %nt; + } + return mfloor((%days * 1440) + (%ht*60) + %nt); } - else if(formattimestring("H") < %h){ - %ht = 24 - %h; - %ht = formattimestring("H")+ %ht; - } - if(formattimestring("n") > %n){ - %nt = formattimestring("n") - %n; - } - else if(formattimestring("n") < %n){ - %nt = 60 - %n; - %nt = formattimestring("n") + %nt; - } - return mfloor((%days * 1440) + (%ht*60) + %nt); + return 0; //return mfloor((%days * 1440) + (%ht*60) + %nt) TAB (%days * 1440) TAB (%ht*60) TAB %nt; } @@ -146,15 +202,109 @@ function dtBanMark(){ return %count + %d TAB formattimestring("yy") TAB formattimestring("H") TAB formattimestring("n"); } -function unban(%guid,%ip){ +function banList(){ + $dtBanList::NameListCount = ($dtBanList::NameListCount > 0) ? $dtBanList::NameListCount : 0; + if(!$dtBanList::NameListCount){ + error("No bans, see" SPC $Host::dtBanlist SPC "for older system entries"); + } + else{ + for (%i = 0; %i < $dtBanList::NameListCount; %i++){ + %fieldList = $dtBanList::NameList[%i]; + error("index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1) SPC "IP:" @ getField(%fieldList,2)); + } + if($dtBanList::NameListCount > 0){ + error("Use unbanIndex(%index); to unban user from the list "); + } + } +} + +function unbanIndex(%index){ + %fieldList = $dtBanList::NameList[%index]; + %name = getField(%fieldList, 0); + if(getFieldCount(%fieldList) > 1){ + for(%i = %index; %i < $dtBanList::NameListCount -1; %i++) { + $dtBanList::NameList[%i] =$dtBanList::NameList[%i+1]; + } + $dtBanList::NameList[%i] = ""; + $dtBanList::NameListCount--; + error("Name" SPC getField(%fieldList,0) SPC "UNBANNED"); + %guid = getField(%fieldList,1); + if($dtBanList::GUID[%guid] !$= ""){ + $dtBanList::GUID[%guid] = ""; + error("GUID" SPC %guid SPC "UNBANNED"); + } + %ip = getField(%fieldList,2); + if($dtBanList::IP[%ip] !$= ""){ + $dtBanList::IP[%ip] = ""; + error("IP" SPC %ip SPC "UNBANNED"); + } + } + else{ + for(%i = %index; %i < $dtBanList::NameListCount -1; %i++) { + $dtBanList::NameList[%i] =$dtBanList::NameList[%i+1]; + } + $dtBanList::NameList[%i] = ""; + $dtBanList::NameListCount--; + error("Error removing invalid index"); + } + saveBanList(); + return %name; +} + + +function banListClean(){ + %count = 0; + for(%i = 0; %i < $dtBanList::NameListCount; %i++) { + %ban = 1; + %banField = $dtBanList::NameList[%i]; + %guid = getField(%banField,1); + %ip = getField(%banField,2); + + %time = $dtBanList::IP[%ip]; + if(%time !$= "BAN" && getFieldCount(%time) > 0){ + %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); + if (%delta > getField(%time,4)){ + $dtBanList::IP[%ip] = ""; + %ban = 0; + } + } + + %time = $dtBanList::GUID[%guid]; + if(%time !$= "BAN" && getFieldCount(%time) > 0){ + %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); + if (%delta > getField(%time,4)){ + $dtBanList::GUID[%guid] = ""; + %ban = 0; + } + } + + if(%banField !$= "" && %ban){ + %tempList[%count] = %banField; + %count++; + } + } + for(%i = 0; %i < %count; %i++) { + $dtBanList::NameList[%i] = %tempList[%i]; + } + $dtBanList::NameListCount = %count; +} + +//old method +function unbanold(%guid,%ip){ + %ip = strReplace(%ip, ".", "_"); + for (%i = 0; %i < $dtBanList::NameListCount; %i++){ + if(getField($dtBanList::NameList[%i], 2) $= %ip || getField($dtBanList::NameList[%i], 1) $= %guid){ + unbanIndex(%i); + return; + } + } if($dtBanList::GUID[%guid] !$= ""){ $dtBanList::GUID[%guid] = ""; error("GUID" SPC %guid SPC "UNBANNED"); } - %ip = strReplace(%ip, ".", "_"); if($dtBanList::IP[%ip] !$= ""){ $dtBanList::IP[%ip] = ""; error("IP" SPC %ip SPC "UNBANNED"); } - export("$dtBanList*", $Host::dtBanlist); -} + saveBanList(); +} \ No newline at end of file diff --git a/Classic/scripts/autoexec/zzDiscordBot.cs b/Classic/scripts/autoexec/zzDiscordBot.cs index 9e36c79..796e788 100644 --- a/Classic/scripts/autoexec/zzDiscordBot.cs +++ b/Classic/scripts/autoexec/zzDiscordBot.cs @@ -5,7 +5,7 @@ //exec("scripts/autoexec/zzDiscordBot.cs"); //ip of the bot -$discordBot::IP = ""; +$discordBot::IP = "127.0.0.1:28003"; $discordBot::reconnectTimeout = 3 * 60000; //auto connect on start $discordBot::autoStart = 0; @@ -203,7 +203,6 @@ function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6) sendToDiscordEmote(%msg, $discordBot::serverFeed); } } - function sendToDiscord(%msg,%channel) { if(isObject(discord) && %msg !$= "") @@ -353,6 +352,33 @@ function discord::onLine(%this, %line){ discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "msgList" @ "\r\n"); } } + case "BANLIST": + if($dtBanList::NameListCount){ + for (%i = 0; %i < $dtBanList::NameListCount; %i++){ + %fieldList = $dtBanList::NameList[%i]; + %msg = "Index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1) SPC "IP:" @ getField(%fieldList,2); + discord.schedule(%i*32,"send","MSGSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ %msg @ "\r\n"); + } + discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "banList" @ "\r\n"); + } + else{ + sendToDiscord("No active bans, see ban file for manual/older entries", $discordBot::monitorChannel); + } + case "UNBANINDEX": + %var = getWord(%lineStrip,1); + if(%var < $dtBanList::NameListCount){ + %name = unbanIndex(%var); + if(%name !$= ""){ + sendToDiscord("User:" @ %name SPC "has been unbanned", $discordBot::monitorChannel); + } + else{ + sendToDiscord("Index Removed", $discordBot::monitorChannel); + } + } + else{ + sendToDiscord("Invalid Index", $discordBot::monitorChannel); + } + default: error("Discord Bad Command" SPC %line); } @@ -482,4 +508,5 @@ function pathMapData(){ //loop to collect player position data error("Player Plot Tracking Has Ended"); sendPrx(0); } -} \ No newline at end of file +} + From cfa59364c24cac7bea0858e870776db2838494b2 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Wed, 13 Apr 2022 15:13:33 -0400 Subject: [PATCH 06/65] Added Flags Restrictions carry over to Tourny Mode --- Classic/scripts/autoexec/VoteMenu.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 6ecf4e4..0699749 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -152,10 +152,11 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) { if(!$MatchStarted && !$CountdownStarted) messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match'); - - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); + if($Host::AllowPlayerVoteChangeMission) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); + if($Host::AllowPlayerVoteTimeLimit) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); if(%multipleTeams && $Host::AllowPlayerVoteTeamDamage) { From 823f695476cbfb46c167ce72ae29686ff64fc5f1 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Wed, 13 Apr 2022 16:40:18 -0400 Subject: [PATCH 07/65] Update Admin Status When De-admined. "A" or "SA" beside name will disappear --- Classic/scripts/server.cs | 6 ++++++ 1 file changed, 6 insertions(+) mode change 100755 => 100644 Classic/scripts/server.cs diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs old mode 100755 new mode 100644 index d943d7f..7cc971f --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -2564,6 +2564,9 @@ function serverCmdStripAdmin(%client, %admin) %admin.isSuperAdmin = 0; messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.'); adminLog(%client, " stripped admin from " @ %admin.nameBase); + messageAll( 'MsgClientDrop', "", %client.name, %client); + messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); return; } else if(%client.isSuperAdmin) @@ -2573,6 +2576,9 @@ function serverCmdStripAdmin(%client, %admin) %admin.isAdmin = 0; %admin.isSuperAdmin = 0; adminLog(%client, " stripped admin from " @ %admin.nameBase); + messageAll( 'MsgClientDrop', "", %client.name, %client); + messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } else messageClient(%client, 'MsgError', '\c2Only Super Admins can use this command.'); From a9dc89f051d126b33e3b18659829c4c59d0f6a49 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Wed, 13 Apr 2022 16:41:10 -0400 Subject: [PATCH 08/65] Name bug Incorrect name. Was blank ingame --- Classic/scripts/defaultGame.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classic/scripts/defaultGame.cs b/Classic/scripts/defaultGame.cs index af79a38..bad9b3f 100755 --- a/Classic/scripts/defaultGame.cs +++ b/Classic/scripts/defaultGame.cs @@ -3385,9 +3385,10 @@ function DefaultGame::voteAdminPlayer(%game, %admin, %client) if (%admin) { - messageAll('MsgAdminAdminPlayer', '\c2The Admin %3 made %2 an admin.', %client, %client.name, $AdminCl.name); + messageAll('MsgAdminAdminPlayer', '\c2The Admin %3 made %2 an admin.', %client, %client.name, %admin.nameBase); %client.isAdmin = 1; %cause = "(admin)"; + adminLog(%admin, " has made" SPC %client.nameBase @ "(" @ %client.guid @ ") an admin."); } else { @@ -3402,6 +3403,7 @@ function DefaultGame::voteAdminPlayer(%game, %admin, %client) else messageAll('MsgVoteFailed', '\c2Vote to make %1 an admin did not pass.', %client.name); } + if(%cause !$= "") logEcho($AdminCl.nameBase @ ": " @ %client.nameBase@" (cl "@%client@") made admin "@%cause, 1); } From c13a7588e0f180d6fdefc1ae459872de647ad050 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Wed, 13 Apr 2022 16:42:15 -0400 Subject: [PATCH 09/65] Allow admins to admin Remove check for SA only to admin --- Classic/scripts/autoexec/VoteMenu.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 0699749..79eb90e 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -322,10 +322,10 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(%arg1.isAdmin) // target is already an admin return; // can't vote to admin an admin! - if(%client.isAdmin) // our pal is an admin + if(%client.isAdmin && !%client.isSuperAdmin) // our pal is an admin (no superadmins) { - if(!%client.isSuperAdmin) // ... but not a super admin - return; // insufficient privileges + if(!$Host::AllowAdmin2Admin) + return; } else // not an admin { From d5627c193ed4fced0d1c6f49d7e169e86eb557c2 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Wed, 13 Apr 2022 17:20:30 -0400 Subject: [PATCH 10/65] Formatting --- Classic/scripts/server.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs index 7cc971f..0928223 100644 --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -2564,9 +2564,9 @@ function serverCmdStripAdmin(%client, %admin) %admin.isSuperAdmin = 0; messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.'); adminLog(%client, " stripped admin from " @ %admin.nameBase); - messageAll( 'MsgClientDrop', "", %client.name, %client); + messageAll('MsgClientDrop', "", %client.name, %client); messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); - messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); + messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); return; } else if(%client.isSuperAdmin) @@ -2576,9 +2576,9 @@ function serverCmdStripAdmin(%client, %admin) %admin.isAdmin = 0; %admin.isSuperAdmin = 0; adminLog(%client, " stripped admin from " @ %admin.nameBase); - messageAll( 'MsgClientDrop', "", %client.name, %client); + messageAll('MsgClientDrop', "", %client.name, %client); messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); - messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); + messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } else messageClient(%client, 'MsgError', '\c2Only Super Admins can use this command.'); From 56d366eee5ceca7f045683dcfc42d97cd0a773bb Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Wed, 13 Apr 2022 17:23:14 -0400 Subject: [PATCH 11/65] Lak>>CTF Team Bug --- Classic/scripts/LakRabbitGame.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Classic/scripts/LakRabbitGame.cs b/Classic/scripts/LakRabbitGame.cs index cf86eba..a2cc10d 100755 --- a/Classic/scripts/LakRabbitGame.cs +++ b/Classic/scripts/LakRabbitGame.cs @@ -2018,11 +2018,7 @@ function LakRabbitGame::gameOver(%game) //call the default DefaultGame::gameOver(%game); - //send the message - messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); - cancel(%game.rabbitWaypointThread); - messageAll('MsgClearObjHud', ""); for(%i = 0; %i < ClientGroup.getCount(); %i++) { %client = ClientGroup.getObject(%i); @@ -2039,6 +2035,12 @@ function LakRabbitGame::gameOver(%game) %client.team = 0; %client.lastTeam = 0; + + //send the message + messageClient(%client, 'MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); + messageClient(%client, 'MsgClearObjHud', ""); + + messageClient(%client, 'MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } // ilys -- cancel waypoint if not showing flag icon From cbaf5818e52f28ddf26d2096f85b2895d76452f0 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Fri, 15 Apr 2022 15:44:44 -0400 Subject: [PATCH 12/65] TK Autovote EndMatch Restriction --- Classic/scripts/autoexec/TKwarn.cs | 70 +++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/Classic/scripts/autoexec/TKwarn.cs b/Classic/scripts/autoexec/TKwarn.cs index d53b5a3..bee93d2 100755 --- a/Classic/scripts/autoexec/TKwarn.cs +++ b/Classic/scripts/autoexec/TKwarn.cs @@ -5,16 +5,16 @@ package TKwarn // From Evo function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType) -{ +{ if(!$countdownStarted && !$MatchStarted) return; - + %tk = Parent::testTeamKill(%game, %victimID, %killerID); - if(!%tk) + if(!%tk) return false; // is not a tk // No Bots - //if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled()) + // if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled()) // return true; // Log TeamKill @@ -23,7 +23,7 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType) //No warnings in tournament mode if($Host::TournamentMode) return true; - + // No Admins if(%killerID.isAdmin) return true; @@ -31,7 +31,7 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType) // Ignore this map if($CurrentMission $= "Mac_FlagArena" || $CurrentMission $= "Machineeggs") return true; - + // warn the player of the imminent kick vote if((%killerID.teamkills == $Host::TKWarn1 - 1) && $Host::TKWarn1 != 0) centerprint(%killerID, "You are receiving this warning for inappropriate teamkilling.\nBehave or a vote to kick will be started.", 10, 2); @@ -61,7 +61,7 @@ if (!isActivePackage(TKwarn)) function TKkick( %client, %admin, %guid ) { messageAll( 'MsgAdminForce', '\c2%1 has been autokicked for teamkilling.', %client.name ); // z0dd - ZOD, 7/13/03. Tell who kicked - + messageClient(%client, 'onClientKicked', ""); messageAllExcept( %client, -1, 'MsgClientDrop', "", Game.kickClientName, %client ); @@ -87,12 +87,12 @@ function TKkick( %client, %admin, %guid ) %cl = ClientGroup.getObject( %i ); if( %cl.guid == %guid ) { - %found = true; + %found = true; // kill and delete this client, their done in this server. if( isObject( %cl.player ) ) %cl.player.scriptKill(0); - + if ( isObject( %cl ) ) { %client.setDisconnectReason( "You have been kicked out of the game for teamkilling." ); // z0dd - ZOD, 7/13/03. Tell who kicked @@ -100,17 +100,17 @@ function TKkick( %client, %admin, %guid ) } // ban by IP as well BanList::add( %guid, %client.getAddress(), $Host::KickBanTime ); - } + } } if( !%found ) - BanList::add( %guid, "0", $Host::KickBanTime ); // keep this guy out for a while since he left. + BanList::add( %guid, "0", $Host::KickBanTime ); // keep this guy out for a while since he left. } else // lan games { // kill and delete this client if( isObject( %client.player ) ) %client.player.scriptKill(0); - + if ( isObject( %client ) ) { %client.setDisconnectReason( "You have been kicked out of the game for teamkilling." ); @@ -124,7 +124,7 @@ function TKkick( %client, %admin, %guid ) // From Evo // Info: Auto start a new vote function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4) -{ +{ // works only for kicking players if(%typeName !$= "VoteKickPlayer") return; @@ -132,38 +132,66 @@ function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4) // only works for FFA mode if($Host::TournamentMode) return; - + + //Added for vote overtime + %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); + if(%curTimeLeftMS <= 90000) + { + //log it + $tkvoteLog = formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "[Autovote Cancelled]" SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "Teamkill Autovote cancelled due insufficient time. #P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]"; + if($Host::ClassicTeamKillLog) + { + %logpath = $Host::ClassicTeamKillLogPath; + export("$tkvoteLog", %logpath, true); + logEcho($tkvoteLog); + } + echo($tkvoteLog); + return; + } + + //notify any admins on the other team + for(%i = 0; %i < ClientGroup.getCount(); %i++) + { + %cl = ClientGroup.getObject(%i); + if (%cl.isAdmin == true) + { + if(%cl.team !$= %arg1.team) //Not on admins team + messageClient(%cl, '', '\c5[A]\c1%1 \c0Teamkill Autovote started to kick %2.~wgui/objective_notification.wav', "Vote in Progress:", %arg1.nameBase); + } + } + echo(formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "Teamkill Autovote started for..." SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "#P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]"); + // a vote is already running, cancel it if(Game.scheduleVote !$= "") stopCurrentVote(); - + %clientsVoting = 0; - + // admins can't be kicked if(%arg1.isAdmin) return; - + Game.kickClient = %arg1; Game.kickClientName = %arg1.name; Game.kickGuid = %arg1.guid; Game.kickTeam = %arg1.team; - + %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if(%cl.team == %arg1.team && !%cl.isAIControlled() && %cl !$= %arg1) - { + { messageClient(%cl, 'VoteStarted', '\c2Vote initiated to kick the teamkiller %1 with %2 teamkills.', %arg1.name, $Host::TKWarn2); %clientsVoting++; } } - + for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if(%cl.team == %arg1.team && !%cl.isAIControlled() && %cl !$= %arg1) - messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100)); + messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100)); } clearVotes(); From 8ef58d73d362336e59acd9c1007bcce4c29f4b25 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Mon, 18 Apr 2022 13:14:14 -0400 Subject: [PATCH 13/65] Refactored --- Classic/scripts/autoexec/TKwarn.cs | 60 ++++++++++++++++++------------ 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/Classic/scripts/autoexec/TKwarn.cs b/Classic/scripts/autoexec/TKwarn.cs index bee93d2..67ba339 100755 --- a/Classic/scripts/autoexec/TKwarn.cs +++ b/Classic/scripts/autoexec/TKwarn.cs @@ -14,8 +14,8 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType) return false; // is not a tk // No Bots - // if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled()) - // return true; + //if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled()) + //return true; // Log TeamKill teamkillLog(%victimID, %killerID, %damageType); @@ -133,20 +133,40 @@ function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4) if($Host::TournamentMode) return; - //Added for vote overtime - %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); - if(%curTimeLeftMS <= 90000) - { - //log it - $tkvoteLog = formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "[Autovote Cancelled]" SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "Teamkill Autovote cancelled due insufficient time. #P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]"; - if($Host::ClassicTeamKillLog) - { - %logpath = $Host::ClassicTeamKillLogPath; - export("$tkvoteLog", %logpath, true); - logEcho($tkvoteLog); - } - echo($tkvoteLog); + // admins can't be kicked + if(%arg1.isAdmin) return; + + //Stop current votes + if(Game.scheduleVote !$= "") + { + //Added for vote overtime + //Dont stop if under 90 secs left + %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); + if(%curTimeLeftMS <= 90000) + { + //log it + $tkvoteLog = formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "[Autovote Cancelled]" SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "Teamkill Autovote cancelled due insufficient time. #P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]"; + if($Host::ClassicTeamKillLog) + { + %logpath = $Host::ClassicTeamKillLogPath; + export("$tkvoteLog", %logpath, true); + logEcho($tkvoteLog); + } + echo($tkvoteLog); + return; + } + else //Stop any current votes + { + //Notify clients the vote is being cancelled + for(%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if(%cl !$= %arg1) //dont notify the team killer + messageClient(%cl, 'VoteStarted', '\c2Vote has been cancelled due to teamkill autovote.'); + } + stopCurrentVote(); + } } //notify any admins on the other team @@ -156,21 +176,13 @@ function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4) if (%cl.isAdmin == true) { if(%cl.team !$= %arg1.team) //Not on admins team - messageClient(%cl, '', '\c5[A]\c1%1 \c0Teamkill Autovote started to kick %2.~wgui/objective_notification.wav', "Vote in Progress:", %arg1.nameBase); + messageClient(%cl, '', '\c5[A]\c1%1 \c0Teamkill Autovote started to kick %2 on the other team.~wgui/objective_notification.wav', "Vote in Progress:", %arg1.nameBase); } } echo(formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "Teamkill Autovote started for..." SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "#P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]"); - // a vote is already running, cancel it - if(Game.scheduleVote !$= "") - stopCurrentVote(); - %clientsVoting = 0; - // admins can't be kicked - if(%arg1.isAdmin) - return; - Game.kickClient = %arg1; Game.kickClientName = %arg1.name; Game.kickGuid = %arg1.guid; From 8db5e4bf51b3b5526fff59312aab8c80ebf6a2b8 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Fri, 22 Apr 2022 11:57:20 -0400 Subject: [PATCH 14/65] Larger dust puffs For cloak detection Line 1088 Line 1126 --- Classic/scripts/player.cs | 260 +++++++++++++++++++------------------- 1 file changed, 130 insertions(+), 130 deletions(-) diff --git a/Classic/scripts/player.cs b/Classic/scripts/player.cs index fbebed0..84abb9f 100755 --- a/Classic/scripts/player.cs +++ b/Classic/scripts/player.cs @@ -187,7 +187,7 @@ datablock AudioProfile(CorpseLootingSound) preload = true; effect = CorpseLootingEffect; }; - + datablock AudioProfile(ArmorMoveBubblesSound) { filename = "fx/armor/bubbletrail2.wav"; @@ -1085,8 +1085,8 @@ datablock ParticleData(LightPuff) textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 0.4"; colors[1] = "0.46 0.46 0.36 0.0"; - sizes[0] = 0.4; - sizes[1] = 1.0; + sizes[0] = 0.8; //was 0.4 + sizes[1] = 1.4; //was 1.0 }; datablock ParticleEmitterData(LightPuffEmitter) @@ -1123,9 +1123,9 @@ datablock ParticleData(LiftoffDust) colors[0] = "0.46 0.36 0.26 0.0"; colors[1] = "0.46 0.46 0.36 0.4"; colors[2] = "0.46 0.46 0.36 0.0"; - sizes[0] = 0.2; - sizes[1] = 0.6; - sizes[2] = 1.0; + sizes[0] = 0.6; //was 0.2 + sizes[1] = 1.0; //was 0.6 + sizes[2] = 1.4; //was 1.0 times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; @@ -1193,11 +1193,11 @@ datablock DebrisData( PlayerDebris ) velocity = 18.0; velocityVariance = 12.0; -}; +}; // z0dd - ZOD, 4/21/02. Altered most of these properties datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile -{ +{ emap = true; className = Armor; @@ -1316,8 +1316,8 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile splashEmitter[0] = PlayerFoamDropletsEmitter; splashEmitter[1] = PlayerFoamEmitter; splashEmitter[2] = PlayerBubbleEmitter; - mediumSplashSoundVelocity = 10.0; - hardSplashSoundVelocity = 20.0; + mediumSplashSoundVelocity = 10.0; + hardSplashSoundVelocity = 20.0; exitSplashSoundVelocity = 5.0; // Controls over slope of runnable/jumpable surfaces @@ -1436,7 +1436,7 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile observeParameters = "0.5 4.5 4.5"; shieldEffectScale = "0.7 0.7 1.0"; - + //Kills autopoints detectsUsingLOSEnemy[1] = true; detectsUsingLOSEnemy[2] = true; @@ -1453,7 +1453,7 @@ datablock DecalData(MediumMaleFootprint) // z0dd - ZOD, 4/21/02. Altered most of these properties datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile -{ +{ emap = true; className = Armor; @@ -1574,7 +1574,7 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile boxHeadRightPercentage = 1; boxHeadBackPercentage = 0; boxHeadFrontPercentage = 1; - + //Foot Prints decalData = MediumMaleFootprint; decalOffset = 0.35; @@ -1594,8 +1594,8 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile splashEmitter[0] = PlayerFoamDropletsEmitter; splashEmitter[1] = PlayerFoamEmitter; splashEmitter[2] = PlayerBubbleEmitter; - mediumSplashSoundVelocity = 10.0; - hardSplashSoundVelocity = 20.0; + mediumSplashSoundVelocity = 10.0; + hardSplashSoundVelocity = 20.0; exitSplashSoundVelocity = 5.0; footstepSplashHeight = 0.35; @@ -1694,7 +1694,7 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile observeParameters = "0.5 4.5 4.5"; shieldEffectScale = "0.7 0.7 1.0"; - + //Kills autopoints detectsUsingLOSEnemy[1] = true; detectsUsingLOSEnemy[2] = true; @@ -1761,7 +1761,7 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile maxDamage = 1.32; maxEnergy = 110; repairRate = 0.0033; - + //Value changed halfway between base and classic. //Classic is 54, Base is 75 //Shield breaks right at two mine-disc @@ -1853,8 +1853,8 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile splashEmitter[0] = PlayerFoamDropletsEmitter; splashEmitter[1] = PlayerFoamEmitter; splashEmitter[2] = PlayerBubbleEmitter; - mediumSplashSoundVelocity = 10.0; - hardSplashSoundVelocity = 20.0; + mediumSplashSoundVelocity = 10.0; + hardSplashSoundVelocity = 20.0; exitSplashSoundVelocity = 5.0; footstepSplashHeight = 0.35; @@ -1953,7 +1953,7 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile observeParameters = "0.5 4.5 4.5"; shieldEffectScale = "0.7 0.7 1.0"; - + //Kills autopoints detectsUsingLOSEnemy[1] = true; detectsUsingLOSEnemy[2] = true; @@ -1998,7 +1998,7 @@ datablock PlayerData(LightMaleBiodermArmor) : LightMaleHumanArmor debrisShapeName = "bio_player_debris.dts"; - + //Foot Prints decalData = LightBiodermFootprint; decalOffset = 0.3; @@ -2023,7 +2023,7 @@ datablock PlayerData(MediumMaleBiodermArmor) : MediumMaleHumanArmor debrisShapeName = "bio_player_debris.dts"; //Foot Prints - decalData = MediumBiodermFootprint; + decalData = MediumBiodermFootprint; decalOffset = 0.35; waterBreathSound = WaterBreathBiodermSound; @@ -2049,7 +2049,7 @@ datablock PlayerData(HeavyMaleBiodermArmor) : HeavyMaleHumanArmor //Foot Prints decalData = HeavyBiodermFootprint; decalOffset = 0.4; - + waterBreathSound = WaterBreathBiodermSound; }; @@ -2122,17 +2122,17 @@ function Armor::onMount(%this,%obj,%vehicle,%node) if(!%obj.inStation) %obj.lastWeapon = (%obj.getMountedImage($WeaponSlot) == 0 ) ? "" : %obj.getMountedImage($WeaponSlot).item; - + %obj.unmountImage($WeaponSlot); - + if(!%obj.client.isAIControlled()) { %obj.setControlObject(%vehicle); %obj.client.setObjectActiveImage(%vehicle, 2); } - + //E3 respawn... - + if(%obj == %obj.lastVehicle.lastPilot && %obj.lastVehicle != %vehicle) { schedule(15000, %obj.lastVehicle,"vehicleAbandonTimeOut", %obj.lastVehicle); @@ -2140,14 +2140,14 @@ function Armor::onMount(%this,%obj,%vehicle,%node) } if(%vehicle.lastPilot !$= "" && %vehicle == %vehicle.lastPilot.lastVehicle) %vehicle.lastPilot.lastVehicle = ""; - + %vehicle.abandon = false; %vehicle.lastPilot = %obj; %obj.lastVehicle = %vehicle; // update the vehicle's team if((%vehicle.getTarget() != -1) && %vehicle.getDatablock().cantTeamSwitch $= "") - { + { setTargetSensorGroup(%vehicle.getTarget(), %obj.client.getSensorGroup()); if( %vehicle.turretObject > 0 ) setTargetSensorGroup(%vehicle.turretObject.getTarget(), %obj.client.getSensorGroup()); @@ -2207,9 +2207,9 @@ function Armor::onUnmount( %this, %obj, %vehicle, %node ) %obj.use(%obj.lastWeapon); else { - if(%obj.getMountedImage($WeaponSlot) == 0) + if(%obj.getMountedImage($WeaponSlot) == 0) %obj.selectWeaponSlot( 0 ); - } + } //Inform gunner position when pilot leaves... //if(%vehicle.getDataBlock().showPilotInfo !$= "") // if((%gunner = %vehicle.getMountNodeObject(1)) != 0) @@ -2271,7 +2271,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode) //to ensure they mount the turret before the passenger seat, regardless of where they collide... if (%obj.client.isAIControlled()) { - %transform = %col.getTransform(); + %transform = %col.getTransform(); //either the AI is *required* to pilot, or they'll pick the first available passenger seat if (%client.pilotVehicle) @@ -2312,7 +2312,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode) } if(%col.noEnemyControl && %obj.team != %col.team) return; - + commandToClient(%obj.client,'SetDefaultVehicleKeys', true); //If pilot or passenger then bind a few extra keys if(%node == 0) @@ -2329,7 +2329,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode) if (%obj.client.isAIControlled() && %node == 1 && (%type $= "BomberFlyer" || %type $= "AssaultVehicle")) { //%client.player.setActionThread(%col.getDataBlock().mountPose[0], true, true); - %client.player.setActionThread(sitting, true, true); + %client.player.setActionThread(sitting, true, true); } %col.mountObject(%obj,%node); @@ -2350,7 +2350,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode) %gotSomething = false; // it's corpse-looting time! // weapons -- don't pick up more than you are allowed to carry! - for(%i = 0; ( %obj.weaponCount < %obj.getDatablock().maxWeapons ) && $InvWeapon[%i] !$= ""; %i++) + for(%i = 0; ( %obj.weaponCount < %obj.getDatablock().maxWeapons ) && $InvWeapon[%i] !$= ""; %i++) { %weap = $NameToInv[$InvWeapon[%i]]; if ( %col.hasInventory( %weap ) ) @@ -2498,7 +2498,7 @@ function Player::resetFlagTossWait(%this) function Player::resetSitMessage(%obj) { - %obj.noSitMessage = false; + %obj.noSitMessage = false; } function Player::setInvincible(%this, %val) @@ -2508,9 +2508,9 @@ function Player::setInvincible(%this, %val) function Player::causedRecentDamage(%this, %val) { - %this.causedRecentDamage = %val; + %this.causedRecentDamage = %val; } - + function hasLargePack(%player) { %pack = %player.getMountedImage($BackpackSlot); @@ -2609,7 +2609,7 @@ function Armor::doDismount(%this, %obj, %forced) %obj.unmount(); if(%obj.mVehicle) %obj.mVehicle.getDataBlock().playerDismounted(%obj.mVehicle, %obj); - + // bots don't change their control objects when in vehicles if(!%obj.client.isAIControlled()) { @@ -2652,7 +2652,7 @@ function resetObserveFollow( %client, %dismount ) if ( %client.observers[%i].clientObserve != %client ) continue; - %client.observers[%i].camera.setOrbitMode( %client.player, %client.player.getTransform(), 0.5, 4.5, 4.5); + %client.observers[%i].camera.setOrbitMode( %client.player, %client.player.getTransform(), 0.5, 4.5, 4.5); } } else @@ -2666,7 +2666,7 @@ function resetObserveFollow( %client, %dismount ) %params = %client.player.getTransform(); else %params = %mount.getDataBlock().observeParameters; - + for( %i = 0; %i < %client.observeCount; %i++ ) { // z0dd - ZOD, 5/21/03. Make sure this client actually obs this client @@ -2675,7 +2675,7 @@ function resetObserveFollow( %client, %dismount ) %client.observers[%i].camera.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); } - } + } } @@ -2683,7 +2683,7 @@ function resetObserveFollow( %client, %dismount ) function Player::scriptKill(%player, %damageType) { - %player.scriptKilled = 1; + %player.scriptKilled = 1; %player.setInvincible(false); %player.damage(0, %player.getPosition(), 10000, %damageType); } @@ -2695,7 +2695,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am return; //---------------------------------------------------------------- - // z0dd - ZOD, 6/09/02. Check to see if this vehicle is destroyed, + // z0dd - ZOD, 6/09/02. Check to see if this vehicle is destroyed, // if it is do no damage. Fixes vehicle ghosting bug. We do not // check for isObject here, destroyed objects fail it even though // they exist as objects, go figure. @@ -2730,7 +2730,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am } else { - if(%damageType != $DamageType::Laser && %damageType != $DamageType::Bullet && %damageType != $DamageType::Blaster) + if(%damageType != $DamageType::Laser && %damageType != $DamageType::Bullet && %damageType != $DamageType::Blaster) return; } } @@ -2740,7 +2740,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am %targetClient = %targetObject.getOwnerClient(); if(isObject(%mineSC)) - %sourceClient = %mineSC; + %sourceClient = %mineSC; else %sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0; @@ -2754,7 +2754,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am else if(%damageType == $DamageType::Suicide) %sourceTeam = 0; //-------------------------------------------------------------------------------------------------------------------- - // z0dd - ZOD, 4/8/02. Check to see if this turret has a valid owner, if not clear the variable. + // z0dd - ZOD, 4/8/02. Check to see if this turret has a valid owner, if not clear the variable. else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret") { %sourceTeam = getTargetSensorGroup(%sourceObject.getTarget()); @@ -2794,11 +2794,11 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am %damageScale = %data.damageScale[%damageType]; if(%damageScale !$= "") %amount *= %damageScale; - + %flash = %targetObject.getDamageFlash() + (%amount * 2); if (%flash > 0.75) %flash = 0.75; - + // Teratos: Originally from Eolk? Mine+Disc tracking/death message support. // No Schedules by DarkTiger Ver.2 %targetClient.mineDisc = false; @@ -2807,17 +2807,17 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am case $DamageType::Disc: if((getSimTime() - %targetClient.mdcTime1) < 256) %targetClient.mineDisc = true; - - %targetClient.mdcTime2 = getSimTime(); + + %targetClient.mdcTime2 = getSimTime(); case $DamageType::Mine: if((getSimTime() - %targetClient.mdcTime2) < 256) %targetClient.mineDisc = true; - - %targetClient.mdcTime1 = getSimTime(); + + %targetClient.mdcTime1 = getSimTime(); } // -- End Mine+Disc insert. - + %previousDamage = %targetObject.getDamagePercent(); %targetObject.setDamageFlash(%flash); %targetObject.applyDamage(%amount); @@ -2826,49 +2826,49 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am %targetClient.lastDamagedBy = %damagingClient; %targetClient.lastDamaged = getSimTime(); - //now call the "onKilled" function if the client was... you know... + //now call the "onKilled" function if the client was... you know... if(%targetObject.getState() $= "Dead") { // where did this guy get it? %damLoc = %targetObject.getDamageLocation(%position); - + // should this guy be blown apart? - if( %damageType == $DamageType::Explosion || + if( %damageType == $DamageType::Explosion || %damageType == $DamageType::TankMortar || %damageType == $DamageType::Mortar || %damageType == $DamageType::MortarTurret || %damageType == $DamageType::BomberBombs || %damageType == $DamageType::SatchelCharge || - %damageType == $DamageType::Missile ) + %damageType == $DamageType::Missile ) { if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining { %targetObject.setMomentumVector(%momVec); - %targetObject.blowup(); + %targetObject.blowup(); } } - + // this should be funny... if( %damageType == $DamageType::VehicleSpawn ) - { + { %targetObject.setMomentumVector("0 0 1"); %targetObject.blowup(); } - + // If we were killed, max out the flash %targetObject.setDamageFlash(0.75); - + %damLoc = %targetObject.getDamageLocation(%position); Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc); } else if ( %amount > 0.1 ) - { + { if( %targetObject.station $= "" && %targetObject.isCloaked() ) { %targetObject.setCloaked( false ); - %targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true ); + %targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true ); } - + playPain( %targetObject ); } } @@ -2883,101 +2883,101 @@ function Armor::applyConcussion( %this, %dist, %radius, %sourceObject, %targetOb { %percentage = 1 - ( %dist / %radius ); %random = getRandom(); - + if( %sourceObject == %targetObject ) - { + { %flagChance = 1.0; %itemChance = 1.0; } else - { + { %flagChance = 0.75; - %itemChance = 0.75; + %itemChance = 0.75; } - + %probabilityFlag = %flagChance * %percentage; - %probabilityItem = %itemChance * %percentage; - + %probabilityItem = %itemChance * %percentage; + if( %random <= %probabilityFlag ) - Game.applyConcussion( %targetObject ); - + Game.applyConcussion( %targetObject ); + if( %random <= %probabilityItem ) { %player = %targetObject; %numWeapons = 0; - + // blaster 0 // plasma 1 // chain 2 - // disc 3 + // disc 3 // grenade 4 // snipe 5 // elf 6 // mortar 7 - + //get our inventory - if( %weaps[0] = %player.getInventory("Blaster") > 0 ) %numWeapons++; - if( %weaps[1] = %player.getInventory("Plasma") > 0 ) %numWeapons++; - if( %weaps[2] = %player.getInventory("Chaingun") > 0 ) %numWeapons++; - if( %weaps[3] = %player.getInventory("Disc") > 0 ) %numWeapons++; - if( %weaps[4] = %player.getInventory("GrenadeLauncher") > 0 ) %numWeapons++; + if( %weaps[0] = %player.getInventory("Blaster") > 0 ) %numWeapons++; + if( %weaps[1] = %player.getInventory("Plasma") > 0 ) %numWeapons++; + if( %weaps[2] = %player.getInventory("Chaingun") > 0 ) %numWeapons++; + if( %weaps[3] = %player.getInventory("Disc") > 0 ) %numWeapons++; + if( %weaps[4] = %player.getInventory("GrenadeLauncher") > 0 ) %numWeapons++; if( %weaps[5] = %player.getInventory("SniperRifle") > 0 ) %numWeapons++; if( %weaps[6] = %player.getInventory("ELFGun") > 0 ) %numWeapons++; if( %weaps[7] = %player.getInventory("Mortar") > 0 ) %numWeapons++; - + %foundWeapon = false; %attempts = 0; - - if( %numWeapons > 0 ) - { + + if( %numWeapons > 0 ) + { while( !%foundWeapon ) { %rand = mFloor( getRandom() * 8 ); if( %weaps[ %rand ] ) { %foundWeapon = true; - + switch ( %rand ) { case 0: - %player.use("Blaster"); + %player.use("Blaster"); case 1: - %player.use("Plasma"); + %player.use("Plasma"); case 2: - %player.use("Chaingun"); + %player.use("Chaingun"); case 3: - %player.use("Disc"); + %player.use("Disc"); case 4: - %player.use("GrenadeLauncher"); - case 5: - %player.use("SniperRifle"); + %player.use("GrenadeLauncher"); + case 5: + %player.use("SniperRifle"); case 6: - %player.use("ElfGun"); + %player.use("ElfGun"); case 7: - %player.use("Mortar"); + %player.use("Mortar"); } - + %image = %player.getMountedImage( $WeaponSlot ); %player.throw( %image.item ); %player.client.setWeaponsHudItem( %image.item, 0, 0 ); %player.throwPack(); } else - { + { %attempts++; if( %attempts > 10 ) %foundWeapon = true; - } + } } } else { %targetObject.throwPack(); %targetObject.throwWeapon(); - } + } } - -} + +} //---------------------------------------------------------------------------- @@ -3000,7 +3000,7 @@ function playPain( %obj ) %client = %obj.client; %random = getRandom(1) + 1; %desc = AudioClosest3d; - + playTargetAudio( %client.target, $PainCry[%random], %desc, false); } @@ -3050,8 +3050,8 @@ function Player::pickup(%this,%obj,%amount) %this.getMountedImage($BackpackSlot) != 0) return 0; // don't pick up a weapon (other than targeting laser) if player's at maxWeapons - else if(%data.className $= Weapon - && %data.getName() !$= "TargetingLaser" // Special case + else if(%data.className $= Weapon + && %data.getName() !$= "TargetingLaser" // Special case && %this.weaponCount >= %this.getDatablock().maxWeapons) return 0; // don't allow players to throw large packs at pilots (thanks Wizard) @@ -3067,7 +3067,7 @@ function Player::use( %this,%data ) return false; // Convert the word "Backpack" to whatever is in the backpack slot. - if ( %data $= "Backpack" ) + if ( %data $= "Backpack" ) { if ( %this.inStation ) return false; @@ -3082,17 +3082,17 @@ function Player::use( %this,%data ) messageClient( %this.client, 'MsgCantUsePack', '\c2You can\'t use your pack while in a weaponry position.~wfx/misc/misc.error.wav' ); return( false ); } - + %image = %this.getMountedImage( $BackpackSlot ); if ( %image ) %data = %image.item; } // Can't use some items when piloting or your a weapon operator - if ( %this.isPilot() || %this.isWeaponOperator() ) + if ( %this.isPilot() || %this.isWeaponOperator() ) if ( %data.getName() !$= "RepairKit" ) return false; - + return ShapeBase::use( %this, %data ); } @@ -3125,13 +3125,13 @@ function Player::isWeaponOperator(%this) } return( false ); -} +} function Player::liquidDamage(%obj, %data, %damageAmount, %damageType) { if(%obj.getState() !$= "Dead") { - %data.damageObject(%obj, 0, "0 0 0", %damageAmount, %damageType); + %data.damageObject(%obj, 0, "0 0 0", %damageAmount, %damageType); %obj.lDamageSchedule = %obj.schedule(50, "liquidDamage", %data, %damageAmount, %damageType); } else @@ -3160,7 +3160,7 @@ function Armor::onEnterLiquid(%data, %obj, %coverage, %type) case 5: //Hot Lava %obj.liquidDamage(%data, $DamageHotLava, $DamageType::Lava); - case 6: + case 6: //Crusty Lava %obj.liquidDamage(%data, $DamageCrustyLava, $DamageType::Lava); case 7: @@ -3281,46 +3281,46 @@ function playDeathAnimation(%player, %damageLocation, %type) { %vertPos = firstWord(%damageLocation); %quadrant = getWord(%damageLocation, 1); - + //echo("vert Pos: " @ %vertPos); //echo("quad: " @ %quadrant); - - if( %type == $DamageType::Explosion || %type == $DamageType::Mortar || %type == $DamageType::Grenade) + + if( %type == $DamageType::Explosion || %type == $DamageType::Mortar || %type == $DamageType::Grenade) { - if(%quadrant $= "front_left" || %quadrant $= "front_right") + if(%quadrant $= "front_left" || %quadrant $= "front_right") %curDie = $PlayerDeathAnim::ExplosionBlowBack; else %curDie = $PlayerDeathAnim::TorsoBackFallForward; } - else if(%vertPos $= "head") + else if(%vertPos $= "head") { - if(%quadrant $= "front_left" || %quadrant $= "front_right" ) + if(%quadrant $= "front_left" || %quadrant $= "front_right" ) %curDie = $PlayerDeathAnim::HeadFrontDirect; - else + else %curDie = $PlayerDeathAnim::HeadBackFallForward; } - else if(%vertPos $= "torso") + else if(%vertPos $= "torso") { - if(%quadrant $= "front_left" ) + if(%quadrant $= "front_left" ) %curDie = $PlayerDeathAnim::TorsoLeftSpinDeath; - else if(%quadrant $= "front_right") + else if(%quadrant $= "front_right") %curDie = $PlayerDeathAnim::TorsoRightSpinDeath; - else if(%quadrant $= "back_left" ) + else if(%quadrant $= "back_left" ) %curDie = $PlayerDeathAnim::TorsoBackFallForward; - else if(%quadrant $= "back_right") + else if(%quadrant $= "back_right") %curDie = $PlayerDeathAnim::TorsoBackFallForward; } - else if (%vertPos $= "legs") + else if (%vertPos $= "legs") { - if(%quadrant $= "front_left" || %quadrant $= "back_left") + if(%quadrant $= "front_left" || %quadrant $= "back_left") %curDie = $PlayerDeathAnim::LegsLeftGimp; - if(%quadrant $= "front_right" || %quadrant $= "back_right") + if(%quadrant $= "front_right" || %quadrant $= "back_right") %curDie = $PlayerDeathAnim::LegsRightGimp; } - + if(%curDie $= "" || %curDie < 1 || %curDie > 11) %curDie = 1; - + %player.setActionThread("Death" @ %curDie); } From dcdfd7109b79a06ed6e3a1d3384589e751243938 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Fri, 22 Apr 2022 11:58:23 -0400 Subject: [PATCH 15/65] Added DM Anticloak --- Classic/scripts/autoexec/TeamManagement.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Classic/scripts/autoexec/TeamManagement.cs b/Classic/scripts/autoexec/TeamManagement.cs index df67a8f..60bf53d 100644 --- a/Classic/scripts/autoexec/TeamManagement.cs +++ b/Classic/scripts/autoexec/TeamManagement.cs @@ -55,12 +55,15 @@ function GetTeamCounts(%game) if( !$Host::TournamentMode ) { - if( $CurrentMissionType $= "CTF" ) + if($CurrentMissionType $= "CTF") { NBRStatusNotify(%game); CheckAntiPack(%game); } - TeamBalanceNotify(%game); + else if($CurrentMissionType $= "DM") + CheckAntiPack(%game); + + TeamBalanceNotify(%game); //Has check for # teams } //Set so counter wont run when it doesnt need to. From 5e9e84e25ee72872e18307090f597de7a668f071 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Mon, 25 Apr 2022 13:50:57 -0400 Subject: [PATCH 16/65] Update Path recording removed --- Classic/scripts/autoexec/dtBanSystem.cs | 148 +++++++++-------------- Classic/scripts/autoexec/zzDiscordBot.cs | 106 ++-------------- 2 files changed, 69 insertions(+), 185 deletions(-) diff --git a/Classic/scripts/autoexec/dtBanSystem.cs b/Classic/scripts/autoexec/dtBanSystem.cs index c09c519..66e9999 100644 --- a/Classic/scripts/autoexec/dtBanSystem.cs +++ b/Classic/scripts/autoexec/dtBanSystem.cs @@ -13,7 +13,7 @@ //TO UNBAN SOMEONE WITHOUT RESTARTING THE SERVER //banList();in console //unbanIndex(%index) %index is the number next to the players name from listBans(); -//Example: unban(555555,"22.222.222.222"); put ip in quotes +//Example: unbanold(555555,"22.222.222.222"); put ip in quotes package dtBan { @@ -42,22 +42,30 @@ function BanList::add(%guid, %ipAddress, %time){ $dtBanList::IP[%bareIP] = dtBanMark() TAB %time TAB %name; } %found = 0; - for (%i = 0; %i < $dtBanList::NameListCount; %i++){ - if(getField($dtBanList::NameList[%i], 0) $= %name){ - %found =1; - if(%guid > 0) - $dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 1, %guid); - if(getSubStr(%ipAddress, 0, 3) $= "IP:") - $dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 2, %bareIP); - break; + %eIndex = -1; + for (%i = 0; %i < 100; %i++){ + if($dtBanList::NameList[%i] !$= ""){ + if(getField($dtBanList::NameList[%i], 0) $= %name){ + %found =1; + if(%guid > 0) + $dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 1, %guid); + if(getSubStr(%ipAddress, 0, 3) $= "IP:") + $dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 2, %bareIP); + break; + } + } + else if(%eIndex == -1){ + %eIndex = %i; } } if(!%found){ - $dtBanList::NameListCount = ($dtBanList::NameListCount > 0) ? $dtBanList::NameListCount : 0; - $dtBanList::NameList[$dtBanList::NameListCount] = %name TAB %guid TAB %bareIP; - $dtBanList::NameListCount++; + if($dtBanList::NameList[%eIndex] $= ""){ + $dtBanList::NameList[%eIndex] = %name TAB %guid TAB %bareIP; + } + else{ + error("Ban Index is not empty"); + } } - // write out the updated bans to the file saveBanList(); } @@ -75,10 +83,12 @@ function banList_checkIP(%client){ if (%delta < getField(%time,4)) return 1; else{ - for (%i = 0; %i < $dtBanList::NameListCount; %i++){ - if(getField($dtBanList::NameList[%i], 2) $= %ip){ - unbanIndex(%i); - break; + for (%i = 0; %i < 100; %i++){ + if($dtBanList::NameList[%i] !$= ""){ + if(getField($dtBanList::NameList[%i], 1) $= %guid){ + unbanIndex(%i); + break; + } } } $dtBanList::IP[%ip] = ""; @@ -97,10 +107,12 @@ function banList_checkGUID(%guid){ if (%delta < getField(%time,4)) return 1; else{ - for (%i = 0; %i < $dtBanList::NameListCount; %i++){ - if(getField($dtBanList::NameList[%i], 1) $= %guid){ - unbanIndex(%i); - break; + for (%i = 0; %i < 100; %i++){ + if($dtBanList::NameList[%i] !$= ""){ + if(getField($dtBanList::NameList[%i], 1) $= %guid){ + unbanIndex(%i); + break; + } } } $dtBanList::GUID[%guid] = ""; @@ -203,30 +215,27 @@ function dtBanMark(){ } function banList(){ - $dtBanList::NameListCount = ($dtBanList::NameListCount > 0) ? $dtBanList::NameListCount : 0; - if(!$dtBanList::NameListCount){ - error("No bans, see" SPC $Host::dtBanlist SPC "for older system entries"); - } - else{ - for (%i = 0; %i < $dtBanList::NameListCount; %i++){ - %fieldList = $dtBanList::NameList[%i]; + %found = 0; + for (%i = 0; %i < 100; %i++){ + %fieldList = $dtBanList::NameList[%i]; + if($dtBanList::NameList[%i] !$= ""){ + %found = 1; error("index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1) SPC "IP:" @ getField(%fieldList,2)); } - if($dtBanList::NameListCount > 0){ - error("Use unbanIndex(%index); to unban user from the list "); - } + } + if(%found){ + error("Use unbanIndex(%index); to unban user from the list "); + } + else{ + error("No bans, see" SPC $Host::dtBanlist SPC "for older entries"); } } function unbanIndex(%index){ - %fieldList = $dtBanList::NameList[%index]; - %name = getField(%fieldList, 0); - if(getFieldCount(%fieldList) > 1){ - for(%i = %index; %i < $dtBanList::NameListCount -1; %i++) { - $dtBanList::NameList[%i] =$dtBanList::NameList[%i+1]; - } - $dtBanList::NameList[%i] = ""; - $dtBanList::NameListCount--; + if( $dtBanList::NameList[%index] !$= ""){ + %fieldList = $dtBanList::NameList[%index]; + %name = getField(%fieldList, 0); + $dtBanList::NameList[%index] = ""; error("Name" SPC getField(%fieldList,0) SPC "UNBANNED"); %guid = getField(%fieldList,1); if($dtBanList::GUID[%guid] !$= ""){ @@ -238,64 +247,21 @@ function unbanIndex(%index){ $dtBanList::IP[%ip] = ""; error("IP" SPC %ip SPC "UNBANNED"); } + saveBanList(); + return %name; } - else{ - for(%i = %index; %i < $dtBanList::NameListCount -1; %i++) { - $dtBanList::NameList[%i] =$dtBanList::NameList[%i+1]; - } - $dtBanList::NameList[%i] = ""; - $dtBanList::NameListCount--; - error("Error removing invalid index"); - } - saveBanList(); - return %name; -} - - -function banListClean(){ - %count = 0; - for(%i = 0; %i < $dtBanList::NameListCount; %i++) { - %ban = 1; - %banField = $dtBanList::NameList[%i]; - %guid = getField(%banField,1); - %ip = getField(%banField,2); - - %time = $dtBanList::IP[%ip]; - if(%time !$= "BAN" && getFieldCount(%time) > 0){ - %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); - if (%delta > getField(%time,4)){ - $dtBanList::IP[%ip] = ""; - %ban = 0; - } - } - - %time = $dtBanList::GUID[%guid]; - if(%time !$= "BAN" && getFieldCount(%time) > 0){ - %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); - if (%delta > getField(%time,4)){ - $dtBanList::GUID[%guid] = ""; - %ban = 0; - } - } - - if(%banField !$= "" && %ban){ - %tempList[%count] = %banField; - %count++; - } - } - for(%i = 0; %i < %count; %i++) { - $dtBanList::NameList[%i] = %tempList[%i]; - } - $dtBanList::NameListCount = %count; + return -1; } //old method function unbanold(%guid,%ip){ %ip = strReplace(%ip, ".", "_"); - for (%i = 0; %i < $dtBanList::NameListCount; %i++){ - if(getField($dtBanList::NameList[%i], 2) $= %ip || getField($dtBanList::NameList[%i], 1) $= %guid){ - unbanIndex(%i); - return; + for (%i = 0; %i < 100; %i++){ + if($dtBanList::NameList[%i] !$= ""){ + if(getField($dtBanList::NameList[%i], 2) $= %ip || getField($dtBanList::NameList[%i], 1) $= %guid){ + unbanIndex(%i); + return; + } } } if($dtBanList::GUID[%guid] !$= ""){ diff --git a/Classic/scripts/autoexec/zzDiscordBot.cs b/Classic/scripts/autoexec/zzDiscordBot.cs index 796e788..b5cf71f 100644 --- a/Classic/scripts/autoexec/zzDiscordBot.cs +++ b/Classic/scripts/autoexec/zzDiscordBot.cs @@ -285,10 +285,6 @@ function discord::onLine(%this, %line){ switch$(%cmd){ //case "Discord": //messageAll( 'MsgDiscord', '\c3Discord: \c4%1 %2',getWord(%lineStrip,1),getWords(%lineStrip,2,getWordCount(%lineStrip) -1)); - case "PLOTSTOP": - $pathMaps::running = 0; - case "PLOTPLAYER": - startPlayerPlot(getWord(%lineStrip,1)); case "GETSTAT": %var = getWord(%lineStrip,1); %mon = getWord(%lineStrip,2); @@ -353,27 +349,26 @@ function discord::onLine(%this, %line){ } } case "BANLIST": - if($dtBanList::NameListCount){ - for (%i = 0; %i < $dtBanList::NameListCount; %i++){ + %found = 0; + for (%i = 0; %i < 100; %i++){ + if($dtBanList::NameList[%i] !$= ""){ %fieldList = $dtBanList::NameList[%i]; - %msg = "Index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1) SPC "IP:" @ getField(%fieldList,2); - discord.schedule(%i*32,"send","MSGSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ %msg @ "\r\n"); + %msg = "Index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1); + %found++; + discord.schedule(%found*32,"send","MSGSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ %msg @ "\r\n"); } - discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "banList" @ "\r\n"); + } + if(%found > 0){ + discord.schedule((%found+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "banList" @ "\r\n"); } else{ sendToDiscord("No active bans, see ban file for manual/older entries", $discordBot::monitorChannel); } case "UNBANINDEX": %var = getWord(%lineStrip,1); - if(%var < $dtBanList::NameListCount){ + if($dtBanList::NameList[%var] !$= ""){ %name = unbanIndex(%var); - if(%name !$= ""){ - sendToDiscord("User:" @ %name SPC "has been unbanned", $discordBot::monitorChannel); - } - else{ - sendToDiscord("Index Removed", $discordBot::monitorChannel); - } + sendToDiscord("User:" @ %name SPC "has been unbanned", $discordBot::monitorChannel); } else{ sendToDiscord("Invalid Index", $discordBot::monitorChannel); @@ -432,81 +427,4 @@ function sendLDATA(%month, %year, %type){ } function unlockStatGen(){ $genStatsLockout = 0; -} - -//////////////////////////////////////////////////////////////////////////////// -//Player Path Maps -//////////////////////////////////////////////////////////////////////////////// - -$pathMaps::maxCount = 32000;// default point count -$pathMaps::speed = 500; -function sendPrx(%x){ - for(%i = %x; %i < $prx::count && (%i - %x) < 50; %i++){ - %line = $prx::data[%i]; - %msg = "CDATA" @ "%c%" @ %i @ "%c%" @ %line @ "\r\n"; - if(isObject(discord)) - discord.send(%msg); - //discord.schedule(%i,"send",%msg); - } - if(%i < $prx::count) - schedule(128, 0, "sendPrx", %i); - else - discord.schedule(5000,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "buildprx" @ $discordBot::cmdSplit @ $prx::terFile @ $discordBot::cmdSplit @ $prx::misFile @ "\r\n"); -} - -function startPlayerPlot(%count){ - if(!$pathMaps::running && (($MatchStarted + $missionRunning) == 2)){ - if(%count > 1000){ - $pathMaps::maxCount = %count; - } - $prx::terFile = Terrain.terrainFile; - $prx::misFile = $missionName; - $prx::count = 0; - $pathMaps::running = 1; - pathMapData(); - sendToDiscord("Player Plot Started" SPC $pathMaps::maxCount, $discordBot::monitorChannel); - error("Player Plot Started"); - } - else{ - sendToDiscord("Game Has Not Started Yet", $discordBot::monitorChannel); - } -} -function floorVector(%vec){ - return mFloor(getWord(%vec,0)) SPC mFloor(getWord(%vec,1)) SPC mFloor(getWord(%vec,2)); -} -function pathDataPoint(%client){ - %player = %client.player; - if(isObject(%player)){ - %veh = (isObject(%client.vehicleMounted)) ? %client.vehicleMounted.getDataBlock().getName() : 0; - $prx::data[$prx::Count] = %client.nameBase @ "%c" @ %pos @ "%c" @ %client.team @ "%c" @ isObject(%player.holdingFlag) @ "%c" @ %veh @ "%c" @ getSimTime(); - $prx::count++; - } -} -function pathMapData(){ //loop to collect player position data - for(%x = 0; %x < ClientGroup.getCount(); %x++){ - %client = ClientGroup.getObject(%x); - %player = %client.player; - if(isObject(%player)){ - %pos = %player.getPosition(); - %fpos = floorVector(%pos); - if(%player.lpm !$= %fpos){ - %veh = (isObject(%client.vehicleMounted)) ? %client.vehicleMounted.getDataBlock().getName() : 0; - $prx::data[$prx::Count] = %client.nameBase @ "%c" @ %pos @ "%c" @ %client.team @ "%c" @ isObject(%player.holdingFlag) @ "%c" @ %veh @ "%c" @ getSimTime(); - $prx::count++; - } - %player.lpm = %fpos; - } - } - if(!($prx::eCount++ % 10)){error("pathMapData" SPC $prx::Count);} - - if($pathMaps::running && (($MatchStarted + $missionRunning) == 2) && $prx::Count < $pathMaps::maxCount){// note will stop at end of mission - schedule($pathMaps::speed, 0,"pathMapData"); - } - else{ - $pathMaps::running = 0; - sendToDiscord("Player Plot Processing", $discordBot::monitorChannel); - error("Player Plot Tracking Has Ended"); - sendPrx(0); - } -} - +} \ No newline at end of file From 9b97a649ddf4d588df653182cf748e80016d2337 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Wed, 27 Apr 2022 14:48:05 -0400 Subject: [PATCH 17/65] Added Coyote sound 100 points --- Classic/scripts/LakRabbitGame.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Classic/scripts/LakRabbitGame.cs b/Classic/scripts/LakRabbitGame.cs index a2cc10d..1604fd4 100755 --- a/Classic/scripts/LakRabbitGame.cs +++ b/Classic/scripts/LakRabbitGame.cs @@ -733,6 +733,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am else if(%points >= 100) { messageAll('', '~wfx/Misc/Flair.wav'); + messageAll('', '~wfx/Bonuses/Nouns/coyote.wav'); } Game.recalcScore(%sourceObject.client); From 4fcfbcf565ada241ee42eb19fd841fdd53775449 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 3 May 2022 16:58:03 -0400 Subject: [PATCH 18/65] OG Blaster (pub only) --- Classic/scripts/autoexec/TacoOverrides.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/TacoOverrides.cs b/Classic/scripts/autoexec/TacoOverrides.cs index a2d85c8..a65f9d8 100755 --- a/Classic/scripts/autoexec/TacoOverrides.cs +++ b/Classic/scripts/autoexec/TacoOverrides.cs @@ -155,7 +155,7 @@ function stationTrigger::onEnterTrigger(%data, %obj, %colObj) function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC) { //Takes 11 blaster shots to kill a heavy, 13 normal. - if(%targetObject.client.armor $= "Heavy" && %damageType $= $DamageType::Blaster) + if(%targetObject.client.armor $= "Heavy" && %damageType $= $DamageType::Blaster && !$Host::TournamentMode) //Free-for-all only %amount *= 1.15; Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC); From 648d3caa29bd30d6d1b1706f95df2a6acb5f8bab Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 6 May 2022 11:08:58 -0400 Subject: [PATCH 19/65] Added Fireworks --- Classic/scripts/LakRabbitGame.cs | 54 +++++++++++++++++++++++++++++++- Classic/scripts/dtChatCmdGame.cs | 2 +- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/Classic/scripts/LakRabbitGame.cs b/Classic/scripts/LakRabbitGame.cs index 1604fd4..ff31196 100755 --- a/Classic/scripts/LakRabbitGame.cs +++ b/Classic/scripts/LakRabbitGame.cs @@ -732,8 +732,8 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am } else if(%points >= 100) { + blastFireworks(); messageAll('', '~wfx/Misc/Flair.wav'); - messageAll('', '~wfx/Bonuses/Nouns/coyote.wav'); } Game.recalcScore(%sourceObject.client); @@ -1052,6 +1052,58 @@ function missileEveryone(%attacker) if(Game.duelMode && %attacker.holdingFlag) %attacker.client.duelSeconds += 15; } + +function blastFireworks(%deezFireworks) +{ + if(!ClientGroup.getCount()) + return; + + // find a random client. + %client = ClientGroup.getObject(getRandom(ClientGroup.getCount() - 1)); + + if(isObject(%client.player) && isObject(Game)) + { + %distance = Sky.visibleDistance; + if(!%distance || %distance > 250) + %distance = 250; + + %position = %client.player.position; + // Vary by half of the visible distance. + %neg = getRandom(0, 1) - 1; + %x = getWord(%position, 0) + ((%distance - getRandom(%distance / 2)) * %neg); + %neg = getRandom(0, 1) - 1; // Randomize it again. + %y = getWord(%position, 1) + ((%distance - getRandom(%distance / 2)) * %neg); + %z = getWord(%position, 2) + (%distance - getRandom(%distance / 2)); + + %random = getRandom(1, $fireworkDatablockCount); + deezFireworksExplode(%x SPC %y SPC %z, %random); + } + + if(%deezFireworks <= 10) + { + %deezFireworks = %deezFireworks + 1; + $deezFireworksSchedule = schedule(getRandom(700), 0, "blastFireworks", %deezFireworks); + } +} + +function deezFireworksExplode(%position, %id) +{ + %emitter = new ParticleEmissionDummy() + { + position = %position; + rotation = "1 0 0 0"; + scale = "1 1 1"; + datablock = "defaultEmissionDummy"; + emitter = "FireworksEmitter" @ %id; + velocity = "1"; + }; + + //echo(%emitter.position); + //serverPlay3d(dtFireworksSound, %emitter.position); + MissionCleanup.add(%emitter); + %emitter.schedule(1250, "delete"); +} + function killEveryone(%ignore, %message) { if(!%message) diff --git a/Classic/scripts/dtChatCmdGame.cs b/Classic/scripts/dtChatCmdGame.cs index 199456d..f517e33 100755 --- a/Classic/scripts/dtChatCmdGame.cs +++ b/Classic/scripts/dtChatCmdGame.cs @@ -955,7 +955,7 @@ function explodeFirework(%position, %id) }; //echo(%emitter.position); - serverPlay3d(dtFireworksSound, %emitter.position); + //serverPlay3d(dtFireworksSound, %emitter.position); MissionCleanup.add(%emitter); %emitter.schedule(1250, "delete"); } From 25653871e8fae904ba5538f134de1fe7c7e10dad Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 7 May 2022 12:25:22 -0400 Subject: [PATCH 20/65] Admin messages --- Classic/scripts/autoexec/VoteMenu.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 79eb90e..68a8d92 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -564,13 +564,13 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if($Host::Password !$= "") { $Host::Password = ""; - messageClient( %client, '', "PUG password been disabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', "PUG password been disabled.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has disabled pug password." ); } else { $Host::Password = $Host::PUGPassword; - messageClient( %client, '', "PUG password been enabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', "PUG password been enabled.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has enabled pug password." ); } } @@ -583,7 +583,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(!isActivePackage(LockedTeams)) activatePackage(LockedTeams); $LockedTeams = 1; - messageClient( %client, '', "Locked Teams has been enabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', "Locked Teams has been enabled.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has enabled Locked Teams."); } else @@ -591,7 +591,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(isActivePackage(LockedTeams)) deactivatePackage(LockedTeams); $LockedTeams = 0; - messageClient( %client, '', "Locked Teams has been disabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', "Locked Teams has been disabled.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has disabled Locked Teams."); } } @@ -606,7 +606,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(isActivePackage(checkver)) deactivatePackage(checkver); - messageClient( %client, '', "Tournament Net Client checking has been disabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', "Tournament Net Client checking has been disabled.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has disabled Net Tourney Client checking."); } else @@ -619,7 +619,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % //Boot Offenders into Obs CheckVerObserver(%client); - messageClient( %client, '', "Tournament Net Client checking has been enabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', "Tournament Net Client checking has been enabled.~wfx/powered/vehicle_screen_on.wav" ); ResetGetCountsStatus(); adminLog(%client, " has enabled Net Tourney Client checking."); } From a6fe4aa346a01e799d65191338102d280d54ee93 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 7 May 2022 12:40:31 -0400 Subject: [PATCH 21/65] Display names --- Classic/scripts/autoexec/VoteMenu.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 68a8d92..bf151f2 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -564,13 +564,13 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if($Host::Password !$= "") { $Host::Password = ""; - messageAdmins('', "PUG password been disabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', %client.nameBase @ " has disabled pug password.~wfx/powered/vehicle_screen_on.wav"); adminLog(%client, " has disabled pug password." ); } else { $Host::Password = $Host::PUGPassword; - messageAdmins('', "PUG password been enabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', %client.nameBase @ " has enabled pug password.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has enabled pug password." ); } } @@ -583,7 +583,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(!isActivePackage(LockedTeams)) activatePackage(LockedTeams); $LockedTeams = 1; - messageAdmins('', "Locked Teams has been enabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', %client.nameBase @ " has enabled Locked Teams.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has enabled Locked Teams."); } else @@ -591,7 +591,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(isActivePackage(LockedTeams)) deactivatePackage(LockedTeams); $LockedTeams = 0; - messageAdmins('', "Locked Teams has been disabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', %client.nameBase @ " has disabled Locked Teams.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has disabled Locked Teams."); } } @@ -606,7 +606,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(isActivePackage(checkver)) deactivatePackage(checkver); - messageAdmins('', "Tournament Net Client checking has been disabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', %client.nameBase @ " has disabled Net Tourney Client checking.~wfx/powered/vehicle_screen_on.wav" ); adminLog(%client, " has disabled Net Tourney Client checking."); } else @@ -619,7 +619,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % //Boot Offenders into Obs CheckVerObserver(%client); - messageAdmins('', "Tournament Net Client checking has been enabled.~wfx/powered/vehicle_screen_on.wav" ); + messageAdmins('', %client.nameBase @ " has enabled Net Tourney Client checking.~wfx/powered/vehicle_screen_on.wav" ); ResetGetCountsStatus(); adminLog(%client, " has enabled Net Tourney Client checking."); } From 35811e33f840b3d64305bf63ebbb2610a52c26af Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 8 May 2022 02:34:54 -0400 Subject: [PATCH 22/65] Wrong spot --- Classic/scripts/autoexec/VoteMenu.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index bf151f2..611332a 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -259,12 +259,6 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % switch$(%typeName) { case "VoteKickPlayer": - if($Host::TournamentMode && !$Host::AllowPlayerTournamentModeVotekick) // Dont allow Votekicks in Tournament Mode - { - messageClient(%client, "", "\c2No votekicks in Tournament Mode."); - return; - } - if(%client == %arg1) // client is trying to votekick himself return; // Use the leave button instead, pal. @@ -278,6 +272,12 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } else // Player is voting to kick { + if($Host::TournamentMode && !$Host::AllowPlayerTournamentModeVotekick) // Dont allow Votekicks in Tournament Mode + { + messageClient(%client, "", "\c2No votekicks in Tournament Mode."); + return; + } + if(%arg1.isAdmin) // target is an admin { messageClient(%client, "MsgClient", "\c2You cannot vote to kick "@%arg1.nameBase@", "@(%arg1.sex $= "Male" ? "he" : "she")@" is an admin!"); From d9ee54045b094311bc3e81ce8159dd881a72ffdf Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 8 May 2022 13:53:25 -0400 Subject: [PATCH 23/65] Always obs --- Classic/scripts/autoexec/VoteMenu.cs | 32 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 611332a..d1c789b 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -1532,32 +1532,36 @@ function serverCmdClientJoinGame(%client) { if($LockedTeams) { - messageClient( %client, '', "Teams are locked. Ask an admin to set your team." ); + messageClient( %client, '', "Teams are locked. Wait to be assigned a team." ); return; } Parent::serverCmdClientJoinGame(%client); } +//exec("Scripts/autoexec/votemenu.cs"); function serverCmdClientPickedTeam(%client, %option) { - Parent::serverCmdClientPickedTeam(%client, %option); //Put first - if($LockedTeams) //Added - { - if($Host::TournamentMode && %client.team !$= 0) //Added - { - messageClient( %client, '', "Teams are locked. Ask an admin to set your team." ); - schedule(1000, 0, "ClearCenterPrint", %client); //So Press FIRE when ready is cleared, later down the pipe - serverCmdClientMakeObserver( %client ); - } - return; - } + if(!$Host::TournamentMode) + return; + + //All roads lead to observer + if( isObject(%client.player) ) + { + %client.player.scriptKill(0); + ClearBottomPrint(%client); + } + Game.forceObserver( %client, "playerChoose" ); + %client.observerMode = "observer"; + %client.notReady = false; + messageClient( %client, '', "Teams are locked. Wait to be assigned a team." ); + return; } function serverCmdClientTeamChange(%client, %option) { if($LockedTeams) { - messageClient( %client, '', "Teams are locked. Ask an admin to set your team." ); + messageClient( %client, '', "Teams are locked. Wait to be assigned a team." ); return; } Parent::serverCmdClientTeamChange(%client, %option); @@ -1613,4 +1617,4 @@ function VoteSound(%teamSpecific, %typename, %arg1, %arg2, %msg) echo(%vip SPC %msg); } } -} +} \ No newline at end of file From 9841b1e98aaf1cd10af99f98bcf58a916655b6ca Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 8 May 2022 15:01:35 -0400 Subject: [PATCH 24/65] Time Changes View Time Limit in Vote Menu Admin can change the Time Limit to 30 in Tourney Mode from the Vote Menu More Practical Vote Times Always Autoset Time to 30 in TourneyMode --- .../scripts/autoexec/MissionTypeOptions.cs | 4 +++ Classic/scripts/autoexec/VoteMenu.cs | 29 ++++++++++++++++--- Classic/scripts/defaultGame.cs | 8 ++--- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/Classic/scripts/autoexec/MissionTypeOptions.cs b/Classic/scripts/autoexec/MissionTypeOptions.cs index baf682e..0efe6b1 100644 --- a/Classic/scripts/autoexec/MissionTypeOptions.cs +++ b/Classic/scripts/autoexec/MissionTypeOptions.cs @@ -56,6 +56,10 @@ function loadMissionStage2() $Host::HiVisibility = "0"; //always SPEED } + //TimeLimit Always 30 minutes in Tourney Mode + if($Host::TournamentMode) + $Host::TimeLimit = "30"; + //Siege NoBaseRape Fix if($CurrentMissionType $= "Siege") $Host::NoBaseRapeEnabled = 0; diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index d1c789b..fda128b 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -79,8 +79,10 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) switch$($CurrentMissionType) { case CTF or SCtF: + if($Host::TournamentMode) + %showTL = " - Time Limit:" SPC $Host::TimeLimit; messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win", - $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win"); + $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL); case LakRabbit: %cap = "2000 Points to Win"; messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap, @@ -418,12 +420,31 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % //If proposed time is lower than server set or higher than unlimited if(%arg1 < $Host::TimeLimit || %arg1 > 999) { - messageClient(%client, "", "\c2Invalid time selection."); - return; + if(!%isAdmin) + { + messageClient(%client, "", "\c2Invalid time selection."); + return; + } + else //is an admin + { + if($Host::TournamentMode) //Admins still have the option to set the time to 30 minutes in Tourney Mode + { + if(%arg1 !$= "30") //30 minutes only + { + messageClient(%client, "", "\c2Invalid time selection."); + return; + } + } + else + { + messageClient(%client, "", "\c2Invalid time selection."); + return; + } + } } //If proposed time is something other than what is selectable - if(%arg1 !$= "90" && %arg1 !$= "120" && %arg1 !$= "150" && %arg1 !$= "180" && %arg1 !$= "240" && %arg1 !$= "360" && %arg1 !$= "480" && %arg1 !$= "999") + if(%arg1 !$= "30" && %arg1 !$= "45" && %arg1 !$= "60" && %arg1 !$= "75" && %arg1 !$= "90" && %arg1 !$= "180" && %arg1 !$= "360" && %arg1 !$= "999") { messageClient(%client, "", "\c2Only selectable times allowed."); return; diff --git a/Classic/scripts/defaultGame.cs b/Classic/scripts/defaultGame.cs index bad9b3f..13edbfa 100755 --- a/Classic/scripts/defaultGame.cs +++ b/Classic/scripts/defaultGame.cs @@ -2973,13 +2973,13 @@ function DefaultGame::sendGameTeamList( %game, %client, %key ) //------------------------------------------------------------------------------ function DefaultGame::sendTimeLimitList( %game, %client, %key ) { + messageClient( %client, 'MsgVoteItem', "", %key, 30, "", '30 minutes' ); + messageClient( %client, 'MsgVoteItem', "", %key, 45, "", '45 minutes' ); + messageClient( %client, 'MsgVoteItem', "", %key, 60, "", '60 minutes' ); + messageClient( %client, 'MsgVoteItem', "", %key, 75, "", '75 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 90, "", '90 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 120, "", '120 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 150, "", '150 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 180, "", '180 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 240, "", '240 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 360, "", '360 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 480, "", '480 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 999, "", 'No time limit' ); } From 9e08e5c48980e7b012becd3c4b369decb496fe3e Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 8 May 2022 15:15:28 -0400 Subject: [PATCH 25/65] Linux Icon --- Classic/scripts/autoexec/MemPatches.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classic/scripts/autoexec/MemPatches.cs b/Classic/scripts/autoexec/MemPatches.cs index 833db4d..14db81c 100644 --- a/Classic/scripts/autoexec/MemPatches.cs +++ b/Classic/scripts/autoexec/MemPatches.cs @@ -52,3 +52,6 @@ function serverCmd(%client) //Disable UE box on crash //Used if a clean crash is desired //memPatch("7dc7fc","90"); + +//Show Linux Icon in server list +//memPatch("5C9628","80CB05"); From df06f0efcb244e9c9057cd0fae6dc0ff73698973 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 15:03:46 -0400 Subject: [PATCH 26/65] Vote System Adjustments A lot of changes Stop vote fix Set Next Mission Added Description adjustments Admin "Vote for..." In Tourney Mode LCTF Pro Mode: Blaster >> Shocklance --- Classic/scripts/DMGame.cs | 249 +++++---- Classic/scripts/LakRabbitGame.cs | 38 +- Classic/scripts/SCtFGame.cs | 47 +- Classic/scripts/autoexec/VoteMenu.cs | 732 ++++++++++++++++----------- 4 files changed, 591 insertions(+), 475 deletions(-) diff --git a/Classic/scripts/DMGame.cs b/Classic/scripts/DMGame.cs index b598b38..bb55248 100644 --- a/Classic/scripts/DMGame.cs +++ b/Classic/scripts/DMGame.cs @@ -40,7 +40,7 @@ function DMGame::setUpTeams(%game) %group = nameToID("MissionGroup/Teams"); if(%group == -1) return; - + // create a team0 if it does not exist %team = nameToID("MissionGroup/Teams/team0"); if(%team == -1) @@ -48,7 +48,7 @@ function DMGame::setUpTeams(%game) %team = new SimGroup("team0"); %group.add(%team); } - + // 'team0' is not counted as a team here %game.numTeams = 0; while(%team != -1) @@ -56,7 +56,7 @@ function DMGame::setUpTeams(%game) // create drop set and add all spawnsphere objects into it %dropSet = new SimSet("TeamDrops" @ %game.numTeams); MissionCleanup.add(%dropSet); - + %spawns = nameToID("MissionGroup/Teams/team" @ %game.numTeams @ "/SpawnSpheres"); if(%spawns != -1) { @@ -64,21 +64,21 @@ function DMGame::setUpTeams(%game) for(%i = 0; %i < %count; %i++) %dropSet.add(%spawns.getObject(%i)); } - + // set the 'team' field for all the objects in this team %team.setTeam(0); - + clearVehicleCount(%team+1); // get next group %team = nameToID("MissionGroup/Teams/team" @ %game.numTeams + 1); if (%team != -1) %game.numTeams++; } - + // set the number of sensor groups (including team0) that are processed setSensorGroupCount(%game.numTeams + 1); %game.numTeams = 1; - + // allow teams 1->31 to listen to each other (team 0 can only listen to self) for(%i = 1; %i < 32; %i++) setSensorGroupListenMask(%i, 0xfffffffe); @@ -106,7 +106,7 @@ function DMGame::equip(%game, %player) for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); - + if( $Host::DMSLOnlyMode ) { %player.clearInventory(); @@ -122,7 +122,7 @@ function DMGame::equip(%game, %player) buyFavorites(%player.client); %player.setEnergyLevel(%player.getDataBlock().maxEnergy); %player.selectWeaponSlot( 0 ); - + // do we want to give players a disc launcher instead? GJL: Yes we do! %player.use("Disc"); } @@ -137,7 +137,7 @@ function DMGame::pickPlayerSpawn(%game, %client, %respawn) function DMGame::clientJoinTeam( %game, %client, %team, %respawn ) { %game.assignClientTeam( %client ); - + // Spawn the player: %game.spawnPlayer( %client, %respawn ); } @@ -146,7 +146,7 @@ function DMGame::assignClientTeam(%game, %client) { for(%i = 1; %i < 32; %i++) $DMTeamArray[%i] = false; - + %maxSensorGroup = 0; %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) @@ -159,7 +159,7 @@ function DMGame::assignClientTeam(%game, %client) %maxSensorGroup = %cl.team; } } - + //now loop through the team array, looking for an empty team for(%i = 1; %i < 32; %i++) { @@ -171,14 +171,14 @@ function DMGame::assignClientTeam(%game, %client) break; } } - + // set player's skin pref here setTargetSkin(%client.target, %client.skin); - + // Let everybody know you are no longer an observer: messageAll( 'MsgClientJoinTeam', '\c1%1 has joined the fray.', %client.name, "", %client, 1 ); updateCanListenState( %client ); - + //now set the max number of sensor groups... setSensorGroupCount(%maxSensorGroup + 1); } @@ -190,9 +190,9 @@ function DMGame::clientMissionDropReady(%game, %client) messageClient(%client, 'MsgDMPlayerDies', "", 0); messageClient(%client, 'MsgDMKill', "", 0); %game.resetScore(%client); - + messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); - + DefaultGame::clientMissionDropReady(%game, %client); } @@ -205,7 +205,7 @@ function DMGame::AIHasJoined(%game, %client) function DMGame::checkScoreLimit(%game, %client) { %scoreLimit = MissionGroup.DM_scoreLimit; - + if(%scoreLimit $= "") %scoreLimit = 25; if(%client.score >= %scoreLimit) @@ -215,7 +215,7 @@ function DMGame::checkScoreLimit(%game, %client) function DMGame::createPlayer(%game, %client, %spawnLoc, %respawn) { DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn); - + %client.setSensorGroup(%client.team); %client.isObserver = 0; } @@ -230,7 +230,7 @@ function DMGame::resetScore(%game, %client) %client.MidAir = 0; %client.Bonus = 0; %client.KillStreakBonus = 0; - + // not a score thing but needs to be reset %client.killCounter = 0; } @@ -244,35 +244,35 @@ function DMGame::forceObserver( %game, %client, %reason ) function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) { cancel(%clVictim.player.alertThread); - + DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc); - + ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc); } function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) -{ +{ if(%clVictim.isMarked && $DMGame::mode) { if(%clKiller $= "" || %clVictim.killCounter < 3) return; - + if(%clVictim == %clKiller || %damageType == $DamageType::Suicide || %damageType == $DamageType::Lava || %damageType == $DamageType::OutOfBounds || %damageType == $DamageType::Ground || %damageType == $DamageType::Lightning) { messageAll('Msgding', '\c2%1\'s Kill Streak has ended. No bonus rewarded.', %clVictim.name, %clVictim.killCounter); %game.lastGuy = 0; } else if(%clVictim !$= %clKiller) - { + { %temprampage = mfloor((%clVictim.killCounter - $DMGame::wpKillCount) * %game.SCORE_PER_KILLSTREAKBONUS); %s = ""; //single bonus - if(%clVictim.killCounter < $DMGame::wpKillCountDoubleBonus) + if(%clVictim.killCounter < $DMGame::wpKillCountDoubleBonus) { - %clKiller.Bonus++; // stats rename to what ever + %clKiller.Bonus++; // stats rename to what ever %clKiller.scoreBonus++; - + //messageAll('Msgding', '\c1%1 receives a bonus for ending %2\'s %3x kill streak.~wfx/misc/flag_lost.wav',%clKiller.name,%clVictim.name, %clVictim.killCounter); messageAllExcept(%clVictim, -1, 'Msgding', '\c4%1 is rewarded with a bonus for ending %5\'s %6X Kill Streak!~wfx/misc/flag_lost.wav', %clKiller.name, "", %clVictim, 1, %clVictim.name, %clVictim.killCounter ); if(%temprampage > 0) @@ -284,11 +284,11 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d messageClient(%clVictim, 'Msgding', '\c2%1 has ended your %2X Kill Streak.~wfx/misc/flag_lost.wav', %clKiller.name, %clVictim.killCounter); } //double bonus - else + else { %clKiller.Bonus++; %clKiller.Bonus++; %clKiller.scoreBonus++; %clKiller.scoreBonus++; - + //messageAll('Msgding', '\c1%1 receives a double bonus for ending %2\'s %3x kill streak.~wfx/misc/flag_lost.wav',%clKiller.name,%clVictim.name, %clVictim.killCounter); messageAllExcept(%clVictim, -1, 'Msgding', '\c4%1 is rewarded with a double bonus for ending %5\'s %6X Kill Streak!~wfx/misc/flag_lost.wav', %clKiller.name, "", %clVictim, 1, %clVictim.name, %clVictim.killCounter ); if(%temprampage > 0) @@ -323,19 +323,19 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d } %clKiller.killCounter++; %clVictim.killCounter = 0; - + switch$($DMGame::mode) { - case 1: // player with the highest kill streak if they are above $DMGame::wpKillCount + case 1: // player with the highest kill streak if they are above $DMGame::wpKillCount %bonusClient = 0; for(%b = 0; %b < ClientGroup.getCount(); %b++) { %cl = ClientGroup.getObject(%b); if(%cl.killCounter >= $DMGame::wpKillCount && %cl.killCounter > %bonusClient.killCounter && !%cl.isObserver) { - %bonusClient = %cl;// we have a new + %bonusClient = %cl;// we have a new } - } + } if(%bonusClient !$= 0 && %clKiller == %bonusClient) { if(%bonusClient !$= %game.lastGuy) @@ -343,7 +343,7 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d for(%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); - + hideTargetWaypoint(%cl,%game.lastGuy); if(%cl !$= %bonusClient) { @@ -352,13 +352,13 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d } messageAllExcept(%bonusClient, -1, 'MsgPingWaypoint', '\c2%1 is on a Kill Streak. Kill them for a bonus!~wgui/vote_nopass.wav', %bonusClient.name, "", %bonusClient, 1 ); messageClient(%bonusClient, 'MsgPingWaypoint', '\c2You\'re on a Kill Streak. Get more kills for extra points!~wfx/misc/target_waypoint.wav', %bonusClient.killCounter); - - %game.lastGuy.isMarked = 0; + + %game.lastGuy.isMarked = 0; %bonusClient.isMarked = 1; - %game.lastGuy = %bonusClient; + %game.lastGuy = %bonusClient; } - else if(%bonusClient == %game.lastGuy && %bonusClient.killCounter > 3) - { + else if(%bonusClient == %game.lastGuy && %bonusClient.killCounter > 3) + { //give waypointed player a kill bonus %bonusClient.KillStreakBonus++; %bonusClient.scoreKillStreakBonus++; @@ -375,7 +375,7 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d %bonusClient = %cl; } - } + } if(%bonusClient != 0 && %game.lastGuy != %bonusClient) { for(%i = 0; %i < ClientGroup.getCount(); %i++) @@ -423,7 +423,7 @@ function hideTargetWaypoint(%client,%clTarget) %visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup()); %visMask &= ~(1 << %client.getSensorGroup()); setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask); - removeClientTargetType(%client, "AssignedTask"); + removeClientTargetType(%client, "AssignedTask"); } } @@ -437,7 +437,7 @@ function DMGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %imp } else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide %game.awardScoreSuicide(%clVictim); - + messageClient(%clVictim, 'MsgDMPlayerDies', "", %clVictim.deaths + %clVictim.suicides); } @@ -449,12 +449,12 @@ function DMGame::recalcScore(%game, %client) %BonusValue = %client.Bonus * %game.SCORE_PER_BONUS; %MidAirValue = %client.MidAir * %game.SCORE_PER_MIDAIR; %KillStreakBonusValue = %client.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS; - + if (%killValue - %deathValue == 0) %client.efficiency = %suicideValue; else %client.efficiency = ((%killValue * %killValue) / (%killValue - (%deathValue + %suicideValue))) + (%BonusValue + %MidAirValue + %KillStreakBonusValue); - + %client.score = mFloatLength(%client.efficiency, 1); messageClient(%client, 'MsgYourScoreIs', "", %client.score); %game.recalcTeamRanks(%client); @@ -479,12 +479,12 @@ function DMGame::gameOver(%game) { //call the default DefaultGame::gameOver(%game); - + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); - + cancel(%game.timeThread); messageAll('MsgClearObjHud', ""); - for(%i = 0; %i < ClientGroup.getCount(); %i ++) + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { %client = ClientGroup.getObject(%i); %game.resetScore(%client); @@ -507,32 +507,32 @@ function plzBounceOffGrid(%obj, %bounceForce, %count) %boundsNorth = getWord(%bounds, 1); %boundsEast = %boundsWest + getWord(%bounds, 2); %boundsSouth = %boundsNorth + getWord(%bounds, 3); - + %shapePos = %obj.getPosition(); %shapex = firstWord(%shapePos); %shapey = getWord(%shapePos, 1); - + if( %shapex >= %boundsWest && %shapex <= %boundsEast && %shapey >= %boundsNorth && %shapey <= %boundsSouth) { // we don't need to bounce at all return; } - + if( %count == 8 ) { // just kill this retard %obj.scriptKill($DamageType::OutOfBounds); return; } - + if (%bounceForce $= "") %bounceForce = 65; - + %oldVel = %obj.getVelocity(); %obj.setVelocity("0 0 0"); - + %vecx = firstWord(%oldVel); %vecy = getWord(%oldVel, 1); %vecz = getWord(%oldVel, 2); - + // four cases, not two cases you fucktard kineticpoet // no wonder the trives of vengrances failed if(%shapex <= %boundsWest) { @@ -541,16 +541,16 @@ function plzBounceOffGrid(%obj, %bounceForce, %count) else if(%shapex >= %boundsEast) { %vecx = -mAbs(%vecx); } - + if(%shapey <= %boundsNorth) { %vecy = mAbs(%vecy); } else if(%shapey >= %boundsSouth) { %vecy = -mAbs(%vecy); } - + %vec = %vecx SPC %vecy SPC %vecz; - + // If the object's speed was pretty slow, give it a boost %oldSpeed = VectorLen(%oldVel); if (%oldSpeed < 25) @@ -560,11 +560,11 @@ function plzBounceOffGrid(%obj, %bounceForce, %count) } else %vec = VectorScale(%vec, 1.15); - + // apply the impulse to the object //%obj.applyImpulse(%obj.getWorldBoxCenter(), %vec); %obj.setVelocity(%vec); - + // repeat this bounce 4 times per second. if we're oob for 2 seconds, take action // don't do this with the flag because that has its own thread if( %obj.dataBlock !$= "Flag" ) { @@ -582,7 +582,7 @@ function isOutOfBounds(%position) %boundsNorth = getWord(%bounds, 1); %boundsEast = %boundsWest + getWord(%bounds, 2); %boundsSouth = %boundsNorth + getWord(%bounds, 3); - + return (%shapex < %boundsWest || %shapex > %boundsEast || %shapey < %boundsNorth || %shapey > %boundsSouth); } @@ -591,7 +591,7 @@ function DMGame::leaveMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; - + plzBounceOffGrid(%player, 65); } @@ -607,7 +607,7 @@ function DMGame::DMAlertPlayer(%game, %count, %player) function DMGame::MissionAreaDamage(%game, %player) { - if(%player.getState() !$= "Dead") + if(%player.getState() !$= "Dead") { %player.setDamageFlash(0.1); %prevHurt = %player.getDamageLevel(); @@ -622,27 +622,27 @@ function DMGame::updateScoreHud(%game, %client, %tag) { // Clear the header: messageClient( %client, 'SetScoreHudHeader', "", "" ); - + // Send the subheader: messageClient(%client, 'SetScoreHudSubheader', "", '\tPLAYER\tRATING\tKILLS\tDEATHS\tBONUS'); - + for (%index = 0; %index < $TeamRank[0, count]; %index++) { //get the client info %cl = $TeamRank[0, %index]; - + //get the score %clScore = %cl.score; - + %clKills = mFloatLength( %cl.kills, 0 ); %clDeaths = mFloatLength( %cl.deaths + %cl.suicides, 0 ); %clBonus = mFloor((%cl.Bonus * %game.SCORE_PER_BONUS) + (%cl.MidAir * %game.SCORE_PER_MIDAIR) + (%cl.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS )); - %clStyle = %cl == %client ? "" : ""; - + %clStyle = %cl == %client ? "" : ""; + //%BonusValue = %client.Bonus * %game.SCORE_PER_BONUS; //%MidAirValue = %client.MidAir * %game.SCORE_PER_MIDAIR; //%KillStreakBonusValue = %client.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS; - + //if the client is not an observer, send the message if (%client.team != 0) { // \%5\%1\%2\%3\tBG' @@ -656,7 +656,7 @@ function DMGame::updateScoreHud(%game, %client, %tag) %cl.name, %clScore, %clKills, %clDeaths, %clStyle, %cl, %clBonus); } } - + // Tack on the list of observers: %observerCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) @@ -665,7 +665,7 @@ function DMGame::updateScoreHud(%game, %client, %tag) if (%cl.team == 0) %observerCount++; } - + if (%observerCount > 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, ""); @@ -686,7 +686,7 @@ function DMGame::updateScoreHud(%game, %client, %tag) } } } - + //clear the rest of Hud so we don't get old lines hanging around... messageClient( %client, 'ClearHud', "", %tag, %index ); } @@ -698,13 +698,13 @@ function DMGame::updateScoreHud(%game, %client, %tag) package DMGame { - + function deployMineCheck(%mineObj, %player) { // explode it vgc schedule(2000, %mineObj, "explodeMine", %mineObj, true); } - + //Take out anything vehicle related function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC) { @@ -714,19 +714,19 @@ package DMGame { %amount *= 1.3; } - + if(%targetObject.client.armor $= "Heavy") { %amount *= 1.43; } - + //error("Armor::damageObject( "@%data@", "@%targetObject@", "@%sourceObject@", "@%position@", "@%amount@", "@%damageType@", "@%momVec@" )"); if(%targetObject.invincible || %targetObject.getState() $= "Dead") return; %targetClient = %targetObject.getOwnerClient(); if(isObject(%mineSC)) - %sourceClient = %mineSC; + %sourceClient = %mineSC; else %sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0; @@ -740,8 +740,8 @@ package DMGame //if (%sourceClient) // %sourceTeam = %sourceClient.getSensorGroup(); //else if(%damageType == $DamageType::Suicide) - // %sourceTeam = 0; - + // %sourceTeam = 0; + // if teamdamage is off, and both parties are on the same team // (but are not the same person), apply no damage //if(!$teamDamage && (%targetClient != %sourceClient) && (%targetTeam == %sourceTeam)) @@ -749,7 +749,7 @@ package DMGame if(%targetObject.isShielded && %damageType != $DamageType::Blaster) %amount = %data.checkShields(%targetObject, %position, %amount, %damageType); - + if(%amount == 0) return; @@ -757,11 +757,11 @@ package DMGame %damageScale = %data.damageScale[%damageType]; if(%damageScale !$= "") %amount *= %damageScale; - + %flash = %targetObject.getDamageFlash() + (%amount * 2); if (%flash > 0.75) %flash = 0.75; - + // Teratos: Originally from Eolk? Mine+Disc tracking/death message support. // No Schedules by DarkTiger Ver.2 %targetClient.mineDisc = false; @@ -770,17 +770,17 @@ package DMGame case $DamageType::Disc: if((getSimTime() - %targetClient.mdcTime1) < 256) %targetClient.mineDisc = true; - - %targetClient.mdcTime2 = getSimTime(); + + %targetClient.mdcTime2 = getSimTime(); case $DamageType::Mine: if((getSimTime() - %targetClient.mdcTime2) < 256) %targetClient.mineDisc = true; - - %targetClient.mdcTime1 = getSimTime(); + + %targetClient.mdcTime1 = getSimTime(); } // -- End Mine+Disc insert. - + %previousDamage = %targetObject.getDamagePercent(); %targetObject.setDamageFlash(%flash); %targetObject.applyDamage(%amount); @@ -788,76 +788,69 @@ package DMGame %targetClient.lastDamagedBy = %damagingClient; %targetClient.lastDamaged = getSimTime(); - - //now call the "onKilled" function if the client was... you know... + + //now call the "onKilled" function if the client was... you know... if(%targetObject.getState() $= "Dead") { // where did this guy get it? %damLoc = %targetObject.getDamageLocation(%position); - + // should this guy be blown apart? - if( %damageType == $DamageType::Explosion || - %damageType == $DamageType::Mortar || - %damageType == $DamageType::SatchelCharge || - %damageType == $DamageType::Missile ) + if( %damageType == $DamageType::Explosion || + %damageType == $DamageType::Mortar || + %damageType == $DamageType::SatchelCharge || + %damageType == $DamageType::Missile ) { if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining { %targetObject.setMomentumVector(%momVec); - %targetObject.blowup(); + %targetObject.blowup(); } } - + // If we were killed, max out the flash %targetObject.setDamageFlash(0.75); - + %damLoc = %targetObject.getDamageLocation(%position); Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc); } else if ( %amount > 0.1 ) - { + { if( %targetObject.station $= "" && %targetObject.isCloaked() ) { %targetObject.setCloaked( false ); - %targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true ); + %targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true ); } - + playPain( %targetObject ); } - } + } }; function DMGame::sendGameVoteMenu(%game, %client, %key) { parent::sendGameVoteMenu( %game, %client, %key ); - + %isAdmin = ( %client.isAdmin || %client.isSuperAdmin ); - + if(!%client.canVote && !%isAdmin) return; - - if ( %game.scheduleVote $= "" ) + + if(%game.scheduleVote $= "") { - if(!%client.isAdmin) + if(!%isAdmin || (%isAdmin && %client.ForceVote)) { if(!$Host::DMSLOnlyMode) - messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Vote to enable Shocklance Only Mode' ); + messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' ); else - messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Vote to disable Shocklance Only Mode' ); - } - else if (%client.ForceVote > 0) - { - if(!$Host::DMSLOnlyMode) - messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Vote to enable Shocklance Only Mode' ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Vote to disable Shocklance Only Mode' ); + messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' ); } else { if(!$Host::DMSLOnlyMode) - messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Enable Shocklance Only Mode' ); + messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable Shocklance Only Mode', 'Enable Shocklance Only Mode' ); else - messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Disable Shocklance Only Mode' ); + messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable Shocklance Only Mode', 'Disable Shocklance Only Mode' ); } } } @@ -869,7 +862,7 @@ function DMGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4) case "DMSLOnlyMode": %game.DMSLOnlyMode(%admin, %arg1, %arg2, %arg3, %arg4); } - + parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4); } @@ -884,17 +877,17 @@ function DMGame::DMSLOnlyMode(%game, %admin, %arg1, %arg2, %arg3, %arg4) if(%admin) { killeveryone(); - + if( $Host::DMSLOnlyMode ) { messageAll('MsgAdminForce', '\c2The Admin has disabled Shocklance Only Mode.'); - + $Host::DMSLOnlyMode = false; } else { messageAll('MsgAdminForce', '\c2The Admin has enabled Shocklance Only Mode.'); - + $Host::DMSLOnlyMode = true; } } @@ -904,17 +897,17 @@ function DMGame::DMSLOnlyMode(%game, %admin, %arg1, %arg2, %arg3, %arg4) if(%totalVotes > 0 && (%game.totalVotesFor / ClientGroup.getCount()) > ($Host::VotePasspercent / 100)) { killeveryone(); - + if( $Host::DMSLOnlyMode ) { messageAll('MsgVotePassed', '\c2Shocklance Only Mode Disabled.'); - + $Host::DMSLOnlyMode = false; } else { messageAll('MsgVotePassed', '\c2Shocklance Only Mode Enabled.'); - + $Host::DMSLOnlyMode = true; } } @@ -932,13 +925,13 @@ function killEveryone(%ignore, %message) else messageAll('msgKillEveryone', %message); - for(%i = 0; %i < ClientGroup.getCount(); %i++) + for(%i = 0; %i < ClientGroup.getCount(); %i++) { %target = ClientGroup.getObject(%i); - + if(!%target.player || %target.player == %ignore) continue; - + %target.player.blowup(); %target.player.scriptKill(); } diff --git a/Classic/scripts/LakRabbitGame.cs b/Classic/scripts/LakRabbitGame.cs index ff31196..4a79979 100755 --- a/Classic/scripts/LakRabbitGame.cs +++ b/Classic/scripts/LakRabbitGame.cs @@ -1172,42 +1172,20 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key ) if( %game.scheduleVote $= "" ) { - if(!%isAdmin) + if(!%isAdmin || (%isAdmin && %client.ForceVote)) { if(!Game.duelMode) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' ); - if(!Game.noSplashDamage) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' ); - // DeVast - PubPro votes - if(!Game.PubPro) - messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Vote to enable Pro Mode' ); + if(!Game.PubPro) // DeVast - PubPro votes + messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode (Disc, Blaster, Plasma Only)', 'Vote to enable Pro Mode (Disc, Blaster, Plasma Only)' ); else - messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Vote to disable Pro Mode' ); - } - //Added so lak vote items are properly displayed in evo adminvotemenu - //A lot of changes were added to admin.ovl in evo - //see footnotes below - else if (%client.ForceVote > 0) - { - if(!Game.duelMode) - messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' ); - - if(!Game.noSplashDamage) - messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' ); - // DeVast - PubPro votes - if(!Game.PubPro) - messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Vote to enable Pro Mode' ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Vote to disable Pro Mode' ); + messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode (Disc, Blaster, Plasma Only)', 'Vote to disable Pro Mode (Disc, Blaster, Plasma Only)' ); } else { @@ -1215,16 +1193,14 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Enable Duel Mode' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Disable Duel Mode' ); - if(!Game.noSplashDamage) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Disable Splash Damage' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Enable Splash Damage' ); - // DeVast - PubPro votes - if(!Game.PubPro) - messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Enable Pro Mode' ); + if(!Game.PubPro) // DeVast - PubPro votes + messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode (Disc, Blaster, Plasma Only)', 'Enable Pro Mode (Disc, Blaster, Plasma Only)' ); else - messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Disable Pro Mode' ); + messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode (Disc, Blaster, Plasma Only)', 'Disable Pro Mode (Disc, Blaster, Plasma Only)' ); } } } diff --git a/Classic/scripts/SCtFGame.cs b/Classic/scripts/SCtFGame.cs index 31ff31f..61baafb 100755 --- a/Classic/scripts/SCtFGame.cs +++ b/Classic/scripts/SCtFGame.cs @@ -495,7 +495,7 @@ function SCtFGame::equip(%game, %player) { %player.clearInventory(); %player.setInventory(Disc,1); - %player.setInventory(Blaster,1); + %player.setInventory(Shocklance,1); %player.setInventory(GrenadeLauncher,1); %player.setInventory(DiscAmmo, %player.getDataBlock().max[DiscAmmo]); %player.setInventory(GrenadeLauncherAmmo, %player.getDataBlock().max[GrenadeLauncherAmmo]); @@ -2214,33 +2214,26 @@ function SCtFGame::sendGameVoteMenu(%game, %client, %key) if(!%client.canVote && !%isAdmin) return; - if ( %game.scheduleVote $= "" ) + if(%game.scheduleVote $= "") { - if(!%client.isAdmin) - { - //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Vote to change the Armor class' ); - //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' ); - if(!$Host::SCtFProMode) - messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' ); - } - else if (%client.ForceVote > 0) - { - if(!$Host::SCtFProMode) - messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' ); - } - else - { - if(!$Host::SCtFProMode) - messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Enable Pro Mode' ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Disable Pro Mode' ); - } - //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Change the Armor class' ); - //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' ); + if(!%isAdmin || (%isAdmin && %client.ForceVote)) + { + //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Vote to change the Armor class' ); + //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' ); + if(!$Host::SCtFProMode) + messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode (Disc, SL, GL Only)', 'Vote to enable Pro Mode (Disc, SL, GL Only)' ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Vote to disable Pro Mode (Disc, SL, GL Only)' ); + } + else + { + if(!$Host::SCtFProMode) + messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode (Disc, SL, GL Only)', 'Enable Pro Mode (Disc, SL, GL Only)' ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Disable Pro Mode (Disc, SL, GL Only)' ); + } + //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Change the Armor class' ); + //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' ); } } diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index fda128b..096b225 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -10,6 +10,7 @@ //$Host::AllowPlayerVoteTournamentMode = 1; //$Host::AllowPlayerVoteTeamDamage = 0; //$Host::AllowPlayerTournamentModeVotekick = 0; +$Host::AllowPlayerVoteNextMission = 1; //Vote Delay //Delay the ability to vote (For everyone) at the beginning of the match @@ -22,19 +23,41 @@ package ExtraVoteMenu { +function serverCmdGetVoteMenu( %client, %key ) +{ + if (isObject( Game ) && !%client.lockVMenu) + Game.sendGameVoteMenu( %client, %key ); + %client.lockVMenu = 0; +} + +function CycleMissions() +{ + if($voteNext) + { + %nextMission = $HostMissionFile[$voteNextMap]; + %type = $HostTypeName[$voteNextType]; + messageAll( 'MsgClient', 'Loading %1 (%2)...', %nextMission, $HostTypeDisplayName[$voteNextType] ); + loadMission( %nextMission, %type ); + $voteNextType = 0; + $voteNextMap = 0; + $voteNext = 0; + } + else + parent::CycleMissions(); +} + function DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4) { switch$ (%typeName) { - case "cancelMatchStart": + case "cancelMatchStart": %game.cancelMatchStart(%admin, %arg1, %arg2, %arg3, %arg4); - case "passRunningVote": %game.passRunningVote(%admin, %arg1, %arg2, %arg3, %arg4); - case "stopRunningVote": %game.stopRunningVote(%admin, %arg1, %arg2, %arg3, %arg4); - + case "VoteNextMission": + %game.setNextMission(%admin, %arg1, %arg2, %arg3, %arg4); default: Parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4); } @@ -42,205 +65,210 @@ function DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %a function DefaultGame::sendGameVoteMenu(%game, %client, %key) { - %isAdmin = (%client.isAdmin || %client.isSuperAdmin); - %multipleTeams = %game.numTeams > 1; + %isAdmin = (%client.isAdmin || %client.isSuperAdmin); + %multipleTeams = %game.numTeams > 1; + %client.k = %key; //For set next mission - // ******************************************** - // Admin Vote For ... Submenu - // ******************************************** - if (!$Host::TournamentMode) - { - if (%client.ForceVote > 0) - %client.ForceVote = %client.ForceVote - 1; + if (%client.ForceVote > 0) + %client.ForceVote = %client.ForceVote - 1; - if (%client.ForceVote > 0) - { - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'change server to Tournament.', 'Vote Tournament Mode'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); + //Admin Submenu + if (%client.ForceVote > 0) + { + if(!$Host::TournamentMode) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'change server to Tournament.', 'Vote Tournament Mode'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); + if(%multipleTeams) + { + if($teamDamage) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); + } + messageClient(%client, 'MsgVoteItem',"", %key, 'ForceVote', 'Cancel Force Vote', "Cancel 'Vote To...'"); + return; // Display no further vote options + } - if(%multipleTeams) - { - if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); - } + //Pass Stop Menu + if(%client.isAdmin && %game.scheduleVote !$= "") + { + if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) // allow admins to stop votes + messageClient( %client, 'MsgVoteItem', "", %key, 'stopRunningVote', 'stop current vote', 'Stop the Vote'); - messageClient(%client, 'MsgVoteItem',"", %key, 'ForceVote', 'Cancel Force Vote', "Cancel 'Vote To...'"); - return; // Display no further vote options - } - } + if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminPassVote)) // allow admins to pass votes + messageClient( %client, 'MsgVoteItem', "", %key, 'passRunningVote', 'pass current vote', 'Pass the Vote'); + return; + } - //Mission Info Header - Mission Name, Type, Caps to Win - if(%client.canVote) - { - switch$($CurrentMissionType) - { + //Mission Info Header - Mission Name, Type, Caps to Win + if(%client.canVote && %game.scheduleVote $= "") + { + switch$($CurrentMissionType) + { case CTF or SCtF: if($Host::TournamentMode) - %showTL = " - Time Limit:" SPC $Host::TimeLimit; - messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win", - $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL); - case LakRabbit: - %cap = "2000 Points to Win"; - messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap, - $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap); - case DM: - %cap = "25 Points to Win"; - messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap, - $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap); - } - } + %showTL = " - Time Limit:" SPC $Host::TimeLimit SPC "Minutes"; + messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win", + $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL); + case LakRabbit: + %cap = "2000 Points to Win"; + messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap, + $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap); + case DM: + %cap = "25 Points to Win"; + messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap, + $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap); + } + } - // TEAM OPTIONS - if(!$Host::TournamentMode) - { - if(%client.team != 0) // he isn't an observer - { - if(%multipleTeams) - messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team'); + // TEAM OPTIONS + if(!$Host::TournamentMode) + { + if(%client.team != 0) // he isn't an observer + { + if(%multipleTeams) + messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team'); + if($MatchStarted) + messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer'); + } + } + else if(%client.isAdmin) // only admins can change team during tournament mode + { + if(%client.team != 0) // he isn't an observer + { + if(%multipleTeams) + messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team'); + messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer'); + } + } - if($MatchStarted) - messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer'); - } - } - else if(%client.isAdmin) // only admins can change team during tournament mode - { - if(%client.team != 0) // he isn't an observer - { - if(%multipleTeams) - messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team'); + //Beginning match Vote Delay + if(!%client.isAdmin) + { + if((getSimTime() - $VoteDelay) < ($Host::VoteDelayTime * 1000)) + return; + } - messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer'); - } - } + if(!%client.canVote && !%isAdmin) + return; - //Beginning match Vote Delay - if(!%client.isAdmin) - { - if((getSimTime() - $VoteDelay) < ($Host::VoteDelayTime * 1000)) - return; - } + if(%game.scheduleVote $= "") + { + if(!%client.isAdmin) + { + if(!$Host::TournamentMode) + { + //if($Host::AllowPlayerVoteChangeMission) //Tourny Only for now + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); + if($Host::AllowPlayerVoteNextMission) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); + if($Host::AllowPlayerVoteTournamentMode) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Vote Tournament Mode'); + if($Host::AllowPlayerVoteTimeLimit) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); + if($Host::AllowPlayerVoteSkipMission) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); - if(!%client.canVote && !%isAdmin) - return; + if(%multipleTeams && $Host::AllowPlayerVoteTeamDamage) + { + if($teamDamage) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); + } + } + else + { + if(!$MatchStarted && !$CountdownStarted) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match'); + if($Host::AllowPlayerVoteChangeMission) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); + if($Host::AllowPlayerVoteNextMission) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode'); + if($Host::AllowPlayerVoteTimeLimit) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); - if(%game.scheduleVote $= "") - { - if(!%client.isAdmin) - { - if(!$Host::TournamentMode) - { - if($Host::AllowPlayerVoteChangeMission) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); - if($Host::AllowPlayerVoteTournamentMode) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Vote Tournament Mode'); - if($Host::AllowPlayerVoteTimeLimit) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); - if($Host::AllowPlayerVoteSkipMission) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); + if(%multipleTeams && $Host::AllowPlayerVoteTeamDamage) + { + if($teamDamage) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); + } + } + } + else + { + if(!$Host::TournamentMode) + { + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Tournament Mode'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission'); + if(!$voteNext) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Set the Next Mission'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'ClearNextMap', 'Clear Next Set Map', 'Clear Next Set Map'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Skip the Mission' ); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); + if(%multipleTeams) + { + if($teamDamage) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); + } + if($Host::AllowAdminVotes) + messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...'); + } + else + { + if(!$MatchStarted && !$CountdownStarted) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Start Match'); + if(!$MatchStarted && $CountdownStarted) + messageClient(%client, 'MsgVoteItem', "", %key, 'cancelMatchStart', 'Cancel Match Start', 'Cancel Match Start'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Free For All Mode'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission'); + if(!$voteNext) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Set the Next Mission'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'ClearNextMap', 'Clear Next Set Map', 'Clear Next Set Map'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); + if($Host::AllowAdminVotes) + messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...'); + if($Host::Password !$= "") + messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password'); + if($LockedTeams) + messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Disable Locked Teams', 'Disable Locked Teams'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Enable Locked Teams', 'Enable Locked Teams'); + if(%multipleTeams) + { + if($teamDamage) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); + } + } - if(%multipleTeams && $Host::AllowPlayerVoteTeamDamage) - { - if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); - } - } - else - { - if(!$MatchStarted && !$CountdownStarted) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match'); - if($Host::AllowPlayerVoteChangeMission) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode'); - if($Host::AllowPlayerVoteTimeLimit) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); + //Toggle Tournament Net Client + if(%client.isSuperAdmin) + { + if($Host::EnableNetTourneyClient) + messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Disable Tournament Net Client', "Disable Tournament Net Client" ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Enable Tournament Net Client', "Enable Tournament Net Client" ); + } - if(%multipleTeams && $Host::AllowPlayerVoteTeamDamage) - { - if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); - } - } - } - else - { - if(!$Host::TournamentMode) - { - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Tournament Mode'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Skip the Mission' ); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); + } - if(%multipleTeams) - { - if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); - } - - if( $Host::AllowAdminVotes ) - messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...'); - } - else - { - if(!$MatchStarted && !$CountdownStarted) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Start Match'); - if(!$MatchStarted && $CountdownStarted) - messageClient(%client, 'MsgVoteItem', "", %key, 'cancelMatchStart', 'Cancel Match Start', 'Cancel Match Start'); - - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Free For All Mode'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); - - if($Host::Password !$= "") - messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password'); - - if($LockedTeams) - messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Disable Locked Teams', 'Disable Locked Teams'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Enable Locked Teams', 'Enable Locked Teams'); - - if(%multipleTeams) - { - if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); - } - } - - //Toggle Tournament Net Client - if(%client.isSuperAdmin) - { - if($Host::EnableNetTourneyClient) - messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Disable Tournament Net Client', "Disable Tournament Net Client" ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Enable Tournament Net Client', "Enable Tournament Net Client" ); - } - - } - - if ($Host::ServerRules[1] !$= "" ) - messageClient( %client, 'MsgVoteItem', "", %key, 'showServerRules', 'show server rules', "Show Server Rules" ); - } - else - { - if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) // allow admins to stop votes - messageClient( %client, 'MsgVoteItem', "", %key, 'stopRunningVote', 'stop current vote', 'Stop the Vote'); - - if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminPassVote)) // allow admins to pass votes - messageClient( %client, 'MsgVoteItem', "", %key, 'passRunningVote', 'pass current vote', 'Pass the Vote'); - } + if ($Host::ServerRules[1] !$= "" ) + messageClient( %client, 'MsgVoteItem', "", %key, 'showServerRules', 'show server rules', "Show Server Rules" ); + } } // Eolk - completely re-wrote this. @@ -250,16 +278,90 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(!%client.canVote && !%isAdmin) return; - if(Game.scheduleVote !$= "" && (!%isAdmin || (%isAdmin && %client.adminVoteSet))) + if(Game.scheduleVote !$= "" && (!%isAdmin || (%isAdmin && %client.ForceVote))) { messageClient(%client, 'voteAlreadyRunning', "\c2A vote is already in progress."); - %client.adminVoteSet = 0; + %client.ForceVote = 0; return; } %teamSpecific = 0; switch$(%typeName) { + case "VoteNextMission": + %foundMap =0; + %client.lockVMenu = 1; + if(strpos(strlwr(%arg1),"next mission") != -1) + { + %key = %client.k++; + for ( %type = 0; %type < $HostTypeCount; %type++ ) + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteNextMission', $HostTypeDisplayName[%type], $HostTypeDisplayName[%type], true ); + return; + } + %key = %client.k++; + for ( %type = 0; %type < $HostTypeCount; %type++ ) + { + if($HostTypeDisplayName[%type] $= %arg1) + { + $HostNextTypeIndex = %type; + + + for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- ) + { + %idx = $HostMission[%type, %i]; + // If we have bots, don't change to a mission that doesn't support bots: + if ( $HostGameBotCount > 0 ) + { + if( !$BotEnabled[%idx] ) + continue; + } + messageClient( %client, 'MsgVoteItem', "", %key,'VoteNextMission',$HostMissionName[%idx],$HostMissionName[%idx], true ); + } + return; + } + } + %type = $HostNextTypeIndex; + for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- ) + { + %idx = $HostMission[%type, %i]; + if ( $HostGameBotCount > 0 ) + { + if( !$BotEnabled[%idx] ) + continue; + } + if(%arg1 $= $HostMissionName[%idx]) + { + $hostNextMapIndex = %idx; + %foundMap = 1; + break; + } + } + //error("found map" SPC %foundMap SPC $HostNextTypeIndex SPC $hostNextMapIndex); + if(%foundMap) + { + %arg3 = $hostNextMapIndex; + %arg4 = $HostNextTypeIndex; + // Vote-spoof prevention right here + %arg1 = $HostMissionFile[%arg3]; + %arg2 = $HostTypeName[%arg4]; + if(!checkMapExist(%arg1, %arg2)) + return; + + // We passed the spoof check, give it the fancy label + %arg1 = $HostMissionName[%arg3]; + %arg2 = $HostTypeDisplayName[%arg4]; + %client.lockVMenu = 0; + if((!%isAdmin && $Host::AllowPlayerVoteNextMission) || (%isAdmin && %client.ForceVote)) // not admin + { + if($CMHasVoted[%client.guid] >= $Host::ClassicMaxVotes && !%isAdmin) // they've voted too many times + { + messageClient(%client, "", "\c2You have exhausted your voting rights for this mission."); + return; + } + %msg = %client.nameBase @ " initiated a vote to set the next mission to " @ %arg1 @ " (" @ %arg2 @ ")."; + $CMHasVoted[%client.guid]++; + } + } case "VoteKickPlayer": if(%client == %arg1) // client is trying to votekick himself return; // Use the leave button instead, pal. @@ -275,12 +377,12 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % else // Player is voting to kick { if($Host::TournamentMode && !$Host::AllowPlayerTournamentModeVotekick) // Dont allow Votekicks in Tournament Mode - { - messageClient(%client, "", "\c2No votekicks in Tournament Mode."); - return; - } + { + messageClient(%client, "", "\c2No votekicks in Tournament Mode."); + return; + } - if(%arg1.isAdmin) // target is an admin + if(%arg1.isAdmin) // target is an admin { messageClient(%client, "MsgClient", "\c2You cannot vote to kick "@%arg1.nameBase@", "@(%arg1.sex $= "Male" ? "he" : "she")@" is an admin!"); return; @@ -419,29 +521,29 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % //If proposed time is lower than server set or higher than unlimited if(%arg1 < $Host::TimeLimit || %arg1 > 999) - { - if(!%isAdmin) - { - messageClient(%client, "", "\c2Invalid time selection."); - return; - } - else //is an admin - { - if($Host::TournamentMode) //Admins still have the option to set the time to 30 minutes in Tourney Mode - { - if(%arg1 !$= "30") //30 minutes only - { - messageClient(%client, "", "\c2Invalid time selection."); - return; - } - } - else - { - messageClient(%client, "", "\c2Invalid time selection."); - return; - } - } - } + { + if(!%isAdmin) + { + messageClient(%client, "", "\c2Invalid time selection."); + return; + } + else //is an admin + { + if($Host::TournamentMode) //Admins still have the option to set the time to 30 minutes in Tourney Mode + { + if(%arg1 !$= "30") //30 minutes only + { + messageClient(%client, "", "\c2Invalid time selection."); + return; + } + } + else + { + messageClient(%client, "", "\c2Invalid time selection."); + return; + } + } + } //If proposed time is something other than what is selectable if(%arg1 !$= "30" && %arg1 !$= "45" && %arg1 !$= "60" && %arg1 !$= "75" && %arg1 !$= "90" && %arg1 !$= "180" && %arg1 !$= "360" && %arg1 !$= "999") @@ -518,19 +620,27 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % case "passRunningVote": if (%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminPassVote)) { - adminStartNewVote( %client, %typename, %arg1, %arg2, %arg3, %arg4); + passCurrentVote(%client); adminLog(%client, " passed the vote in progress."); + return; } case "stopRunningVote": - if($VOStatus !$="InProgress" || $Host::TournamentMode) //Dont allow a stop vote after time has expired, then no new time is set - VoteOverTime - { - if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) - { - adminStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4); - adminLog(%client, " stopped the vote in progress."); - } - } + if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) + { + if($VOStatus !$="InProgress") //Dont allow a stop vote after time has expired, then no new time is set - VoteOverTime + { + stopCurrentVote(%client); + adminLog(%client, " stopped the vote in progress."); + return; + } + else + { + messageClient(%client, "", "\c2Can't stop time vote after time has expired."); + return; + } + + } // LakRabbit Stuff case "VoteDuelMode": @@ -647,33 +757,44 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } return; case "ForceVote": - if (%client.isAdmin && $Host::AllowAdminVotes) - { - if (%client.ForceVote) - { - %client.ForceVote = 0; - messageClient( %client, '', 'Vote to ... cancelled.' ); - } - else - { - %client.ForceVote = 2; - messageClient( %client, '', "Now select what to vote on, please." ); - } - } + if (!%client.isAdmin) + return; + + if(%client.isAdmin && !$Host::AllowAdminVotes) + return; + + if (%client.ForceVote) + { + %client.ForceVote = 0; + messageClient( %client, '', 'Vote to ... cancelled.' ); + } + else + { + %client.ForceVote = 2; + messageClient( %client, '', "Now select what to vote on, please." ); + } + return; + case "ClearNextMap": + if (%client.isAdmin && $voteNext) + { + messageAll('MsgAdminForce', "\c2The Admin " @ %client.nameBase @ " has cleared the next set mission."); + adminLog(%client, " has cleared the next set mission."); + $voteNext = 0; + } + return; default: return; } - if(%isAdmin && !%client.adminVoteSet && !%client.ForceVote) + if(%isAdmin && !%client.ForceVote) adminStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4); else playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg); } //exec("scripts/autoexec/VoteMenu.cs"); - function playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg) { %clientsVoting = 0; @@ -717,6 +838,8 @@ function playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %tea { case "VoteChangeMission": messageClient( %cl, 'VoteStarted', "\c2" @ %msg, %client.name, "change the mission to", %arg1, %arg2); + case "VoteNextMission": + messageClient( %cl, 'VoteStarted', "\c2" @ %msg, %client.name, "set next mission to", %arg1, %arg2); case "VoteSkipMission": messageClient( %cl, 'VoteStarted', "\c2" @ %msg, %client.name, "skip the mission"); case "VoteChangeTimeLimit": @@ -883,6 +1006,7 @@ function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typ if(isObject(%admin)) { messageAll('MsgAdminChangeMission', '\c2The Admin %3 has changed the mission to %1 (%2).', %missionDisplayName, %typeDisplayName, %admin.name ); + $voteNext = 0; %game.gameOver(); loadMission( %mission, %missionType, false ); adminLog(%admin, " has changed the mission to " @ %missionDisplayName @ " (" @ %typeDisplayName @ ")"); @@ -901,6 +1025,7 @@ function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typ //Show Vote % messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone); + $voteNext = 0; %game.gameOver(); loadMission( %mission, %missionType, false ); } @@ -1346,27 +1471,6 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k } } -function DefaultGame::passRunningVote(%game, %admin, %arg1, %arg2, %arg3, %arg4) -{ - if ( %admin && Game.scheduleVote !$= "" ) - { - passCurrentVote(); - messageAll('MsgAdminForce', '\c2The Admin passed the vote.' ); - echo("The admin" SPC %admin.nameBase SPC "has passed the vote."); - } -} - -function DefaultGame::stopRunningVote(%game, %admin, %arg1, %arg2, %arg3, %arg4) -{ - %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); - if(%admin && Game.scheduleVote !$= "" && %curTimeLeftMS > 0) - { - stopCurrentVote(); - messageAll('MsgAdminForce', '\c2The Admin stopped the vote.'); - echo("The admin" SPC %admin.nameBase SPC "has stopped the vote."); - } -} - function adminStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4) { if ( Game.scheduleVote !$= "" && Game.voteType $= %typeName ) @@ -1414,28 +1518,29 @@ function checkMapExist(%missionName, %missionType) // passCurrentVote() // Info: passes a vote that is running. -function passCurrentVote() // Edit GG +// Eolk - Removed *** classic admin stuff. +function passCurrentVote(%admin) { if(Game.scheduleVote !$= "") { - messageAll('closeVoteHud', ""); - cancel(Game.scheduleVote); - Game.scheduleVote = ""; - Game.kickClient = ""; + messageAll('closeVoteHud', ""); + cancel(Game.scheduleVote); + Game.scheduleVote = ""; + Game.kickClient = ""; - if(Game.votingArgs[typeName] $= "VoteKickPlayer") // special case here - { - Game.votesFor[Game.kickTeam] = ClientGroup.getCount() - $HostGameBotCount; - Game.votesAgainst[Game.kickTeam] = 0; - } - else - { - Game.totalVotesFor = ClientGroup.getCount() - $HostGameBotCount; - Game.totalVotesAgainst = 0; - } + if(Game.votingArgs[typeName] $= "VoteKickPlayer") // special case here + { + Game.votesFor[Game.kickTeam] = ClientGroup.getCount() - $HostGameBotCount; + Game.votesAgainst[Game.kickTeam] = 0; + } + else + { + Game.totalVotesFor = ClientGroup.getCount() - $HostGameBotCount; + Game.totalVotesAgainst = 0; + } - Game.evalVote(Game.votingArgs[typeName], false, Game.votingArgs[arg1], Game.votingArgs[arg2], Game.votingArgs[arg3], Game.votingArgs[arg4]); - clearVotes(); + Game.evalVote(Game.votingArgs[typeName], false, Game.votingArgs[arg1], Game.votingArgs[arg2], Game.votingArgs[arg3], Game.votingArgs[arg4]); + clearVotes(); //Stop vote chimes for(%i = 0; %i < $Host::EnableVoteSoundReminders; %i++) @@ -1444,20 +1549,25 @@ function passCurrentVote() // Edit GG cancel(Game.voteReminder[%i]); Game.voteReminder[%i] = ""; } + + messageAll('MsgAdminForce', "\c2The Admin " @ getTaggedString(%admin.name) @ " has passed the vote."); } + else + messageClient(%admin, "MsgClient", "\c2There is no vote to pass..."); } // stopCurrentVote() // Info: stop a vote that is still running -function stopCurrentVote() +function stopCurrentVote(%admin) { - if(Game.scheduleVote !$= "") - { - messageAll('closeVoteHud', ""); - cancel(Game.scheduleVote); - Game.scheduleVote = ""; - Game.kickClient = ""; - clearVotes(); + if(Game.scheduleVote !$= "") + { + + messageAll('closeVoteHud', ""); + cancel(Game.scheduleVote); + Game.scheduleVote = ""; + Game.kickClient = ""; + clearVotes(); //Stop vote chimes for(%i = 0; %i < $Host::EnableVoteSoundReminders; %i++) @@ -1466,7 +1576,11 @@ function stopCurrentVote() cancel(Game.voteReminder[%i]); Game.voteReminder[%i] = ""; } - } + + messageAll('MsgAdminForce', "\c2The Admin " @ getTaggedString(%admin.name) @ " has cancelled the vote."); + } + else + messageClient(%admin, "MsgClient", "\c2There is no vote to stop..."); } // calcVotes(%typeName, %arg1, %arg2, %arg3, %arg4) @@ -1638,4 +1752,44 @@ function VoteSound(%teamSpecific, %typename, %arg1, %arg2, %msg) echo(%vip SPC %msg); } } -} \ No newline at end of file +} + + +function DefaultGame::setNextMission(%game, %client, %map, %type, %mapIndex, %typeIndex) +{ + if(%client.isAdmin || %client.isSuperAdmin) + { + $voteNext = 1; + $voteNextType = %typeIndex; + $voteNextMap = %mapIndex; + messageAll('MsgAdminChangeMission', '\c2The Admin %3 has set the next mission to %1 (%2).~wfx/misc/hunters_greed.wav', $HostMissionName[%mapIndex], $HostTypeDisplayName[%typeIndex], %client.name ); + adminLog(%client, " has set the next mission to" SPC $HostMissionName[%mapIndex] @ "(" @ $HostTypeDisplayName[%typeIndex] @ ")."); + } + else + { + %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; + // Added people who dont vote into the equation, now if you do not vote, it doesn't count as a no. - z0dd - ZOD + if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone)) > ($Host::VotePasspercent / 100)) + { + $voteNext = 1; + $voteNextType = %typeIndex; + $voteNextMap = %mapIndex; + messageAll('MsgVotePassed', '\c2Next mission set to %1 (%2) by vote.', $HostMissionName[%mapIndex], $HostTypeDisplayName[%typeIndex]); + + //Log Vote % - Must be before Game Over + %key = "Passed"; + votePercentLog(%missionDisplayName, %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone); + //Show Vote % + messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone); + } + else + { + messageAll('MsgVoteFailed', '\c2Next mission vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone) * 100)); + //Log Vote % + %key = "Failed"; + votePercentLog(%missionDisplayName, %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone); + //Show Vote % + messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone); + } + } +} From 815fd0ac310e20976d7bd353d26ad9930e66f744 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 15:03:59 -0400 Subject: [PATCH 27/65] Vote Stat Bug --- Classic/scripts/autoexec/z_dtStats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/z_dtStats.cs b/Classic/scripts/autoexec/z_dtStats.cs index 3c5293e..8e4417a 100644 --- a/Classic/scripts/autoexec/z_dtStats.cs +++ b/Classic/scripts/autoexec/z_dtStats.cs @@ -2206,7 +2206,7 @@ package dtStatsGame{ } function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg){ parent::serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg); - if($dtStats::Enable){ + if($dtStats::Enable && (!%client.isAdmin || (%client.isAdmin && %client.ForceVote)){ %client.dtStats.voteCount++; if(%typeName $= "VoteChangeMission"){ %mission = $HostMissionFile[%arg3]; From b440c5abeb41c6c117cbdf73b1a00fd228ea8557 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 15:48:18 -0400 Subject: [PATCH 28/65] Allow longer warmup Tourny --- Classic/scripts/server.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs index 0928223..25e0494 100644 --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -2564,7 +2564,7 @@ function serverCmdStripAdmin(%client, %admin) %admin.isSuperAdmin = 0; messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.'); adminLog(%client, " stripped admin from " @ %admin.nameBase); - messageAll('MsgClientDrop', "", %client.name, %client); + messageAll( 'MsgClientDrop', "", %client.name, %client); messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); return; @@ -2576,7 +2576,7 @@ function serverCmdStripAdmin(%client, %admin) %admin.isAdmin = 0; %admin.isSuperAdmin = 0; adminLog(%client, " stripped admin from " @ %admin.nameBase); - messageAll('MsgClientDrop', "", %client.name, %client); + messageAll( 'MsgClientDrop', "", %client.name, %client); messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } @@ -2916,7 +2916,10 @@ function startTourneyCountdown() } // lets get it on! - Countdown( 30 * 1000 ); + if($Host::warmupTime <= 30) + Countdown(30 * 1000); + else + Countdown($Host::warmupTime * 1000); //Follow warmupTime! } function checkTourneyMatchStart() @@ -2990,7 +2993,11 @@ function checkTourneyMatchStart() Game.scheduleVote = ""; } - Countdown(30 * 1000); + // lets get it on! + if($Host::warmupTime <= 30) + Countdown(30 * 1000); + else + Countdown($Host::warmupTime * 1000); //Follow warmupTime! } } From 3e5ebbca29de0c772fbc19e88e346514f9087ca6 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 15:55:08 -0400 Subject: [PATCH 29/65] Added Classic Camera.cs --- Classic/scripts/camera.cs | 722 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 722 insertions(+) create mode 100644 Classic/scripts/camera.cs diff --git a/Classic/scripts/camera.cs b/Classic/scripts/camera.cs new file mode 100644 index 0000000..06c56d7 --- /dev/null +++ b/Classic/scripts/camera.cs @@ -0,0 +1,722 @@ +$Camera::movementSpeed = 40; + +datablock CameraData(Observer) +{ + mode = "observerStatic"; + firstPersonOnly = true; +}; + +datablock CameraData(CommanderCamera) +{ + mode = "observerStatic"; + firstPersonOnly = true; +}; + +function CommanderCamera::onTrigger( %data, %obj, %trigger, %state ) +{ + // no need to do anything here. +} + +function Observer::onTrigger(%data,%obj,%trigger,%state) +{ + // state = 0 means that a trigger key was released + if (%state == 0) + return; + + //first, give the game the opportunity to prevent the observer action + if (!Game.ObserverOnTrigger(%data, %obj, %trigger, %state)) + return; + + //now observer functions if you press the "throw" + if (%trigger >= 4) + return; + + //trigger types: 0:fire 1:altTrigger 2:jump 3:jet 4:throw + %client = %obj.getControllingClient(); + if (%client == 0) + return; + + switch$ (%obj.mode) + { + case "justJoined": + // z0dd - ZOD, 7/15/03. Don't need to waste CPU on a demo check + //if (isDemo()) + // clearCenterPrint(%client); + if (%trigger == 0) //press FIRE + { + // clear intro message + clearBottomPrint( %client ); + + //spawn the player + commandToClient(%client, 'setHudMode', 'Standard'); + Game.assignClientTeam(%client); + Game.spawnPlayer( %client, $MatchStarted ); + + if( $MatchStarted ) + { + %client.camera.setFlyMode(); + %client.setControlObject( %client.player ); + } + else + { + %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); + %client.setControlObject( %client.camera ); + } + } + else if (%trigger == 3) //press JET + { + //cycle throw the static observer spawn points + %markerObj = Game.pickObserverSpawn(%client, true); + %transform = %markerObj.getTransform(); + %obj.setTransform(%transform); + %obj.setFlyMode(); + } + else if (%trigger == 2) //press JUMP + { + //switch the observer mode to observing clients + if (isObject(%client.observeFlyClient)) + serverCmdObserveClient(%client, %client.observeFlyClient); + else + serverCmdObserveClient(%client, -1); + + displayObserverHud(%client, %client.observeClient); + if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching. + messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name); + } + + case "playerDeath": + // Attached to a dead player - spawn regardless of trigger type + if(!%client.waitRespawn && getSimTime() > %client.suicideRespawnTime) + { + commandToClient(%client, 'setHudMode', 'Standard'); + Game.spawnPlayer( %client, true ); + %client.camera.setFlyMode(); + %client.setControlObject(%client.player); + } + + case "PreviewMode": + if (%trigger == 0) + { + commandToClient(%client, 'setHudMode', 'Standard'); + if( %client.lastTeam ) + Game.clientJoinTeam( %client, %client.lastTeam ); + else + { + Game.assignClientTeam( %client, true ); + + // Spawn the player: + Game.spawnPlayer( %client, false ); + } + %client.camera.setFlyMode(); + %client.setControlObject( %client.player ); + } + + case "toggleCameraFly": + // this is the default camera mode + + case "observerFly": + // Free-flying observer camera + if (%trigger == 0) + { + if( !$Host::TournamentMode && $MatchStarted ) + { + // reset observer params + clearBottomPrint(%client); + commandToClient(%client, 'setHudMode', 'Standard'); + + if( %client.lastTeam !$= "" && %client.lastTeam != 0 && Game.numTeams > 1) + { + Game.clientJoinTeam( %client, %client.lastTeam, $MatchStarted ); + %client.camera.setFlyMode(); + %client.setControlObject( %client.player ); + } + else + { + Game.assignClientTeam( %client ); + + // Spawn the player: + Game.spawnPlayer( %client, true ); + %client.camera.setFlyMode(); + %client.setControlObject( %client.player ); + ClearBottomPrint( %client ); + } + } + else if( !$Host::TournamentMode ) + { + clearBottomPrint(%client); + Game.assignClientTeam( %client ); + + // Spawn the player: + Game.spawnPlayer( %client, false ); + %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); + %client.setControlObject( %client.camera ); + } + } + else if (%trigger == 3) //press JET + { + %markerObj = Game.pickObserverSpawn(%client, true); + %transform = %markerObj.getTransform(); + %obj.setTransform(%transform); + %obj.setFlyMode(); + } + else if (%trigger == 2) //press JUMP + { + //switch the observer mode to observing clients + if (isObject(%client.observeFlyClient)) + serverCmdObserveClient(%client, %client.observeFlyClient); + else + serverCmdObserveClient(%client, -1); + + observerFollowUpdate( %client, %client.observeClient, false ); + displayObserverHud(%client, %client.observeClient); + if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching. + messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name); + } + + case "observerStatic": + // Non-moving observer camera + %next = (%trigger == 3 ? true : false); + %markerObj = Game.pickObserverSpawn(%client, %next); + %transform = %markerObj.getTransform(); + %obj.setTransform(%transform); + %obj.setFlyMode(); + + case "observerStaticNoNext": + // Non-moving, non-cycling observer camera + + case "observerTimeout": + // Player didn't respawn quickly enough + if (%trigger == 0) + { + clearBottomPrint(%client); + commandToClient(%client, 'setHudMode', 'Standard'); + if( %client.lastTeam ) + Game.clientJoinTeam( %client, %client.lastTeam, true ); + else + { + Game.assignClientTeam( %client ); + + // Spawn the player: + Game.spawnPlayer( %client, true ); + } + %client.camera.setFlyMode(); + %client.setControlObject( %client.player ); + } + else if (%trigger == 3) //press JET + { + %markerObj = Game.pickObserverSpawn(%client, true); + %transform = %markerObj.getTransform(); + %obj.setTransform(%transform); + %obj.setFlyMode(); + } + else if (%trigger == 2) //press JUMP + { + //switch the observer mode to observing clients + if (isObject(%client.observeFlyClient)) + serverCmdObserveClient(%client, %client.observeFlyClient); + else + serverCmdObserveClient(%client, -1); + + // update the observer list for this client + observerFollowUpdate( %client, %client.observeClient, false ); + + displayObserverHud(%client, %client.observeClient); + if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching. + messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name); + } + + case "observerFollow": + // Observer attached to a moving object (assume player for now...) + //press FIRE - cycle to next client + if (%trigger == 0) + { + %nextClient = findNextObserveClient(%client); + %prevObsClient = %client.observeClient; + if (%nextClient > 0 && %nextClient != %client.observeClient) + { + // update the observer list for this client + observerFollowUpdate( %client, %nextClient, true ); + + //set the new object + %transform = %nextClient.player.getTransform(); + //if( !%nextClient.isMounted() ) z0dd - ZOD, 7/15/03. DUH! + if( !%nextClient.player.isMounted() ) + { + //z0dd - ZOD, 7/15/03. Use datablock of armor for observer params + %params = %nextClient.player.getDataBlock().observeParameters; + %obj.setOrbitMode(%nextClient.player, %transform, getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); + //%obj.setOrbitMode(%nextClient.player, %transform, 0.5, 4.5, 4.5); + %client.observeClient = %nextClient; + } + else + { + %mount = %nextClient.player.getObjectMount(); + if( %mount.getDataBlock().observeParameters $= "" ) + %params = %transform; + else + %params = %mount.getDataBlock().observeParameters; + + %obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); + %client.observeClient = %nextClient; + } + + //send the message(s) + displayObserverHud(%client, %nextClient); + if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching. + { + messageClient(%nextClient, 'Observer', '\c1%1 is now observing you.', %client.name); + messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); + } + } + } + else if (%trigger == 3) //press JET - cycle to prev client + { + %prevClient = findPrevObserveClient(%client); + %prevObsClient = %client.observeClient; + if (%prevClient > 0 && %prevClient != %client.observeClient) + { + // update the observer list for this client + observerFollowUpdate( %client, %prevClient, true ); + + //set the new object + %transform = %prevClient.player.getTransform(); + //if( !%prevClient.isMounted() ) z0dd - ZOD, 7/15/03. DUH! + if( !%prevClient.player.isMounted() ) + { + //z0dd - ZOD, 7/15/03. Use datablock of armor for observer params + %params = %prevClient.player.getDataBlock().observeParameters; + %obj.setOrbitMode(%prevClient.player, %transform, getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); + //%obj.setOrbitMode(%prevClient.player, %transform, 0.5, 4.5, 4.5); + %client.observeClient = %prevClient; + } + else + { + %mount = %prevClient.player.getObjectMount(); + if( %mount.getDataBlock().observeParameters $= "" ) + %params = %transform; + else + %params = %mount.getDataBlock().observeParameters; + + %obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); + %client.observeClient = %prevClient; + } + //send the message(s) + displayObserverHud(%client, %prevClient); + if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching. + { + messageClient(%prevClient, 'Observer', '\c1%1 is now observing you.', %client.name); + messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); + } + } + } + else if (%trigger == 2) //press JUMP + { + // update the observer list for this client + observerFollowUpdate( %client, -1, false ); + + //toggle back to observer fly mode + %obj.mode = "observerFly"; + %obj.setFlyMode(); + updateObserverFlyHud(%client); + if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching. + messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); + } + + case "pre-game": + if(!$Host::TournamentMode || $CountdownStarted) + return; + + if(%client.notReady) + { + %client.notReady = ""; + MessageAll( 0, '\c1%1 is READY.', %client.name ); + if(%client.notReadyCount < 3) + centerprint( %client, "\nWaiting for match start (FIRE if not ready)", 0, 3); + else + centerprint( %client, "\nWaiting for match start", 0, 3); + } + else + { + %client.notReadyCount++; + if(%client.notReadyCount < 4) + { + %client.notReady = true; + MessageAll( 0, '\c1%1 is not READY.', %client.name ); + centerprint( %client, "\nPress FIRE when ready.", 0, 3 ); + } + return; + } + CheckTourneyMatchStart(); + } +} + +function Observer::setMode(%data, %obj, %mode, %targetObj) +{ + if(%mode $= "") + return; + %client = %obj.getControllingClient(); + switch$ (%mode) { + case "justJoined": + commandToClient(%client, 'setHudMode', 'Observer'); + %markerObj = Game.pickObserverSpawn(%client, true); + %transform = %markerObj.getTransform(); + %obj.setTransform(%transform); + %obj.setFlyMode(); + + case "pre-game": + commandToClient(%client, 'setHudMode', 'Observer'); + //z0dd - ZOD, 7/15/03. Use datablock of armor for observer params + %params = %targetObj.getDataBlock().observeParameters; + %obj.setOrbitMode(%targetObj, %targetObj.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); + //%obj.setOrbitMode( %targetObj, %targetObj.getTransform(), 0.5, 4.5, 4.5); + + case "observerFly": + // Free-flying observer camera + commandToClient(%client, 'setHudMode', 'Observer'); + %markerObj = Game.pickObserverSpawn(%client, true); + %transform = %markerObj.getTransform(); + %obj.setTransform(%transform); + %obj.setFlyMode(); + + case "observerStatic" or "observerStaticNoNext": + // Non-moving observer camera + %markerObj = Game.pickObserverSpawn(%client, true); + %transform = %markerObj.getTransform(); + %obj.setTransform(%transform); + + case "observerFollow": + // Observer attached to a moving object (assume player for now...) + %transform = %targetObj.getTransform(); + + if( !%targetObj.isMounted() ) + { + //z0dd - ZOD, 7/15/03. Use datablock of armor for observer params + %params = %targetObj.getDataBlock().observeParameters; + %obj.setOrbitMode(%targetObj, %transform, getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); + //%obj.setOrbitMode(%targetObj, %transform, 0.5, 4.5, 4.5); + } + else + { + %mount = %targetObj.getObjectMount(); + if( %mount.getDataBlock().observeParameters $= "" ) + %params = %transform; + else + %params = %mount.getDataBlock().observeParameters; + + %obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); + } + + case "observerTimeout": + commandToClient(%client, 'setHudMode', 'Observer'); + %markerObj = Game.pickObserverSpawn(%client, true); + %transform = %markerObj.getTransform(); + %obj.setTransform(%transform); + %obj.setFlyMode(); + } + %obj.mode = %mode; +} + +function findNextObserveClient(%client) +{ + %index = -1; + %count = ClientGroup.getCount(); + if (%count <= 1) + return -1; + + for (%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if (%cl == %client.observeClient) + { + %index = %i; + break; + } + } + + //now find the next client (note, if not found, %index still == -1) + %index++; + if (%index >= %count) + %index = 0; + + %newClient = -1; + for (%i = %index; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if (%cl != %client && %cl.player > 0) + { + %newClient = %cl; + break; + } + } + + //if we didn't find anyone, search from the beginning again + if (%newClient < 0) + { + for (%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if (%cl != %client && %cl.player > 0) + { + %newClient = %cl; + break; + } + } + } + + //if we still haven't found anyone (new), give up.. + if (%newClient < 0 || %newClient.player == %player) + return -1; +} + +function findPrevObserveClient(%client) +{ + %index = -1; + %count = ClientGroup.getCount(); + if (%count <= 1) + return -1; + + for (%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if (%cl == %client.observeClient) + { + %index = %i; + break; + } + } + + //now find the prev client + %index--; + if (%index < 0) + %index = %count - 1; + + %newClient = -1; + for (%i = %index; %i >= 0; %i--) + { + %cl = ClientGroup.getObject(%i); + if (%cl != %client && %cl.player > 0) + { + %newClient = %cl; + break; + } + } + + //if we didn't find anyone, search from the end again + if (%newClient < 0) + { + for (%i = %count - 1; %i >= 0; %i--) + { + %cl = ClientGroup.getObject(%i); + if (%cl != %client && %cl.player > 0) + { + %newClient = %cl; + break; + } + } + } + + //if we still haven't found anyone (new), give up.. + if (%newClient < 0 || %newClient.player == %player) + return -1; +} + +function observeClient(%client) +{ + if( $testcheats ) + { + //pass in -1 to choose any client... + commandToServer('observeClient', %client); + } +} + +function serverCmdObserveClient(%client, %target) +{ + //clear the observer fly mode var... + %client.observeFlyClient = -1; + + //cancel any scheduled update + cancel(%client.obsHudSchedule); + + // must be an observer when observing other clients + if( %client.getControlObject() != %client.camera) + return; + + //can't observer yourself + if (%client == %target) + return; + + %count = ClientGroup.getCount(); + + //can't go into observer mode if you're the only client + if (%count <= 1) + return; + + //make sure the target actually exists + if (%target > 0) + { + %found = false; + for (%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if (%cl == %target) + { + %found = true; + break; + } + } + + if (!%found) + return; + } + else + { + %client.observeClient = -1; + %target = findNextObserveClient(%client); + if (%target <= 0) + return; + } + + //send the message + if (%client.camera.mode !$= "observerFollow") + { + if (isObject(%client.player)) + %client.player.scriptKill(0); + + //messageAllExcept(%client, -1, 'ClientNowObserver', '\c1%1 is now an observer.', %client.name); + //messageClient(%client, 'YouNowObserver', '\c1You are now observing %1.', %target.name); + } + + %client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player); + %client.setControlObject(%client.camera); + + //tag is used if a client who is being observed dies... + %client.observeClient = %target; +} + +function observerFollowUpdate( %client, %nextClient, %cycle ) +{ + %Oclient = %client.observeClient; + if( %Oclient $= "" ) + return; + + // changed to observer fly... + if( %nextClient == -1 ) + { + // find us in their observer list and remove, then reshuffle the list... + for( %i = 0; %i < %Oclient.observeCount; %i++ ) + { + if( %Oclient.observers[%i] == %client ) + { + %Oclient.observeCount--; + %Oclient.observers[%i] = %Oclient.observers[%Oclient.observeCount]; + %Oclient.observers[%Oclient.observeCount] = ""; + break; + } + } + return; // were done.. + } + + // changed from observer fly to observer follow... + if( !%cycle && %nextClient != -1 ) + { + // if nobody is observing this guy, initialize their observer count... + if( %nextClient.observeCount $= "" ) + %nextClient.observeCount = 0; + + // add us to their list of observers... + %nextClient.observers[%nextClient.observeCount] = %client; + %nextClient.observeCount++; + return; // were done. + } + + if( %nextClient != -1 ) + { + // cycling to the next client... + for( %i = 0; %i < %Oclient.observeCount; %i++ ) + { + // first remove us from our prev client's list... + if( %Oclient.observers[%i] == %client ) + { + %Oclient.observeCount--; + %Oclient.observers[%i] = %Oclient.observers[%Oclient.observeCount]; + %Oclient.observers[%Oclient.observeCount] = ""; + break; // screw you guys, i'm goin home! + } + } + + // if nobody is observing this guy, initialize their observer count... + if( %nextClient.observeCount $= "" ) + %nextClient.observeCount = 0; + + // now add us to the new clients list... + %nextClient.observeCount++; + %nextClient.observers[%nextClient.observeCount - 1] = %client; + } +} + +function updateObserverFlyHud(%client) +{ + //just in case there are two threads going... + cancel(%client.obsHudSchedule); + %client.observeFlyClient = -1; + + //make sure the client is supposed to be in observer fly mode... + if (!isObject(%client) || %client.team != 0 || %client.getControlObject() != %client.camera || %client.camera.mode $= "observerFollow") + return; + + //get various info about the player's eye + %srcEyeTransform = %client.camera.getTransform(); + %srcEyePoint = firstWord(%srcEyeTransform) @ " " @ getWord(%srcEyeTransform, 1) @ " " @ getWord(%srcEyeTransform, 2); + + %srcEyeVector = MatrixMulVector("0 0 0 " @ getWords(%srcEyeTransform, 3, 6), "0 1 0"); + %srcEyeVector = VectorNormalize(%srcEyeVector); + + //see if there's an enemy near our defense location... + %clientCount = 0; + %count = ClientGroup.getCount(); + %viewedClient = -1; + %clientDot = -1; + for(%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + + //make sure we find an AI who's alive and not the client + if (%cl != %client && isObject(%cl.player)) + { + //make sure the player is within range + %clPos = %cl.player.getWorldBoxCenter(); + %distance = VectorDist(%clPos, %srcEyePoint); + if (%distance <= 30) + { + //create the vector from the client to the client + %clVector = VectorNormalize(VectorSub(%clPos, %srcEyePoint)); + + //see if the dot product is greater than our current, and greater than 0.6 + %dot = VectorDot(%clVector, %srcEyeVector); + + if (%dot > 0.6 && %dot > %clientDot) + { + //make sure we're not looking through walls... + %mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType; + %losResult = containerRayCast(%srcEyePoint, %clPos, %mask); + %losObject = GetWord(%losResult, 0); + if (!isObject(%losObject)) + { + %viewedClient = %cl; + %clientDot = %dot; + } + } + } + } + } + + if (isObject(%viewedClient)) + displayObserverHud(%client, 0, %viewedClient); + else + displayObserverHud(%client, 0); + + %client.observeFlyClient = %viewedClient; + + //schedule the next... + %client.obsHudSchedule = schedule(500, %client, updateObserverFlyHud, %client); +} From 5172ed82e3ede0611ad1a726aabd7620cd435f67 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 15:55:40 -0400 Subject: [PATCH 30/65] Ready Spam Cooldown --- Classic/scripts/camera.cs | 48 +++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/Classic/scripts/camera.cs b/Classic/scripts/camera.cs index 06c56d7..ecde139 100644 --- a/Classic/scripts/camera.cs +++ b/Classic/scripts/camera.cs @@ -326,27 +326,41 @@ function Observer::onTrigger(%data,%obj,%trigger,%state) if(!$Host::TournamentMode || $CountdownStarted) return; - if(%client.notReady) + %readySpamDif = getSimTime() - %client.readySpam; + %readySpamDif1 = getSimTime() - %client.readySpamMsg; + if(%readySpamDif > 10000 || !%client.readySpam) { - %client.notReady = ""; - MessageAll( 0, '\c1%1 is READY.', %client.name ); - if(%client.notReadyCount < 3) - centerprint( %client, "\nWaiting for match start (FIRE if not ready)", 0, 3); - else - centerprint( %client, "\nWaiting for match start", 0, 3); - } - else - { - %client.notReadyCount++; - if(%client.notReadyCount < 4) + %client.readySpam = getSimTime(); + if(%client.notReady) { - %client.notReady = true; - MessageAll( 0, '\c1%1 is not READY.', %client.name ); - centerprint( %client, "\nPress FIRE when ready.", 0, 3 ); + %client.notReady = ""; + MessageAll( 0, '\c1%1 is READY.', %client.name ); + if(%client.notReadyCount < 3) + centerprint( %client, "\nWaiting for match start (FIRE if not ready)", 0, 3); + else + centerprint( %client, "\nWaiting for match start", 0, 3); } - return; + else + { + %client.notReadyCount++; + if(%client.notReadyCount < 4) + { + %client.notReady = true; + MessageAll( 0, '\c1%1 is not READY.', %client.name ); + centerprint( %client, "\nPress FIRE when ready.", 0, 3 ); + } + return; + } + + CheckTourneyMatchStart(); } - CheckTourneyMatchStart(); + else if((%readySpamDif1 > 1000 || !%client.readySpamMsg) && %client.notReadyCount < 4) + { + %client.readySpamMsg = getSimTime(); + %wait = mFloor((10000 - (getSimTime() - %client.readySpam)) / 1000); + messageClient(%client, 'MsgObserverCooldown', '\c3Ready Cooldown:\cr Please wait another %1 seconds.', %wait ); + } + } } From a972f3d89d3093efd25fba57fcd0c2f80e6acf99 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 16:20:29 -0400 Subject: [PATCH 31/65] ) --- Classic/scripts/autoexec/z_dtStats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/z_dtStats.cs b/Classic/scripts/autoexec/z_dtStats.cs index 8e4417a..72aba3f 100644 --- a/Classic/scripts/autoexec/z_dtStats.cs +++ b/Classic/scripts/autoexec/z_dtStats.cs @@ -2206,7 +2206,7 @@ package dtStatsGame{ } function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg){ parent::serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg); - if($dtStats::Enable && (!%client.isAdmin || (%client.isAdmin && %client.ForceVote)){ + if($dtStats::Enable && (!%client.isAdmin || (%client.isAdmin && %client.ForceVote))){ %client.dtStats.voteCount++; if(%typeName $= "VoteChangeMission"){ %mission = $HostMissionFile[%arg3]; From 72da21648e344bdcdb35e7b9bc4f4395f582f793 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 16:27:59 -0400 Subject: [PATCH 32/65] Formatting --- Classic/scripts/server.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs index 25e0494..2121290 100644 --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -2564,14 +2564,14 @@ function serverCmdStripAdmin(%client, %admin) %admin.isSuperAdmin = 0; messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.'); adminLog(%client, " stripped admin from " @ %admin.nameBase); - messageAll( 'MsgClientDrop', "", %client.name, %client); + messageAll('MsgClientDrop', "", %client.name, %client); messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); return; } else if(%client.isSuperAdmin) { - messageAll( 'MsgStripAdminPlayer', '\c2%1 removed %2\'s admin privledges.', %client.name, %admin.name, %admin ); + messageAll('MsgStripAdminPlayer', '\c2%1 removed %2\'s admin privledges.', %client.name, %admin.name, %admin ); messageClient(%admin, 'MsgStripAdminPlayer', 'You are being stripped of your admin privledges by %1.', %client.name); %admin.isAdmin = 0; %admin.isSuperAdmin = 0; @@ -2993,11 +2993,11 @@ function checkTourneyMatchStart() Game.scheduleVote = ""; } - // lets get it on! - if($Host::warmupTime <= 30) - Countdown(30 * 1000); - else - Countdown($Host::warmupTime * 1000); //Follow warmupTime! + // lets get it on! + if($Host::warmupTime <= 30) + Countdown(30 * 1000); + else + Countdown($Host::warmupTime * 1000); //Follow warmupTime! } } From 7b23fb29ddb05e8cee87c72b04702c247c014d0c Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 19:58:46 -0400 Subject: [PATCH 33/65] Admin Force Update --- Classic/scripts/server.cs | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs index 2121290..354bd0a 100644 --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -1100,17 +1100,17 @@ function GameConnection::onDrop(%client, %reason) // reset the server if everyone has left the game if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::EmptyServerReset && !$resettingServer && !$LoadingMission && $CurrentMissionType !$= $Host::MissionType ) { - // Timed Server Reset: $Host::EmptyServerReset = 1; --- Time in Minutes $Host::EmptyServerResetTime = 120; - if(isEventPending($EmptyServerResetSchedule)) - { - error(formatTimeString("HH:nn:ss") SPC "Previous Timed Server Reset schedule cancelled..." ); - cancel($EmptyServerResetSchedule); - } + // Timed Server Reset: $Host::EmptyServerReset = 1; --- Time in Minutes $Host::EmptyServerResetTime = 120; + if(isEventPending($EmptyServerResetSchedule)) + { + error(formatTimeString("HH:nn:ss") SPC "Previous Timed Server Reset schedule cancelled..." ); + cancel($EmptyServerResetSchedule); + } - %resettime = $Host::EmptyServerResetTime * 60000; - if(%resettime <= 0) %resettime = 1; - $EmptyServerResetSchedule = schedule(%resettime, 0, "ResetServerTimed"); - error(formatTimeString("HH:nn:ss") SPC "Timed Server Reset schedule started..." ); + %resettime = $Host::EmptyServerResetTime * 60000; + if(%resettime <= 0) %resettime = 1; + $EmptyServerResetSchedule = schedule(%resettime, 0, "ResetServerTimed"); + error(formatTimeString("HH:nn:ss") SPC "Timed Server Reset schedule started..." ); } } @@ -1764,8 +1764,13 @@ function serverCmdSAD(%client, %password) %client.isSuperAdmin = true; MessageAll( 'MsgSuperAdminPlayer', '\c2%2 has become a Super Admin by force.', %client, %name); %adminmsg = " has become a Super Admin by force."; - adminLog(%client, %adminmsg); - logEcho(%client.nameBase @ " has become a Super Admin by force."); + adminLog(%client, %adminmsg); + logEcho(%client.nameBase @ " has become a Super Admin by force."); + + //Update everyones client and put an SA by your name + messageAll( 'MsgClientDrop', "", %client.name, %client); + messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } case $Host::AdminPassword: @@ -1780,8 +1785,13 @@ function serverCmdSAD(%client, %password) %client.isSuperAdmin = false; MessageAll( 'MsgAdminForce', '\c2%2 has become a Admin by force.', %client, %name); %adminmsg = " has become an Admin by force."; - adminLog(%client, %adminmsg); - logEcho(%client.nameBase @ " has become an Admin by force."); + adminLog(%client, %adminmsg); + logEcho(%client.nameBase @ " has become an Admin by force."); + + //Update everyones client and put an A by your name + messageAll( 'MsgClientDrop', "", %client.name, %client); + messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } default: messageClient(%client, 'MsgPasswordFailed', '\c2Illegal SAD PW.'); From 2aa74e7609ef83774cc97da70c8d7c2b71eead34 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 20:01:43 -0400 Subject: [PATCH 34/65] Set Next Mission Reset Some notes and moving around Limit Set Next Mission to 6 people --- Classic/scripts/autoexec/VoteMenu.cs | 282 +++++++++++++++------------ 1 file changed, 155 insertions(+), 127 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 096b225..9232714 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -89,7 +89,7 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); } messageClient(%client, 'MsgVoteItem',"", %key, 'ForceVote', 'Cancel Force Vote', "Cancel 'Vote To...'"); - return; // Display no further vote options + return; } //Pass Stop Menu @@ -155,9 +155,10 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) if(!%client.canVote && !%isAdmin) return; + //Standard Vote Options if(%game.scheduleVote $= "") { - if(!%client.isAdmin) + if(!%client.isAdmin) //Not an admin { if(!$Host::TournamentMode) { @@ -201,7 +202,7 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) } } } - else + else //Is an Admin { if(!$Host::TournamentMode) { @@ -255,10 +256,9 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) } } - //Toggle Tournament Net Client - if(%client.isSuperAdmin) + if(%client.isSuperAdmin) //Super Admin Only { - if($Host::EnableNetTourneyClient) + if($Host::EnableNetTourneyClient) //Toggle Tournament Net Client messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Disable Tournament Net Client', "Disable Tournament Net Client" ); else messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Enable Tournament Net Client', "Enable Tournament Net Client" ); @@ -266,6 +266,7 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) } + //Everyone if ($Host::ServerRules[1] !$= "" ) messageClient( %client, 'MsgVoteItem', "", %key, 'showServerRules', 'show server rules', "Show Server Rules" ); } @@ -288,80 +289,6 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % %teamSpecific = 0; switch$(%typeName) { - case "VoteNextMission": - %foundMap =0; - %client.lockVMenu = 1; - if(strpos(strlwr(%arg1),"next mission") != -1) - { - %key = %client.k++; - for ( %type = 0; %type < $HostTypeCount; %type++ ) - messageClient( %client, 'MsgVoteItem', "", %key, 'VoteNextMission', $HostTypeDisplayName[%type], $HostTypeDisplayName[%type], true ); - return; - } - %key = %client.k++; - for ( %type = 0; %type < $HostTypeCount; %type++ ) - { - if($HostTypeDisplayName[%type] $= %arg1) - { - $HostNextTypeIndex = %type; - - - for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- ) - { - %idx = $HostMission[%type, %i]; - // If we have bots, don't change to a mission that doesn't support bots: - if ( $HostGameBotCount > 0 ) - { - if( !$BotEnabled[%idx] ) - continue; - } - messageClient( %client, 'MsgVoteItem', "", %key,'VoteNextMission',$HostMissionName[%idx],$HostMissionName[%idx], true ); - } - return; - } - } - %type = $HostNextTypeIndex; - for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- ) - { - %idx = $HostMission[%type, %i]; - if ( $HostGameBotCount > 0 ) - { - if( !$BotEnabled[%idx] ) - continue; - } - if(%arg1 $= $HostMissionName[%idx]) - { - $hostNextMapIndex = %idx; - %foundMap = 1; - break; - } - } - //error("found map" SPC %foundMap SPC $HostNextTypeIndex SPC $hostNextMapIndex); - if(%foundMap) - { - %arg3 = $hostNextMapIndex; - %arg4 = $HostNextTypeIndex; - // Vote-spoof prevention right here - %arg1 = $HostMissionFile[%arg3]; - %arg2 = $HostTypeName[%arg4]; - if(!checkMapExist(%arg1, %arg2)) - return; - - // We passed the spoof check, give it the fancy label - %arg1 = $HostMissionName[%arg3]; - %arg2 = $HostTypeDisplayName[%arg4]; - %client.lockVMenu = 0; - if((!%isAdmin && $Host::AllowPlayerVoteNextMission) || (%isAdmin && %client.ForceVote)) // not admin - { - if($CMHasVoted[%client.guid] >= $Host::ClassicMaxVotes && !%isAdmin) // they've voted too many times - { - messageClient(%client, "", "\c2You have exhausted your voting rights for this mission."); - return; - } - %msg = %client.nameBase @ " initiated a vote to set the next mission to " @ %arg1 @ " (" @ %arg2 @ ")."; - $CMHasVoted[%client.guid]++; - } - } case "VoteKickPlayer": if(%client == %arg1) // client is trying to votekick himself return; // Use the leave button instead, pal. @@ -642,53 +569,6 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } - // LakRabbit Stuff - case "VoteDuelMode": - if(!$CurrentMissionType $= "LakRabbit") - return; - - if(!%isAdmin || (%isAdmin && %client.ForceVote)) - %msg = %client.nameBase @ " initiated a vote to " @ (Game.duelMode == 0 ? "enable" : "disable") @ " duel mode."; - - case "VoteSplashDamage": - if(!$CurrentMissionType $= "LakRabbit") - return; - - if(!%isAdmin || (%isAdmin && %client.ForceVote)) - %msg = %client.nameBase @ " initiated a vote to " @ (Game.noSplashDamage == 1 ? "enable" : "disable") @ " splash damage."; - - case "VotePro": - if(!$CurrentMissionType $= "LakRabbit") - return; - - if(!%isAdmin || (%isAdmin && %client.ForceVote)) - %msg = %client.nameBase @ " initiated a vote to " @ (Game.pubPro == 0 ? "enable" : "disable") @ " pro mode."; - - case "DMSLOnlyMode": - if(!$CurrentMissionType $= "DM") - return; - - if(!%isAdmin || (%isAdmin && %client.ForceVote)) - %msg = %client.nameBase @ " initiated a vote to " @ (Game.DMSLOnlyMode == 0 ? "enable" : "disable") @ " shocklance only mode."; - - case "SCtFProMode": - if(!$CurrentMissionType $= "sctf") - return; - - if(!%isAdmin || (%isAdmin && %client.ForceVote)) - %msg = %client.nameBase @ " initiated a vote to " @ (Game.SCtFProMode == 0 ? "enable" : "disable") @ " pro mode."; - - case "showServerRules": - if (($Host::ServerRules[1] !$= "") && (!%client.CantView)) - { - for ( %i = 1; $Host::ServerRules[%i] !$= ""; %i++ ) - { - messageClient(%client, 'ServerRule', '\c2%1', $Host::ServerRules[%i] ); - } - %client.cantView = true; - %client.schedViewRules = schedule( 10000, %client, "resetViewSchedule", %client ); - } - return; case "TogglePUGpassword": if (%client.isAdmin) { @@ -706,6 +586,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } } return; + case "ToggleLockedTeams": if (%client.isAdmin) { @@ -727,6 +608,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } } return; + case "ToggleTourneyNetClient": if (%client.isAdmin) { @@ -756,6 +638,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } } return; + case "ForceVote": if (!%client.isAdmin) return; @@ -775,6 +658,88 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } return; + + case "VoteNextMission": + if(!%client.isAdmin && $TotalTeamPlayerCount < 6) + { + messageClient( %client, '', "Need at least 6 players on teams to set the next map." ); + return; + } + + %foundMap = 0; + %client.lockVMenu = 1; + if(strpos(strlwr(%arg1),"next mission") != -1) + { + %key = %client.k++; + for ( %type = 0; %type < $HostTypeCount; %type++ ) + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteNextMission', $HostTypeDisplayName[%type], $HostTypeDisplayName[%type], true ); + return; + } + %key = %client.k++; + for ( %type = 0; %type < $HostTypeCount; %type++ ) + { + if($HostTypeDisplayName[%type] $= %arg1) + { + $HostNextTypeIndex = %type; + + + for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- ) + { + %idx = $HostMission[%type, %i]; + // If we have bots, don't change to a mission that doesn't support bots: + if ( $HostGameBotCount > 0 ) + { + if( !$BotEnabled[%idx] ) + continue; + } + messageClient( %client, 'MsgVoteItem', "", %key,'VoteNextMission',$HostMissionName[%idx],$HostMissionName[%idx], true ); + } + return; + } + } + %type = $HostNextTypeIndex; + for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- ) + { + %idx = $HostMission[%type, %i]; + if ( $HostGameBotCount > 0 ) + { + if( !$BotEnabled[%idx] ) + continue; + } + if(%arg1 $= $HostMissionName[%idx]) + { + $hostNextMapIndex = %idx; + %foundMap = 1; + break; + } + } + //error("found map" SPC %foundMap SPC $HostNextTypeIndex SPC $hostNextMapIndex); + if(%foundMap) + { + %arg3 = $hostNextMapIndex; + %arg4 = $HostNextTypeIndex; + // Vote-spoof prevention right here + %arg1 = $HostMissionFile[%arg3]; + %arg2 = $HostTypeName[%arg4]; + if(!checkMapExist(%arg1, %arg2)) + return; + + // We passed the spoof check, give it the fancy label + %arg1 = $HostMissionName[%arg3]; + %arg2 = $HostTypeDisplayName[%arg4]; + %client.lockVMenu = 0; + if((!%isAdmin && $Host::AllowPlayerVoteNextMission) || (%isAdmin && %client.ForceVote)) // not admin + { + if($CMHasVoted[%client.guid] >= $Host::ClassicMaxVotes && !%isAdmin) // they've voted too many times + { + messageClient(%client, "", "\c2You have exhausted your voting rights for this mission."); + return; + } + %msg = %client.nameBase @ " initiated a vote to set the next mission to " @ %arg1 @ " (" @ %arg2 @ ")."; + $CMHasVoted[%client.guid]++; + } + } + case "ClearNextMap": if (%client.isAdmin && $voteNext) { @@ -784,6 +749,56 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } return; + // LakRabbit Stuff + case "VoteDuelMode": + if(!$CurrentMissionType $= "LakRabbit") + return; + + if(!%isAdmin || (%isAdmin && %client.ForceVote)) + %msg = %client.nameBase @ " initiated a vote to " @ (Game.duelMode == 0 ? "enable" : "disable") @ " duel mode."; + + case "VoteSplashDamage": + if(!$CurrentMissionType $= "LakRabbit") + return; + + if(!%isAdmin || (%isAdmin && %client.ForceVote)) + %msg = %client.nameBase @ " initiated a vote to " @ (Game.noSplashDamage == 1 ? "enable" : "disable") @ " splash damage."; + + case "VotePro": + if(!$CurrentMissionType $= "LakRabbit") + return; + + if(!%isAdmin || (%isAdmin && %client.ForceVote)) + %msg = %client.nameBase @ " initiated a vote to " @ (Game.pubPro == 0 ? "enable" : "disable") @ " pro mode."; + + //Deathmatch Stuff + case "DMSLOnlyMode": + if(!$CurrentMissionType $= "DM") + return; + + if(!%isAdmin || (%isAdmin && %client.ForceVote)) + %msg = %client.nameBase @ " initiated a vote to " @ (Game.DMSLOnlyMode == 0 ? "enable" : "disable") @ " shocklance only mode."; + + //LCTF Stuff + case "SCtFProMode": + if(!$CurrentMissionType $= "sctf") + return; + + if(!%isAdmin || (%isAdmin && %client.ForceVote)) + %msg = %client.nameBase @ " initiated a vote to " @ (Game.SCtFProMode == 0 ? "enable" : "disable") @ " pro mode."; + + case "showServerRules": + if (($Host::ServerRules[1] !$= "") && (!%client.CantView)) + { + for ( %i = 1; $Host::ServerRules[%i] !$= ""; %i++ ) + { + messageClient(%client, 'ServerRule', '\c2%1', $Host::ServerRules[%i] ); + } + %client.cantView = true; + %client.schedViewRules = schedule( 10000, %client, "resetViewSchedule", %client ); + } + return; + default: return; } @@ -1489,6 +1504,19 @@ function adminStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4) Game.evalVote(%typeName, %client, %arg1, %arg2, %arg3, %arg4); } +//Reset Set next mission if everyone leaves +function GameConnection::onDrop(%client, %reason) +{ + Parent::onDrop(%client, %reason); + + //Reset SetNextMission + if($HostGamePlayerCount - $HostGameBotCount == 0 && $Host::AllowPlayerVoteNextMission && $voteNext) + { + echo("No clients on the server. Set next mission reset..."); + $voteNext = 0; + } +} + }; // checkMapExist(%missionName, %missionType) From 0393f2522b4a088f3ef31142cb6bdb5d9ff9eedc Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 10 May 2022 20:19:20 -0400 Subject: [PATCH 35/65] Took out --- Classic/scripts/autoexec/VoteMenu.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 9232714..40703f4 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -97,7 +97,6 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) { if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) // allow admins to stop votes messageClient( %client, 'MsgVoteItem', "", %key, 'stopRunningVote', 'stop current vote', 'Stop the Vote'); - if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminPassVote)) // allow admins to pass votes messageClient( %client, 'MsgVoteItem', "", %key, 'passRunningVote', 'pass current vote', 'Pass the Vote'); return; @@ -1510,7 +1509,7 @@ function GameConnection::onDrop(%client, %reason) Parent::onDrop(%client, %reason); //Reset SetNextMission - if($HostGamePlayerCount - $HostGameBotCount == 0 && $Host::AllowPlayerVoteNextMission && $voteNext) + if($HostGamePlayerCount - $HostGameBotCount == 0 && $voteNext) { echo("No clients on the server. Set next mission reset..."); $voteNext = 0; From 54621f1b685bf9637f3b3c2f09cfb918b7065e61 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Wed, 11 May 2022 10:57:12 -0400 Subject: [PATCH 36/65] Formatting --- Classic/scripts/autoexec/VoteMenu.cs | 57 +++++++++++++--------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 40703f4..7b24e78 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -23,29 +23,6 @@ $Host::AllowPlayerVoteNextMission = 1; package ExtraVoteMenu { -function serverCmdGetVoteMenu( %client, %key ) -{ - if (isObject( Game ) && !%client.lockVMenu) - Game.sendGameVoteMenu( %client, %key ); - %client.lockVMenu = 0; -} - -function CycleMissions() -{ - if($voteNext) - { - %nextMission = $HostMissionFile[$voteNextMap]; - %type = $HostTypeName[$voteNextType]; - messageAll( 'MsgClient', 'Loading %1 (%2)...', %nextMission, $HostTypeDisplayName[$voteNextType] ); - loadMission( %nextMission, %type ); - $voteNextType = 0; - $voteNextMap = 0; - $voteNext = 0; - } - else - parent::CycleMissions(); -} - function DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4) { switch$ (%typeName) @@ -554,18 +531,15 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % case "stopRunningVote": if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) { - if($VOStatus !$="InProgress") //Dont allow a stop vote after time has expired, then no new time is set - VoteOverTime - { - stopCurrentVote(%client); - adminLog(%client, " stopped the vote in progress."); - return; - } - else + if($VOStatus $="InProgress") //Dont allow a stop vote after time has expired, then no new time is set - VoteOverTime { messageClient(%client, "", "\c2Can't stop time vote after time has expired."); return; } + stopCurrentVote(%client); + adminLog(%client, " stopped the vote in progress."); + return; } case "TogglePUGpassword": @@ -1503,6 +1477,29 @@ function adminStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4) Game.evalVote(%typeName, %client, %arg1, %arg2, %arg3, %arg4); } +function serverCmdGetVoteMenu( %client, %key ) +{ + if (isObject( Game ) && !%client.lockVMenu) + Game.sendGameVoteMenu( %client, %key ); + %client.lockVMenu = 0; +} + +function CycleMissions() +{ + if($voteNext) + { + %nextMission = $HostMissionFile[$voteNextMap]; + %type = $HostTypeName[$voteNextType]; + messageAll( 'MsgClient', 'Loading %1 (%2)...', %nextMission, $HostTypeDisplayName[$voteNextType] ); + loadMission( %nextMission, %type ); + $voteNextType = 0; + $voteNextMap = 0; + $voteNext = 0; + } + else + parent::CycleMissions(); +} + //Reset Set next mission if everyone leaves function GameConnection::onDrop(%client, %reason) { From fa596ada640e1f4bdd077c3298d601262e9dfe08 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Thu, 12 May 2022 00:31:19 -0400 Subject: [PATCH 37/65] See Next Map Header --- Classic/scripts/autoexec/VoteMenu.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 7b24e78..4cc1a45 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -87,8 +87,10 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) case CTF or SCtF: if($Host::TournamentMode) %showTL = " - Time Limit:" SPC $Host::TimeLimit SPC "Minutes"; + if($voteNext) + %showNM = " - Next Map:" SPC $HostMissionFile[$voteNextMap] SPC "(" @ $HostTypeName[$voteNextType] @ ")"; messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win", - $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL); + $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL @ %showNM); case LakRabbit: %cap = "2000 Points to Win"; messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap, @@ -717,8 +719,10 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if (%client.isAdmin && $voteNext) { messageAll('MsgAdminForce', "\c2The Admin " @ %client.nameBase @ " has cleared the next set mission."); - adminLog(%client, " has cleared the next set mission."); - $voteNext = 0; + adminLog(%client, " has cleared" SPC $HostMissionFile[$voteNextMap] SPC "(" @ $HostTypeName[$voteNextType] @ ") from the next set mission."); + $voteNextType = 0; + $voteNextMap = 0; + $voteNext = 0; } return; @@ -1509,6 +1513,8 @@ function GameConnection::onDrop(%client, %reason) if($HostGamePlayerCount - $HostGameBotCount == 0 && $voteNext) { echo("No clients on the server. Set next mission reset..."); + $voteNextType = 0; + $voteNextMap = 0; $voteNext = 0; } } From 51be28a6c5ccb1df8d7794d3abe47f7cd4bf210e Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Thu, 12 May 2022 00:34:03 -0400 Subject: [PATCH 38/65] DisplayName instead --- Classic/scripts/autoexec/VoteMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 4cc1a45..ffbf88a 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -88,7 +88,7 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) if($Host::TournamentMode) %showTL = " - Time Limit:" SPC $Host::TimeLimit SPC "Minutes"; if($voteNext) - %showNM = " - Next Map:" SPC $HostMissionFile[$voteNextMap] SPC "(" @ $HostTypeName[$voteNextType] @ ")"; + %showNM = " - Next Map:" SPC $HostMissionName[$voteNextMap] SPC "(" @ $HostTypeName[$voteNextType] @ ")"; messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win", $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL @ %showNM); case LakRabbit: From 0e6e0bdfd8be2e6198b81cd8159f775976e15d47 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 13 May 2022 14:55:25 -0400 Subject: [PATCH 39/65] Rewrote VoteMenu Func Rewrote VoteMenu Func Added Restricted Voting Integrated SetNextMission Added Description Details Added ClearCenterPrint for FIRE when obs --- Classic/prefs/serverPrefs.cs | 2 +- .../scripts/autoexec/MissionTypeOptions.cs | 36 ++- Classic/scripts/autoexec/ObserverCooldown.cs | 14 +- Classic/scripts/autoexec/VoteMenu.cs | 264 ++++++++++-------- Classic/scripts/serverDefaults.cs | 2 +- 5 files changed, 172 insertions(+), 146 deletions(-) diff --git a/Classic/prefs/serverPrefs.cs b/Classic/prefs/serverPrefs.cs index 1967cdb..bee4996 100644 --- a/Classic/prefs/serverPrefs.cs +++ b/Classic/prefs/serverPrefs.cs @@ -8,8 +8,8 @@ $Host::AllowAdminStopVote = 1; $Host::AllowAdminStopVotes = 1; $Host::AllowAdminVotes = 1; $Host::AllowMapScript = "True"; -$Host::AllowPlayerTournamentModeVotekick = 0; $Host::AllowPlayerVoteChangeMission = 1; +$Host::AllowPlayerVoteNextMission = 1; $Host::AllowPlayerVoteSkipMission = 1; $Host::AllowPlayerVoteTeamDamage = 0; $Host::AllowPlayerVoteTimeLimit = 1; diff --git a/Classic/scripts/autoexec/MissionTypeOptions.cs b/Classic/scripts/autoexec/MissionTypeOptions.cs index 0efe6b1..e724c36 100644 --- a/Classic/scripts/autoexec/MissionTypeOptions.cs +++ b/Classic/scripts/autoexec/MissionTypeOptions.cs @@ -28,37 +28,37 @@ function loadMissionStage2() { if($Host::TournamentMode && $Host::PUGautoPassword) $Host::Password = $Host::PUGPassword; - else if(!$Host::TournamentMode) - { - if($Host::Password) - $Host::Password = ""; - if($LockedTeams) - $LockedTeams = 0; - } //Set server mode to SPEED - $Host::HiVisibility = "0"; + $Host::HiVisibility = 0; } else if($CurrentMissionType $= "LakRabbit") { - if($Host::Password) - $Host::Password = ""; - if($LockedTeams) - $LockedTeams = 0; if($Host::TournamentMode) $Host::TournamentMode = 0; //Set server mode to DISTANCE - $Host::HiVisibility = "1"; + $Host::HiVisibility = 1; } case 1: $Host::Password = $Host::PUGPassword; - $Host::HiVisibility = "0"; //always SPEED + $Host::HiVisibility = 0; //always SPEED } - //TimeLimit Always 30 minutes in Tourney Mode if($Host::TournamentMode) - $Host::TimeLimit = "30"; + $Host::TimeLimit = 30; //TimeLimit Always 30 minutes in Tourney Mode + else + { + //Disable everything + if($Host::Password) + $Host::Password = ""; + if($LockedTeams) + $LockedTeams = 0; + if($RestrictedVoting) + $RestrictedVoting = 0; + } + if(isActivePackage(LockedTeams) && !$LockedTeams) + deactivatePackage(LockedTeams); //Siege NoBaseRape Fix if($CurrentMissionType $= "Siege") @@ -66,11 +66,9 @@ function loadMissionStage2() else $Host::NoBaseRapeEnabled = 1; - if(isActivePackage(LockedTeams) && !$LockedTeams) - deactivatePackage(LockedTeams); - parent::loadMissionStage2(); + //Map Change Center Print. Used to advertise upcoming events if($Host::MapChangeMSG) centerPrintAll($Host::MapChangeMSGContent, 12, 3); } diff --git a/Classic/scripts/autoexec/ObserverCooldown.cs b/Classic/scripts/autoexec/ObserverCooldown.cs index ac0b407..a0e071d 100644 --- a/Classic/scripts/autoexec/ObserverCooldown.cs +++ b/Classic/scripts/autoexec/ObserverCooldown.cs @@ -7,25 +7,27 @@ package ObserverTimeout { -function serverCmdClientMakeObserver( %client ) +function serverCmdClientMakeObserver(%client) { - //10 second cooldown on becoming an observer + //10 second cooldown on becoming an observer %timeDif = getSimTime() - %client.observerTimeout; %timeDif1 = getSimTime() - %client.observerMsg; if(%timeDif > 10000 || !%client.observerTimeout || %client.isAdmin) { - if ( isObject( Game ) && Game.kickClient != %client ) - Game.forceObserver( %client, "playerChoose" ); - %client.observerProtectStart = getSimTime(); %client.observerTimeout = getSimTime(); + + if (isObject(Game) && Game.kickClient != %client) + Game.forceObserver(%client, "playerChoose"); + if($Host::TournamentMode) //Added to clear FIRE centerPrint + ClearCenterPrint(%client); } //1 second cooldown on message else if((%timeDif1 > 1000 || !%client.observerMsg)) { %wait = mFloor((10000 - (getSimTime() - %client.observerProtectStart)) / 1000); messageClient(%client, 'MsgObserverCooldown', '\c3Observer Cooldown:\cr Please wait another %1 seconds.', %wait ); - + %client.observerMsg = getSimTime(); } } diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index ffbf88a..251c3a8 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -9,8 +9,7 @@ //$Host::AllowPlayerVoteTimeLimit = 1; //$Host::AllowPlayerVoteTournamentMode = 1; //$Host::AllowPlayerVoteTeamDamage = 0; -//$Host::AllowPlayerTournamentModeVotekick = 0; -$Host::AllowPlayerVoteNextMission = 1; +//$Host::AllowPlayerVoteNextMission = 1; //Vote Delay //Delay the ability to vote (For everyone) at the beginning of the match @@ -103,19 +102,16 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) } // TEAM OPTIONS - if(!$Host::TournamentMode) + if(%client.team != 0) //he isn't an observer { - if(%client.team != 0) // he isn't an observer + if(!%client.isAdmin && !$Host::TournamentMode) { if(%multipleTeams) messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team'); if($MatchStarted) messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer'); } - } - else if(%client.isAdmin) // only admins can change team during tournament mode - { - if(%client.team != 0) // he isn't an observer + else if(%client.isAdmin) //only admins can change team during tournament mode { if(%multipleTeams) messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team'); @@ -124,11 +120,8 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) } //Beginning match Vote Delay - if(!%client.isAdmin) - { - if((getSimTime() - $VoteDelay) < ($Host::VoteDelayTime * 1000)) + if(!%client.isAdmin && (getSimTime() - $VoteDelay) < ($Host::VoteDelayTime * 1000)) return; - } if(!%client.canVote && !%isAdmin) return; @@ -136,114 +129,129 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) //Standard Vote Options if(%game.scheduleVote $= "") { - if(!%client.isAdmin) //Not an admin + //Start Match + if(!$MatchStarted && !$CountdownStarted && $Host::TournamentMode) { - if(!$Host::TournamentMode) + if(!%client.isAdmin) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Start Match'); + } + //Cancel Match Start + if(!$MatchStarted && $CountdownStarted && $Host::TournamentMode && %client.isAdmin) + messageClient(%client, 'MsgVoteItem', "", %key, 'cancelMatchStart', 'Cancel Match Start', 'Cancel Match Start'); + //Vote Free For All Mode + if($Host::TournamentMode) + { + if(!%client.isAdmin) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Change FFA Mode'); + } + //Vote Tournament Mode + if(!$Host::TournamentMode) + { + if(!%client.isAdmin) { - //if($Host::AllowPlayerVoteChangeMission) //Tourny Only for now - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); - if($Host::AllowPlayerVoteNextMission) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); - if($Host::AllowPlayerVoteTournamentMode) + if($Host::AllowPlayerVoteTournamentMode && !$RestrictedVoting) messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Vote Tournament Mode'); - if($Host::AllowPlayerVoteTimeLimit) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); - if($Host::AllowPlayerVoteSkipMission) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); - - if(%multipleTeams && $Host::AllowPlayerVoteTeamDamage) - { - if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); - } } else - { - if(!$MatchStarted && !$CountdownStarted) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match'); - if($Host::AllowPlayerVoteChangeMission) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); - if($Host::AllowPlayerVoteNextMission) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode'); - if($Host::AllowPlayerVoteTimeLimit) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); - - if(%multipleTeams && $Host::AllowPlayerVoteTeamDamage) - { - if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); - } - } - } - else //Is an Admin - { - if(!$Host::TournamentMode) - { messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Tournament Mode'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission'); - if(!$voteNext) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Set the Next Mission'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'ClearNextMap', 'Clear Next Set Map', 'Clear Next Set Map'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Skip the Mission' ); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); - if(%multipleTeams) + } + //Vote Change Mission + if(!%client.isAdmin) + { + if($Host::AllowPlayerVoteChangeMission && !$RestrictedVoting) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); + } + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission'); + //Vote Change Next Mission + if(!%client.isAdmin) + { + if($Host::AllowPlayerVoteNextMission && !$RestrictedVoting) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); + } + else + { + if(!$voteNext) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Set the Next Mission'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'ClearNextMap', 'Clear Next Set Map', 'Clear Next Set Map'); + } + //Vote Change Time + if(!%client.isAdmin) + { + if($Host::AllowPlayerVoteTimeLimit && !$RestrictedVoting) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); + } + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); + //Vote Skip Mission + if(!%client.isAdmin) + { + if($Host::AllowPlayerVoteSkipMission && !$RestrictedVoting) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); + } + else + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Skip the Mission' ); + //Admin Vote Menu + if(%client.isAdmin && $Host::AllowAdminVotes) + messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...'); + //PUG Password + if(%client.isAdmin && $Host::TournamentMode) + { + if($Host::Password !$= "") + messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password'); + } + //Locked Teams + if(%client.isAdmin && $Host::TournamentMode) + { + if($LockedTeams) + messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Disable Locked Teams', 'Disable Locked Teams'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Enable Locked Teams', 'Enable Locked Teams'); + } + //Restricted Voting + if(%client.isAdmin && $Host::TournamentMode) + { + if($RestrictedVoting) + messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleRestrictedVoting', 'Disable Restricted Voting', 'Disable Restricted Voting'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleRestrictedVoting', 'Enable Restricted Voting', 'Enable Restricted Voting'); + } + //Vote Team Damage + if(%multipleTeams) + { + if(!%client.isAdmin) + { + if($Host::AllowPlayerVoteTeamDamage && !$RestrictedVoting) { if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage'); else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); } - if($Host::AllowAdminVotes) - messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...'); } else { - if(!$MatchStarted && !$CountdownStarted) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Start Match'); - if(!$MatchStarted && $CountdownStarted) - messageClient(%client, 'MsgVoteItem', "", %key, 'cancelMatchStart', 'Cancel Match Start', 'Cancel Match Start'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Free For All Mode'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission'); - if(!$voteNext) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Set the Next Mission'); + if($teamDamage) + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage'); else - messageClient(%client, 'MsgVoteItem', "", %key, 'ClearNextMap', 'Clear Next Set Map', 'Clear Next Set Map'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); - if($Host::AllowAdminVotes) - messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...'); - if($Host::Password !$= "") - messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password'); - if($LockedTeams) - messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Disable Locked Teams', 'Disable Locked Teams'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Enable Locked Teams', 'Enable Locked Teams'); - if(%multipleTeams) - { - if($teamDamage) - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); - } + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); } - - if(%client.isSuperAdmin) //Super Admin Only - { - if($Host::EnableNetTourneyClient) //Toggle Tournament Net Client - messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Disable Tournament Net Client', "Disable Tournament Net Client" ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Enable Tournament Net Client', "Enable Tournament Net Client" ); - } - } - + //Super Admin Only + if(%client.isSuperAdmin) + { + if($Host::EnableNetTourneyClient) //Toggle Tournament Net Client + messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Disable Tournament Net Client', "Disable Tournament Net Client" ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Enable Tournament Net Client', "Enable Tournament Net Client" ); + } //Everyone if ($Host::ServerRules[1] !$= "" ) messageClient( %client, 'MsgVoteItem', "", %key, 'showServerRules', 'show server rules', "Show Server Rules" ); @@ -281,9 +289,9 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } else // Player is voting to kick { - if($Host::TournamentMode && !$Host::AllowPlayerTournamentModeVotekick) // Dont allow Votekicks in Tournament Mode + if($Host::TournamentMode && $RestrictedVoting) // Dont allow Votekicks in Tournament Mode { - messageClient(%client, "", "\c2No votekicks in Tournament Mode."); + messageClient(%client, "", "\c2No votekicks in Tournament Mode at this time."); return; } @@ -545,25 +553,25 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } case "TogglePUGpassword": - if (%client.isAdmin) + if (%client.isAdmin && $Host::TournamentMode) { if($Host::Password !$= "") { $Host::Password = ""; - messageAdmins('', %client.nameBase @ " has disabled pug password.~wfx/powered/vehicle_screen_on.wav"); - adminLog(%client, " has disabled pug password." ); + messageAdmins('', %client.nameBase @ " has disabled the PUG password.~wfx/powered/vehicle_screen_on.wav"); + adminLog(%client, " has disabled PUG password." ); } else { $Host::Password = $Host::PUGPassword; - messageAdmins('', %client.nameBase @ " has enabled pug password.~wfx/powered/vehicle_screen_on.wav" ); - adminLog(%client, " has enabled pug password." ); + messageAdmins('', %client.nameBase @ " has enabled the PUG password (\"" @ $Host::PUGPassword @ "\").~wfx/powered/vehicle_screen_on.wav"); + adminLog(%client, " has enabled PUG password." ); } } return; case "ToggleLockedTeams": - if (%client.isAdmin) + if (%client.isAdmin && $Host::TournamentMode) { if(!$LockedTeams) { @@ -584,8 +592,26 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } return; + case "ToggleRestrictedVoting": + if(%client.isAdmin && $Host::TournamentMode) + { + if(!$RestrictedVoting) + { + $RestrictedVoting = 1; + messageAdmins('', %client.nameBase @ " has enabled restricted voting (No Map, Time, Kick, or Team Damage Votes).~wfx/powered/vehicle_screen_on.wav"); + adminLog(%client, " has enabled restricted voting." ); + } + else + { + $RestrictedVoting = 0; + messageAdmins('', %client.nameBase @ " has disabled restricted voting.~wfx/powered/vehicle_screen_on.wav" ); + adminLog(%client, " has disabled restricted voting." ); + } + } + return; + case "ToggleTourneyNetClient": - if (%client.isAdmin) + if(%client.isAdmin && $Host::TournamentMode) { if($Host::EnableNetTourneyClient) { @@ -1447,12 +1473,12 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ChangeTeam", "", %str, %caseId ); } - // z0dd - ZOD, 7/11/03. Allow Super admins to force themselves to obs. - if( %isSuperAdmin ) - { - if(%isTargetSelf && !%isTargetObserver) - messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ToObserver", "", 'Force observer', 5 ); - } + // z0dd - ZOD, 7/11/03. Allow Super admins to force themselves to obs. + if( %isSuperAdmin ) + { + if(%isTargetSelf && !%isTargetObserver) + messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ToObserver", "", 'Force observer', 5 ); + } } else if ( %isTargetObserver ) { diff --git a/Classic/scripts/serverDefaults.cs b/Classic/scripts/serverDefaults.cs index dca31e9..07d1e8c 100755 --- a/Classic/scripts/serverDefaults.cs +++ b/Classic/scripts/serverDefaults.cs @@ -188,7 +188,7 @@ $Host::AllowPlayerVoteSkipMission = 1; $Host::AllowPlayerVoteTimeLimit = 1; $Host::AllowPlayerVoteTournamentMode = 1; $Host::AllowPlayerVoteTeamDamage = 1; -$Host::AllowPlayerTournamentModeVotekick = 1; +$Host::AllowPlayerVoteNextMission = 1; $Host::NoBaseRapeEnabled = 1; //Enable or Disable No Base Rape $Host::NoBaseRapePlayerCount = 14; //Min number players the turn off No Base Rape $Host::AveragePings = 1; //Show Average ping in F2 menu From 5f2444fdc216fb3e4db33af72950b9ef26c61563 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 13 May 2022 15:56:41 -0400 Subject: [PATCH 40/65] Not needed --- Classic/scripts/autoexec/VoteMenu.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 251c3a8..5322d95 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -28,10 +28,6 @@ function DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %a { case "cancelMatchStart": %game.cancelMatchStart(%admin, %arg1, %arg2, %arg3, %arg4); - case "passRunningVote": - %game.passRunningVote(%admin, %arg1, %arg2, %arg3, %arg4); - case "stopRunningVote": - %game.stopRunningVote(%admin, %arg1, %arg2, %arg3, %arg4); case "VoteNextMission": %game.setNextMission(%admin, %arg1, %arg2, %arg3, %arg4); default: From cf74f47e1a1627aca6f9a3f4fc5159369449645c Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 15 May 2022 15:43:12 -0400 Subject: [PATCH 41/65] Update --- Classic/scripts/autoexec/z_dtAFK.cs | 163 +++++++++++----------------- 1 file changed, 64 insertions(+), 99 deletions(-) diff --git a/Classic/scripts/autoexec/z_dtAFK.cs b/Classic/scripts/autoexec/z_dtAFK.cs index a96fe45..ccb0d97 100644 --- a/Classic/scripts/autoexec/z_dtAFK.cs +++ b/Classic/scripts/autoexec/z_dtAFK.cs @@ -2,31 +2,30 @@ // Script BY: DarkTiger // Worked on: ChocoTaco // If player is afk specific amount of time in minutes, force them into observer +deleteVariables("$dtVar::AFKList*"); +$AFKCount = 0; // Enable/Disable entire script $dtVar::AFKTimeout = 1; // 60000 * 2 is 2 minutes // 0 minutes disables -$dtVar::AFKtime = 60000 * 2; +$dtVar::AFKtime = 60000 * 1; // Run from List Only instead of All clients on the server. 1 is yes, 0 is no $dtVar::ListOnly = 1; // Add clients who are normally AFK $dtVar::AFKList[$AFKCount++] = ""; $dtVar::AFKList[$AFKCount++] = ""; + // Loop Check Timer // How often do you want a AFKLoop. 1000 * 30 is 30 seconds -$dtVar::AFKloop = 1000 * 30; - -//////////////////////////////////////////////////////////////////////////////// +$dtVar::AFKloop = 1000 * 15; // Set Status Var -if($dtVar::ListOnly) +if($dtVar::ListOnly || !$dtVar::AFKtime) $DT_AFKStatus = "IDLE"; else $DT_AFKStatus = "ACTIVE"; -//////////////////////////////////////////////////////////////////////////////// - package DT_AFKPackage { @@ -67,21 +66,19 @@ function GameConnection::onDrop(%client, %reason) }; -//////////////////////////////////////////////////////////////////////////////// - function DT_AFKStatusConnect(%client) { - if($dtVar::AFKtime != 0 && !$Host::TournamentMode) //0 minutes disables + if(!$dtVar::AFKtime || $Host::TournamentMode) + return; + + for(%x = 1; %x <= $AFKCount; %x++) { - for(%x = 1; %x <= $AFKCount; %x++) + %guid = $dtVar::AFKList[%x]; + if(%client.guid $= %guid && %guid !$= "") { - %guid = $dtVar::AFKList[%x]; - if(%client.guid $= %guid && %guid !$= "") - { - $DT_AFKStatus = "ACTIVE"; - $DT_AFKListCount++; - %client.dtAFK = 1; - } + $DT_AFKStatus = "ACTIVE"; + $DT_AFKListCount++; + %client.dtAFK = 1; } } } @@ -89,87 +86,72 @@ function DT_AFKStatusConnect(%client) function DT_AFKStatusDrop(%client) { if(%client.dtAFK) - $DT_AFKListCount = $DT_AFKListCount - 1; + $DT_AFKListCount--; - // for(%x = 1; %x <= $AFKCount; %x++) - // { - // %guid = $dtVar::AFKList[%x]; - // if(%client.guid $= %guid && %guid !$= "") - // $DT_AFKListCount = $DT_AFKListCount - 1; - // } - - if($DT_AFKListCount $= 0) //Wont set IDLE until all List Clients are off the server + //Reset + if($DT_AFKListCount $= 0) $DT_AFKStatus = "IDLE"; } -//////////////////////////////////////////////////////////////////////////////// - function DT_AFKtimeoutLoop() { - //echo($DT_AFKStatus); - - switch$($DT_AFKStatus) - { - case ACTIVE: - if($dtVar::AFKtime != 0 && !$Host::TournamentMode) //0 minutes disables - { - if($dtVar::ListOnly) - { - for(%i = 0; %i < ClientGroup.getCount(); %i ++) - { - %client = ClientGroup.getObject(%i); - if(%client.dtAFK) - { - if(!%client.isAIControlled() && isObject(%client.player) && %client.player.getState() !$= "Dead") - AFKChk(%client); - } - } - } - else - { - for(%i = 0; %i < ClientGroup.getCount(); %i ++) - { - %client = ClientGroup.getObject(%i); - if(!%client.isAIControlled() && isObject(%client.player) && %client.player.getState() !$= "Dead") - AFKChk(%client); - } - } - } - case IDLE: - //Do Nothing - } - if(isEventPending($dtVar::AFKloopSchedule)) cancel($dtVar::AFKloopSchedule); + //echo($DT_AFKStatus); + if($DT_AFKStatus $= "ACTIVE" && !$Host::TournamentMode) + { + if($dtVar::ListOnly) + { + for(%i = 0; %i < ClientGroup.getCount(); %i ++) + { + %client = ClientGroup.getObject(%i); + if(%client.dtAFK) + { + if(!%client.isAIControlled() && isObject(%client.player) && %client.player.getState() !$= "Dead") + CheckAFK(%client); + } + } + } + else + { + for(%i = 0; %i < ClientGroup.getCount(); %i ++) + { + %client = ClientGroup.getObject(%i); + if(!%client.isAIControlled() && isObject(%client.player) && %client.player.getState() !$= "Dead") + CheckAFK(%client); + } + } + } + + //Have another go? $dtVar::AFKloopSchedule = schedule($dtVar::AFKloop, 0, "DT_AFKtimeoutLoop"); } -//////////////////////////////////////////////////////////////////////////////// - -function AFKChk(%client) +function CheckAFK(%client) { - if(%client.player.curTransform $= %client.player.getTransform()) - {//checks to see if there position and rotation are the same. - %client.player.afkTimer += $dtVar::AFKloop; - if(%client.player.afkTimer >= $dtVar::AFKtime) - { - Game.AFKForceObserver(%client); - return; - } - } - else - { - %client.player.afkTimer = 0;//reset if moving - } + //checks to see if there position and rotation are the same. + if(%client.player.curTransform $= %client.player.getTransform()) + { + %client.player.afkTimer += $dtVar::AFKloop; + if(%client.player.afkTimer >= $dtVar::AFKtime) + { + Game.AFKForceObserver(%client); + return; + } + } + else + %client.player.afkTimer = 0; //reset if moving - %client.player.curTransform = %client.player.getTransform();//save current transform + //save current transform + %client.player.curTransform = %client.player.getTransform(); } -//////////////////////////////////////////////////////////////////////////////// - function DefaultGame::AFKForceObserver(%game, %client) { + if($Host::TournamentMode) + return; + //make sure we have a valid client... if (%client <= 0) return; @@ -196,23 +178,6 @@ function DefaultGame::AFKForceObserver(%game, %client) logEcho(%client.nameBase@" (cl "@%client@") was forced into observer mode due to inactivity"); %client.lastTeam = %client.team; - if($Host::TournamentMode) - { - if(!$matchStarted) - { - if(%client.camera.Mode $= "pickingTeam") - { - commandToClient( %client, 'processPickTeam'); - clearBottomPrint( %client ); - } - else - { - clearCenterPrint(%client); - %client.notReady = true; - } - } - } - // switch client to team 0 (observer) %client.team = 0; %client.player.team = 0; @@ -233,4 +198,4 @@ function DefaultGame::AFKForceObserver(%game, %client) // call the onEvent for this game type %game.onClientEnterObserverMode(%client); //Bounty uses this to remove this client from others' hit lists -} +} \ No newline at end of file From 8a2fed340c256f907c201152f7dd3de2fd96a6ec Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 17 May 2022 14:33:08 -0400 Subject: [PATCH 42/65] Redone LT Asset Deletion --- Classic/scripts/SCtFGame.cs | 113 +++++++----------------------------- 1 file changed, 22 insertions(+), 91 deletions(-) diff --git a/Classic/scripts/SCtFGame.cs b/Classic/scripts/SCtFGame.cs index 61baafb..690ed19 100755 --- a/Classic/scripts/SCtFGame.cs +++ b/Classic/scripts/SCtFGame.cs @@ -452,7 +452,7 @@ function SCtFGame::missionLoadDone(%game) %game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 ); %game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 ); - deleteNonSCtFObjectsFromMap(); + deleteNonSCtFObjects(); } function SCtFGame::clientMissionDropReady(%game, %client) @@ -2450,97 +2450,28 @@ function SCtFGame::SCtFProMode(%game, %admin, %arg1, %arg2, %arg3, %arg4) // playerStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4, %clientsVoting); // } - -//--------------------------------DeleteObjects Code------------------------------- //AutoRemove assets, sensors, and turrets from non-LT maps -// -function getGroupObjectByName(%group, %name) +function deleteNonSCtFObjects() { - %numObjects = %group.getCount(); + %c = 0; + InitContainerRadiusSearch("0 0 0", 9999, $TypeMasks::ItemObjectType | + $TypeMasks::TurretObjectType | $TypeMasks::ForceFieldObjectType | + $TypeMasks::VehicleObjectType | $TypeMasks::StaticShapeObjectType); + while ((%obj = containerSearchNext()) != 0) + { + if(%obj.Datablock !$= "flag" && %obj.Datablock !$= "RepairKit" && %obj.Datablock !$= "RepairPatch") //Dont delete these... + { + %deleteList[%c] = %obj; + %c++; + } - for(%i = 0; %i < %numObjects; %i++) - { - if (%group.getObject(%i).getClassName() $= %name) - return %group.getObject(%i); - } -} - -function deleteObjectsFromMapByType(%type) -{ - %teamsGroup = getGroupObjectByName(MissionGroup, "Teams"); - if (!isObject(%teamsGroup)) - { - return; - } - - %team1Group = getGroupObjectByName(%teamsGroup, "Team1"); - if (!isObject(%team1Group)) - { - return; - } - - %team2Group = getGroupObjectByName(%teamsGroup, "Team2"); - if (!isObject(%team2Group)) - { - return; - } - - %team1Base0Group = getGroupObjectByName(%team1Group, "Base0"); - if (!isObject(%team1Base0Group)) - { - return; - } - - %team2Base0Group = getGroupObjectByName(%team2Group, "Base1"); - if (!isObject(%team2Base0Group)) - { - return; - } - - - deleteObjectsFromGroupByType(%team1Base0Group, %type); - deleteObjectsFromGroupByType(%team2Base0Group, %type); -} - -function deleteObjectsFromGroupByType(%group, %type) -{ - %noObjectsLeft = 0; - - while (%noObjectsLeft == 0) - { - %i = 0; - %noObjectsLeft = 1; - %loop = 1; - %numObjects = %group.getCount(); - - while ((%loop == 1) && (%i < %numObjects)) - { - %obj = %group.getObject(%i); - - if (%obj.getClassName() $= "SimGroup") - deleteObjectsFromGroupByType(%obj, %type); - - if (%obj.getClassName() $= %type) - { - %obj.delete(); - %loop = 0; - %noObjectsLeft = 0; - } - else - %i++; - } - } -} - -function deleteNonSCtFObjectsFromMap() -{ - deleteObjectsFromGroupByType(MissionGroup, "Turret"); - deleteObjectsFromGroupByType(MissionGroup, "StaticShape"); - deleteObjectsFromGroupByType(MissionGroup, "FlyingVehicle"); - deleteObjectsFromGroupByType(MissionGroup, "WheeledVehicle"); - deleteObjectsFromGroupByType(MissionGroup, "HoverVehicle"); - deleteObjectsFromGroupByType(MissionGroup, "Waypoint"); - //deleteObjectsFromGroupByType(MissionGroup, "ForceFieldBare"); - //deleteObjectsFromGroupByType(MissionGroup, "Item"); -} + } + for(%i = 0; %i < %c; %i++) + { + %deleteList[%i].delete(); + } + //Delete all ForceField PhysicalZones (PZones) + if(isObject(PZones)) + PZones.schedule(1500,"delete"); +} \ No newline at end of file From 35f0804b147f4104b129d151423c017bc22994ca Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 17 May 2022 18:21:50 -0400 Subject: [PATCH 43/65] Allow FF --- Classic/scripts/SCtFGame.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Classic/scripts/SCtFGame.cs b/Classic/scripts/SCtFGame.cs index 690ed19..dd2a50a 100755 --- a/Classic/scripts/SCtFGame.cs +++ b/Classic/scripts/SCtFGame.cs @@ -2455,8 +2455,7 @@ function deleteNonSCtFObjects() { %c = 0; InitContainerRadiusSearch("0 0 0", 9999, $TypeMasks::ItemObjectType | - $TypeMasks::TurretObjectType | $TypeMasks::ForceFieldObjectType | - $TypeMasks::VehicleObjectType | $TypeMasks::StaticShapeObjectType); + $TypeMasks::TurretObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticShapeObjectType); //For FF: $TypeMasks::ForceFieldObjectType while ((%obj = containerSearchNext()) != 0) { if(%obj.Datablock !$= "flag" && %obj.Datablock !$= "RepairKit" && %obj.Datablock !$= "RepairPatch") //Dont delete these... @@ -2472,6 +2471,6 @@ function deleteNonSCtFObjects() } //Delete all ForceField PhysicalZones (PZones) - if(isObject(PZones)) - PZones.schedule(1500,"delete"); + // if(isObject(PZones)) + // PZones.schedule(1500,"delete"); } \ No newline at end of file From 6ab776b4f75a3b2dfb399e0d57238d0d3f184851 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 20 May 2022 11:36:48 -0400 Subject: [PATCH 44/65] Force update --- Classic/scripts/LakRabbitGame.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Classic/scripts/LakRabbitGame.cs b/Classic/scripts/LakRabbitGame.cs index 4a79979..43be16b 100755 --- a/Classic/scripts/LakRabbitGame.cs +++ b/Classic/scripts/LakRabbitGame.cs @@ -40,7 +40,6 @@ // // v3.34 Febuary 2019 // Armor::damageObject rework -// Added SetNextMission support // Indoor Spawning support // // v3.33 January 2019 @@ -2065,11 +2064,17 @@ function LakRabbitGame::gameOver(%game) %client.team = 0; %client.lastTeam = 0; + if(!%client.isAIControlled()) + { + //This is not a great way to do this...but...everything will be correct in all clients menus if its a change to ctf... + messageAll('MsgClientDrop', "", %client.name, %client); + messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageClient(%client, 'MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); + } + //send the message messageClient(%client, 'MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); messageClient(%client, 'MsgClearObjHud', ""); - - messageClient(%client, 'MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } // ilys -- cancel waypoint if not showing flag icon From a2eaf0dc473f5b83a2968e1164791a1933be37a5 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 21 May 2022 14:04:09 -0400 Subject: [PATCH 45/65] AttackLOS Sky Fix --- Classic/scripts/autoexec/TacoOverrides.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Classic/scripts/autoexec/TacoOverrides.cs b/Classic/scripts/autoexec/TacoOverrides.cs index a65f9d8..43567a4 100755 --- a/Classic/scripts/autoexec/TacoOverrides.cs +++ b/Classic/scripts/autoexec/TacoOverrides.cs @@ -298,6 +298,22 @@ function ConcussionGrenadeThrown::onThrow(%this, %gren) %gren.detThread = schedule(1800, %gren, "detonateGrenade", %gren); // Was 2000 } +//Attack LOS Sky Fix +function serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap) +{ + %obj = getTargetObject(%client.getTargetId()); + if(isObject(%obj)) + { + %vec = %client.player.getMuzzleVector(0); + %vec2 = vectorNormalize(vectorSub(%obj.getWorldBoxCenter(), %client.player.getMuzzlePoint(%slot))); + %dot = vectorDot(%vec, %vec2); + if(%dot < 0.9) + return; + } + + parent::serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap); +} + }; // Prevent package from being activated if it is already From 12463fdfc0e220ecb71e90835ecfe965f72ac2b3 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 21 May 2022 14:11:56 -0400 Subject: [PATCH 46/65] Dont Allow %client.target --- Classic/scripts/server.cs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs index 354bd0a..f9ef39f 100644 --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -861,7 +861,7 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, messageClient(%client, 'MsgClientJoin', "", %recipient.name, %recipient, - %recipient.target, + "", %recipient.isAIControlled(), %recipient.isAdmin, %recipient.isSuperAdmin, @@ -879,21 +879,21 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, if ( $CurrentMissionType !$= "SinglePlayer" ) { // z0dd - ZOD, 5/08/04. Send message of any gameplay changes -// messageClient( %client, 'MsgClassic', 'Classic \c2Sniper Mod: \c3%1.', ($Host::ClassicLoadSniperChanges ? 'Enabled' : 'Disabled') ); -// messageClient( %client, 'MsgClassic', 'Classic \c2Missile Mod: \c3%1.', ($Host::ClassicLoadMissileChanges ? 'Enabled' : 'Disabled') ); -// messageClient( %client, 'MsgClassic', 'Classic \c2Mortar Mod: \c3%1.', ($Host::ClassicLoadMortarChanges ? 'Enabled' : 'Disabled') ); -// messageClient( %client, 'MsgClassic', 'Classic \c2Blaster Mod: \c3%1.', ($Host::ClassicLoadBlasterChanges ? 'Enabled' : 'Disabled') ); -// messageClient( %client, 'MsgClassic', 'Classic \c2Plasma Turret Mod: \c3%1.', ($Host::ClassicLoadPlasmaTurretChanges ? 'Enabled' : 'Disabled') ); -// messageClient( %client, 'MsgClassic', 'Classic \c2Player Mod: \c3%1.', ($Host::ClassicLoadPlayerChanges ? 'Enabled' : 'Disabled') ); -// messageClient( %client, 'MsgClassic', 'Classic \c2Havoc Mod: \c3%1.', ($Host::ClassicLoadHavocChanges ? 'Enabled' : 'Disabled') ); -// messageClient( %client, 'MsgClassic', 'Classic \c2Mine Mod: \c3%1.', ($Host::ClassicLoadMineChanges ? 'Enabled' : 'Disabled') ); -// messageClient( %client, 'MsgClassic', 'Classic \c2V-Ramming Mod: \c3%1.', ($Host::ClassicLoadVRamChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2Sniper Mod: \c3%1.', ($Host::ClassicLoadSniperChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2Missile Mod: \c3%1.', ($Host::ClassicLoadMissileChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2Mortar Mod: \c3%1.', ($Host::ClassicLoadMortarChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2Blaster Mod: \c3%1.', ($Host::ClassicLoadBlasterChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2Plasma Turret Mod: \c3%1.', ($Host::ClassicLoadPlasmaTurretChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2Player Mod: \c3%1.', ($Host::ClassicLoadPlayerChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2Havoc Mod: \c3%1.', ($Host::ClassicLoadHavocChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2Mine Mod: \c3%1.', ($Host::ClassicLoadMineChanges ? 'Enabled' : 'Disabled') ); + //messageClient( %client, 'MsgClassic', 'Classic \c2V-Ramming Mod: \c3%1.', ($Host::ClassicLoadVRamChanges ? 'Enabled' : 'Disabled') ); // z0dd - ZOD, 9/29/02. Removed T2 demo code from here messageClient(%client, 'MsgClientJoin', 'Welcome to Tribes2 %1.', %client.name, %client, - %client.target, + "", false, // isBot %client.isAdmin, %client.isSuperAdmin, @@ -904,7 +904,7 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game.', %client.name, %client, - %client.target, + "", false, // isBot %client.isAdmin, %client.isSuperAdmin, @@ -1769,7 +1769,7 @@ function serverCmdSAD(%client, %password) //Update everyones client and put an SA by your name messageAll( 'MsgClientDrop', "", %client.name, %client); - messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageAll('MsgClientJoin', "",%client.name, %client, "",%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } @@ -1790,7 +1790,7 @@ function serverCmdSAD(%client, %password) //Update everyones client and put an A by your name messageAll( 'MsgClientDrop', "", %client.name, %client); - messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageAll('MsgClientJoin', "",%client.name, %client, "",%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } default: @@ -2575,7 +2575,7 @@ function serverCmdStripAdmin(%client, %admin) messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.'); adminLog(%client, " stripped admin from " @ %admin.nameBase); messageAll('MsgClientDrop', "", %client.name, %client); - messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageAll('MsgClientJoin', "",%client.name, %client, "",%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); return; } @@ -2587,7 +2587,7 @@ function serverCmdStripAdmin(%client, %admin) %admin.isSuperAdmin = 0; adminLog(%client, " stripped admin from " @ %admin.nameBase); messageAll( 'MsgClientDrop', "", %client.name, %client); - messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); + messageAll('MsgClientJoin', "",%client.name, %client, "",%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid); messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team ); } else From bedd3afe52181d0b3ff38d27886c06c8e0f954a3 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 22 May 2022 11:26:08 -0400 Subject: [PATCH 47/65] More EndMatch Notify TourneyMode --- Classic/scripts/defaultGame.cs | 15 ++++++++++----- Classic/scripts/server.cs | 8 +++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Classic/scripts/defaultGame.cs b/Classic/scripts/defaultGame.cs index 13edbfa..af2121d 100755 --- a/Classic/scripts/defaultGame.cs +++ b/Classic/scripts/defaultGame.cs @@ -3849,10 +3849,9 @@ function notifyMatchEnd(%time) { %seconds = mFloor(%time / 1000); - if (%seconds > 1) { + if(%seconds > 1) MessageAll('MsgMissionEnd', '\c2Match ends in %1 seconds.~wfx/misc/hunters_%1.wav', %seconds); - } - else if (%seconds == 1) + else if(%seconds == 1) MessageAll('MsgMissionEnd', '\c2Match ends in 1 second.~wfx/misc/hunters_1.wav'); UpdateClientTimes(%time); @@ -3862,9 +3861,15 @@ function notifyMatchEndMinutes(%time) { %seconds = mFloor(%time / 1000); - if (%seconds == 180) + if(%seconds == 900 && $Host::TournamentMode) + MessageAll('MsgMissionEndMinutes', '\c2Match ends in 15 minutes.~wfx/misc/flagself.wav'); + else if(%seconds == 600 && $Host::TournamentMode) + MessageAll('MsgMissionEndMinutes', '\c2Match ends in 10 minutes.~wfx/misc/flagself.wav'); + else if(%seconds == 300 && $Host::TournamentMode) + MessageAll('MsgMissionEndMinutes', '\c2Match ends in 5 minutes.~wfx/misc/flagself.wav'); + else if(%seconds == 180) MessageAll('MsgMissionEndMinutes', '\c2Match ends in 3 minutes.~wfx/misc/flagself.wav'); - else if (%seconds == 120) + else if(%seconds == 120) MessageAll('MsgMissionEndMinutes', '\c2Match ends in 2 minutes.~wfx/misc/flagself.wav'); UpdateClientTimes(%time); diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs index f9ef39f..3335c22 100644 --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -899,8 +899,8 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, %client.isSuperAdmin, %client.isSmurf, %client.sendGuid ); - // z0dd - ZOD, 9/29/02. Removed T2 demo code from here + // z0dd - ZOD, 9/29/02. Removed T2 demo code from here messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game.', %client.name, %client, @@ -3089,6 +3089,12 @@ function EndCountdown(%timeMS) else return; + if(%timeMS >= 900000 && $Host::TournamentMode) + Game.endfifteenminuteCount = schedule(%timeMS - 900000, Game, "notifyMatchEndMinutes", 900000); + if(%timeMS >= 600000 && $Host::TournamentMode) + Game.endtenminuteCount = schedule(%timeMS - 600000, Game, "notifyMatchEndMinutes", 600000); + if(%timeMS >= 300000 && $Host::TournamentMode) + Game.endfiveminuteCount = schedule(%timeMS - 300000, Game, "notifyMatchEndMinutes", 300000); if(%timeMS >= 180000) Game.endthreeminuteCount = schedule(%timeMS - 180000, Game, "notifyMatchEndMinutes", 180000); if(%timeMS >= 120000) From 818fced94e7c68451e80d9a3204c852d32e8428a Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 22 May 2022 11:26:14 -0400 Subject: [PATCH 48/65] Update --- Classic/scripts/autoexec/TacoOverrides.cs | 29 +++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Classic/scripts/autoexec/TacoOverrides.cs b/Classic/scripts/autoexec/TacoOverrides.cs index 43567a4..96b2f32 100755 --- a/Classic/scripts/autoexec/TacoOverrides.cs +++ b/Classic/scripts/autoexec/TacoOverrides.cs @@ -301,17 +301,26 @@ function ConcussionGrenadeThrown::onThrow(%this, %gren) //Attack LOS Sky Fix function serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap) { - %obj = getTargetObject(%client.getTargetId()); - if(isObject(%obj)) - { - %vec = %client.player.getMuzzleVector(0); - %vec2 = vectorNormalize(vectorSub(%obj.getWorldBoxCenter(), %client.player.getMuzzlePoint(%slot))); - %dot = vectorDot(%vec, %vec2); - if(%dot < 0.9) - return; - } + %obj = getTargetObject(%client.getTargetId()); + if(isObject(%obj)) + { + if(%obj.getClassName() $= "Player" && !%client.player.ccActive) + { + %vec = %client.player.getMuzzleVector(0); + %vec2 = vectorNormalize(vectorSub(%obj.getWorldBoxCenter(), %client.player.getMuzzlePoint(%slot))); + %dot = vectorDot(%vec, %vec2); + if(%dot < 0.9) + return; + } + } - parent::serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap); + parent::serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap); +} + +function serverCmdScopeCommanderMap(%client, %scope) +{ + parent::serverCmdScopeCommanderMap(%client, %scope); + %client.player.ccActive = %scope; } }; From 10365266343f5dcc29e5fb39d40746ed90d0668c Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Mon, 23 May 2022 19:05:37 -0400 Subject: [PATCH 49/65] Allow Allow client to know his own ID (For voicepacks) --- Classic/scripts/server.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs index 3335c22..de7b8b5 100644 --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -893,7 +893,7 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, messageClient(%client, 'MsgClientJoin', 'Welcome to Tribes2 %1.', %client.name, %client, - "", + %client.target, false, // isBot %client.isAdmin, %client.isSuperAdmin, From 13d6fb08a110ffc7da2ada8cfc8cfafba3d4f7bc Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 28 May 2022 16:15:19 -0400 Subject: [PATCH 50/65] Took out Remote server is down anyway --- Classic/scripts/autoexec/VoteMenu.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 5322d95..19f8e0f 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -240,14 +240,14 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); } } - //Super Admin Only - if(%client.isSuperAdmin) - { - if($Host::EnableNetTourneyClient) //Toggle Tournament Net Client - messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Disable Tournament Net Client', "Disable Tournament Net Client" ); - else - messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Enable Tournament Net Client', "Enable Tournament Net Client" ); - } + //Super Admin Only - Disabled for now + // if(%client.isSuperAdmin) + // { + // if($Host::EnableNetTourneyClient) //Toggle Tournament Net Client + // messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Disable Tournament Net Client', "Disable Tournament Net Client" ); + // else + // messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Enable Tournament Net Client', "Enable Tournament Net Client" ); + // } //Everyone if ($Host::ServerRules[1] !$= "" ) messageClient( %client, 'MsgVoteItem', "", %key, 'showServerRules', 'show server rules', "Show Server Rules" ); @@ -607,7 +607,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % return; case "ToggleTourneyNetClient": - if(%client.isAdmin && $Host::TournamentMode) + if(%client.isSuperAdmin) { if($Host::EnableNetTourneyClient) { From 6c7caeee3d848bce6b849506c0ed0cf7bad11ca4 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Mon, 30 May 2022 12:49:09 -0400 Subject: [PATCH 51/65] Comments Added line 75 and 414 --- Classic/scripts/projectiles.cs | 76 +++++++++++++++++----------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/Classic/scripts/projectiles.cs b/Classic/scripts/projectiles.cs index 6624394..9f24021 100644 --- a/Classic/scripts/projectiles.cs +++ b/Classic/scripts/projectiles.cs @@ -11,7 +11,7 @@ // GrenadeProjectileData : ProjectileData // SeekerProjectileData : ProjectileData // SniperProjectileData : ProjectileData -// +// //-------------------------------------------------------------------------- //-------------------------------------- Default functions // @@ -33,12 +33,12 @@ function SniperProjectileData::onCollision(%data, %projectile, %targetObject, %m { %damLoc = firstWord(%targetObject.getDamageLocation(%position)); if(%damLoc $= "head") - { + { %targetObject.getOwnerClient().headShot = 1; %modifier = %data.rifleHeadMultiplier; } else - { + { %modifier = 1; %targetObject.getOwnerClient().headShot = 0; } @@ -72,10 +72,11 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot) { %obj.cantFire = 1; %preventTime = %data.stateTimeoutValue[4]; + //%preventTime = (%data.stateTimeoutValue[4] + %data.stateTimeoutValue[3]) - 0.032; %obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj); } // --------------------------------------------------------------------------- - + %data.lightStart = getSimTime(); if( %obj.station $= "" && %obj.isCloaked() ) @@ -89,7 +90,7 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot) else { // if( %obj.getEnergyLevel() > 20 ) - // { + // { // %obj.setCloaked( false ); // %obj.reCloak = %obj.schedule( 500, "setCloaked", true ); // } @@ -97,15 +98,15 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot) //We check if the player is still cloaked now. So no need to limit to 20% energy for the cloak in/out animation %obj.setCloaked( false ); %obj.reCloak = schedule( 500, 0, "checkCloakState", %obj); - } + } } if( %obj.client > 0 ) - { + { %obj.setInvincibleMode(0 ,0.00); - %obj.setInvincible( false ); // fire your weapon and your invincibility goes away. + %obj.setInvincible( false ); // fire your weapon and your invincibility goes away. } - + %vehicle = 0; if(%data.usesEnergy) { @@ -119,11 +120,11 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot) } else %energy = %obj.getEnergyLevel(); - + if(%data.useCapacitor && %data.usesEnergy) - { + { if( %useEnergyObj.turretObject.getCapacitorLevel() < %data.minEnergy ) - { + { return; } } @@ -164,7 +165,7 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot) %obj.lastProjectile = %p; %obj.deleteLastProjectile = %data.deleteLastProjectile; MissionCleanup.add(%p); - + // AI hook if(%obj.client) %obj.client.projectile = %p; @@ -172,9 +173,9 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot) if(%data.usesEnergy) { if(%data.useMountEnergy) - { + { if( %data.useCapacitor ) - { + { %vehicle.turretObject.setCapacitorLevel( %vehicle.turretObject.getCapacitorLevel() - %data.fireEnergy ); } else @@ -222,7 +223,7 @@ function MissileLauncherImage::onFire(%data,%obj,%slot) // z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix. if(!%p) { - return; + return; } //-------------------------------------------------------- MissileSet.add(%p); @@ -253,7 +254,7 @@ function MissileLauncherImage::onWetFire(%data, %obj, %slot) // z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix. if(!%p) { - return; + return; } //-------------------------------------------------------- MissileSet.add(%p); @@ -269,7 +270,7 @@ function MissileBarrelLarge::onFire(%data,%obj,%slot) // z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix. if(!%p) { - return; + return; } //-------------------------------------------------------- MissileSet.add(%p); // z0dd - ZOD, 8/10/03. Bots need this. @@ -298,7 +299,7 @@ function MortarImage::onFire(%data,%obj,%slot) // z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix. if(!%p) { - return; + return; } // z0dd - ZOD, 5/22/03, Spawn a mortar at the end of the projectiles lifetime. // Addresses long range mortar spam exploit. @@ -358,7 +359,7 @@ function SniperRifleImage::onFire(%data,%obj,%slot) %obj.lastProjectile = %p; MissionCleanup.add(%p); serverPlay3D(SniperRifleFireSound, %obj.getTransform()); - + // AI hook if(%obj.client) %obj.client.projectile = %p; @@ -375,7 +376,7 @@ function ElfGunImage::onFire(%data, %obj, %slot) // z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix. if(!%p) { - return; + return; } //-------------------------------------------------------- if(!%p.hasTarget()) @@ -389,7 +390,7 @@ function TargetingLaserImage::onFire(%data,%obj,%slot) // z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix. if(!%p) { - return; + return; } //-------------------------------------------------------- %p.setTarget(%obj.team); @@ -403,13 +404,14 @@ function ShockLanceImage::onFire(%this, %obj, %slot) %obj.setInvincibleMode(0, 0.00); %obj.setInvincible( false ); } - + // z0dd - ZOD, 4/10/04. ilys - Added rapidfire shocklance fix if(%obj.cantfire !$= "") return; %obj.cantfire = 1; %preventTime = %this.stateTimeoutValue[4]; + //%preventTime = (%data.stateTimeoutValue[4] + %data.stateTimeoutValue[3]) - 0.032; %obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj); if( %obj.getEnergyLevel() < %this.minEnergy ) // z0dd - ZOD, 5/22/03. Check energy level first @@ -427,7 +429,7 @@ function ShockLanceImage::onFire(%this, %obj, %slot) else { // if( %obj.getEnergyLevel() > 20 ) - // { + // { // %obj.setCloaked( false ); // %obj.reCloak = %obj.schedule( 500, "setCloaked", true ); // } @@ -435,7 +437,7 @@ function ShockLanceImage::onFire(%this, %obj, %slot) //We check if the player is still cloaked now. So no need to limit to 20% energy for the cloak in/out animation %obj.setCloaked( false ); %obj.reCloak = schedule( 500, 0, "checkCloakState", %obj); - } + } } %muzzlePos = %obj.getMuzzlePoint(%slot); @@ -482,7 +484,7 @@ function ShockLanceImage::onFire(%this, %obj, %slot) MissionCleanup.add(%p); %damageMultiplier = 1.0; - + if(%hitObj.getDataBlock().getClassName() $= "PlayerData") { // Now we see if we hit from behind... @@ -512,13 +514,13 @@ function ShockLanceImage::onFire(%this, %obj, %slot) } // -------------------------------------------------------------- } - + %totalDamage = %this.Projectile.DirectDamage * %damageMultiplier; %hitObj.getDataBlock().damageObject(%hitobj, %p.sourceObject, %hitpos, %totalDamage, $DamageType::ShockLance); %noDisplay = false; } - } + } if( %noDisplay ) { @@ -554,7 +556,7 @@ function ELFProjectileData::zapTarget(%data, %projectile, %target, %targeter) if( %target.teamDamageStateOnZap || !%teammates ) %target.setRechargeRate(%oldERate - %data.drainEnergy); else - %target.setRechargeRate(%oldERate); + %target.setRechargeRate(%oldERate); %projectile.checkELFStatus(%data, %target, %targeter); } @@ -705,7 +707,7 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse //%amount = (1.0 - (%dist / %radius)) * %coverage * %damage; //error( "damage: " @ %amount @ " at distance: " @ %dist @ " radius: " @ %radius @ " maxDamage: " @ %damage ); - + %data = %targetObject.getDataBlock(); %className = %data.className; @@ -714,7 +716,7 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse %p = %targetObject.getWorldBoxCenter(); %momVec = VectorSub(%p, %position); %momVec = VectorNormalize(%momVec); - + //------------------------------------------------------------------------------ // z0dd - ZOD, 7/08/02. More kick when player damages self with disc or mortar. // Stronger DJs and mortar jumps without impacting others (mainly HoFs) @@ -730,7 +732,7 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse } } //------------------------------------------------------------------------------ - + %impulseVec = VectorScale(%momVec, %impulse * (1.0 - (%dist / %radius))); %doImpulse = true; } @@ -740,27 +742,27 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse %momVec = VectorSub(%p, %position); %momVec = VectorNormalize(%momVec); %impulseVec = VectorScale(%momVec, %impulse * (1.0 - (%dist / %radius))); - + if( getWord( %momVec, 2 ) < -0.5 ) %momVec = "0 0 1"; - + // Add obj's velocity into the momentum vector %velocity = %targetObject.getVelocity(); //%momVec = VectorNormalize( vectorAdd( %momVec, %velocity) ); %doImpulse = true; } else - { + { %momVec = "0 0 1"; %doImpulse = false; } - + if(%amount > 0) %data.damageObject(%targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %explosionSource.theClient, %explosionSource); else if( %explosionSource.getDataBlock().getName() $= "ConcussionGrenadeThrown" && %data.getClassName() $= "PlayerData" ) { %data.applyConcussion( %dist, %radius, %sourceObject, %targetObject ); - + if(!$teamDamage && %sourceObject != %targetObject && %sourceObject.client.team == %targetObject.client.team) { messageClient(%targetObject.client, 'msgTeamConcussionGrenade', '\c1You were hit by %1\'s concussion grenade.', getTaggedString(%sourceObject.client.name)); From 29aa496c36550bdfbf40c93491b0f4e74091c20a Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Mon, 30 May 2022 12:51:04 -0400 Subject: [PATCH 52/65] Reload Fix --- Classic/scripts/autoexec/TacoOverrides.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Classic/scripts/autoexec/TacoOverrides.cs b/Classic/scripts/autoexec/TacoOverrides.cs index 96b2f32..694b1a7 100755 --- a/Classic/scripts/autoexec/TacoOverrides.cs +++ b/Classic/scripts/autoexec/TacoOverrides.cs @@ -323,6 +323,17 @@ function serverCmdScopeCommanderMap(%client, %scope) %client.player.ccActive = %scope; } +//Mortar Throw Reload Fix +function ShapeBase::throwWeapon(%this) +{ + if((%this.getMountedImage($WeaponSlot).getName() $= "MortarImage" || %this.getMountedImage($WeaponSlot).getName() $= "MissileLauncherImage" || %this.getMountedImage($WeaponSlot).getName() $= "ShockLanceImage") && + (%this.getImageState($WeaponSlot) $= "Reload" || %this.getImageState($WeaponSlot) $= "Fire")){ + return; + } + + parent::throwWeapon(%this); +} + }; // Prevent package from being activated if it is already From b0f2c13c1bbac7ecbbc1e780358b950ef183c407 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 3 Jun 2022 18:32:23 -0400 Subject: [PATCH 53/65] Admin2Admin for SA in-game --- Classic/scripts/autoexec/VoteMenu.cs | 32 +++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 19f8e0f..9bd3446 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -240,7 +240,16 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); } } - //Super Admin Only - Disabled for now + + //Super Admin Only + if(%client.isSuperAdmin) + { + if($Host::AllowAdmin2Admin) //Toggle Admin2Admin + messageClient( %client, 'MsgVoteItem', "", %key, 'Admins2Admin', 'Disable Admins to Admin', "Disable Admins to Admin" ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'Admins2Admin', 'Enable Admins to Admin', "Enable Admins to Admin" ); + } + //Disabled for now // if(%client.isSuperAdmin) // { // if($Host::EnableNetTourneyClient) //Toggle Tournament Net Client @@ -248,6 +257,7 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) // else // messageClient( %client, 'MsgVoteItem', "", %key, 'ToggleTourneyNetClient', 'Enable Tournament Net Client', "Enable Tournament Net Client" ); // } + //Everyone if ($Host::ServerRules[1] !$= "" ) messageClient( %client, 'MsgVoteItem', "", %key, 'showServerRules', 'show server rules', "Show Server Rules" ); @@ -606,6 +616,26 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } return; + case "Admins2Admin": + if(%client.isSuperAdmin) + { + if($Host::AllowAdmin2Admin) + { + $Host::AllowAdmin2Admin = 0; + + messageAdmins('', %client.nameBase @ " has disabled Admins to Admin.~wfx/powered/vehicle_screen_on.wav" ); + adminLog(%client, " has disabled Admins to Admin."); + } + else + { + $Host::AllowAdmin2Admin = 1; + + messageAdmins('', %client.nameBase @ " has enabled Admins to Admin.~wfx/powered/vehicle_screen_on.wav" ); + adminLog(%client, " has enabled Admins to Admin."); + } + } + return; + case "ToggleTourneyNetClient": if(%client.isSuperAdmin) { From d6948d26a4b23006b57e3165a90946e412018c50 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 4 Jun 2022 20:12:59 -0400 Subject: [PATCH 54/65] woops --- Classic/scripts/autoexec/MissionTypeOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/MissionTypeOptions.cs b/Classic/scripts/autoexec/MissionTypeOptions.cs index e724c36..893025c 100644 --- a/Classic/scripts/autoexec/MissionTypeOptions.cs +++ b/Classic/scripts/autoexec/MissionTypeOptions.cs @@ -50,7 +50,7 @@ function loadMissionStage2() else { //Disable everything - if($Host::Password) + if($Host::Password !$= "") $Host::Password = ""; if($LockedTeams) $LockedTeams = 0; From 918961c90a6a1a268e39dbe431992f8bef0e1a66 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Mon, 6 Jun 2022 09:52:14 -0400 Subject: [PATCH 55/65] Reset --- Classic/scripts/autoexec/MissionTypeOptions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classic/scripts/autoexec/MissionTypeOptions.cs b/Classic/scripts/autoexec/MissionTypeOptions.cs index 893025c..2689ed1 100644 --- a/Classic/scripts/autoexec/MissionTypeOptions.cs +++ b/Classic/scripts/autoexec/MissionTypeOptions.cs @@ -56,6 +56,9 @@ function loadMissionStage2() $LockedTeams = 0; if($RestrictedVoting) $RestrictedVoting = 0; + if($Host::AllowAdmin2Admin) + $Host::AllowAdmin2Admin = 0; + } if(isActivePackage(LockedTeams) && !$LockedTeams) deactivatePackage(LockedTeams); From cccbd9aa9f98003d8700e029891b6385ed9ab497 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Mon, 6 Jun 2022 09:58:21 -0400 Subject: [PATCH 56/65] Line --- Classic/scripts/autoexec/MissionTypeOptions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Classic/scripts/autoexec/MissionTypeOptions.cs b/Classic/scripts/autoexec/MissionTypeOptions.cs index 2689ed1..fb5a38d 100644 --- a/Classic/scripts/autoexec/MissionTypeOptions.cs +++ b/Classic/scripts/autoexec/MissionTypeOptions.cs @@ -58,7 +58,6 @@ function loadMissionStage2() $RestrictedVoting = 0; if($Host::AllowAdmin2Admin) $Host::AllowAdmin2Admin = 0; - } if(isActivePackage(LockedTeams) && !$LockedTeams) deactivatePackage(LockedTeams); From e1069b6284eb03ea664428c788869916ec100033 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Mon, 6 Jun 2022 17:38:48 -0400 Subject: [PATCH 57/65] SA Admin bug --- Classic/scripts/autoexec/VoteMenu.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 9bd3446..eb3aff3 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -345,18 +345,18 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % if(%arg1.isAdmin) // target is already an admin return; // can't vote to admin an admin! - if(%client.isAdmin && !%client.isSuperAdmin) // our pal is an admin (no superadmins) - { - if(!$Host::AllowAdmin2Admin) - return; - } - else // not an admin - { - if(!$host::allowadminplayervotes) // admin player votes are NOT enabled - return; // can't do that pal + if(%isAdmin) + { + if(!%client.isSuperAdmin && !$Host::AllowAdmin2Admin) + return; + } + else + { + if(!$host::allowadminplayervotes) // admin player votes are NOT enabled + return; // can't do that pal %msg = %client.nameBase @ " initiated a vote to admin player " @ %arg1.nameBase @ "."; - } + } case "BanPlayer": if(%client.isSuperAdmin && !%arg1.isSuperAdmin) // we're a super admin, and our target isn't a super admin From e1771fbf88fdee9e85fbc51a960cca949182555c Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Mon, 6 Jun 2022 17:39:17 -0400 Subject: [PATCH 58/65] Reset FlagObs on F2-Name --- Classic/scripts/autoexec/ObserveFlag.cs | 61 ++++++++++++++----------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/Classic/scripts/autoexec/ObserveFlag.cs b/Classic/scripts/autoexec/ObserveFlag.cs index 76bcf55..5ac0c19 100644 --- a/Classic/scripts/autoexec/ObserveFlag.cs +++ b/Classic/scripts/autoexec/ObserveFlag.cs @@ -53,7 +53,7 @@ function Observer::onTrigger(%data, %obj, %trigger, %state) } else return; - + // the flag isn't carried if(%otherFlag.carrier $= "") observeFlag(%client, %otherFlag, 1, %otherFlagTeam); @@ -121,7 +121,15 @@ function Observer::setMode(%data, %obj, %mode, %targetObj) default: Parent::setMode(%data, %obj, %mode, %targetObj); } - %obj.mode = %mode; + %obj.mode = %mode; +} + +function serverCmdObserveClient(%client, %target) +{ + %client.observeFlyClient = ""; + %client.observingFlag = false; + + parent::serverCmdObserveClient(%client, %target); } }; @@ -134,14 +142,14 @@ function serverCmdObserveFirstFlag(%client) { if(Game.class !$= CTFGame && Game.class !$= SCtFGame) return; - + // client must be an observer if(%client.team > 0 || !$Observers) //$Observers added; Serverside var; Needs to have value to work correctly return; - + // check if the flag is carried by someone %player = $TeamFlag[1].carrier; - + if($TeamFlag[1].isHome || %player $= "") observeFlag(%client, $TeamFlag[1], 1, 1); else @@ -152,14 +160,14 @@ function serverCmdObserveSecondFlag(%client) { if(Game.class !$= CTFGame && Game.class !$= SCtFGame) return; - + // client must be an observer if(%client.team > 0 || !$Observers) //$Observers added; Serverside var; Needs to have value to work correctly return; - + // check if the flag is carried by someone %player = $TeamFlag[2].carrier; - + if($TeamFlag[2].isHome || %player $= "") observeFlag(%client, $TeamFlag[2], 1, 2); else @@ -173,27 +181,27 @@ function observeFlag(%client, %target, %type, %flagTeam) { if(!isObject(%client) || !isObject(%target) || !isObject(%client.camera)) return; - + if(Game.class !$= CTFGame && Game.class !$= SCtFGame) return; - + if(%client.team > 0) return; - + // cancel any scheduled update if(isEventPending(%client.obsHudSchedule)) cancel(%client.obsHudSchedule); - + // must be an observer when observing other clients if(%client.getControlObject() != %client.camera) return; - + //can't observer yourself if(%client == %target) return; - + %count = ClientGroup.getCount(); - + //can't go into observer mode if you're the only client if(%count <= 1 && %type != 1) return; @@ -202,18 +210,18 @@ function observeFlag(%client, %target, %type, %flagTeam) { if(isObject(%client.player)) %client.player.scriptKill(0); // the player is still playing (this shouldn't be happen) - + %client.camera.getDataBlock().setMode(%client.camera, "followFlag", $TeamFlag[%flagTeam]); %client.setControlObject(%client.camera); clearBottomPrint(%client); - + // was the client observing a player before? if(%client.observeClient != -1) - { - observerFollowUpdate(%client, -1, false); - messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); - %client.observeClient = -1; - } + { + observerFollowUpdate(%client, -1, false); + messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); + %client.observeClient = -1; + } } else // Player { @@ -232,22 +240,23 @@ function observeFlag(%client, %target, %type, %flagTeam) if(!%found) return; } - + if(isObject(%client.player)) %client.player.scriptKill(0); // the player is still playing (this shouldn't be happen) - + observerFollowUpdate(%client, %target, true); displayObserverHud(%client, %target); messageClient(%target, 'Observer', '\c1%1 is now observing you.', %client.name); // was the client observing a player before? if(%client.observeClient != -1) - messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); + messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); + %client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player); %client.setControlObject(%client.camera); %client.observeClient = %target; } - + //clear the observer fly mode var... %client.observeFlyClient = -1; %client.observingFlag = true; From e4483ab58b7fef574791df3920084c68eeb484eb Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 7 Jun 2022 19:37:51 -0400 Subject: [PATCH 59/65] 30 Minutes Only Tournament Mode --- Classic/scripts/autoexec/VoteMenu.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index eb3aff3..08fb656 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -419,12 +419,19 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % return; } - if($CurrentMissionType $= "Siege") // Can't change time in this one + if($CurrentMissionType $= "Siege") // Can't change time in this one { messageClient(%client, "", "\c2Cannot change the time limit in this gametype."); return; } + // 30 minutes Only in Tournament mode + if($Host::TournamentMode && %arg1 !$= "30") + { + messageClient(%client, "", "\c2Only 30 minute time limit allowed in tournament mode."); + return; + } + // Eolk - don't let votes/admins end the map immediately by switching the time limit below the elapsed time if((%arg1 * 60 * 1000) < (getSimTime() - $missionStartTime)) { From d6c2e1d1826ba36b05bb1de78d8523a0ee9d5d9f Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 10 Jun 2022 14:56:58 -0400 Subject: [PATCH 60/65] Added checks --- Classic/scripts/autoexec/TeamManagement.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Classic/scripts/autoexec/TeamManagement.cs b/Classic/scripts/autoexec/TeamManagement.cs index 60bf53d..bd4d2b2 100644 --- a/Classic/scripts/autoexec/TeamManagement.cs +++ b/Classic/scripts/autoexec/TeamManagement.cs @@ -175,6 +175,9 @@ function GameConnection::onDrop(%client, %reason) // Called in GetTeamCounts function TeamBalanceNotify(%game) { + if(!$Host::EnableTeamBalanceNotify && !$Host::EnableAutobalance) + return; + if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 ) { //Uneven @@ -228,6 +231,9 @@ function NotifyUnbalanced( %game ) if(isEventPending($NotifySchedule)) cancel($NotifySchedule); + if(!$Host::EnableTeamBalanceNotify && !$Host::EnableAutobalance) + return; + if( $TBNStatus !$= "NOTIFY" ) //If Status has changed to EVEN or anything else (GameOver reset). return; @@ -360,6 +366,9 @@ function Autobalance( %game ) if(isEventPending($AutoBalanceSchedule)) cancel($AutoBalanceSchedule); + if(!$Host::EnableAutobalance) + return; + if($TBNStatus !$= "NOTIFY") //If Status has changed to EVEN or anything else (GameOver reset). return; From 692e7746483daeed34ba5b169c6902ef54fd7d53 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 12 Jun 2022 10:38:43 -0400 Subject: [PATCH 61/65] Comment out No voting for AntiTurtleTime --- Classic/scripts/CTFGame.cs | 62 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Classic/scripts/CTFGame.cs b/Classic/scripts/CTFGame.cs index db28732..6e5061a 100755 --- a/Classic/scripts/CTFGame.cs +++ b/Classic/scripts/CTFGame.cs @@ -2093,39 +2093,39 @@ function CTFGame::startFlagCollisionSearch(%game, %flag) // VOTING /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// -function CTFGame::sendGameVoteMenu(%game, %client, %key) -{ - DefaultGame::sendGameVoteMenu(%game, %client, %key); - if ( %game.scheduleVote $= "" ) - { - //if(%client.isAdmin) - //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' ); - //else - // messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' ); - } -} +// function CTFGame::sendGameVoteMenu(%game, %client, %key) +// { +// DefaultGame::sendGameVoteMenu(%game, %client, %key); +// if ( %game.scheduleVote $= "" ) +// { +// if(%client.isAdmin) +// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' ); +// else +// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' ); +// } +// } -function CTFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4) -{ - DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4); - switch$ (%typeName) - { - case "voteAntiTurtleTime": - %game.voteAntiTurtleTime(%admin, %arg1, %arg2, %arg3, %arg4); - } -} +// function CTFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4) +// { +// DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4); +// switch$ (%typeName) +// { +// case "voteAntiTurtleTime": +// %game.voteAntiTurtleTime(%admin, %arg1, %arg2, %arg3, %arg4); +// } +// } -function CTFGame::sendAntiTurtleTimeList( %game, %client, %key ) -{ - messageClient( %client, 'MsgVoteItem', "", %key, 6, "", '6 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 8, "", '8 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 10, "", '10 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 12, "", '12 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 14, "", '14 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 16, "", '16 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 18, "", '18 minutes' ); - messageClient( %client, 'MsgVoteItem', "", %key, 200, "", 'Disable Anti Turtle' ); -} +// function CTFGame::sendAntiTurtleTimeList( %game, %client, %key ) +// { +// messageClient( %client, 'MsgVoteItem', "", %key, 6, "", '6 minutes' ); +// messageClient( %client, 'MsgVoteItem', "", %key, 8, "", '8 minutes' ); +// messageClient( %client, 'MsgVoteItem', "", %key, 10, "", '10 minutes' ); +// messageClient( %client, 'MsgVoteItem', "", %key, 12, "", '12 minutes' ); +// messageClient( %client, 'MsgVoteItem', "", %key, 14, "", '14 minutes' ); +// messageClient( %client, 'MsgVoteItem', "", %key, 16, "", '16 minutes' ); +// messageClient( %client, 'MsgVoteItem', "", %key, 18, "", '18 minutes' ); +// messageClient( %client, 'MsgVoteItem', "", %key, 200, "", 'Disable Anti Turtle' ); +// } function CTFGame::voteAntiTurtleTime(%game, %admin, %newLimit) { From ba450a4b3eecdd9df5cce4ea5c389a171f51f8e5 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Wed, 15 Jun 2022 18:56:00 -0400 Subject: [PATCH 62/65] Update Added lak lctf big stats options --- Classic/scripts/autoexec/zzDiscordBot.cs | 37 ++++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/Classic/scripts/autoexec/zzDiscordBot.cs b/Classic/scripts/autoexec/zzDiscordBot.cs index b5cf71f..0c78cd9 100644 --- a/Classic/scripts/autoexec/zzDiscordBot.cs +++ b/Classic/scripts/autoexec/zzDiscordBot.cs @@ -286,10 +286,13 @@ function discord::onLine(%this, %line){ //case "Discord": //messageAll( 'MsgDiscord', '\c3Discord: \c4%1 %2',getWord(%lineStrip,1),getWords(%lineStrip,2,getWordCount(%lineStrip) -1)); case "GETSTAT": - %var = getWord(%lineStrip,1); - %mon = getWord(%lineStrip,2); - %year = getWord(%lineStrip,3); + %mon = getWord(%lineStrip,1); + %year = getWord(%lineStrip,2); + %var = getWord(%lineStrip,3); %game = getWord(%lineStrip,4); + if(%game $= ""){// default if not valid + %game = "CTFGame"; + } %returnIndex = getWord(%lineStrip,5); %nameList = $lData::name[%var,%game,"month",%mon,%year]; %dataList = $lData::data[%var,%game,"month",%mon,%year]; @@ -302,8 +305,12 @@ function discord::onLine(%this, %line){ $genStatsLockout = 1; %month = getWord(%lineStrip,1); %year = getWord(%lineStrip,2); + %game = getWord(%lineStrip,3); + if(%game $= ""){// default if not valid + %game = "CTFGame"; + } if(%month > 0 && %year > 0){ - schedule(1000, 0, "sendLDATA", %month, %year, "CTFGame"); + schedule(1000, 0, "sendLDATA", %month, %year, %game); } } else{ @@ -312,9 +319,9 @@ function discord::onLine(%this, %line){ case "PING": discord.send("PONG" @ $discordBot::cmdSplit @ "\r\n"); case "PINGAVG": - %min = 10000; - %max = -10000; - %lowCount = %lowPing = 0; + %min = 10000; + %max = -10000; + %lowCount = %lowPing = 0; for(%i = 0; %i < ClientGroup.getCount(); %i++){ %cl = ClientGroup.getObject(%i); %ping = %cl.isAIControlled() ? 0 : %cl.getPing(); @@ -382,7 +389,7 @@ if(!isObject(discord) && $discordBot::autoStart){ discordCon(); } -function sendLDATA(%month, %year, %type){ +function sendLDATA(%month, %year, %game){ %file = new FileObject(); RootGroup.add(%file); %folderPath = "serverStats/LData/*.cs"; @@ -391,18 +398,16 @@ function sendLDATA(%month, %year, %type){ for (%i = 0; %i < %count; %i++){ %filepath = findNextfile(%folderPath); %fieldPath =strreplace(%filePath,"-","\t"); - %game = getField(%fieldPath,1); + %g = getField(%fieldPath,1); %m = getField(%fieldPath,2); // 0 path / 1 game / 2 mon / 3 year / 4 type / 5 .cs %y = getField(%fieldPath,3); //%lType = getField(%fieldPath,4); - if(%month $= %m && %y $= %year && %game $= %type){ + //error(%g SPC %game SPC %m SPC %month SPC %y SPC %year); + if(%month $= %m && %y $= %year && %g $= %game){ %found = 1; break; } } - $dtSendDataMon = %month; - $dtSendDataYear = %year; - $dtSendDataType = %type; if(isFile(%filepath) && %found){ sendToDiscord("Building Big Stats", $discordBot::monitorChannel); %file.OpenForRead(%filepath); @@ -410,11 +415,11 @@ function sendLDATA(%month, %year, %type){ while(!%file.isEOF()){ %line = %file.readLine(); if(strPos(%line,"%tguid") == -1){ - discord.schedule((%i++)*32,"send","STATSDATA" @ "%c%" @ $dtSendDataMon @ "%c%" @ $dtSendDataType @ "%c%" @ %line @ "\r\n"); + discord.schedule((%i++)*32,"send","STATSDATA" @ "%c%" @ %month @ "%c%" @ %game @ "%c%" @ %line @ "\r\n"); } } - error("Sent LData To Discord" SPC %month SPC %year SPC %type SPC %i); - discord.schedule((%i++*32)+1000,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "buildStats" @ $discordBot::cmdSplit @ %month @ $discordBot::cmdSplit @ %year @ $discordBot::cmdSplit @ %type @ $discordBot::cmdSplit @ "\r\n"); + //error("Sent LData To Discord" SPC %month SPC %year SPC %game SPC %i); + discord.schedule((%i++*32)+1000,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "buildStats" @ $discordBot::cmdSplit @ %month @ $discordBot::cmdSplit @ %year @ $discordBot::cmdSplit @ %game @ $discordBot::cmdSplit @ "\r\n"); schedule((%i++*32)+1000, 0, "unlockStatGen"); } From b57f33d46198038afdcfc8d200328405b11ec8e3 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Wed, 22 Jun 2022 06:53:52 -0400 Subject: [PATCH 63/65] Change RandomSeed Every map change --- Classic/scripts/autoexec/MissionTypeOptions.cs | 3 +++ Classic/scripts/autoexec/TeamManagement.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/MissionTypeOptions.cs b/Classic/scripts/autoexec/MissionTypeOptions.cs index fb5a38d..3bc6731 100644 --- a/Classic/scripts/autoexec/MissionTypeOptions.cs +++ b/Classic/scripts/autoexec/MissionTypeOptions.cs @@ -73,6 +73,9 @@ function loadMissionStage2() //Map Change Center Print. Used to advertise upcoming events if($Host::MapChangeMSG) centerPrintAll($Host::MapChangeMSGContent, 12, 3); + + //Set random seed + setRandomSeed(getrandom(1,200000)); } }; diff --git a/Classic/scripts/autoexec/TeamManagement.cs b/Classic/scripts/autoexec/TeamManagement.cs index bd4d2b2..ae72f77 100644 --- a/Classic/scripts/autoexec/TeamManagement.cs +++ b/Classic/scripts/autoexec/TeamManagement.cs @@ -24,7 +24,7 @@ function CreateServer( %mission, %missionType ) //Call for a GetTeamCount update GetTeamCounts(%game); - // Prevent package from being activated if it is already + //Prevent package from being activated if it is already if (!isActivePackage(TeamCountsTriggers)) activatePackage(TeamCountsTriggers); } From 4b671d78c5576f8f47ec764176213bdc2c4e4a40 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 24 Jun 2022 13:23:19 -0400 Subject: [PATCH 64/65] Flag Tunneling Fix Prevent players from warping thru the flag at high speeds (CTF Type Games Only) --- Classic/scripts/autoexec/flagTunnelingFix.cs | 104 +++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 Classic/scripts/autoexec/flagTunnelingFix.cs diff --git a/Classic/scripts/autoexec/flagTunnelingFix.cs b/Classic/scripts/autoexec/flagTunnelingFix.cs new file mode 100644 index 0000000..822d5cc --- /dev/null +++ b/Classic/scripts/autoexec/flagTunnelingFix.cs @@ -0,0 +1,104 @@ +//Fixes for collision tunneling on flag objects note only in CTF type games +//Script By:DarkTiger +$ftEnable = 1; +$flagSimTime = 60;//note a higher the time, the larger the sweep scans will be +$flagCheckRadius = 50; +$playerBoxA = "-0.6 -0.6 0"; +$playerBoxB = "0.6 0.6 2.3"; + +package flagFix{ + function CTFGame::startFlagCollisionSearch(%game, %flag){ + parent::startFlagCollisionSearch(%game, %flag); + if((getSimTime() - %game.fcs) >= $flagSimTime && $ftEnable){ + %game.flagColTest(%flag); + %game.fcs = getSimTime(); + } + } + function SCtFGame::startFlagCollisionSearch(%game, %flag){ + parent::startFlagCollisionSearch(%game, %flag); + if((getSimTime() - %game.fcs) >= $flagSimTime && $ftEnable){ + %game.flagColTest(%flag); + %game.fcs = getSimTime(); + } + } + + function PracticeCTFGame::startFlagCollisionSearch(%game, %flag){ + parent::startFlagCollisionSearch(%game, %flag); + if((getSimTime() - %game.fcs) >= $flagSimTime && $ftEnable){ + %game.flagColTest(%flag); + %game.fcs = getSimTime(); + } + } + + function CTFGame::startMatch(%game){ + parent::startMatch(%game); + %game.setupFlagTrig(); + if(!isEventPending(Game.flagLoop)){ + %game.atHomeFlagLoop(); + } + } + + function SCtFGame::startMatch(%game){ + parent::startMatch(%game); + %game.setupFlagTrig(); + if(!isEventPending(Game.flagLoop)){ + %game.atHomeFlagLoop(); + } + %game.fcs = getSimTime(); + } + + function PracticeCTFGame::startMatch(%game){ + parent::startMatch(%game); + %game.setupFlagTrig(); + if(!isEventPending(Game.flagLoop)){ + %game.atHomeFlagLoop(); + } + %game.fcs = getSimTime(); + } +}; +activatePackage(flagFix); + +function DefaultGame::flagColTest(%game, %flag){ + %Box2 = %flag.getWorldBox(); + InitContainerRadiusSearch( %flag.getWorldBoxCenter(), $flagCheckRadius, $TypeMasks::PlayerObjectType); + while((%player = containerSearchNext()) != 0){ + %playerPos = %player.getPosition(); + if(%player.lastSim > 0 && (%player.getState() !$= "Dead")){// only check at speed + if((getSimTime() - %player.lastSim) <= 256){//make sure are last position is valid + %sweepCount = mFloor(vectorDist(%playerPos, %player.oldPos) + 1); + for(%i = 0; %i < %sweepCount; %i++){// sweep behind us to see if we should have hit something + %lerpPos = vectorLerp(%playerPos, %player.oldPos, (%i+1)/%sweepCount);//back sweep + %Box1 = vectorAdd($playerBoxA, %lerpPos) SPC vectorAdd($playerBoxB, %lerpPos); + if(boxIntersect(%Box1, %Box2)){ + %flag.getDataBlock().onCollision(%flag, %player); + break; + } + } + } + } + %player.oldPos = %playerPos; + %player.lastSim = getSimTime(); + } +} + +function vectorLerp(%point1, %point2, %t) { + return vectorAdd(%point1, vectorScale(vectorSub(%point2, %point1), %t)); +} + +function boxIntersect(%a, %b){ + return (getWord(%a, 0) <= getWord(%b, 3) && getWord(%a, 3) >= getWord(%b, 0)) && + (getWord(%a, 1) <= getWord(%b, 4) && getWord(%a, 4) >= getWord(%b, 1)) && + (getWord(%a, 2) <= getWord(%b, 5) && getWord(%a, 5) >= getWord(%b, 2)); +} + +function DefaultGame::atHomeFlagLoop(%game){ + if($TeamFlag[1].isHome ){ + %game.flagColTest($TeamFlag[1], 0); + } + if($TeamFlag[2].isHome){ + %game.flagColTest($TeamFlag[2], 0); + } + %speed = ($HostGamePlayerCount - $HostGameBotCount > 0) ? $flagSimTime : 30000; + if(isObject(Game) && $missionRunning && $ftEnable) + %game.flagLoop = %game.schedule(%speed, "atHomeFlagLoop"); +} From e35dddc9922f3e9f34df3685c3ac3d5e809e9d43 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 26 Jun 2022 16:10:23 -0400 Subject: [PATCH 65/65] Use $Host Var --- Classic/scripts/autoexec/zDebriefLoadingScreen.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Classic/scripts/autoexec/zDebriefLoadingScreen.cs b/Classic/scripts/autoexec/zDebriefLoadingScreen.cs index c247a08..493d9fa 100755 --- a/Classic/scripts/autoexec/zDebriefLoadingScreen.cs +++ b/Classic/scripts/autoexec/zDebriefLoadingScreen.cs @@ -60,9 +60,9 @@ $dtLoadingScreen::Delay = 0; $dtLoadingScreen::ShowFullScreen = 0; // Enable/Disable Images $dtLoadingScreen::ShowImages = 0; -// Enable/Disable Server Logo -$dtLoadingScreen::ShowLogo = $Host::LoadScreenShowLogo; //$dtLoadingScreen::ShowLogo = 0; -$dtLoadingScreen::LogoName = $Host::LoadScreenShowLogoName; //$dtLoadingScreen::LogoName = "dpub/DPUB_logo"; +// Enable/Disable Server Logo +//$Host::LoadScreenShowLogo = 0; +//$Host::LoadScreenShowLogoName = "dpub/DPUB_logo"; // Color safetynet @@ -234,11 +234,11 @@ function ALTsendModInfoToClient(%client) $dtLoadingScreen::LoadScreenMessage[$dmlP++] = " "; $dtLoadingScreen::LoadScreenMessage[$dmlP++] = " "; } - else if($dtLoadingScreen::ShowLogo) + else if($Host::LoadScreenShowLogo) { if(%client.dmpVersion $=$DMP::Version) { - $dtLoadingScreen::LoadScreenMessage[$dmlP++] = ""; + $dtLoadingScreen::LoadScreenMessage[$dmlP++] = ""; $dtLoadingScreen::LoadScreenMessage[$dmlP++] = " "; $dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";