madmenyo Posted June 11, 2010 Share Posted June 11, 2010 Hi, I was wondering how i can make interactions that other users can pick up? How do i pass information to another user? For example: 1. Player A clicks on Player B's name in a window and chooses to attack this player. 2. Player B gets a message in his screen and chooses yes. 3. Server rolls dice on who may start ans passes this to both players. 4. First players chooses what he wants to do and clicks finish. 5. Other player gets a go to make his move. I am using PHP, AJAX, Javascript and MySql. But i can't find anything on how to approach this. Maybe i'm using the wrong search terms so enlighten me on what functions i should use? With my knowledge i can get this to work with AJAX requests. I would make a fight toggle for the player and ajax keeps queriing the server if that toggle has been set, if so that message would appear that he got challanged. Then for the turns the same, keep doing AJAX requests to see if the finished turn toggle is set. Would this be the way to go? Or are there other sollutions that are more efficient, practical and better? Quote Link to comment Share on other sites More sharing options...
Psycho Posted June 11, 2010 Share Posted June 11, 2010 AJAX. You will need to use a combination of JavaScript and PHP. There is no way to "push" data to the web browser with common implementations. The JavaScript will need to make a request to the server every n seconds to see if there is any new data to display and then update the user's dislplay accordingly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.