handleInternalEvent details!

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

duke
Posts: 31
Joined: 16 Apr 2009, 11:23

handleInternalEvent details!

Postby duke » 02 Jul 2009, 09:31

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.
User avatar
Lapo
Site Admin
Posts: 21286
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 03 Jul 2009, 13:34

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
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

onRoomVarUpdate serverside

Postby mhdside » 14 Jul 2009, 14:56

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.
Mahmoud Badri
Senior actionscript developer
http://www.el3ab.com

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 8 guests