mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-03-26 14:59:09 +00:00
Proper Overrides
Moved some things around so its easier to find using proper overrides instead of inserting code in random places. Works the same way.
This commit is contained in:
parent
d10d3cb1e9
commit
083af158ae
7 changed files with 153 additions and 35 deletions
|
|
@ -65,10 +65,7 @@ function GetTeamCounts( %game, %client, %respawn )
|
|||
//Start Team Balance Notify
|
||||
schedule(1000, 0, "TeamBalanceNotify", %game, %team1difference, %team2difference);
|
||||
//Start AntiCloak
|
||||
schedule(1500, 0, "ActivateAntiCloak", %game);
|
||||
//Start MapRepetitionChecker
|
||||
schedule(2000, 0, "MapRepetitionChecker", %game);
|
||||
|
||||
schedule(1500, 0, "CheckAntiCloak", %game);
|
||||
|
||||
//Set so counter wont run when it doesnt need to.
|
||||
$GetCountsClientTeamChange = false;
|
||||
|
|
@ -79,10 +76,91 @@ function GetTeamCounts( %game, %client, %respawn )
|
|||
}
|
||||
|
||||
|
||||
// Run at DefaultGame::clientJoinTeam, DefaultGame::clientChangeTeam, DefaultGame::assignClientTeam in evo defaultgame.ovl
|
||||
// Also Run at DefaultGame::onClientEnterObserverMode, DefaultGame::AIChangeTeam, DefaultGame::onClientLeaveGame, DefaultGame::forceObserver in evo defaultgame.ovl
|
||||
// And finally GameConnection::onConnect in evo server.ovl
|
||||
// Triggers a Full run
|
||||
function ResetClientChangedTeams()
|
||||
{
|
||||
$GetCountsClientTeamChange = true;
|
||||
}
|
||||
|
||||
// Proper Overrides
|
||||
// Events that determine a TeamGetCounts update
|
||||
package TeamCountsTriggers
|
||||
{
|
||||
|
||||
function DefaultGame::clientJoinTeam( %game, %client, %team, %respawn )
|
||||
{
|
||||
Parent::clientJoinTeam( %game, %client, %team, %respawn );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs, %respawned)
|
||||
{
|
||||
Parent::clientChangeTeam(%game, %client, %team, %fromObs, %respawned);
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
function DefaultGame::assignClientTeam(%game, %client, %respawn )
|
||||
{
|
||||
Parent::assignClientTeam(%game, %client, %respawn );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
function DefaultGame::onClientEnterObserverMode( %game, %client )
|
||||
{
|
||||
Parent::onClientEnterObserverMode( %game, %client );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
function DefaultGame::AIChangeTeam(%game, %client, %newTeam)
|
||||
{
|
||||
Parent::AIChangeTeam(%game, %client, %newTeam);
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
function DefaultGame::onClientLeaveGame(%game, %client)
|
||||
{
|
||||
Parent::onClientLeaveGame(%game, %client);
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
function DefaultGame::forceObserver(%game, %client, %reason)
|
||||
{
|
||||
Parent::forceObserver(%game, %client, %reason);
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
function GameConnection::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch)
|
||||
{
|
||||
Parent::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(TeamCountsTriggers))
|
||||
activatePackage(TeamCountsTriggers);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue