Hi All,

(Sorry about such a long first post!)

I am building a module based gaming network in Flash and have looked around
for some kind of command-stack-gateway framework for sending receiving
commands through a single gateway to/from flash/PHP.

When I say commands I mean function input/output to and from the server. I
am not talking about swf objects etc. I don't care what protocol is used to
transfer the commands be it remoting, loadVars, whatever (as it should be
abstracted to work with all of them anyway).

For example, if my flash runtime environment is running a 'chat' module and
a 'who is here' module and a 'multiplayer poker' module - I need to
communicate with the server to get db result sets, game updates, chat
updates etc.

I was unable to find an established flash based command-stack-gateway for
the type of thing I am talking about. (perhaps someone can point me to one).


In the mean time I have developed one that is based on the UNIX daemon
philosophy, that so far I am calling PFCom - (PHP flash communication).

The philosophy is quite simple really. All server send/receive requests are
qued in a command stack and then sent to a single PHP script as a
stack-of-commands (via a single flash command-broker/gateway). The PHP
script deals with each of the commands and then responds appropriately.

Each command on the outgoing command stack sent to the PHP gateway
(request_handler.php) includes the following parameters.

1) target_php_module
2) target_php_action (i.e. function)
3) arguments to send to the function

The php gateway then loops through the incoming command stack and passes
each command to a PHP module/action. 

Once all commands have been processed the results are compiled as another
command stack and sent back to flash. Each entry in the outgoing stack has
the following structure:

1) target_flash_module
2) target_flash_function
3) arguments to send to the function

A flash level0 PFCom event then loops through the incoming command stack and
executes each specified function with the supplied parameters.

For example:

module     / function / args
chat_module.add_chat(args)

So in effect:

 1) Many flash modules push commands/requests onto a single outgoing command
stack
 2) A single flash event transmits the command stack at a predetirmined
refresh rate
 3) The server respons with a response command stack
 4) The commands are bubbled up from level0 to target functions

The point of all of this hokery pokery is to get rid of redundant
flash/server communication by stacking multiple commands in one shot. 

This is very useful if you have a chat module that has a 5 second refresh
rate, and a user list that has a 10 second refresh, and game update commands
with 3 second refresh rate. i.e. You can get data for all modules in one hit
via a centralised command-stack broker. 

The other benefit is the modular-abstracted-architecture and the ease of
using shared functions etc in your single gateway (therefore a tendency
towards a less redundant PHP and flash codebase).

Anyway, long story short. I have developed the basics of this and am
wondering if any of the flash.os/com dev groups are interested in it (as it
is abstracted to work with any type of com system).

Also, does it already exist? Is it useful? Anyone interested in turning it
into a fully blows flash release for the various com packages? Etc? 

I guess I should add one final note... before any kind of flame war
starts... 

"The above has nothing to do with the basic protocol of sending/receiving
data in flash, it is completely agnostic as to the underlying method of data
transfer. It is simply a command processing architecture that runs on top of
any other lower level flash/com protocol. I.E. It's sort of like a databse
abstraction layer for server interaction."

Looking forward to your thoughts!

Cheers,
JV :)


_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to