Page 1 of 1

handleInternalEvent details!

Posted: 02 Jul 2009, 09:31
by duke
I see I can intercept the following:

loginRequest
logOut
userJoin
userExit
userLost
spectatorSwitched
newRoom
roomLost
pubMsg
privMsg
fileUpload
serverReady
playerSwitched

would it be possible to add "login" event? There's one for if the user requests to login, and one if he logs out, but none if he successfully logs in. I want to intercept THAT and send some messages to him, I don't want to assume that by sending him the "yes you can login" message, he's logged in. There might be a bit of lag or something else so he'd get the messages I want to send when he's logged in, while nothing is listening for them!

edit: playerSwitched probably does the same thing (fires when a player joins/switches a room), but I haven't tested this.

Posted: 03 Jul 2009, 13:34
by Lapo
would it be possible to add "login" event? There's one for if the user requests to login, and one if he logs out, but none if he successfully logs in.

The login event flow involves that your code does the following:

1- check credentials
2- perform the actual login (canLogin() method)
3- send a notification to the user

At step 2 the User is already physically logged it, so you don't need an event to confirm that.
If there's any problem with the login you get an exception fired.

Take a look at the Java Extension Cookbook for a complete example:
http://www.smartfoxserver.com/docs/docP ... okBook.htm

onRoomVarUpdate serverside

Posted: 14 Jul 2009, 14:56
by mhdside
is it possible to intercept the RoomVarUpdate on the server? so if a player changes a room variable the server gets to know about it.