Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default 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.
    James


    Connected to reality through a proxy server.

  2. #2
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    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....

  3. #3
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    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.

  4. #4
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Maybe i didnt explain it needs to update when a player suddenly leaves etc
    James


    Connected to reality through a proxy server.

  5. #5
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    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.

  6. #6
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    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

  7. #7
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    How could i do that
    James


    Connected to reality through a proxy server.

  8. #8
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    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 "/

  9. #9
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Ok i understand that.
    James


    Connected to reality through a proxy server.

  10. #10
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    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.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •