mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Don't set member offline before linkdead
This prevents toggling to offline state before setting to and from linkdead status. Without this change, a new expedition leader will be chosen as soon as the current leader goes linkdead. On live an expedition leader retains leadership while linkdead
This commit is contained in:
parent
d8b825f478
commit
9c4df6f026
@ -738,7 +738,7 @@ public:
|
||||
|
||||
bool TGB() const { return tgb; }
|
||||
|
||||
void OnDisconnect(bool hard_disconnect);
|
||||
void OnDisconnect(bool hard_disconnect, bool linkdead = false);
|
||||
|
||||
uint16 GetSkillPoints() { return m_pp.points;}
|
||||
void SetSkillPoints(int inp) { m_pp.points = inp;}
|
||||
|
||||
@ -560,17 +560,20 @@ bool Client::Process() {
|
||||
}
|
||||
|
||||
if (client_state != CLIENT_LINKDEAD && !eqs->CheckState(ESTABLISHED)) {
|
||||
OnDisconnect(true);
|
||||
LogInfo("Client linkdead: {}", name);
|
||||
|
||||
if (Admin() > 100) {
|
||||
OnDisconnect(true);
|
||||
if (GetMerc()) {
|
||||
GetMerc()->Save();
|
||||
GetMerc()->Depop();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (!linkdead_timer.Enabled()) {
|
||||
|
||||
OnDisconnect(true, true);
|
||||
|
||||
if (!linkdead_timer.Enabled()) {
|
||||
linkdead_timer.Start(RuleI(Zone, ClientLinkdeadMS));
|
||||
client_state = CLIENT_LINKDEAD;
|
||||
AI_Start(CLIENT_LD_TIMEOUT);
|
||||
@ -689,7 +692,7 @@ bool Client::Process() {
|
||||
}
|
||||
|
||||
/* Just a set of actions preformed all over in Client::Process */
|
||||
void Client::OnDisconnect(bool hard_disconnect) {
|
||||
void Client::OnDisconnect(bool hard_disconnect, bool linkdead) {
|
||||
if(hard_disconnect)
|
||||
{
|
||||
LeaveGroup();
|
||||
@ -713,7 +716,7 @@ void Client::OnDisconnect(bool hard_disconnect) {
|
||||
}
|
||||
|
||||
Expedition* expedition = GetExpedition();
|
||||
if (expedition && !bZoning)
|
||||
if (expedition && !bZoning && !linkdead && !linkdead_timer.Enabled())
|
||||
{
|
||||
expedition->SetMemberStatus(this, ExpeditionMemberStatus::Offline);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user