Custom event- how to create.

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

Moderators: Lapo, Bax

Post Reply
User avatar
Prof_PP
Posts: 126
Joined: 07 Dec 2007, 08:53
Location: Austria
Contact:

Custom event- how to create.

Post by Prof_PP »

Okay, someone may or may not have done this, but I have searched and cant find anything.

I wish to validate if a name has been allocated in the database before registering a new user. The database code and server side code is not a problem, except for communicating with the server.

The user is NOT yet logged in hence I cannot use sendXtMessage as this will not work until after login. I understand this. So I thought I would modify "handleInternalEvent" with an event of "validate" and send it using the smartfox.login.

However, I cannot seem to modify the evt sent to the server. Am I missing something in my logic? Am I up the wrong tree? Or is this not possible and I need to do it another (maybe easier) way?

Any constructive advice appreciated.
Thanks in advance.
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Hello,

I assume this is for registration purposes.

Since you are using h2database, this workflow may be acceptable:
1. Temporary log in as a guest and;
2. automatically send an empty room list (if you're using java, use helper.sendCustomRoomList method or use _server.sendGenericMessage instead). The room list is required prior to using sendXtMessage.

If you were using an external database such as mySQL - you could use a php script to validate the username instead.

Hope this helps,
Joshua
Smartfox's forum is my daily newspaper.
User avatar
Prof_PP
Posts: 126
Joined: 07 Dec 2007, 08:53
Location: Austria
Contact:

Post by Prof_PP »

Hey Joshua, Thanks for this.

Yes, this is for registration purposes but we are now using an external mySQL database (in preparation for eventual move to SFS2X).

However, I will proceed using you initial suggestion (not php), as I wish to keep the process linked into the Flash/Air app.

Will let you know the results.

Thanks
PP.
Post Reply