Run script after user disconnection.

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
cpdavidd
Posts: 31
Joined: 25 Feb 2010, 08:03

Run script after user disconnection.

Post by cpdavidd »

Is there a possibility to run an script/extension after user disconnecting (clicking on "Exit" button/closing the game...)?
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Yes,

A user disconnection internal event will be triggered in your zone extension. The internal event is called "userLost" - from there, you can perform the script you need. Note: If a logOut had occured, userLost won't occur. Only one of those two will be fired, not both.
Smartfox's forum is my daily newspaper.
cpdavidd
Posts: 31
Joined: 25 Feb 2010, 08:03

Post by cpdavidd »

Thanks alot
:)

EDIT: And could I get a parameter, why the user was been disconnected (If its due to idle, or being kicked)
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

I don't think so with this version of SFS. SFS2X possibly
Smartfox's forum is my daily newspaper.
Post Reply