From 414575f4201badb7cb33bb9e396016c929bc3c8f Mon Sep 17 00:00:00 2001 From: ares Date: Sat, 22 Oct 2016 19:19:08 +0200 Subject: [PATCH 1/2] Added a more reliable way to handle login/logout independent from character definition and its events. --- src/graysvr/CClient.cpp | 3 +++ src/graysvr/CClientMsg.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/graysvr/CClient.cpp b/src/graysvr/CClient.cpp index 455f9b190..49679f611 100644 --- a/src/graysvr/CClient.cpp +++ b/src/graysvr/CClient.cpp @@ -128,6 +128,9 @@ void CClient::CharDisconnect() return; Announce(false); + CScriptTriggerArgs LogoutArgs; + m_pChar->r_Call("f_onchar_logout", m_pChar, &LogoutArgs); + bool bCanInstaLogOut = CanInstantLogOut(); int iLingerTime = g_Cfg.m_iClientLingerTime; diff --git a/src/graysvr/CClientMsg.cpp b/src/graysvr/CClientMsg.cpp index ada4a4ef3..9f3f98c27 100644 --- a/src/graysvr/CClientMsg.cpp +++ b/src/graysvr/CClientMsg.cpp @@ -3688,6 +3688,8 @@ BYTE CClient::Setup_Start(CChar *pChar) // Send character startup stuff to playe m_pAccount->m_TagDefs.DeleteKey("LastLogged"); Announce(true); // announce you to the world + CScriptTriggerArgs LoginArgs; + m_pChar->r_Call("f_onchar_login", m_pChar, &LoginArgs); // Don't login on the water, bring us to nearest shore (unless I can swim) if ( !IsPriv(PRIV_GM) && !m_pChar->Char_GetDef()->Can(CAN_C_SWIM) && m_pChar->IsSwimming() ) From 1f35413a8f507c6aa1bdbcc60b1d718ed7cd2456 Mon Sep 17 00:00:00 2001 From: ares Date: Sat, 22 Oct 2016 19:33:38 +0200 Subject: [PATCH 2/2] just updated the readme for login/logout stuff --- docs/REVISIONS-56-SERIES.TXT | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/REVISIONS-56-SERIES.TXT b/docs/REVISIONS-56-SERIES.TXT index 9da96a345..68f745642 100644 --- a/docs/REVISIONS-56-SERIES.TXT +++ b/docs/REVISIONS-56-SERIES.TXT @@ -253,4 +253,7 @@ Fixed: Critical Bug in background save mechanism where an unsaved offline player 17-10-2016, Coruja Fixed: NPCs losing 'statf_spawned' flag after server restart. Fixed: Nightsight buff icon not being enabled/disabled when using NIGHTSIGHT function or changing 'statf_nightsight' char flag. -Changed: Updated internal SQLite libs v3.14.2 to v3.15.0. \ No newline at end of file +Changed: Updated internal SQLite libs v3.14.2 to v3.15.0. + +22-10-2016, Ares +Added: f_onchar_login/f_onchar_logout functions (usually placed in sphere_serv_triggers.scp) are now called for clients login/-out at characters. This is independent from character definition or events to be more reliable. SRC is the character.