mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-02-22 23:43:34 +00:00
Added Back
Was able to fix without moving overrides
This commit is contained in:
parent
8633b46e27
commit
3d66de5b03
2 changed files with 82 additions and 92 deletions
|
|
@ -1,90 +0,0 @@
|
|||
// LateOveridesGame.cs
|
||||
//
|
||||
// Created to overrides that need to be executed later in the server loading process.
|
||||
// Sometimes this is necessary.
|
||||
//
|
||||
|
||||
|
||||
// autoexec/GetTeamCounts.cs Overrides
|
||||
// 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::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();
|
||||
}
|
||||
|
||||
function GameConnection::onDrop(%client, %reason)
|
||||
{
|
||||
Parent::onDrop(%client, %reason);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(TeamCountsTriggers))
|
||||
activatePackage(TeamCountsTriggers);
|
||||
|
|
@ -21,6 +21,10 @@ function CreateServer( %mission, %missionType )
|
|||
parent::CreateServer( %mission, %missionType );
|
||||
//Call for a GetTeamCount update
|
||||
GetTeamCounts( %game, %client, %respawn );
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(TeamCountsTriggers))
|
||||
activatePackage(TeamCountsTriggers);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -82,5 +86,81 @@ function ResetClientChangedTeams()
|
|||
$GetCountsClientTeamChange = true;
|
||||
}
|
||||
|
||||
// Overrides moved to Scripts/LateOverridesGame.cs
|
||||
// Due to issues in reliability
|
||||
// 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::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();
|
||||
}
|
||||
|
||||
function GameConnection::onDrop(%client, %reason)
|
||||
{
|
||||
Parent::onDrop(%client, %reason);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetClientChangedTeams();
|
||||
}
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue