tags:

views:

135

answers:

0

hi guys, currently i am in browser game project, quite similar to mafia wars or restaurant city(in facebook)

we are using php jquery and CI to build this game

  1. my question is how to make secure dynamic update via ajax(e.g in mafia wars, it is stamina that if you spent some, the game will show you "more in 04:00" and if you wait 4 minutes the stamina will regenerate a little, if your stamina is not full yet the timer come back to 04:00) how to make and control this so it is not easily get abused by user

my pre assume is to generate php page that accept regenerate request(request sent by client via ajax when timer reach 00:00) do some database job, then return signal continue or stop, continue if in database the user stamina is not full yet, stop if the stamina is full therefore stop showing the timer

  1. how to manage data consistently between server and client views, (i assume if every request return updated value from server(server do 3 jobs, updating database , send continue/not signal, and returning update value) will deal quite processing time rather than just update database and send continue/not signal) -> because this update process will be very much often processed

i am sorry for my bad english as english is not my primary language, any help is appreciated