View Single Post
Old 03-18-2010, 07:05 AM   #8
Sombalance
Member
 
Join Date: Sep 2002
Posts: 49
Sombalance is on a distinguished road
Re: Getting FMud to work

I haven't played with FMUD, but I did write a flash client a wee bit ago and I recall getting the policy file handled by the game server was a pain in the butt.

Basically, the client probably does a call to loadPolicyFile that makes a connection to the game server to recover the policy file. Once it retrieves the file, it closes the connection and then uses a call to connect to do the actual game connection. That is two separate connections that have to be handled.

The loadPolicyFile call expects only the policy file to be returned. If anything else is returned, it fails. So, if you have a welcome banner that is displayed when players first connect, that might be sent along with the policy file, which would invalidate the policy file. Your server should see something like <policy-file-request/> sent when this connection is made.

I got around it by having the game server listen on a second port. It only sends the policy information on the first attempt when it receives the policy-file-request. On the second connection (to actually run the game), I send an immediate tag to the game server that lets it know I've already received the policy, and that triggers the welcome message and starts the normal game login process.

I do a few other things that made sense at the time to handle all flash connections through an alternate port. In theory, you can probably handle the policy request to one port and still use the main game port for the actual playing connection.


Here is a snippet from the flash client that I worked with.

Sombalance is offline   Reply With Quote