View Full Version : PHPoker - Theory
Mr Macro
13-07-2007, 07:06 PM
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.
Mentor
13-07-2007, 07:38 PM
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....
Luckyrare
13-07-2007, 07:59 PM
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.
Mr Macro
13-07-2007, 08:04 PM
Maybe i didnt explain it needs to update when a player suddenly leaves etc
Luckyrare
13-07-2007, 08:12 PM
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.
Mentor
13-07-2007, 08:16 PM
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
Mr Macro
13-07-2007, 08:18 PM
How could i do that
Mentor
13-07-2007, 08:23 PM
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 "/
Mr Macro
13-07-2007, 09:05 PM
Ok i understand that.
Splinter
13-07-2007, 09:16 PM
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.
Mentor
13-07-2007, 09:31 PM
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.
although it would work some of the time, it would cause problems if someone crashed (aka no onunload events would be triggered), if there wasnt also a time out system in place as well "/
Luckyrare
13-07-2007, 09:39 PM
If you just update the table every 5 seconds via Javascript -> php -> mysql then if the users timestamp is older than lets say 15 seconds they are out of the game.
[Oli]
13-07-2007, 10:48 PM
lol, ok this is kind of random post but just had to think of it :p
Well i'm from belgium as some of you may know already and at dinner we were watching the news, and it had a headline about Poker becoming a real dangerous hype, that many younger teenagers are starting to play Poker for actual money which is against the law in Belgium, as only casino's are allowed to do poker competitions once a year. And they went on about the new hype of online pokering and that young teenages are faster attracted to the game these days as it's easy to learn, and they "start" with just playing with their friends for a few euro's but the more they do it the higher the bids become.
Anyway looking at this topic's name just made me think of it :p
I woulnd't mind playing a game of Poker, for virtual (fake) money that is.
I wouldn't ever play for real money.
Anyway, good luck with this project to everyone who works on it ;)
Make it so you win credits on the site.
Mr Macro
15-07-2007, 02:33 PM
I don't know what the online money will be used for, but it will be free and legal.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.