Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some general function calls for client login/logout at characters. #75

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/REVISIONS-56-SERIES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -628,4 +628,7 @@ Fixed: NPCs vendors not calculating skill train price correctly.
[sphere_events_npcs.scp]: Fixed event 'e_trainer' showing wrong trainable skill list on vendor's context menu

09-06-2017, Coruja
Changed: Updated internal SQLite libs v3.19.2 to v3.19.3.
Changed: Updated internal SQLite libs v3.19.2 to v3.19.3.

09-06-2017, 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.
3 changes: 3 additions & 0 deletions src/graysvr/CClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,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;

Expand Down
2 changes: 2 additions & 0 deletions src/graysvr/CClientMsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3674,6 +3674,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() )
Expand Down