Taerzik -> RE: Flash Q&A Thread 4 (1/13/2008 3:34:39)
|
Alright yall, I said I'd keep you up to date on my progress with my multi-user client and here it is: SUCCESS!!! Follow the link banner below in my sig. and then click the half-moon icon on the right. Yup, it was an easy solution too. I was having a problem with getting users to be able to connect to the game server; reason: new security measures in Flash. The solution is to serve the users a socket policy file when they try to connect, however it's not as easy as it sounds... but almost. The quick and easy solution is to initiate an XML socket connection via AS. In my case I had a special Socket Server running that they needed to connect to(SFS). Here's how to do it with SmartFox Server. 1. Install/Setup your web server (a Web server not the SF server) - The complexity of this process varies based on what server you use. Be sure to specify a port for your XML connection, probably a high numbered port. 2. Install/Configure SmartFox Server. It's not hard, be sure to configure the connection port and your IP number as per the instructions. 3. Get it all arranged and try to run the SF server. This is just a test. If something doesn't work then tackle the problem now. 4. If you don't have a 'working' multi-user game/app yet, get it ready. The folks at gotoandplay.com have lots of helpful advice, not to mention the examples that come with SFS. If nothing else, use one of the examples that came with the SFS files. Ok, you're just about ready. Go prepare a 'crossdomain.xml' policy file. Poke around gotoandplay.com for details. Also, be SURE to use the link they offer that goes to Adobe's pages about the latest security measures. It's boring and technical but you need to read that stuff, well, about half of it. The key to making the connection is to have your Flash file first make a generic xml socket connection, since the crossdomain policy file is (supposed to be) at the root of your server files, it auto-loads when a user makes an xml socket connection with AS to the default port (80 I think). Once that's been done, THEN make the SF connection and close the original socket connection. By that process your client can gain permission to connect and establish a connection. 5. Everything ready? Test it! ___A. Turn your web server on if it's not already. ___B. Turn the SF server on if it's not already. ___C. Try to run your file. If it works, put it on a web page and try it from there. (If it fails here then your crossdomain policy file is probably messed up) ___D. If everything looks good at this point, try to connect from a separate machine that's not on the same local network as the host machine. You may need volunteers for this part. 6. Congratulate yourself, go celebrate or something. 7. Ok code slave, party's over, back to the keyboard. That's about it in a nutshell. It's taken me a few months to get this far but I worked very sporadically in little bundles of hours and only about once or twice a week at the most, maybe less. All told there's probably not even 48 hors of my effort in the thing so far. (And it probably shows.) Anyway, the link is in the banner and through the half-moon icon on the right hand side.
|
|
|
|