mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-12 22:54:33 +00:00
Merge branch 'Dev' into Stable
This commit is contained in:
commit
428d4b341c
27 changed files with 2478 additions and 1229 deletions
|
|
@ -8,8 +8,8 @@ $Host::AllowAdminStopVote = 1;
|
||||||
$Host::AllowAdminStopVotes = 1;
|
$Host::AllowAdminStopVotes = 1;
|
||||||
$Host::AllowAdminVotes = 1;
|
$Host::AllowAdminVotes = 1;
|
||||||
$Host::AllowMapScript = "True";
|
$Host::AllowMapScript = "True";
|
||||||
$Host::AllowPlayerTournamentModeVotekick = 0;
|
|
||||||
$Host::AllowPlayerVoteChangeMission = 1;
|
$Host::AllowPlayerVoteChangeMission = 1;
|
||||||
|
$Host::AllowPlayerVoteNextMission = 1;
|
||||||
$Host::AllowPlayerVoteSkipMission = 1;
|
$Host::AllowPlayerVoteSkipMission = 1;
|
||||||
$Host::AllowPlayerVoteTeamDamage = 0;
|
$Host::AllowPlayerVoteTeamDamage = 0;
|
||||||
$Host::AllowPlayerVoteTimeLimit = 1;
|
$Host::AllowPlayerVoteTimeLimit = 1;
|
||||||
|
|
@ -149,6 +149,8 @@ $Host::MaxPlayers = 30;
|
||||||
$Host::MinBotDifficulty = 0;
|
$Host::MinBotDifficulty = 0;
|
||||||
$Host::MinFlagRecordPlayerCount = 6;
|
$Host::MinFlagRecordPlayerCount = 6;
|
||||||
$Host::MissionType = "LakRabbit";
|
$Host::MissionType = "LakRabbit";
|
||||||
|
$Host::MultipleMapRotation = 0;
|
||||||
|
$Host::MultipleMapRotationCount = 3;
|
||||||
$Host::NoBaseRapeEnabled = 1;
|
$Host::NoBaseRapeEnabled = 1;
|
||||||
$Host::NoBaseRapePlayerCount = 14;
|
$Host::NoBaseRapePlayerCount = 14;
|
||||||
$Host::NoSmurfs = 0;
|
$Host::NoSmurfs = 0;
|
||||||
|
|
|
||||||
|
|
@ -2093,39 +2093,39 @@ function CTFGame::startFlagCollisionSearch(%game, %flag)
|
||||||
// VOTING ///////////////////////////////////////////////////////////////////////////////
|
// VOTING ///////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
function CTFGame::sendGameVoteMenu(%game, %client, %key)
|
// function CTFGame::sendGameVoteMenu(%game, %client, %key)
|
||||||
{
|
// {
|
||||||
DefaultGame::sendGameVoteMenu(%game, %client, %key);
|
// DefaultGame::sendGameVoteMenu(%game, %client, %key);
|
||||||
if ( %game.scheduleVote $= "" )
|
// if ( %game.scheduleVote $= "" )
|
||||||
{
|
// {
|
||||||
//if(%client.isAdmin)
|
// if(%client.isAdmin)
|
||||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' );
|
||||||
//else
|
// else
|
||||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' );
|
// 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)
|
// function CTFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
{
|
// {
|
||||||
DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
|
// DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
|
||||||
switch$ (%typeName)
|
// switch$ (%typeName)
|
||||||
{
|
// {
|
||||||
case "voteAntiTurtleTime":
|
// case "voteAntiTurtleTime":
|
||||||
%game.voteAntiTurtleTime(%admin, %arg1, %arg2, %arg3, %arg4);
|
// %game.voteAntiTurtleTime(%admin, %arg1, %arg2, %arg3, %arg4);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
function CTFGame::sendAntiTurtleTimeList( %game, %client, %key )
|
// function CTFGame::sendAntiTurtleTimeList( %game, %client, %key )
|
||||||
{
|
// {
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 6, "", '6 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 6, "", '6 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 8, "", '8 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 8, "", '8 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 10, "", '10 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 10, "", '10 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 12, "", '12 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 12, "", '12 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 14, "", '14 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 14, "", '14 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 16, "", '16 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 16, "", '16 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 18, "", '18 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 18, "", '18 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 200, "", 'Disable Anti Turtle' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 200, "", 'Disable Anti Turtle' );
|
||||||
}
|
// }
|
||||||
|
|
||||||
function CTFGame::voteAntiTurtleTime(%game, %admin, %newLimit)
|
function CTFGame::voteAntiTurtleTime(%game, %admin, %newLimit)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -836,28 +836,21 @@ function DMGame::sendGameVoteMenu(%game, %client, %key)
|
||||||
if(!%client.canVote && !%isAdmin)
|
if(!%client.canVote && !%isAdmin)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( %game.scheduleVote $= "" )
|
if(%game.scheduleVote $= "")
|
||||||
{
|
{
|
||||||
if(!%client.isAdmin)
|
if(!%isAdmin || (%isAdmin && %client.ForceVote))
|
||||||
{
|
{
|
||||||
if(!$Host::DMSLOnlyMode)
|
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
|
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 (%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' );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!$Host::DMSLOnlyMode)
|
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
|
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' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@
|
||||||
//
|
//
|
||||||
// v3.34 Febuary 2019
|
// v3.34 Febuary 2019
|
||||||
// Armor::damageObject rework
|
// Armor::damageObject rework
|
||||||
// Added SetNextMission support
|
|
||||||
// Indoor Spawning support
|
// Indoor Spawning support
|
||||||
//
|
//
|
||||||
// v3.33 January 2019
|
// v3.33 January 2019
|
||||||
|
|
@ -732,6 +731,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
}
|
}
|
||||||
else if(%points >= 100)
|
else if(%points >= 100)
|
||||||
{
|
{
|
||||||
|
blastFireworks();
|
||||||
messageAll('', '~wfx/Misc/Flair.wav');
|
messageAll('', '~wfx/Misc/Flair.wav');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1051,6 +1051,58 @@ function missileEveryone(%attacker)
|
||||||
if(Game.duelMode && %attacker.holdingFlag)
|
if(Game.duelMode && %attacker.holdingFlag)
|
||||||
%attacker.client.duelSeconds += 15;
|
%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)
|
function killEveryone(%ignore, %message)
|
||||||
{
|
{
|
||||||
if(!%message)
|
if(!%message)
|
||||||
|
|
@ -1119,42 +1171,20 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key )
|
||||||
|
|
||||||
if( %game.scheduleVote $= "" )
|
if( %game.scheduleVote $= "" )
|
||||||
{
|
{
|
||||||
if(!%isAdmin)
|
if(!%isAdmin || (%isAdmin && %client.ForceVote))
|
||||||
{
|
{
|
||||||
if(!Game.duelMode)
|
if(!Game.duelMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' );
|
||||||
|
|
||||||
if(!Game.noSplashDamage)
|
if(!Game.noSplashDamage)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' );
|
||||||
// DeVast - PubPro votes
|
if(!Game.PubPro) // DeVast - PubPro votes
|
||||||
if(!Game.PubPro)
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode (Disc, Blaster, Plasma Only)', 'Vote to enable Pro Mode (Disc, Blaster, Plasma Only)' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
|
|
||||||
else
|
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)' );
|
||||||
}
|
|
||||||
//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' );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1162,16 +1192,14 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key )
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Enable Duel Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Enable Duel Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Disable Duel Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Disable Duel Mode' );
|
||||||
|
|
||||||
if(!Game.noSplashDamage)
|
if(!Game.noSplashDamage)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Disable Splash Damage' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Disable Splash Damage' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Enable Splash Damage' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Enable Splash Damage' );
|
||||||
// DeVast - PubPro votes
|
if(!Game.PubPro) // DeVast - PubPro votes
|
||||||
if(!Game.PubPro)
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode (Disc, Blaster, Plasma Only)', 'Enable Pro Mode (Disc, Blaster, Plasma Only)' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Enable Pro Mode' );
|
|
||||||
else
|
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)' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2018,11 +2046,7 @@ function LakRabbitGame::gameOver(%game)
|
||||||
//call the default
|
//call the default
|
||||||
DefaultGame::gameOver(%game);
|
DefaultGame::gameOver(%game);
|
||||||
|
|
||||||
//send the message
|
|
||||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
|
||||||
|
|
||||||
cancel(%game.rabbitWaypointThread);
|
cancel(%game.rabbitWaypointThread);
|
||||||
messageAll('MsgClearObjHud', "");
|
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
{
|
{
|
||||||
%client = ClientGroup.getObject(%i);
|
%client = ClientGroup.getObject(%i);
|
||||||
|
|
@ -2039,6 +2063,18 @@ function LakRabbitGame::gameOver(%game)
|
||||||
|
|
||||||
%client.team = 0;
|
%client.team = 0;
|
||||||
%client.lastTeam = 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', "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ilys -- cancel waypoint if not showing flag icon
|
// ilys -- cancel waypoint if not showing flag icon
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ function SCtFGame::missionLoadDone(%game)
|
||||||
%game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 );
|
%game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 );
|
||||||
%game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 );
|
%game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 );
|
||||||
|
|
||||||
deleteNonSCtFObjectsFromMap();
|
deleteNonSCtFObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
function SCtFGame::clientMissionDropReady(%game, %client)
|
function SCtFGame::clientMissionDropReady(%game, %client)
|
||||||
|
|
@ -495,7 +495,7 @@ function SCtFGame::equip(%game, %player)
|
||||||
{
|
{
|
||||||
%player.clearInventory();
|
%player.clearInventory();
|
||||||
%player.setInventory(Disc,1);
|
%player.setInventory(Disc,1);
|
||||||
%player.setInventory(Blaster,1);
|
%player.setInventory(Shocklance,1);
|
||||||
%player.setInventory(GrenadeLauncher,1);
|
%player.setInventory(GrenadeLauncher,1);
|
||||||
%player.setInventory(DiscAmmo, %player.getDataBlock().max[DiscAmmo]);
|
%player.setInventory(DiscAmmo, %player.getDataBlock().max[DiscAmmo]);
|
||||||
%player.setInventory(GrenadeLauncherAmmo, %player.getDataBlock().max[GrenadeLauncherAmmo]);
|
%player.setInventory(GrenadeLauncherAmmo, %player.getDataBlock().max[GrenadeLauncherAmmo]);
|
||||||
|
|
@ -2214,33 +2214,26 @@ function SCtFGame::sendGameVoteMenu(%game, %client, %key)
|
||||||
if(!%client.canVote && !%isAdmin)
|
if(!%client.canVote && !%isAdmin)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( %game.scheduleVote $= "" )
|
if(%game.scheduleVote $= "")
|
||||||
{
|
{
|
||||||
if(!%client.isAdmin)
|
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, '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' );
|
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' );
|
||||||
if(!$Host::SCtFProMode)
|
if(!$Host::SCtFProMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode (Disc, SL, GL Only)', 'Vote to enable Pro Mode (Disc, SL, GL Only)' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Vote to disable Pro Mode (Disc, SL, GL Only)' );
|
||||||
}
|
}
|
||||||
else if (%client.ForceVote > 0)
|
else
|
||||||
{
|
{
|
||||||
if(!$Host::SCtFProMode)
|
if(!$Host::SCtFProMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode (Disc, SL, GL Only)', 'Enable Pro Mode (Disc, SL, GL Only)' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Disable Pro Mode (Disc, SL, GL Only)' );
|
||||||
}
|
}
|
||||||
else
|
//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(!$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' );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2457,97 +2450,27 @@ function SCtFGame::SCtFProMode(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
// playerStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4, %clientsVoting);
|
// playerStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4, %clientsVoting);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------DeleteObjects Code-------------------------------
|
|
||||||
//AutoRemove assets, sensors, and turrets from non-LT maps
|
//AutoRemove assets, sensors, and turrets from non-LT maps
|
||||||
//
|
function deleteNonSCtFObjects()
|
||||||
function getGroupObjectByName(%group, %name)
|
|
||||||
{
|
{
|
||||||
%numObjects = %group.getCount();
|
%c = 0;
|
||||||
|
InitContainerRadiusSearch("0 0 0", 9999, $TypeMasks::ItemObjectType |
|
||||||
|
$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...
|
||||||
|
{
|
||||||
|
%deleteList[%c] = %obj;
|
||||||
|
%c++;
|
||||||
|
}
|
||||||
|
|
||||||
for(%i = 0; %i < %numObjects; %i++)
|
}
|
||||||
{
|
for(%i = 0; %i < %c; %i++)
|
||||||
if (%group.getObject(%i).getClassName() $= %name)
|
{
|
||||||
return %group.getObject(%i);
|
%deleteList[%i].delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Delete all ForceField PhysicalZones (PZones)
|
||||||
|
// if(isObject(PZones))
|
||||||
|
// PZones.schedule(1500,"delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,3 +52,6 @@ function serverCmd(%client)
|
||||||
//Disable UE box on crash
|
//Disable UE box on crash
|
||||||
//Used if a clean crash is desired
|
//Used if a clean crash is desired
|
||||||
//memPatch("7dc7fc","90");
|
//memPatch("7dc7fc","90");
|
||||||
|
|
||||||
|
//Show Linux Icon in server list
|
||||||
|
//memPatch("5C9628","80CB05");
|
||||||
|
|
|
||||||
|
|
@ -28,47 +28,54 @@ function loadMissionStage2()
|
||||||
{
|
{
|
||||||
if($Host::TournamentMode && $Host::PUGautoPassword)
|
if($Host::TournamentMode && $Host::PUGautoPassword)
|
||||||
$Host::Password = $Host::PUGPassword;
|
$Host::Password = $Host::PUGPassword;
|
||||||
else if(!$Host::TournamentMode)
|
|
||||||
{
|
|
||||||
if($Host::Password)
|
|
||||||
$Host::Password = "";
|
|
||||||
if($LockedTeams)
|
|
||||||
$LockedTeams = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set server mode to SPEED
|
//Set server mode to SPEED
|
||||||
$Host::HiVisibility = "0";
|
$Host::HiVisibility = 0;
|
||||||
}
|
}
|
||||||
else if($CurrentMissionType $= "LakRabbit")
|
else if($CurrentMissionType $= "LakRabbit")
|
||||||
{
|
{
|
||||||
if($Host::Password)
|
|
||||||
$Host::Password = "";
|
|
||||||
if($LockedTeams)
|
|
||||||
$LockedTeams = 0;
|
|
||||||
if($Host::TournamentMode)
|
if($Host::TournamentMode)
|
||||||
$Host::TournamentMode = 0;
|
$Host::TournamentMode = 0;
|
||||||
|
|
||||||
//Set server mode to DISTANCE
|
//Set server mode to DISTANCE
|
||||||
$Host::HiVisibility = "1";
|
$Host::HiVisibility = 1;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
$Host::Password = $Host::PUGPassword;
|
$Host::Password = $Host::PUGPassword;
|
||||||
$Host::HiVisibility = "0"; //always SPEED
|
$Host::HiVisibility = 0; //always SPEED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($Host::TournamentMode)
|
||||||
|
$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($Host::AllowAdmin2Admin)
|
||||||
|
$Host::AllowAdmin2Admin = 0;
|
||||||
|
}
|
||||||
|
if(isActivePackage(LockedTeams) && !$LockedTeams)
|
||||||
|
deactivatePackage(LockedTeams);
|
||||||
|
|
||||||
//Siege NoBaseRape Fix
|
//Siege NoBaseRape Fix
|
||||||
if($CurrentMissionType $= "Siege")
|
if($CurrentMissionType $= "Siege")
|
||||||
$Host::NoBaseRapeEnabled = 0;
|
$Host::NoBaseRapeEnabled = 0;
|
||||||
else
|
else
|
||||||
$Host::NoBaseRapeEnabled = 1;
|
$Host::NoBaseRapeEnabled = 1;
|
||||||
|
|
||||||
if(isActivePackage(LockedTeams) && !$LockedTeams)
|
|
||||||
deactivatePackage(LockedTeams);
|
|
||||||
|
|
||||||
parent::loadMissionStage2();
|
parent::loadMissionStage2();
|
||||||
|
|
||||||
|
//Map Change Center Print. Used to advertise upcoming events
|
||||||
if($Host::MapChangeMSG)
|
if($Host::MapChangeMSG)
|
||||||
centerPrintAll($Host::MapChangeMSGContent, 12, 3);
|
centerPrintAll($Host::MapChangeMSGContent, 12, 3);
|
||||||
|
|
||||||
|
//Set random seed
|
||||||
|
setRandomSeed(getrandom(1,200000));
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,14 @@ function Observer::setMode(%data, %obj, %mode, %targetObj)
|
||||||
%obj.mode = %mode;
|
%obj.mode = %mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serverCmdObserveClient(%client, %target)
|
||||||
|
{
|
||||||
|
%client.observeFlyClient = "";
|
||||||
|
%client.observingFlag = false;
|
||||||
|
|
||||||
|
parent::serverCmdObserveClient(%client, %target);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Prevent package from being activated if it is already
|
// Prevent package from being activated if it is already
|
||||||
|
|
@ -209,11 +217,11 @@ function observeFlag(%client, %target, %type, %flagTeam)
|
||||||
|
|
||||||
// was the client observing a player before?
|
// was the client observing a player before?
|
||||||
if(%client.observeClient != -1)
|
if(%client.observeClient != -1)
|
||||||
{
|
{
|
||||||
observerFollowUpdate(%client, -1, false);
|
observerFollowUpdate(%client, -1, false);
|
||||||
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.observeClient = -1;
|
%client.observeClient = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Player
|
else // Player
|
||||||
{
|
{
|
||||||
|
|
@ -242,7 +250,8 @@ function observeFlag(%client, %target, %type, %flagTeam)
|
||||||
|
|
||||||
// was the client observing a player before?
|
// was the client observing a player before?
|
||||||
if(%client.observeClient != -1)
|
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.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player);
|
||||||
%client.setControlObject(%client.camera);
|
%client.setControlObject(%client.camera);
|
||||||
%client.observeClient = %target;
|
%client.observeClient = %target;
|
||||||
|
|
|
||||||
|
|
@ -7,18 +7,20 @@
|
||||||
package ObserverTimeout
|
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;
|
%timeDif = getSimTime() - %client.observerTimeout;
|
||||||
%timeDif1 = getSimTime() - %client.observerMsg;
|
%timeDif1 = getSimTime() - %client.observerMsg;
|
||||||
if(%timeDif > 10000 || !%client.observerTimeout || %client.isAdmin)
|
if(%timeDif > 10000 || !%client.observerTimeout || %client.isAdmin)
|
||||||
{
|
{
|
||||||
if ( isObject( Game ) && Game.kickClient != %client )
|
|
||||||
Game.forceObserver( %client, "playerChoose" );
|
|
||||||
|
|
||||||
%client.observerProtectStart = getSimTime();
|
%client.observerProtectStart = getSimTime();
|
||||||
%client.observerTimeout = 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
|
//1 second cooldown on message
|
||||||
else if((%timeDif1 > 1000 || !%client.observerMsg))
|
else if((%timeDif1 > 1000 || !%client.observerMsg))
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType)
|
||||||
|
|
||||||
// No Bots
|
// No Bots
|
||||||
//if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled())
|
//if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled())
|
||||||
// return true;
|
//return true;
|
||||||
|
|
||||||
// Log TeamKill
|
// Log TeamKill
|
||||||
teamkillLog(%victimID, %killerID, %damageType);
|
teamkillLog(%victimID, %killerID, %damageType);
|
||||||
|
|
@ -133,16 +133,56 @@ function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4)
|
||||||
if($Host::TournamentMode)
|
if($Host::TournamentMode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// a vote is already running, cancel it
|
|
||||||
if(Game.scheduleVote !$= "")
|
|
||||||
stopCurrentVote();
|
|
||||||
|
|
||||||
%clientsVoting = 0;
|
|
||||||
|
|
||||||
// admins can't be kicked
|
// admins can't be kicked
|
||||||
if(%arg1.isAdmin)
|
if(%arg1.isAdmin)
|
||||||
return;
|
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
|
||||||
|
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 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 @ "]");
|
||||||
|
|
||||||
|
%clientsVoting = 0;
|
||||||
|
|
||||||
Game.kickClient = %arg1;
|
Game.kickClient = %arg1;
|
||||||
Game.kickClientName = %arg1.name;
|
Game.kickClientName = %arg1.name;
|
||||||
Game.kickGuid = %arg1.guid;
|
Game.kickGuid = %arg1.guid;
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ function stationTrigger::onEnterTrigger(%data, %obj, %colObj)
|
||||||
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
||||||
{
|
{
|
||||||
//Takes 11 blaster shots to kill a heavy, 13 normal.
|
//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;
|
%amount *= 1.15;
|
||||||
|
|
||||||
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||||
|
|
@ -298,6 +298,42 @@ function ConcussionGrenadeThrown::onThrow(%this, %gren)
|
||||||
%gren.detThread = schedule(1800, %gren, "detonateGrenade", %gren); // Was 2000
|
%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))
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
function serverCmdScopeCommanderMap(%client, %scope)
|
||||||
|
{
|
||||||
|
parent::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
|
// Prevent package from being activated if it is already
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ function CreateServer( %mission, %missionType )
|
||||||
//Call for a GetTeamCount update
|
//Call for a GetTeamCount update
|
||||||
GetTeamCounts(%game);
|
GetTeamCounts(%game);
|
||||||
|
|
||||||
// Prevent package from being activated if it is already
|
//Prevent package from being activated if it is already
|
||||||
if (!isActivePackage(TeamCountsTriggers))
|
if (!isActivePackage(TeamCountsTriggers))
|
||||||
activatePackage(TeamCountsTriggers);
|
activatePackage(TeamCountsTriggers);
|
||||||
}
|
}
|
||||||
|
|
@ -55,12 +55,15 @@ function GetTeamCounts(%game)
|
||||||
|
|
||||||
if( !$Host::TournamentMode )
|
if( !$Host::TournamentMode )
|
||||||
{
|
{
|
||||||
if( $CurrentMissionType $= "CTF" )
|
if($CurrentMissionType $= "CTF")
|
||||||
{
|
{
|
||||||
NBRStatusNotify(%game);
|
NBRStatusNotify(%game);
|
||||||
CheckAntiPack(%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.
|
//Set so counter wont run when it doesnt need to.
|
||||||
|
|
@ -172,6 +175,9 @@ function GameConnection::onDrop(%client, %reason)
|
||||||
// Called in GetTeamCounts
|
// Called in GetTeamCounts
|
||||||
function TeamBalanceNotify(%game)
|
function TeamBalanceNotify(%game)
|
||||||
{
|
{
|
||||||
|
if(!$Host::EnableTeamBalanceNotify && !$Host::EnableAutobalance)
|
||||||
|
return;
|
||||||
|
|
||||||
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 )
|
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 )
|
||||||
{
|
{
|
||||||
//Uneven
|
//Uneven
|
||||||
|
|
@ -225,6 +231,9 @@ function NotifyUnbalanced( %game )
|
||||||
if(isEventPending($NotifySchedule))
|
if(isEventPending($NotifySchedule))
|
||||||
cancel($NotifySchedule);
|
cancel($NotifySchedule);
|
||||||
|
|
||||||
|
if(!$Host::EnableTeamBalanceNotify && !$Host::EnableAutobalance)
|
||||||
|
return;
|
||||||
|
|
||||||
if( $TBNStatus !$= "NOTIFY" ) //If Status has changed to EVEN or anything else (GameOver reset).
|
if( $TBNStatus !$= "NOTIFY" ) //If Status has changed to EVEN or anything else (GameOver reset).
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -357,6 +366,9 @@ function Autobalance( %game )
|
||||||
if(isEventPending($AutoBalanceSchedule))
|
if(isEventPending($AutoBalanceSchedule))
|
||||||
cancel($AutoBalanceSchedule);
|
cancel($AutoBalanceSchedule);
|
||||||
|
|
||||||
|
if(!$Host::EnableAutobalance)
|
||||||
|
return;
|
||||||
|
|
||||||
if($TBNStatus !$= "NOTIFY") //If Status has changed to EVEN or anything else (GameOver reset).
|
if($TBNStatus !$= "NOTIFY") //If Status has changed to EVEN or anything else (GameOver reset).
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
198
Classic/scripts/autoexec/dtBanSystem.cs
Executable file → Normal file
198
Classic/scripts/autoexec/dtBanSystem.cs
Executable file → Normal file
|
|
@ -11,12 +11,12 @@
|
||||||
//$dtBanList::GUID3555379 = "4\t2021\t18\t31\t518400";
|
//$dtBanList::GUID3555379 = "4\t2021\t18\t31\t518400";
|
||||||
|
|
||||||
//TO UNBAN SOMEONE WITHOUT RESTARTING THE SERVER
|
//TO UNBAN SOMEONE WITHOUT RESTARTING THE SERVER
|
||||||
//unban(%guid,%ip); in console
|
//banList();in console
|
||||||
//Example: unban(555555,"22.222.222.222"); put ip in quotes
|
//unbanIndex(%index) %index is the number next to the players name from listBans();
|
||||||
|
//Example: unbanold(555555,"22.222.222.222"); put ip in quotes
|
||||||
|
|
||||||
package dtBan
|
package dtBan
|
||||||
{
|
{
|
||||||
|
|
||||||
function ClassicLoadBanlist()
|
function ClassicLoadBanlist()
|
||||||
{
|
{
|
||||||
$ClassicPermaBans = 0;
|
$ClassicPermaBans = 0;
|
||||||
|
|
@ -30,21 +30,43 @@ function BanList::add(%guid, %ipAddress, %time){
|
||||||
if(%time > 999999){
|
if(%time > 999999){
|
||||||
%time = "BAN";
|
%time = "BAN";
|
||||||
}
|
}
|
||||||
|
%name = getClientBanName(%guid, %ipAddress);
|
||||||
if (%guid > 0){
|
if (%guid > 0){
|
||||||
$dtBanList::GUID[%guid] = dtBanMark() TAB %time;
|
$dtBanList::GUID[%guid] = dtBanMark() TAB %time TAB %name;
|
||||||
}
|
}
|
||||||
if (getSubStr(%ipAddress, 0, 3) $= "IP:"){
|
if (getSubStr(%ipAddress, 0, 3) $= "IP:"){
|
||||||
// add IP ban
|
|
||||||
%bareIP = getSubStr(%ipAddress, 3, strLen(%ipAddress));
|
%bareIP = getSubStr(%ipAddress, 3, strLen(%ipAddress));
|
||||||
%bareIP = getSubStr(%bareIP, 0, strstr(%bareIP, ":"));
|
%bareIP = getSubStr(%bareIP, 0, strstr(%bareIP, ":"));
|
||||||
%bareIP = strReplace(%bareIP, ".", "_"); // variable access bug workaround
|
%bareIP = strReplace(%bareIP, ".", "_"); // variable access bug workaround
|
||||||
|
// add IP ban
|
||||||
$dtBanList::IP[%bareIP] = dtBanMark() TAB %time;
|
$dtBanList::IP[%bareIP] = dtBanMark() TAB %time TAB %name;
|
||||||
//error("ban" SPC %bareIP SPC $dtBanList::IP[%bareIP]);
|
|
||||||
}
|
}
|
||||||
|
%found = 0;
|
||||||
// write out the updated bans to the file
|
%eIndex = -1;
|
||||||
export("$dtBanList*", $Host::dtBanlist);
|
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){
|
||||||
|
if($dtBanList::NameList[%eIndex] $= ""){
|
||||||
|
$dtBanList::NameList[%eIndex] = %name TAB %guid TAB %bareIP;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
error("Ban Index is not empty");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
saveBanList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function banList_checkIP(%client){
|
function banList_checkIP(%client){
|
||||||
|
|
@ -56,14 +78,21 @@ function banList_checkIP(%client){
|
||||||
%time = $dtBanList::IP[%ip];
|
%time = $dtBanList::IP[%ip];
|
||||||
if(%time $= "BAN")
|
if(%time $= "BAN")
|
||||||
return 1;
|
return 1;
|
||||||
if (%time !$= "" && %time != 0){
|
if (getFieldCount(%time) > 0){
|
||||||
%delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3));
|
%delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3));
|
||||||
if (%delta < getField(%time,4))
|
if (%delta < getField(%time,4))
|
||||||
return 1;
|
return 1;
|
||||||
else{
|
else{
|
||||||
|
for (%i = 0; %i < 100; %i++){
|
||||||
|
if($dtBanList::NameList[%i] !$= ""){
|
||||||
|
if(getField($dtBanList::NameList[%i], 1) $= %guid){
|
||||||
|
unbanIndex(%i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$dtBanList::IP[%ip] = "";
|
$dtBanList::IP[%ip] = "";
|
||||||
schedule(1000,0,"export","$dtBanList*", $Host::dtBanlist);
|
saveBanList();
|
||||||
//export("$dtBanList*", "prefs/dtBanlist.cs");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -73,14 +102,21 @@ function banList_checkGUID(%guid){
|
||||||
%time = $dtBanList::GUID[%guid];
|
%time = $dtBanList::GUID[%guid];
|
||||||
if(%time $= "BAN")
|
if(%time $= "BAN")
|
||||||
return 1;
|
return 1;
|
||||||
if (%time !$= "" && %time != 0){
|
if (getFieldCount(%time) > 0){
|
||||||
%delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3));
|
%delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3));
|
||||||
if (%delta < getField(%time,4))
|
if (%delta < getField(%time,4))
|
||||||
return 1;
|
return 1;
|
||||||
else{
|
else{
|
||||||
$dtBanList::GUID[%guid] = "";
|
for (%i = 0; %i < 100; %i++){
|
||||||
schedule(500,0,"export","$dtBanList*", $Host::dtBanlist);
|
if($dtBanList::NameList[%i] !$= ""){
|
||||||
//export("$dtBanList*", "prefs/dtBanlist.cs");
|
if(getField($dtBanList::NameList[%i], 1) $= %guid){
|
||||||
|
unbanIndex(%i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$dtBanList::GUID[%guid] = "";
|
||||||
|
saveBanList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -88,31 +124,63 @@ function banList_checkGUID(%guid){
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!isActivePackage(dtBan))
|
if (!isActivePackage(dtBan)){
|
||||||
activatePackage(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){
|
function getBanCount(%d, %year, %h, %n){
|
||||||
%dif = formattimestring("yy") - %year;
|
if(%d && %year && %h && %n){
|
||||||
%days += 365 * (%dif-1);
|
%dif = formattimestring("yy") - %year;
|
||||||
%days += 365 - %d;
|
%days += 365 * (%dif-1);
|
||||||
%days += dtBanDay();
|
%days += 365 - %d;
|
||||||
%ht = %nt = 0;
|
%days += dtBanDay();
|
||||||
if(formattimestring("H") > %h){
|
%ht = %nt = 0;
|
||||||
%ht = formattimestring("H") - %h;
|
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){
|
return 0;
|
||||||
%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 mfloor((%days * 1440) + (%ht*60) + %nt) TAB (%days * 1440) TAB (%ht*60) TAB %nt;
|
//return mfloor((%days * 1440) + (%ht*60) + %nt) TAB (%days * 1440) TAB (%ht*60) TAB %nt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,15 +214,63 @@ function dtBanMark(){
|
||||||
return %count + %d TAB formattimestring("yy") TAB formattimestring("H") TAB formattimestring("n");
|
return %count + %d TAB formattimestring("yy") TAB formattimestring("H") TAB formattimestring("n");
|
||||||
}
|
}
|
||||||
|
|
||||||
function unban(%guid,%ip){
|
function banList(){
|
||||||
|
%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(%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){
|
||||||
|
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] !$= ""){
|
||||||
|
$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");
|
||||||
|
}
|
||||||
|
saveBanList();
|
||||||
|
return %name;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//old method
|
||||||
|
function unbanold(%guid,%ip){
|
||||||
|
%ip = strReplace(%ip, ".", "_");
|
||||||
|
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] !$= ""){
|
if($dtBanList::GUID[%guid] !$= ""){
|
||||||
$dtBanList::GUID[%guid] = "";
|
$dtBanList::GUID[%guid] = "";
|
||||||
error("GUID" SPC %guid SPC "UNBANNED");
|
error("GUID" SPC %guid SPC "UNBANNED");
|
||||||
}
|
}
|
||||||
%ip = strReplace(%ip, ".", "_");
|
|
||||||
if($dtBanList::IP[%ip] !$= ""){
|
if($dtBanList::IP[%ip] !$= ""){
|
||||||
$dtBanList::IP[%ip] = "";
|
$dtBanList::IP[%ip] = "";
|
||||||
error("IP" SPC %ip SPC "UNBANNED");
|
error("IP" SPC %ip SPC "UNBANNED");
|
||||||
}
|
}
|
||||||
export("$dtBanList*", $Host::dtBanlist);
|
saveBanList();
|
||||||
}
|
}
|
||||||
104
Classic/scripts/autoexec/flagTunnelingFix.cs
Normal file
104
Classic/scripts/autoexec/flagTunnelingFix.cs
Normal file
|
|
@ -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");
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
//$Host::ClassicRotationFile = "prefs/mapRotation1.cs";
|
//$Host::ClassicRotationFile = "prefs/mapRotation1.cs";
|
||||||
|
|
||||||
//Enable/Disable
|
//Enable/Disable
|
||||||
$EnableMultipleMapRotation = 0;
|
//$Host::MultipleMapRotation = 0;
|
||||||
|
|
||||||
//How any mapRotation Files
|
//How any mapRotation Files
|
||||||
//Naming scheme mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc
|
//Naming scheme mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc
|
||||||
$mapRotationFilesCount = 3;
|
//$Host::MultipleMapRotationCount = 3;
|
||||||
|
|
||||||
function multipleMapRotation()
|
function multipleMapRotation()
|
||||||
{
|
{
|
||||||
|
|
@ -15,7 +15,7 @@ function multipleMapRotation()
|
||||||
|
|
||||||
if(%var) //If number exists proceed
|
if(%var) //If number exists proceed
|
||||||
{
|
{
|
||||||
if(%var $= $mapRotationFilesCount)
|
if(%var $= $Host::MultipleMapRotationCount)
|
||||||
%var = 1;
|
%var = 1;
|
||||||
else
|
else
|
||||||
%var = %var + 1;
|
%var = %var + 1;
|
||||||
|
|
@ -34,5 +34,5 @@ function multipleMapRotationEcho()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Run
|
//Run
|
||||||
if($EnableMultipleMapRotation)
|
if($Host::MultipleMapRotation)
|
||||||
multipleMapRotation();
|
multipleMapRotation();
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@ $dtLoadingScreen::ShowFullScreen = 0;
|
||||||
// Enable/Disable Images
|
// Enable/Disable Images
|
||||||
$dtLoadingScreen::ShowImages = 0;
|
$dtLoadingScreen::ShowImages = 0;
|
||||||
// Enable/Disable Server Logo
|
// Enable/Disable Server Logo
|
||||||
$dtLoadingScreen::ShowLogo = $Host::LoadScreenShowLogo; //$dtLoadingScreen::ShowLogo = 0;
|
//$Host::LoadScreenShowLogo = 0;
|
||||||
$dtLoadingScreen::LogoName = $Host::LoadScreenShowLogoName; //$dtLoadingScreen::LogoName = "dpub/DPUB_logo";
|
//$Host::LoadScreenShowLogoName = "dpub/DPUB_logo";
|
||||||
|
|
||||||
|
|
||||||
// Color safetynet
|
// Color safetynet
|
||||||
|
|
@ -234,11 +234,11 @@ function ALTsendModInfoToClient(%client)
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||||
}
|
}
|
||||||
else if($dtLoadingScreen::ShowLogo)
|
else if($Host::LoadScreenShowLogo)
|
||||||
{
|
{
|
||||||
if(%client.dmpVersion $=$DMP::Version)
|
if(%client.dmpVersion $=$DMP::Version)
|
||||||
{
|
{
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<bitmap:" @ $dtLoadingScreen::LogoName @ ">";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<bitmap:" @ $Host::LoadScreenShowLogoName @ ">";
|
||||||
|
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||||
|
|
|
||||||
|
|
@ -2,31 +2,30 @@
|
||||||
// Script BY: DarkTiger
|
// Script BY: DarkTiger
|
||||||
// Worked on: ChocoTaco
|
// Worked on: ChocoTaco
|
||||||
// If player is afk specific amount of time in minutes, force them into observer
|
// If player is afk specific amount of time in minutes, force them into observer
|
||||||
|
deleteVariables("$dtVar::AFKList*");
|
||||||
|
$AFKCount = 0;
|
||||||
|
|
||||||
// Enable/Disable entire script
|
// Enable/Disable entire script
|
||||||
$dtVar::AFKTimeout = 1;
|
$dtVar::AFKTimeout = 1;
|
||||||
// 60000 * 2 is 2 minutes
|
// 60000 * 2 is 2 minutes
|
||||||
// 0 minutes disables
|
// 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
|
// Run from List Only instead of All clients on the server. 1 is yes, 0 is no
|
||||||
$dtVar::ListOnly = 1;
|
$dtVar::ListOnly = 1;
|
||||||
// Add clients who are normally AFK
|
// Add clients who are normally AFK
|
||||||
$dtVar::AFKList[$AFKCount++] = "";
|
$dtVar::AFKList[$AFKCount++] = "";
|
||||||
$dtVar::AFKList[$AFKCount++] = "";
|
$dtVar::AFKList[$AFKCount++] = "";
|
||||||
|
|
||||||
// Loop Check Timer
|
// Loop Check Timer
|
||||||
// How often do you want a AFKLoop. 1000 * 30 is 30 seconds
|
// How often do you want a AFKLoop. 1000 * 30 is 30 seconds
|
||||||
$dtVar::AFKloop = 1000 * 30;
|
$dtVar::AFKloop = 1000 * 15;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Set Status Var
|
// Set Status Var
|
||||||
if($dtVar::ListOnly)
|
if($dtVar::ListOnly || !$dtVar::AFKtime)
|
||||||
$DT_AFKStatus = "IDLE";
|
$DT_AFKStatus = "IDLE";
|
||||||
else
|
else
|
||||||
$DT_AFKStatus = "ACTIVE";
|
$DT_AFKStatus = "ACTIVE";
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
package DT_AFKPackage
|
package DT_AFKPackage
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -67,21 +66,19 @@ function GameConnection::onDrop(%client, %reason)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
function DT_AFKStatusConnect(%client)
|
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];
|
$DT_AFKStatus = "ACTIVE";
|
||||||
if(%client.guid $= %guid && %guid !$= "")
|
$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)
|
function DT_AFKStatusDrop(%client)
|
||||||
{
|
{
|
||||||
if(%client.dtAFK)
|
if(%client.dtAFK)
|
||||||
$DT_AFKListCount = $DT_AFKListCount - 1;
|
$DT_AFKListCount--;
|
||||||
|
|
||||||
// for(%x = 1; %x <= $AFKCount; %x++)
|
//Reset
|
||||||
// {
|
if($DT_AFKListCount $= 0)
|
||||||
// %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
|
|
||||||
$DT_AFKStatus = "IDLE";
|
$DT_AFKStatus = "IDLE";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
function DT_AFKtimeoutLoop()
|
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))
|
if(isEventPending($dtVar::AFKloopSchedule))
|
||||||
cancel($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");
|
$dtVar::AFKloopSchedule = schedule($dtVar::AFKloop, 0, "DT_AFKtimeoutLoop");
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
function CheckAFK(%client)
|
||||||
|
|
||||||
function AFKChk(%client)
|
|
||||||
{
|
{
|
||||||
if(%client.player.curTransform $= %client.player.getTransform())
|
//checks to see if there position and rotation are the same.
|
||||||
{//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)
|
%client.player.afkTimer += $dtVar::AFKloop;
|
||||||
{
|
if(%client.player.afkTimer >= $dtVar::AFKtime)
|
||||||
Game.AFKForceObserver(%client);
|
{
|
||||||
return;
|
Game.AFKForceObserver(%client);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
%client.player.afkTimer = 0;//reset if moving
|
%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)
|
function DefaultGame::AFKForceObserver(%game, %client)
|
||||||
{
|
{
|
||||||
|
if($Host::TournamentMode)
|
||||||
|
return;
|
||||||
|
|
||||||
//make sure we have a valid client...
|
//make sure we have a valid client...
|
||||||
if (%client <= 0)
|
if (%client <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
@ -196,23 +178,6 @@ function DefaultGame::AFKForceObserver(%game, %client)
|
||||||
logEcho(%client.nameBase@" (cl "@%client@") was forced into observer mode due to inactivity");
|
logEcho(%client.nameBase@" (cl "@%client@") was forced into observer mode due to inactivity");
|
||||||
%client.lastTeam = %client.team;
|
%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)
|
// switch client to team 0 (observer)
|
||||||
%client.team = 0;
|
%client.team = 0;
|
||||||
%client.player.team = 0;
|
%client.player.team = 0;
|
||||||
|
|
|
||||||
|
|
@ -1733,7 +1733,7 @@ package dtStats{
|
||||||
if($dtStats::Enable){
|
if($dtStats::Enable){
|
||||||
dtSaveServerVars();
|
dtSaveServerVars();
|
||||||
dtScanForRepair();
|
dtScanForRepair();
|
||||||
$mapID::gameID = addNum($mapID::gameID,1);
|
$mapID::gameID = formattimestring("mddyHHnnss");
|
||||||
if($dtStats::debugEchos)
|
if($dtStats::debugEchos)
|
||||||
error("GAME ID" SPC $mapID::gameID SPC "//////////////////////////////");
|
error("GAME ID" SPC $mapID::gameID SPC "//////////////////////////////");
|
||||||
}
|
}
|
||||||
|
|
@ -2206,7 +2206,7 @@ package dtStatsGame{
|
||||||
}
|
}
|
||||||
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg){
|
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg){
|
||||||
parent::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++;
|
%client.dtStats.voteCount++;
|
||||||
if(%typeName $= "VoteChangeMission"){
|
if(%typeName $= "VoteChangeMission"){
|
||||||
%mission = $HostMissionFile[%arg3];
|
%mission = $HostMissionFile[%arg3];
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
//exec("scripts/autoexec/zzDiscordBot.cs");
|
//exec("scripts/autoexec/zzDiscordBot.cs");
|
||||||
|
|
||||||
//ip of the bot
|
//ip of the bot
|
||||||
$discordBot::IP = "";
|
$discordBot::IP = "127.0.0.1:28003";
|
||||||
$discordBot::reconnectTimeout = 3 * 60000;
|
$discordBot::reconnectTimeout = 3 * 60000;
|
||||||
//auto connect on start
|
//auto connect on start
|
||||||
$discordBot::autoStart = 0;
|
$discordBot::autoStart = 0;
|
||||||
|
|
@ -203,7 +203,6 @@ function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6)
|
||||||
sendToDiscordEmote(%msg, $discordBot::serverFeed);
|
sendToDiscordEmote(%msg, $discordBot::serverFeed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendToDiscord(%msg,%channel)
|
function sendToDiscord(%msg,%channel)
|
||||||
{
|
{
|
||||||
if(isObject(discord) && %msg !$= "")
|
if(isObject(discord) && %msg !$= "")
|
||||||
|
|
@ -286,15 +285,14 @@ function discord::onLine(%this, %line){
|
||||||
switch$(%cmd){
|
switch$(%cmd){
|
||||||
//case "Discord":
|
//case "Discord":
|
||||||
//messageAll( 'MsgDiscord', '\c3Discord: \c4%1 %2',getWord(%lineStrip,1),getWords(%lineStrip,2,getWordCount(%lineStrip) -1));
|
//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":
|
case "GETSTAT":
|
||||||
%var = getWord(%lineStrip,1);
|
%mon = getWord(%lineStrip,1);
|
||||||
%mon = getWord(%lineStrip,2);
|
%year = getWord(%lineStrip,2);
|
||||||
%year = getWord(%lineStrip,3);
|
%var = getWord(%lineStrip,3);
|
||||||
%game = getWord(%lineStrip,4);
|
%game = getWord(%lineStrip,4);
|
||||||
|
if(%game $= ""){// default if not valid
|
||||||
|
%game = "CTFGame";
|
||||||
|
}
|
||||||
%returnIndex = getWord(%lineStrip,5);
|
%returnIndex = getWord(%lineStrip,5);
|
||||||
%nameList = $lData::name[%var,%game,"month",%mon,%year];
|
%nameList = $lData::name[%var,%game,"month",%mon,%year];
|
||||||
%dataList = $lData::data[%var,%game,"month",%mon,%year];
|
%dataList = $lData::data[%var,%game,"month",%mon,%year];
|
||||||
|
|
@ -307,8 +305,12 @@ function discord::onLine(%this, %line){
|
||||||
$genStatsLockout = 1;
|
$genStatsLockout = 1;
|
||||||
%month = getWord(%lineStrip,1);
|
%month = getWord(%lineStrip,1);
|
||||||
%year = getWord(%lineStrip,2);
|
%year = getWord(%lineStrip,2);
|
||||||
|
%game = getWord(%lineStrip,3);
|
||||||
|
if(%game $= ""){// default if not valid
|
||||||
|
%game = "CTFGame";
|
||||||
|
}
|
||||||
if(%month > 0 && %year > 0){
|
if(%month > 0 && %year > 0){
|
||||||
schedule(1000, 0, "sendLDATA", %month, %year, "CTFGame");
|
schedule(1000, 0, "sendLDATA", %month, %year, %game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
@ -317,9 +319,9 @@ function discord::onLine(%this, %line){
|
||||||
case "PING":
|
case "PING":
|
||||||
discord.send("PONG" @ $discordBot::cmdSplit @ "\r\n");
|
discord.send("PONG" @ $discordBot::cmdSplit @ "\r\n");
|
||||||
case "PINGAVG":
|
case "PINGAVG":
|
||||||
%min = 10000;
|
%min = 10000;
|
||||||
%max = -10000;
|
%max = -10000;
|
||||||
%lowCount = %lowPing = 0;
|
%lowCount = %lowPing = 0;
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||||
%cl = ClientGroup.getObject(%i);
|
%cl = ClientGroup.getObject(%i);
|
||||||
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
||||||
|
|
@ -353,6 +355,32 @@ function discord::onLine(%this, %line){
|
||||||
discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "msgList" @ "\r\n");
|
discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "msgList" @ "\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case "BANLIST":
|
||||||
|
%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);
|
||||||
|
%found++;
|
||||||
|
discord.schedule(%found*32,"send","MSGSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ %msg @ "\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($dtBanList::NameList[%var] !$= ""){
|
||||||
|
%name = unbanIndex(%var);
|
||||||
|
sendToDiscord("User:" @ %name SPC "has been unbanned", $discordBot::monitorChannel);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
sendToDiscord("Invalid Index", $discordBot::monitorChannel);
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error("Discord Bad Command" SPC %line);
|
error("Discord Bad Command" SPC %line);
|
||||||
}
|
}
|
||||||
|
|
@ -361,7 +389,7 @@ if(!isObject(discord) && $discordBot::autoStart){
|
||||||
discordCon();
|
discordCon();
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendLDATA(%month, %year, %type){
|
function sendLDATA(%month, %year, %game){
|
||||||
%file = new FileObject();
|
%file = new FileObject();
|
||||||
RootGroup.add(%file);
|
RootGroup.add(%file);
|
||||||
%folderPath = "serverStats/LData/*.cs";
|
%folderPath = "serverStats/LData/*.cs";
|
||||||
|
|
@ -370,18 +398,16 @@ function sendLDATA(%month, %year, %type){
|
||||||
for (%i = 0; %i < %count; %i++){
|
for (%i = 0; %i < %count; %i++){
|
||||||
%filepath = findNextfile(%folderPath);
|
%filepath = findNextfile(%folderPath);
|
||||||
%fieldPath =strreplace(%filePath,"-","\t");
|
%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
|
%m = getField(%fieldPath,2); // 0 path / 1 game / 2 mon / 3 year / 4 type / 5 .cs
|
||||||
%y = getField(%fieldPath,3);
|
%y = getField(%fieldPath,3);
|
||||||
//%lType = getField(%fieldPath,4);
|
//%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;
|
%found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dtSendDataMon = %month;
|
|
||||||
$dtSendDataYear = %year;
|
|
||||||
$dtSendDataType = %type;
|
|
||||||
if(isFile(%filepath) && %found){
|
if(isFile(%filepath) && %found){
|
||||||
sendToDiscord("Building Big Stats", $discordBot::monitorChannel);
|
sendToDiscord("Building Big Stats", $discordBot::monitorChannel);
|
||||||
%file.OpenForRead(%filepath);
|
%file.OpenForRead(%filepath);
|
||||||
|
|
@ -389,11 +415,11 @@ function sendLDATA(%month, %year, %type){
|
||||||
while(!%file.isEOF()){
|
while(!%file.isEOF()){
|
||||||
%line = %file.readLine();
|
%line = %file.readLine();
|
||||||
if(strPos(%line,"%tguid") == -1){
|
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);
|
//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 @ %type @ $discordBot::cmdSplit @ "\r\n");
|
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");
|
schedule((%i++*32)+1000, 0, "unlockStatGen");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -407,79 +433,3 @@ function sendLDATA(%month, %year, %type){
|
||||||
function unlockStatGen(){
|
function unlockStatGen(){
|
||||||
$genStatsLockout = 0;
|
$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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
736
Classic/scripts/camera.cs
Normal file
736
Classic/scripts/camera.cs
Normal file
|
|
@ -0,0 +1,736 @@
|
||||||
|
$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;
|
||||||
|
|
||||||
|
%readySpamDif = getSimTime() - %client.readySpam;
|
||||||
|
%readySpamDif1 = getSimTime() - %client.readySpamMsg;
|
||||||
|
if(%readySpamDif > 10000 || !%client.readySpam)
|
||||||
|
{
|
||||||
|
%client.readySpam = getSimTime();
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
@ -1802,7 +1802,7 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
||||||
%damMess = "DISABLED";
|
%damMess = "DISABLED";
|
||||||
|
|
||||||
if(%game.numTeams > 1)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2973,13 +2973,13 @@ function DefaultGame::sendGameTeamList( %game, %client, %key )
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
function DefaultGame::sendTimeLimitList( %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, 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, 180, "", '180 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 240, "", '240 minutes' );
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 360, "", '360 minutes' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 360, "", '360 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 480, "", '480 minutes' );
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 999, "", 'No time limit' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 999, "", 'No time limit' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3385,9 +3385,10 @@ function DefaultGame::voteAdminPlayer(%game, %admin, %client)
|
||||||
|
|
||||||
if (%admin)
|
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;
|
%client.isAdmin = 1;
|
||||||
%cause = "(admin)";
|
%cause = "(admin)";
|
||||||
|
adminLog(%admin, " has made" SPC %client.nameBase @ "(" @ %client.guid @ ") an admin.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -3402,6 +3403,7 @@ function DefaultGame::voteAdminPlayer(%game, %admin, %client)
|
||||||
else
|
else
|
||||||
messageAll('MsgVoteFailed', '\c2Vote to make %1 an admin did not pass.', %client.name);
|
messageAll('MsgVoteFailed', '\c2Vote to make %1 an admin did not pass.', %client.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%cause !$= "")
|
if(%cause !$= "")
|
||||||
logEcho($AdminCl.nameBase @ ": " @ %client.nameBase@" (cl "@%client@") made admin "@%cause, 1);
|
logEcho($AdminCl.nameBase @ ": " @ %client.nameBase@" (cl "@%client@") made admin "@%cause, 1);
|
||||||
}
|
}
|
||||||
|
|
@ -3847,10 +3849,9 @@ function notifyMatchEnd(%time)
|
||||||
{
|
{
|
||||||
%seconds = mFloor(%time / 1000);
|
%seconds = mFloor(%time / 1000);
|
||||||
|
|
||||||
if (%seconds > 1) {
|
if(%seconds > 1)
|
||||||
MessageAll('MsgMissionEnd', '\c2Match ends in %1 seconds.~wfx/misc/hunters_%1.wav', %seconds);
|
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');
|
MessageAll('MsgMissionEnd', '\c2Match ends in 1 second.~wfx/misc/hunters_1.wav');
|
||||||
|
|
||||||
UpdateClientTimes(%time);
|
UpdateClientTimes(%time);
|
||||||
|
|
@ -3860,9 +3861,15 @@ function notifyMatchEndMinutes(%time)
|
||||||
{
|
{
|
||||||
%seconds = mFloor(%time / 1000);
|
%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');
|
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');
|
MessageAll('MsgMissionEndMinutes', '\c2Match ends in 2 minutes.~wfx/misc/flagself.wav');
|
||||||
|
|
||||||
UpdateClientTimes(%time);
|
UpdateClientTimes(%time);
|
||||||
|
|
|
||||||
|
|
@ -955,7 +955,7 @@ function explodeFirework(%position, %id)
|
||||||
};
|
};
|
||||||
|
|
||||||
//echo(%emitter.position);
|
//echo(%emitter.position);
|
||||||
serverPlay3d(dtFireworksSound, %emitter.position);
|
//serverPlay3d(dtFireworksSound, %emitter.position);
|
||||||
MissionCleanup.add(%emitter);
|
MissionCleanup.add(%emitter);
|
||||||
%emitter.schedule(1250, "delete");
|
%emitter.schedule(1250, "delete");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1085,8 +1085,8 @@ datablock ParticleData(LightPuff)
|
||||||
textureName = "particleTest";
|
textureName = "particleTest";
|
||||||
colors[0] = "0.46 0.36 0.26 0.4";
|
colors[0] = "0.46 0.36 0.26 0.4";
|
||||||
colors[1] = "0.46 0.46 0.36 0.0";
|
colors[1] = "0.46 0.46 0.36 0.0";
|
||||||
sizes[0] = 0.4;
|
sizes[0] = 0.8; //was 0.4
|
||||||
sizes[1] = 1.0;
|
sizes[1] = 1.4; //was 1.0
|
||||||
};
|
};
|
||||||
|
|
||||||
datablock ParticleEmitterData(LightPuffEmitter)
|
datablock ParticleEmitterData(LightPuffEmitter)
|
||||||
|
|
@ -1123,9 +1123,9 @@ datablock ParticleData(LiftoffDust)
|
||||||
colors[0] = "0.46 0.36 0.26 0.0";
|
colors[0] = "0.46 0.36 0.26 0.0";
|
||||||
colors[1] = "0.46 0.46 0.36 0.4";
|
colors[1] = "0.46 0.46 0.36 0.4";
|
||||||
colors[2] = "0.46 0.46 0.36 0.0";
|
colors[2] = "0.46 0.46 0.36 0.0";
|
||||||
sizes[0] = 0.2;
|
sizes[0] = 0.6; //was 0.2
|
||||||
sizes[1] = 0.6;
|
sizes[1] = 1.0; //was 0.6
|
||||||
sizes[2] = 1.0;
|
sizes[2] = 1.4; //was 1.0
|
||||||
times[0] = 0.0;
|
times[0] = 0.0;
|
||||||
times[1] = 0.5;
|
times[1] = 0.5;
|
||||||
times[2] = 1.0;
|
times[2] = 1.0;
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot)
|
||||||
{
|
{
|
||||||
%obj.cantFire = 1;
|
%obj.cantFire = 1;
|
||||||
%preventTime = %data.stateTimeoutValue[4];
|
%preventTime = %data.stateTimeoutValue[4];
|
||||||
|
//%preventTime = (%data.stateTimeoutValue[4] + %data.stateTimeoutValue[3]) - 0.032;
|
||||||
%obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj);
|
%obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj);
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
@ -410,6 +411,7 @@ function ShockLanceImage::onFire(%this, %obj, %slot)
|
||||||
|
|
||||||
%obj.cantfire = 1;
|
%obj.cantfire = 1;
|
||||||
%preventTime = %this.stateTimeoutValue[4];
|
%preventTime = %this.stateTimeoutValue[4];
|
||||||
|
//%preventTime = (%data.stateTimeoutValue[4] + %data.stateTimeoutValue[3]) - 0.032;
|
||||||
%obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj);
|
%obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj);
|
||||||
|
|
||||||
if( %obj.getEnergyLevel() < %this.minEnergy ) // z0dd - ZOD, 5/22/03. Check energy level first
|
if( %obj.getEnergyLevel() < %this.minEnergy ) // z0dd - ZOD, 5/22/03. Check energy level first
|
||||||
|
|
|
||||||
87
Classic/scripts/server.cs
Executable file → Normal file
87
Classic/scripts/server.cs
Executable file → Normal file
|
|
@ -861,7 +861,7 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
||||||
messageClient(%client, 'MsgClientJoin', "",
|
messageClient(%client, 'MsgClientJoin', "",
|
||||||
%recipient.name,
|
%recipient.name,
|
||||||
%recipient,
|
%recipient,
|
||||||
%recipient.target,
|
"",
|
||||||
%recipient.isAIControlled(),
|
%recipient.isAIControlled(),
|
||||||
%recipient.isAdmin,
|
%recipient.isAdmin,
|
||||||
%recipient.isSuperAdmin,
|
%recipient.isSuperAdmin,
|
||||||
|
|
@ -879,15 +879,15 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
||||||
if ( $CurrentMissionType !$= "SinglePlayer" )
|
if ( $CurrentMissionType !$= "SinglePlayer" )
|
||||||
{
|
{
|
||||||
// z0dd - ZOD, 5/08/04. Send message of any gameplay changes
|
// 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 \c2Sniper Mod: \c3%1.', ($Host::ClassicLoadSniperChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Missile Mod: \c3%1.', ($Host::ClassicLoadMissileChanges ? '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 \c2Mortar Mod: \c3%1.', ($Host::ClassicLoadMortarChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Blaster Mod: \c3%1.', ($Host::ClassicLoadBlasterChanges ? '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 \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 \c2Player Mod: \c3%1.', ($Host::ClassicLoadPlayerChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Havoc Mod: \c3%1.', ($Host::ClassicLoadHavocChanges ? '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 \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 \c2V-Ramming Mod: \c3%1.', ($Host::ClassicLoadVRamChanges ? 'Enabled' : 'Disabled') );
|
||||||
|
|
||||||
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
||||||
messageClient(%client, 'MsgClientJoin', 'Welcome to Tribes2 %1.',
|
messageClient(%client, 'MsgClientJoin', 'Welcome to Tribes2 %1.',
|
||||||
|
|
@ -899,12 +899,12 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
||||||
%client.isSuperAdmin,
|
%client.isSuperAdmin,
|
||||||
%client.isSmurf,
|
%client.isSmurf,
|
||||||
%client.sendGuid );
|
%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.',
|
messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game.',
|
||||||
%client.name,
|
%client.name,
|
||||||
%client,
|
%client,
|
||||||
%client.target,
|
"",
|
||||||
false, // isBot
|
false, // isBot
|
||||||
%client.isAdmin,
|
%client.isAdmin,
|
||||||
%client.isSuperAdmin,
|
%client.isSuperAdmin,
|
||||||
|
|
@ -1100,17 +1100,17 @@ function GameConnection::onDrop(%client, %reason)
|
||||||
// reset the server if everyone has left the game
|
// reset the server if everyone has left the game
|
||||||
if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::EmptyServerReset && !$resettingServer && !$LoadingMission && $CurrentMissionType !$= $Host::MissionType )
|
if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::EmptyServerReset && !$resettingServer && !$LoadingMission && $CurrentMissionType !$= $Host::MissionType )
|
||||||
{
|
{
|
||||||
// Timed Server Reset: $Host::EmptyServerReset = 1; --- Time in Minutes $Host::EmptyServerResetTime = 120;
|
// Timed Server Reset: $Host::EmptyServerReset = 1; --- Time in Minutes $Host::EmptyServerResetTime = 120;
|
||||||
if(isEventPending($EmptyServerResetSchedule))
|
if(isEventPending($EmptyServerResetSchedule))
|
||||||
{
|
{
|
||||||
error(formatTimeString("HH:nn:ss") SPC "Previous Timed Server Reset schedule cancelled..." );
|
error(formatTimeString("HH:nn:ss") SPC "Previous Timed Server Reset schedule cancelled..." );
|
||||||
cancel($EmptyServerResetSchedule);
|
cancel($EmptyServerResetSchedule);
|
||||||
}
|
}
|
||||||
|
|
||||||
%resettime = $Host::EmptyServerResetTime * 60000;
|
%resettime = $Host::EmptyServerResetTime * 60000;
|
||||||
if(%resettime <= 0) %resettime = 1;
|
if(%resettime <= 0) %resettime = 1;
|
||||||
$EmptyServerResetSchedule = schedule(%resettime, 0, "ResetServerTimed");
|
$EmptyServerResetSchedule = schedule(%resettime, 0, "ResetServerTimed");
|
||||||
error(formatTimeString("HH:nn:ss") SPC "Timed Server Reset schedule started..." );
|
error(formatTimeString("HH:nn:ss") SPC "Timed Server Reset schedule started..." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1764,8 +1764,13 @@ function serverCmdSAD(%client, %password)
|
||||||
%client.isSuperAdmin = true;
|
%client.isSuperAdmin = true;
|
||||||
MessageAll( 'MsgSuperAdminPlayer', '\c2%2 has become a Super Admin by force.', %client, %name);
|
MessageAll( 'MsgSuperAdminPlayer', '\c2%2 has become a Super Admin by force.', %client, %name);
|
||||||
%adminmsg = " has become a Super Admin by force.";
|
%adminmsg = " has become a Super Admin by force.";
|
||||||
adminLog(%client, %adminmsg);
|
adminLog(%client, %adminmsg);
|
||||||
logEcho(%client.nameBase @ " has become a Super Admin by force.");
|
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.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid);
|
||||||
|
messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team );
|
||||||
}
|
}
|
||||||
|
|
||||||
case $Host::AdminPassword:
|
case $Host::AdminPassword:
|
||||||
|
|
@ -1780,8 +1785,13 @@ function serverCmdSAD(%client, %password)
|
||||||
%client.isSuperAdmin = false;
|
%client.isSuperAdmin = false;
|
||||||
MessageAll( 'MsgAdminForce', '\c2%2 has become a Admin by force.', %client, %name);
|
MessageAll( 'MsgAdminForce', '\c2%2 has become a Admin by force.', %client, %name);
|
||||||
%adminmsg = " has become an Admin by force.";
|
%adminmsg = " has become an Admin by force.";
|
||||||
adminLog(%client, %adminmsg);
|
adminLog(%client, %adminmsg);
|
||||||
logEcho(%client.nameBase @ " has become an Admin by force.");
|
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.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid);
|
||||||
|
messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team );
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
messageClient(%client, 'MsgPasswordFailed', '\c2Illegal SAD PW.');
|
messageClient(%client, 'MsgPasswordFailed', '\c2Illegal SAD PW.');
|
||||||
|
|
@ -2564,15 +2574,21 @@ function serverCmdStripAdmin(%client, %admin)
|
||||||
%admin.isSuperAdmin = 0;
|
%admin.isSuperAdmin = 0;
|
||||||
messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.');
|
messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.');
|
||||||
adminLog(%client, " stripped admin from " @ %admin.nameBase);
|
adminLog(%client, " stripped admin from " @ %admin.nameBase);
|
||||||
|
messageAll('MsgClientDrop', "", %client.name, %client);
|
||||||
|
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;
|
return;
|
||||||
}
|
}
|
||||||
else if(%client.isSuperAdmin)
|
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);
|
messageClient(%admin, 'MsgStripAdminPlayer', 'You are being stripped of your admin privledges by %1.', %client.name);
|
||||||
%admin.isAdmin = 0;
|
%admin.isAdmin = 0;
|
||||||
%admin.isSuperAdmin = 0;
|
%admin.isSuperAdmin = 0;
|
||||||
adminLog(%client, " stripped admin from " @ %admin.nameBase);
|
adminLog(%client, " stripped admin from " @ %admin.nameBase);
|
||||||
|
messageAll( 'MsgClientDrop', "", %client.name, %client);
|
||||||
|
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
|
else
|
||||||
messageClient(%client, 'MsgError', '\c2Only Super Admins can use this command.');
|
messageClient(%client, 'MsgError', '\c2Only Super Admins can use this command.');
|
||||||
|
|
@ -2910,7 +2926,10 @@ function startTourneyCountdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
// lets get it on!
|
// lets get it on!
|
||||||
Countdown( 30 * 1000 );
|
if($Host::warmupTime <= 30)
|
||||||
|
Countdown(30 * 1000);
|
||||||
|
else
|
||||||
|
Countdown($Host::warmupTime * 1000); //Follow warmupTime!
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkTourneyMatchStart()
|
function checkTourneyMatchStart()
|
||||||
|
|
@ -2984,7 +3003,11 @@ function checkTourneyMatchStart()
|
||||||
Game.scheduleVote = "";
|
Game.scheduleVote = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
Countdown(30 * 1000);
|
// lets get it on!
|
||||||
|
if($Host::warmupTime <= 30)
|
||||||
|
Countdown(30 * 1000);
|
||||||
|
else
|
||||||
|
Countdown($Host::warmupTime * 1000); //Follow warmupTime!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3066,6 +3089,12 @@ function EndCountdown(%timeMS)
|
||||||
else
|
else
|
||||||
return;
|
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)
|
if(%timeMS >= 180000)
|
||||||
Game.endthreeminuteCount = schedule(%timeMS - 180000, Game, "notifyMatchEndMinutes", 180000);
|
Game.endthreeminuteCount = schedule(%timeMS - 180000, Game, "notifyMatchEndMinutes", 180000);
|
||||||
if(%timeMS >= 120000)
|
if(%timeMS >= 120000)
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ $Host::AllowPlayerVoteSkipMission = 1;
|
||||||
$Host::AllowPlayerVoteTimeLimit = 1;
|
$Host::AllowPlayerVoteTimeLimit = 1;
|
||||||
$Host::AllowPlayerVoteTournamentMode = 1;
|
$Host::AllowPlayerVoteTournamentMode = 1;
|
||||||
$Host::AllowPlayerVoteTeamDamage = 1;
|
$Host::AllowPlayerVoteTeamDamage = 1;
|
||||||
$Host::AllowPlayerTournamentModeVotekick = 1;
|
$Host::AllowPlayerVoteNextMission = 1;
|
||||||
$Host::NoBaseRapeEnabled = 1; //Enable or Disable No Base Rape
|
$Host::NoBaseRapeEnabled = 1; //Enable or Disable No Base Rape
|
||||||
$Host::NoBaseRapePlayerCount = 14; //Min number players the turn off No Base Rape
|
$Host::NoBaseRapePlayerCount = 14; //Min number players the turn off No Base Rape
|
||||||
$Host::AveragePings = 1; //Show Average ping in F2 menu
|
$Host::AveragePings = 1; //Show Average ping in F2 menu
|
||||||
|
|
@ -212,6 +212,8 @@ $Host::LoadScreenShowLogo = 0;
|
||||||
$Host::LoadScreenShowLogoName = "dpub/DPUB_logo"; //Logo location Filename
|
$Host::LoadScreenShowLogoName = "dpub/DPUB_logo"; //Logo location Filename
|
||||||
$Host::MapChangeMSG = 0; //Center Print between mapchanges
|
$Host::MapChangeMSG = 0; //Center Print between mapchanges
|
||||||
$Host::MapChangeMSGContent = "<color:3cb4b4><font:Sui Generis:22>Pickup Night\n<color:3cb4b4><font:Univers:16>Saturday, March 5th\n<color:3cb4b4><font:Univers:16>Join discord for details";
|
$Host::MapChangeMSGContent = "<color:3cb4b4><font:Sui Generis:22>Pickup Night\n<color:3cb4b4><font:Univers:16>Saturday, March 5th\n<color:3cb4b4><font:Univers:16>Join 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
|
//LakRabbit
|
||||||
$Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled
|
$Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue