*Wintergrasp: Tenacity fixes by Spp
*Better Windows signal handling for services, by defacer *Always hide triggers for players, by ogeraisi --HG-- branch : trunk
This commit is contained in:
@@ -2000,6 +2000,10 @@ bool Creature::IsVisibleInGridForPlayer(Player const* pl) const
|
|||||||
if(pl->isGameMaster())
|
if(pl->isGameMaster())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// Trigger shouldn't be visible for players
|
||||||
|
if(isTrigger())
|
||||||
|
return false;
|
||||||
|
|
||||||
// Live player (or with not release body see live creatures or death creatures with corpse disappearing time > 0
|
// Live player (or with not release body see live creatures or death creatures with corpse disappearing time > 0
|
||||||
if(pl->isAlive() || pl->GetDeathTimer() > 0)
|
if(pl->isAlive() || pl->GetDeathTimer() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
+56
-64
@@ -69,6 +69,7 @@ void LoadTeamPair(TeamPairMap &pairMap, const TeamPair *pair)
|
|||||||
|
|
||||||
#define REMOVE_WARTIME_AURAS(p) (p)->RemoveAura(SPELL_RECRUIT);\
|
#define REMOVE_WARTIME_AURAS(p) (p)->RemoveAura(SPELL_RECRUIT);\
|
||||||
(p)->RemoveAura(SPELL_CORPORAL);(p)->RemoveAura(SPELL_LIEUTENANT)
|
(p)->RemoveAura(SPELL_CORPORAL);(p)->RemoveAura(SPELL_LIEUTENANT)
|
||||||
|
#define REMOVE_TENACITY_AURA(p) CastTenacity(p, 0)
|
||||||
|
|
||||||
typedef std::list<const AreaPOIEntry *> AreaPOIList;
|
typedef std::list<const AreaPOIEntry *> AreaPOIList;
|
||||||
|
|
||||||
@@ -145,24 +146,13 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
|
|||||||
}
|
}
|
||||||
areaPOIs.erase(poi);
|
areaPOIs.erase(poi);
|
||||||
|
|
||||||
//disable for now
|
|
||||||
//continue;
|
|
||||||
|
|
||||||
// add capture point
|
// add capture point
|
||||||
uint32 capturePointEntry = 0;
|
uint32 capturePointEntry = 0;
|
||||||
|
|
||||||
//192028 192029
|
|
||||||
//192030 192031
|
|
||||||
//192032 192033
|
|
||||||
|
|
||||||
//190475 190487 not sure
|
|
||||||
//192626 192627
|
|
||||||
//194959 194960
|
|
||||||
|
|
||||||
switch(goData->id)
|
switch(goData->id)
|
||||||
{
|
{
|
||||||
case 192028: capturePointEntry = 190475; break;
|
case 192028: capturePointEntry = 190475; break;
|
||||||
case 192029: capturePointEntry = 190487; break;
|
case 192029: capturePointEntry = 190487; break; // not sure
|
||||||
case 192030: capturePointEntry = 190475; break;
|
case 192030: capturePointEntry = 190475; break;
|
||||||
case 192031: capturePointEntry = 190487; break;
|
case 192031: capturePointEntry = 190487; break;
|
||||||
case 192032: capturePointEntry = 190475; break;
|
case 192032: capturePointEntry = 190475; break;
|
||||||
@@ -292,6 +282,7 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
|
|||||||
m_wartime = false;
|
m_wartime = false;
|
||||||
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME) * MINUTE * IN_MILISECONDS;
|
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME) * MINUTE * IN_MILISECONDS;
|
||||||
|
|
||||||
|
// Load custom rewards
|
||||||
if (sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
|
if (sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
|
||||||
for (int i = 0; i < WG_REWARD_EVENT_MAX; ++i)
|
for (int i = 0; i < WG_REWARD_EVENT_MAX; ++i)
|
||||||
m_customHonorReward[i] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_0 + i);
|
m_customHonorReward[i] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_0 + i);
|
||||||
@@ -362,7 +353,6 @@ void OPvPWintergrasp::ProcessEvent(GameObject *obj, uint32 eventId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BroadcastStateChange(state);
|
BroadcastStateChange(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -370,7 +360,7 @@ void OPvPWintergrasp::ProcessEvent(GameObject *obj, uint32 eventId)
|
|||||||
|
|
||||||
void OPvPWintergrasp::RemoveOfflinePlayerWGAuras()
|
void OPvPWintergrasp::RemoveOfflinePlayerWGAuras()
|
||||||
{
|
{
|
||||||
// if server crashed while in battle there could be players with rank, tenacity or wintergrasp essence auras
|
// if server crashed while in battle there could be players with rank or tenacity
|
||||||
CharacterDatabase.PExecute("DELETE FROM character_aura WHERE spell IN (%u,%u,%u, %u)",
|
CharacterDatabase.PExecute("DELETE FROM character_aura WHERE spell IN (%u,%u,%u, %u)",
|
||||||
SPELL_RECRUIT, SPELL_CORPORAL, SPELL_LIEUTENANT, SPELL_TENACITY);
|
SPELL_RECRUIT, SPELL_CORPORAL, SPELL_LIEUTENANT, SPELL_TENACITY);
|
||||||
}
|
}
|
||||||
@@ -668,7 +658,6 @@ void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
|||||||
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
||||||
|
|
||||||
SendInitWorldStatesTo(plr);
|
SendInitWorldStatesTo(plr);
|
||||||
|
|
||||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||||
UpdateTenacityStack();
|
UpdateTenacityStack();
|
||||||
}
|
}
|
||||||
@@ -681,7 +670,7 @@ void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
|||||||
plr->GetVehicle()->Dismiss();
|
plr->GetVehicle()->Dismiss();
|
||||||
REMOVE_WARTIME_AURAS(plr);
|
REMOVE_WARTIME_AURAS(plr);
|
||||||
}
|
}
|
||||||
plr->RemoveAura(SPELL_TENACITY);
|
REMOVE_TENACITY_AURA(plr);
|
||||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||||
UpdateTenacityStack();
|
UpdateTenacityStack();
|
||||||
}
|
}
|
||||||
@@ -746,12 +735,33 @@ void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cast or removes Tenacity. MaxHP Modified, HP keeps it's % ratio
|
||||||
|
void OPvPWintergrasp::CastTenacity(Unit *utr, int32 newStack)
|
||||||
|
{
|
||||||
|
if (!utr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
uint32 spellId = utr->GetTypeId() == TYPEID_PLAYER ? SPELL_TENACITY : SPELL_TENACITY_VEHICLE;
|
||||||
|
float percent = (0.0f + utr->GetHealth()) / utr->GetMaxHealth();
|
||||||
|
|
||||||
|
if (newStack)
|
||||||
|
utr->SetAuraStack(spellId, utr, newStack);
|
||||||
|
else
|
||||||
|
utr->RemoveAura(spellId);
|
||||||
|
utr->SetHealth(uint32(utr->GetMaxHealth()*percent));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recalculates Tenacity and applies it to Players / Vehicles
|
||||||
void OPvPWintergrasp::UpdateTenacityStack()
|
void OPvPWintergrasp::UpdateTenacityStack()
|
||||||
{
|
{
|
||||||
|
if (!m_wartime)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TeamId team = TEAM_NEUTRAL;
|
||||||
uint32 allianceNum = m_players[TEAM_ALLIANCE].size();
|
uint32 allianceNum = m_players[TEAM_ALLIANCE].size();
|
||||||
uint32 hordeNum = m_players[TEAM_HORDE].size();
|
uint32 hordeNum = m_players[TEAM_HORDE].size();
|
||||||
|
|
||||||
int32 newStack = 0;
|
int32 newStack = 0;
|
||||||
|
|
||||||
if (allianceNum && hordeNum)
|
if (allianceNum && hordeNum)
|
||||||
{
|
{
|
||||||
if (allianceNum < hordeNum)
|
if (allianceNum < hordeNum)
|
||||||
@@ -763,36 +773,37 @@ void OPvPWintergrasp::UpdateTenacityStack()
|
|||||||
if (newStack == m_tenacityStack)
|
if (newStack == m_tenacityStack)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Remove old buff
|
if (m_tenacityStack > 0 && newStack <= 0) // old buff was on alliance
|
||||||
if (m_tenacityStack > 0) // old buff was on alliance
|
team = TEAM_ALLIANCE;
|
||||||
{
|
else if (m_tenacityStack < 0 && newStack >= 0) // old buff was on horde
|
||||||
if (newStack <= 0) // new buff should on horde
|
team = TEAM_HORDE;
|
||||||
{
|
|
||||||
TeamCastSpell(TEAM_ALLIANCE, -SPELL_TENACITY);
|
|
||||||
VehicleCastSpell(TEAM_ALLIANCE, -SPELL_TENACITY_VEHICLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (m_tenacityStack < 0)
|
|
||||||
{
|
|
||||||
if (newStack >= 0)
|
|
||||||
{
|
|
||||||
TeamCastSpell(TEAM_HORDE, -SPELL_TENACITY);
|
|
||||||
VehicleCastSpell(TEAM_HORDE, -SPELL_TENACITY_VEHICLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_tenacityStack = newStack;
|
m_tenacityStack = newStack;
|
||||||
|
|
||||||
|
// Remove old buff
|
||||||
|
if (team != TEAM_NEUTRAL)
|
||||||
|
{
|
||||||
|
for (PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||||
|
if ((*itr)->getLevel() > 69)
|
||||||
|
REMOVE_TENACITY_AURA((*itr));
|
||||||
|
|
||||||
|
for (CreatureSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
|
||||||
|
REMOVE_TENACITY_AURA((*itr));
|
||||||
|
}
|
||||||
|
|
||||||
// Apply new buff
|
// Apply new buff
|
||||||
if (newStack)
|
if (newStack)
|
||||||
{
|
{
|
||||||
TeamId team = newStack > 0 ? TEAM_ALLIANCE : TEAM_HORDE;
|
team = newStack > 0 ? TEAM_ALLIANCE : TEAM_HORDE;
|
||||||
if (newStack < 0) newStack = -newStack;
|
if (newStack < 0) newStack = -newStack;
|
||||||
int32 auraStack = newStack > 20 ? 20 : newStack; // Dont let it be higher than 20
|
int32 auraStack = newStack > 20 ? 20 : newStack; // Dont let it be higher than 20
|
||||||
for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
|
||||||
|
for (PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||||
if ((*itr)->getLevel() > 69)
|
if ((*itr)->getLevel() > 69)
|
||||||
(*itr)->SetAuraStack(SPELL_TENACITY, *itr, auraStack);
|
CastTenacity((*itr), auraStack);
|
||||||
for (CreatureSet::iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
|
|
||||||
(*itr)->SetAuraStack(SPELL_TENACITY_VEHICLE, *itr, auraStack);
|
for (CreatureSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
|
||||||
|
CastTenacity((*itr), auraStack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -892,14 +903,10 @@ void OPvPWintergrasp::StartBattle()
|
|||||||
m_wartime = true;
|
m_wartime = true;
|
||||||
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME) * MINUTE * IN_MILISECONDS;
|
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME) * MINUTE * IN_MILISECONDS;
|
||||||
|
|
||||||
for (uint32 team = 0; team < 2; ++team)
|
// Add recruit Aura, Add Tenacity
|
||||||
{
|
TeamCastSpell(m_defender, SPELL_RECRUIT);
|
||||||
for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
TeamCastSpell(OTHER_TEAM(m_defender), SPELL_RECRUIT);
|
||||||
{
|
UpdateTenacityStack();
|
||||||
REMOVE_WARTIME_AURAS(*itr);
|
|
||||||
(*itr)->CastSpell(*itr, SPELL_RECRUIT, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPvPWintergrasp::EndBattle()
|
void OPvPWintergrasp::EndBattle()
|
||||||
@@ -945,6 +952,7 @@ void OPvPWintergrasp::EndBattle()
|
|||||||
(*itr)->ModifyHonorPoints(honor);
|
(*itr)->ModifyHonorPoints(honor);
|
||||||
}
|
}
|
||||||
REMOVE_WARTIME_AURAS(*itr);
|
REMOVE_WARTIME_AURAS(*itr);
|
||||||
|
REMOVE_TENACITY_AURA(*itr);
|
||||||
(*itr)->CombatStop(true);
|
(*itr)->CombatStop(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -957,14 +965,7 @@ void OPvPWintergrasp::EndBattle()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*TeamId loser = OTHER_TEAM(m_defender);
|
//3.2.0: TeamCastSpell(OTHER_TEAM(m_defender), SPELL_TELEPORT_DALARAN);
|
||||||
for (PlayerSet::iterator itr = m_players[loser].begin(); itr != m_players[loser].end();)
|
|
||||||
{
|
|
||||||
Player *plr = *itr;
|
|
||||||
++itr;
|
|
||||||
plr->CastSpell(plr, SPELL_TELEPORT_DALARAN, true);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
RemoveOfflinePlayerWGAuras();
|
RemoveOfflinePlayerWGAuras();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1103,12 +1104,3 @@ void SiegeWorkshop::ChangeTeam(TeamId oldTeam)
|
|||||||
|
|
||||||
sLog.outDebug("Wintergrasp workshop now belongs to %u.", (uint32)m_buildingState->GetTeam());
|
sLog.outDebug("Wintergrasp workshop now belongs to %u.", (uint32)m_buildingState->GetTeam());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void SiegeWorkshop::DespawnAllVehicles()
|
|
||||||
{
|
|
||||||
while(!m_vehicles.empty())
|
|
||||||
(*m_vehicles.begin())->Dismiss();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|||||||
+20
-20
@@ -22,11 +22,14 @@
|
|||||||
#include "OutdoorPvPImpl.h"
|
#include "OutdoorPvPImpl.h"
|
||||||
|
|
||||||
#define ZONE_WINTERGRASP 4197
|
#define ZONE_WINTERGRASP 4197
|
||||||
|
|
||||||
const uint16 GameEventWintergraspDefender[2] = {50, 51};
|
|
||||||
const uint32 WintergraspFaction[2] = {1732, 1735};
|
|
||||||
|
|
||||||
#define POS_X_CENTER 4700
|
#define POS_X_CENTER 4700
|
||||||
|
#define MAX_VEHICLE_PER_WORKSHOP 4
|
||||||
|
|
||||||
|
const uint32 WintergraspFaction[2] = {1732, 1735};
|
||||||
|
const uint32 WG_MARK_OF_HONOR = 43589;
|
||||||
|
const uint32 VehNumWorldState[2] = {3680,3490};
|
||||||
|
const uint32 MaxVehNumWorldState[2] = {3681,3491};
|
||||||
|
const uint32 ClockWorldState[5] = {3785,3784,3782,3976,3975};
|
||||||
|
|
||||||
enum WintergraspSpell
|
enum WintergraspSpell
|
||||||
{
|
{
|
||||||
@@ -36,18 +39,21 @@ enum WintergraspSpell
|
|||||||
|
|
||||||
SPELL_TENACITY = 58549,
|
SPELL_TENACITY = 58549,
|
||||||
SPELL_TENACITY_VEHICLE = 59911,
|
SPELL_TENACITY_VEHICLE = 59911,
|
||||||
SPELL_TOWER_CONTROL = 62064,
|
|
||||||
|
|
||||||
|
SPELL_TELEPORT_DALARAN = 53360,
|
||||||
|
SPELL_SHUTDOWN_VEHICLE = 21247,
|
||||||
|
|
||||||
|
SPELL_TOWER_CONTROL = 62064,
|
||||||
SPELL_VICTORY_REWARD = 56902,
|
SPELL_VICTORY_REWARD = 56902,
|
||||||
SPELL_DEFEAT_REWARD = 58494,
|
SPELL_DEFEAT_REWARD = 58494,
|
||||||
SPELL_DAMAGED_TOWER = 59135,
|
SPELL_DAMAGED_TOWER = 59135,
|
||||||
SPELL_DESTROYED_TOWER = 59136,
|
SPELL_DESTROYED_TOWER = 59136,
|
||||||
SPELL_DAMAGED_BUILDING = 59201,
|
SPELL_DAMAGED_BUILDING = 59201,
|
||||||
SPELL_INTACT_BUILDING = 59203,
|
SPELL_INTACT_BUILDING = 59203,
|
||||||
|
// Unused: Not implemented
|
||||||
SPELL_TELEPORT_DALARAN = 53360,
|
// SPELL_VICTORY_AURA = 60044,
|
||||||
|
// SPELL_RULERS_OF_WG = 52108,
|
||||||
SPELL_SHUTDOWN_VEHICLE = 21247,
|
// SPELL_ESSENCE_OF_WG = 58045,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum WintergraspRewardEvent
|
enum WintergraspRewardEvent
|
||||||
@@ -61,22 +67,18 @@ enum WintergraspRewardEvent
|
|||||||
WG_REWARD_EVENT_MAX
|
WG_REWARD_EVENT_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_VEHICLE_PER_WORKSHOP 4
|
/* Not used / Not implemented
|
||||||
|
|
||||||
const uint32 WG_KEEP_CM = 0; //Need data
|
const uint16 GameEventWintergraspDefender[2] = {50, 51};
|
||||||
const uint32 WG_RULERS_BUFF = 52108;
|
|
||||||
//some cosmetics :
|
|
||||||
const uint32 WG_VICTORY_AURA = 60044;
|
|
||||||
|
|
||||||
enum OutdoorPvP_WG_Sounds
|
enum OutdoorPvP_WG_Sounds
|
||||||
{
|
{
|
||||||
/*TODO OutdoorPvP_WG_SOUND_KEEP_CLAIMED = 8192,
|
OutdoorPvP_WG_SOUND_KEEP_CLAIMED = 8192,
|
||||||
OutdoorPvP_WG_SOUND_KEEP_CAPTURED_ALLIANCE = 8173,
|
OutdoorPvP_WG_SOUND_KEEP_CAPTURED_ALLIANCE = 8173,
|
||||||
OutdoorPvP_WG_SOUND_KEEP_CAPTURED_HORDE = 8213,
|
OutdoorPvP_WG_SOUND_KEEP_CAPTURED_HORDE = 8213,
|
||||||
OutdoorPvP_WG_SOUND_KEEP_ASSAULTED_ALLIANCE = 8212,
|
OutdoorPvP_WG_SOUND_KEEP_ASSAULTED_ALLIANCE = 8212,
|
||||||
OutdoorPvP_WG_SOUND_KEEP_ASSAULTED_HORDE = 8174,
|
OutdoorPvP_WG_SOUND_KEEP_ASSAULTED_HORDE = 8174,
|
||||||
OutdoorPvP_WG_SOUND_NEAR_VICTORY = 8456
|
OutdoorPvP_WG_SOUND_NEAR_VICTORY = 8456
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DataId
|
enum DataId
|
||||||
@@ -94,10 +96,7 @@ enum OutdoorPvP_WG_KeepStatus
|
|||||||
OutdoorPvP_WG_KEEP_STATUS_ALLY_OCCUPIED = 3,
|
OutdoorPvP_WG_KEEP_STATUS_ALLY_OCCUPIED = 3,
|
||||||
OutdoorPvP_WG_KEEP_STATUS_HORDE_OCCUPIED = 4
|
OutdoorPvP_WG_KEEP_STATUS_HORDE_OCCUPIED = 4
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
const uint32 VehNumWorldState[2] = {3680,3490};
|
|
||||||
const uint32 MaxVehNumWorldState[2] = {3681,3491};
|
|
||||||
const uint32 ClockWorldState[5] = {3785,3784,3782,3976,3975};
|
|
||||||
|
|
||||||
enum WintergraspCreType
|
enum WintergraspCreType
|
||||||
{
|
{
|
||||||
@@ -226,6 +225,7 @@ class OPvPWintergrasp : public OutdoorPvP
|
|||||||
void UpdateClockDigit(uint32 &timer, uint32 digit, uint32 mod);
|
void UpdateClockDigit(uint32 &timer, uint32 digit, uint32 mod);
|
||||||
void PromotePlayer(Player *player) const;
|
void PromotePlayer(Player *player) const;
|
||||||
void UpdateTenacityStack();
|
void UpdateTenacityStack();
|
||||||
|
void CastTenacity(Unit *utr, int32 newStack);
|
||||||
void UpdateAllWorldObject();
|
void UpdateAllWorldObject();
|
||||||
bool UpdateCreatureInfo(Creature *creature) const;
|
bool UpdateCreatureInfo(Creature *creature) const;
|
||||||
bool UpdateGameObjectInfo(GameObject *go) const;
|
bool UpdateGameObjectInfo(GameObject *go) const;
|
||||||
|
|||||||
@@ -521,6 +521,7 @@ void Master::_OnSignal(int s)
|
|||||||
break;
|
break;
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
if (m_ServiceStatus != 1)
|
||||||
case SIGBREAK:
|
case SIGBREAK:
|
||||||
#endif
|
#endif
|
||||||
World::StopNow(SHUTDOWN_EXIT_CODE);
|
World::StopNow(SHUTDOWN_EXIT_CODE);
|
||||||
@@ -536,6 +537,7 @@ void Master::_HookSignals()
|
|||||||
signal(SIGINT, _OnSignal);
|
signal(SIGINT, _OnSignal);
|
||||||
signal(SIGTERM, _OnSignal);
|
signal(SIGTERM, _OnSignal);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
if (m_ServiceStatus != 1)
|
||||||
signal(SIGBREAK, _OnSignal);
|
signal(SIGBREAK, _OnSignal);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,6 +373,7 @@ void HookSignals()
|
|||||||
signal(SIGINT, OnSignal);
|
signal(SIGINT, OnSignal);
|
||||||
signal(SIGTERM, OnSignal);
|
signal(SIGTERM, OnSignal);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
if (m_ServiceStatus != 1)
|
||||||
signal(SIGBREAK, OnSignal);
|
signal(SIGBREAK, OnSignal);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -383,6 +384,7 @@ void UnhookSignals()
|
|||||||
signal(SIGINT, 0);
|
signal(SIGINT, 0);
|
||||||
signal(SIGTERM, 0);
|
signal(SIGTERM, 0);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
if (m_ServiceStatus != 1)
|
||||||
signal(SIGBREAK, 0);
|
signal(SIGBREAK, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user