From 19bee763bdb1957dbca046433919b572622cfae1 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sat, 15 Jul 2017 09:36:43 -0400 Subject: [PATCH 1/8] Make world messages about logging in and logging out more detailed. Previously logging in (from desktop) and out (from game) both of which land you at char select both said Logging (In). Now it tells you which is occuring. There really is no Logging Out Compleetely message - not sure where that could or should be added. --- world/client.cpp | 29 ++++++++++++++++++++++++----- world/cliententry.h | 1 + 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/world/client.cpp b/world/client.cpp index 19c7747b5..31ec305ba 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -449,17 +449,33 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { return false; } - cle->SetOnline(); - if(minilogin){ + cle->SetOnline(); WorldConfig::DisableStats(); Log(Logs::General, Logs::World_Server, "MiniLogin Account #%d",cle->AccountID()); } else { - if (!is_player_zoning) { - Log(Logs::General, Logs::World_Server, - "Account (%s) Logging in :: LSID: %d ", cle->AccountName(), cle->LSID()); + // Track who is in and who is out of the game + char *inout= (char *) ""; + + if (cle->GetOnline() < CLE_Status_Online){ + // Desktop -> Char Select + inout = (char *) "In"; } + else { + // Game -> Char Select + inout=(char *) "Out"; + } + + // Always at Char select at this point. + // Either from a fresh client launch or coming back from the game. + // Exiting the game entirely does not come through here. + // Could use a Logging Out Completely message somewhere. + cle->SetOnline(CLE_Status_CharSelect); + + Log(Logs::General, Logs::World_Server, + "Account (%s) Logging(%s) to character select :: LSID: %d ", + cle->AccountName(), inout, cle->LSID()); } const WorldConfig *Config=WorldConfig::get(); @@ -1021,6 +1037,9 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { } case OP_WorldLogout: { + //Log(Logs::General, Logs::World_Server, + //"Account (%s) Logging Off :: LSID: %d ", cle->AccountName(), cle->LSID()); + //online.erase(cle->LSID()); eqs->Close(); cle->SetOnline(CLE_Status_Offline); //allows this player to log in again without an ip restriction. return false; diff --git a/world/cliententry.h b/world/cliententry.h index cb096950c..24a837ae9 100644 --- a/world/cliententry.h +++ b/world/cliententry.h @@ -50,6 +50,7 @@ public: inline const char* LSName() const { return plsname; } inline int16 WorldAdmin() const { return pworldadmin; } inline const char* GetLSKey() const { return plskey; } + inline const int8 GetOnline() const { return pOnline; } // Account stuff inline uint32 AccountID() const { return paccountid; } From 06b91a6e01a25cea7e904d1177ec6169facefaf9 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sat, 15 Jul 2017 09:54:04 -0400 Subject: [PATCH 2/8] Removed some instrumentation. Added a comment/observation. --- world/client.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/world/client.cpp b/world/client.cpp index 31ec305ba..60221f25b 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1037,9 +1037,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { } case OP_WorldLogout: { - //Log(Logs::General, Logs::World_Server, - //"Account (%s) Logging Off :: LSID: %d ", cle->AccountName(), cle->LSID()); - //online.erase(cle->LSID()); + // I don't see this getting executed on logout eqs->Close(); cle->SetOnline(CLE_Status_Offline); //allows this player to log in again without an ip restriction. return false; From 89a5a45d7e0e84e142a3ea2a95cbe44bb5274544 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sat, 15 Jul 2017 10:27:51 -0400 Subject: [PATCH 3/8] Fix logging in compare. --- world/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/client.cpp b/world/client.cpp index 60221f25b..b31f77c02 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -458,7 +458,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { // Track who is in and who is out of the game char *inout= (char *) ""; - if (cle->GetOnline() < CLE_Status_Online){ + if (cle->GetOnline() == CLE_Status_Never){ // Desktop -> Char Select inout = (char *) "In"; } From 91589eae34986bab5ccb8eff86879cc8765f66af Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sat, 15 Jul 2017 11:14:28 -0400 Subject: [PATCH 4/8] Added back if_player_logging check. --- world/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/client.cpp b/world/client.cpp index b31f77c02..94aa906e9 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -454,7 +454,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { WorldConfig::DisableStats(); Log(Logs::General, Logs::World_Server, "MiniLogin Account #%d",cle->AccountID()); } - else { + else if (!is_player_zoning) { // Track who is in and who is out of the game char *inout= (char *) ""; From 0b647c7ae58a5171ca4941145f8b92b3b142dbbd Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sat, 15 Jul 2017 12:09:47 -0400 Subject: [PATCH 5/8] Added back SetOnline for logging clients. Not sure it's needed honestly, but I left it as I found it + the better messages. --- world/client.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/world/client.cpp b/world/client.cpp index 94aa906e9..4fd157088 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -477,6 +477,9 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { "Account (%s) Logging(%s) to character select :: LSID: %d ", cle->AccountName(), inout, cle->LSID()); } + else { + cle->SetOnline(); + } const WorldConfig *Config=WorldConfig::get(); From f7cc23d41553c6a3c02610871abd477baae57ef4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 16 Jul 2017 03:21:13 -0500 Subject: [PATCH 6/8] Cracked the code on FixZ offsets --- zone/waypoints.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index d1581a21c..15ab630ca 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -849,6 +849,7 @@ void Mob::FixZ() { { /* Any more than 5 in the offset makes NPC's hop/snap to ceiling in small corridors */ float new_z = this->FindGroundZ(m_Position.x, m_Position.y, 5); + new_z += (this->GetSize() / 1.55); auto duration = timer.elapsed(); @@ -864,7 +865,7 @@ void Mob::FixZ() { duration ); - if ((new_z > -2000) && std::abs(m_Position.z - new_z) < 35) { + if ((new_z > -2000) && new_z != -999999) { if (RuleB(Map, MobZVisualDebug)) this->SendAppearanceEffect(78, 0, 0, 0, 0); From b2b447516de781e330099437c04ffc4f88145296 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 16 Jul 2017 03:31:26 -0500 Subject: [PATCH 7/8] Make a FixZ call at waypoint arrive so bad grids don't make NPC's hop --- zone/mob_ai.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index a016b98e6..56ebb6fc2 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1573,6 +1573,8 @@ void NPC::AI_DoMovement() { SetHeading(m_CurrentWayPoint.w); } + this->FixZ(); + SendPosition(); //kick off event_waypoint arrive From 0b489bc507ddbff193e616d2d958eef7d095eb9e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 16 Jul 2017 04:36:36 -0500 Subject: [PATCH 8/8] LoS Drop when close adjustment --- zone/mob_ai.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 56ebb6fc2..e1e4682b0 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1001,7 +1001,7 @@ void Mob::AI_Process() { if (this->GetTarget()) { /* If we are engaged, moving and following client, let's look for best Z more often */ float target_distance = DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition()); - if (target_distance >= 50) { + if (target_distance >= 25) { this->FixZ(); } else if (!this->CheckLosFN(this->GetTarget())) {