Wednesday, October 8, 2008

Hello World Login with JAGS 1.4m

I've had this demo sitting around for months, thinking I'd had posted it.

This hello world template will help anyone learn how to convert their Actionscript 3 game into a multiplayer game using the JAGS 1.4m server. Physics don't complicate this example like the Tank game, so it's much easier.

The client shows how a login request might be handled, what messages are flowing, and how game names spaces and groups within your game space works.

Typical built in commands save you the grunt work of making a multiplayer game a reality. Not only do you get a nice foundation, but you can easily direct who the messages are going to (everyone in the game, just that players group, or to a single player):



Plus, I give you a simple class called YourCommands.as to extend your own game events and commands. Take a look at this simple Actionscript code:



You can put as much or as little logic into the Java server side. The java code demonstrates how you would pump the game messages through your java code, giving it a chance to alter what a player can do, what the message contains, who its going to, and of course affect your java game state.

The JAGS 1.4m server has a really cool way of checking for any (optional) java code you may have put on the backend. Just plop as many jagGames.java classes onto the JAGS server, and it will match your AS3 client with the right java resource.

That way, all you have to do is put stuff in the doAction method and you've got a complete server backend. Check out this jagsGame.java that is in the public_ftp.login.v1_1 folder:



All the code can be easily ran without installing anything, and then can be downloaded as full projects with source code when you want to get into it.

Just visit fireleg.com and look at the Login 1.1 links.

3 comments:

Foxinfosoft said...

your site is very informative
Thank you
iPhone application development

erectile dysfunction said...

What's up to every body, it's my first pay a visit of this web site; this webpage includes amazing and in fact excellent data in support of readers.

best erectile dysfunction pills said...

Hi there! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no back up. Do you have any solutions to prevent hackers?