-
PHPoker - Theory
So to check how many players are on the table, a loop checks how many players are on the table, then if it is not equal to the last updated number of players it updates so their is space for other players to join.If you don't understand, its because I'm typing while i am dead on gears of war.So its rushed lol.
-
A loop? why waste all that proccessing time, just get mysql to tell you how many it found in the db, its what mysql_num_rows is for....
-
Looping would just slow it down and for no good, count using mysql_num_rows as that will reduce it some what. Also you may want to ask this to be moved to the project forum as this is a project.
-
Maybe i didnt explain it needs to update when a player suddenly leaves etc
-
You should be able to do that but doing it instantly would have to include javascript (AJAX) to send some data before the browser/tab closes. I am 99% sure that is possible. Then logging the timestamps in the mysql and it would be working fine.
-
Wouldnt that be handled by your sessions system? since id think thats pretty esseental to have else you cant keep track of whats in what game and what card they have o.0
-
-
session time is updated everytime they connect to the server via ajax or whatever, if they dont connect in a certain time period, they time out since chances are they aint there no more "/
-
-
You can use the onload and onunload events to be able to easily update the database as to the players in the room with AJAX.