This content has been marked as final. Show 8 replies
This may be a bit beyond just a ColdFusion solution.
The difficulty is tying two separate sessions together. This is
something ColdFusion is not really built to do.
I can imagine that you maybe able to do something with an application
data structure that joins pairs of sessions together.
But if you have access to use Flex it does have built in sharing|pushing
capabilities and could make this task easier. Depending on how agile
you are at picking up the concepts of Flex. Just a note on cost. One
can do Flex for free as long as you make do without the handy-dandy Flex
This is a perfect fit for an Application variable. You could have an application var with an array of session vars. Or you could just control the whole flow from the application level. Just make sure to use cflock when updating the app var.
You may be onto something there. So have an application variable for each duel, and within that a session var for player 1 health, player 2 health, player 1 move choice and so on? Where then should the calculations be done?
You would need an action type cfm file on the server that contained all the logic code for the game. Like you said this page could be called via ajax and game info (moves, results, etc...) could be passed back and forth from the server to the client. I did sudoku helper program that uses ajax like that at http://www.burnette.us/blog/index.cfm/2006/9/21/You-Say-Sudoku-I-Say-Sudoko
Ah, very impressive. I will just throw this out there, TSB would you be interested in helping me code this? I could get you login information and such to my server, and access to the database and all that. I have a ton of work to do on this app, and you seem like you could be a great help. Let me know if you want to/have time. Thanks! That offer goes for anyone else who is interested, I can use all the help I can get with this project.
This sounds like a great application for LiveCycle data services. I assume you'll need to use the express (free) version to start. You would need to create a data set, and broadcast messages to the browser once the data set is updated.
Kenji, I have ajax examples on the site and you can email me with questions, my address is on the website burnette.us. I will try and email help with any problems you run into building the app but I don't have that much free time anymore. As you can see I have not posted code examples on my site in over a year. About the time I went from programmer to IT manager.
Thanks for the input, I will certainly check out LiveCycle. I am always hesitant to try new technologies, as I only have a such a loose handle on the ones I already use :P Is it hard to get started with? TSB, thanks for the sample code and such, I am sure it will be very valuable, and I will probably ask for your help a few times. Thanks to some suggestions from other people, I know have to basically overhaul my fighting moves database, as we are moving a tree based skill system (similar to Diablo for those who have played that). I will work on getting that all changed over to the new style and come back to this part of the project hopefully in a day or two.