mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
[Fix] Fix an issue with EVENT_DISCONNECT not firing on regular /camp (#3153)
* [Fix] Fix an issue with EVENT_DISCONNECT not firing on regular /camp # Notes - We were only sending `EVENT_DISCONNECT` on GM instant camps or linkdeads. * Update client_process.cpp
This commit is contained in:
parent
8bdcf7cb94
commit
ea2f431fce
@ -689,23 +689,18 @@ bool Client::Process() {
|
|||||||
|
|
||||||
/* Just a set of actions preformed all over in 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) {
|
||||||
if(hard_disconnect)
|
if (hard_disconnect) {
|
||||||
{
|
|
||||||
LeaveGroup();
|
LeaveGroup();
|
||||||
if (GetMerc())
|
|
||||||
{
|
if (GetMerc()) {
|
||||||
GetMerc()->Save();
|
GetMerc()->Save();
|
||||||
GetMerc()->Depop();
|
GetMerc()->Depop();
|
||||||
}
|
}
|
||||||
Raid *MyRaid = entity_list.GetRaidByClient(this);
|
|
||||||
|
|
||||||
if (MyRaid)
|
auto* r = entity_list.GetRaidByClient(this);
|
||||||
MyRaid->MemberZoned(this);
|
|
||||||
|
|
||||||
RecordPlayerEventLog(PlayerEvent::WENT_OFFLINE, PlayerEvent::EmptyEvent{});
|
if (r) {
|
||||||
|
r->MemberZoned(this);
|
||||||
if (parse->PlayerHasQuestSub(EVENT_DISCONNECT)) {
|
|
||||||
parse->EventPlayer(EVENT_DISCONNECT, this, "", 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QS: PlayerLogConnectDisconnect */
|
/* QS: PlayerLogConnectDisconnect */
|
||||||
@ -715,35 +710,40 @@ void Client::OnDisconnect(bool hard_disconnect) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bZoning)
|
if (!bZoning) {
|
||||||
{
|
|
||||||
SetDynamicZoneMemberStatus(DynamicZoneMemberStatus::Offline);
|
SetDynamicZoneMemberStatus(DynamicZoneMemberStatus::Offline);
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveAllAuras();
|
RemoveAllAuras();
|
||||||
|
|
||||||
Mob *Other = trade->With();
|
auto* o = trade->With();
|
||||||
if(Other)
|
if (o) {
|
||||||
{
|
|
||||||
LogTrading("Client disconnected during a trade. Returning their items");
|
LogTrading("Client disconnected during a trade. Returning their items");
|
||||||
FinishTrade(this);
|
FinishTrade(this);
|
||||||
|
|
||||||
if(Other->IsClient())
|
if (o->IsClient()) {
|
||||||
Other->CastToClient()->FinishTrade(Other);
|
o->CastToClient()->FinishTrade(o);
|
||||||
|
}
|
||||||
|
|
||||||
/* Reset both sides of the trade */
|
/* Reset both sides of the trade */
|
||||||
trade->Reset();
|
trade->Reset();
|
||||||
Other->trade->Reset();
|
o->trade->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
database.SetFirstLogon(CharacterID(), 0); //We change firstlogon status regardless of if a player logs out to zone or not, because we only want to trigger it on their first login from world.
|
database.SetFirstLogon(CharacterID(), 0); //We change firstlogon status regardless of if a player logs out to zone or not, because we only want to trigger it on their first login from world.
|
||||||
|
|
||||||
/* Remove ourself from all proximities */
|
/* Remove from all proximities */
|
||||||
ClearAllProximities();
|
ClearAllProximities();
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_LogoutReply);
|
auto outapp = new EQApplicationPacket(OP_LogoutReply);
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
|
|
||||||
|
RecordPlayerEventLog(PlayerEvent::WENT_OFFLINE, PlayerEvent::EmptyEvent{});
|
||||||
|
|
||||||
|
if (parse->PlayerHasQuestSub(EVENT_DISCONNECT)) {
|
||||||
|
parse->EventPlayer(EVENT_DISCONNECT, this, "", 0);
|
||||||
|
}
|
||||||
|
|
||||||
Disconnect();
|
Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user