Skip to content

Commit

Permalink
add grace timer b4 boot out
Browse files Browse the repository at this point in the history
  • Loading branch information
crdunwel committed Jan 11, 2024
1 parent c80451f commit 31ccc8e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions common/ruletypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ RULE_BOOL(Quarm, EnforceClassicEraHardCaps, true) // Classic behavior is true, L
RULE_INT(Quarm, AOEThrottlingMaxAOETargets, 50) // This will curb nonsense with performance issues relating to amount of targets if the amount of clients exceeds 300 in a single zone.
RULE_INT(Quarm, AOEThrottlingMaxClients, 300) // This will curb nonsense with performance issues relating to amount of targets if the amount of clients exceeds 300 in a single zone.
RULE_INT(Quarm, EnableLuclinEraShieldACOvercap, false)
RULE_INT(Quarm, ClientInstanceBootGraceMS, 60000)
RULE_CATEGORY_END()

RULE_CATEGORY( Map )
Expand Down
2 changes: 2 additions & 0 deletions zone/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Client::Client(EQStreamInterface* ieqs)
mend_reset_timer(60000),
underwater_timer(1000),
zoning_timer(5000),
instance_boot_grace_timer(RuleI(Quarm, ClientInstanceBootGraceMS)),
m_Proximity(FLT_MAX, FLT_MAX, FLT_MAX), //arbitrary large number
m_ZoneSummonLocation(-2.0f,-2.0f,-2.0f,-2.0f),
m_AutoAttackPosition(0.0f, 0.0f, 0.0f, 0.0f),
Expand Down Expand Up @@ -222,6 +223,7 @@ Client::Client(EQStreamInterface* ieqs)
door_check_timer.Disable();
mend_reset_timer.Disable();
zoning_timer.Disable();
instance_boot_grace_timer.Disable();
instalog = false;
m_pp.autosplit = false;
// initialise haste variable
Expand Down
3 changes: 3 additions & 0 deletions zone/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,8 @@ class Client : public Mob
void CorpseSummoned(Corpse *corpse);
void CorpseSummonOnPositionUpdate();

inline bool InstanceBootGraceTimerExpired() { return instance_boot_grace_timer.Check(); }

protected:
friend class Mob;
void CalcItemBonuses(StatBonuses* newbon);
Expand Down Expand Up @@ -1264,6 +1266,7 @@ class Client : public Mob
Timer underwater_timer;

Timer zoning_timer;
Timer instance_boot_grace_timer;

glm::vec3 m_Proximity;

Expand Down
1 change: 1 addition & 0 deletions zone/client_packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
QueuePacket(outapp);
safe_delete(outapp);

instance_boot_grace_timer.Start();
SetAttackTimer();
conn_state = ZoneInfoSent;
zoneinpacket_timer.Start();
Expand Down
4 changes: 2 additions & 2 deletions zone/zone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2740,7 +2740,7 @@ bool Zone::CanDoCombat(Mob* current, Mob* other, bool process)
{
if (current && other && zone->GetGuildID() != GUILD_NONE)
{
if (current->IsClient())
if (current->IsClient() && current->CastToClient()->InstanceBootGraceTimerExpired())
{
bool bCanEngage = CanClientEngage(current->CastToClient(), other);
if (!bCanEngage)
Expand All @@ -2749,7 +2749,7 @@ bool Zone::CanDoCombat(Mob* current, Mob* other, bool process)
return false;
}
}
if (other->IsClient())
if (other->IsClient() && other->CastToClient()->InstanceBootGraceTimerExpired())
{
bool bCanEngage = CanClientEngage(other->CastToClient(), current);
if (!bCanEngage)
Expand Down

0 comments on commit 31ccc8e

Please sign in to comment.