Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6106481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:05:03+00:00 2026-05-23T14:05:03+00:00

I am willing to create a two-player quiz game, in real time. For this

  • 0

I am willing to create a two-player quiz game, in real time. For this I need to track when users are on my quiz’s page and when they leave it. Basically, I need some kind of lobby, where players gather and from where my script picks two random players who should face each other in the game.

As many players would switch from online to offline in a very short time, I prefer not to use the classic ‘update player status to database and then retrieve at a given interval the list of online players’. Currently, I am toying with the idea of using Comet Push, and have studied a little bit PubNub.

The actual quiz game I believe it is pretty easy to solve: use of classic Comet publish() to send answers and subscribe() to check the other user’s status. But the thing that bothers me is how do I get that specific list with online users?

I tried to publish() a user_id when a user goes to the lobby, but how do I notify all the other users when this user goes offline? How do I display in the lobby the total number of connected users together with their names?

It’s the first time I face Comet and its logic isn’t entirely clear to me.

Thank you for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:05:03+00:00Added an answer on May 23, 2026 at 2:05 pm

    You might want to try out Pusher and our (I work for Pusher) presence functionality. The presence channels let you easily implement room/lobby-style functionality and should meet your criteria.

    • You get an initial list of users subscribed to the channel when you subscribed
    • You are informed whenever a user subscribes (enters) and unsubscribes (leaves) the channel (room/lobby)

    This way you don’t need to implement this functionality yourself. It’s part of the solution Pusher provides.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am willing to create div's dynamically on double clicking anywhere on the page.
For this two tables: CREATE TABLE TEST1 ( ID INTEGER ,key VARCHAR(50),VALUE1 VARCHAR(50)); CREATE
I am willing to use Google Analytics to track stats about usage of my
While I'm perfectly willing to believe that this has been asked elsewhere, I haven't
How can I create an xsd to give me this type of xml structure
I am attempting to create the following scenario, and I'm willing to use any
I'm trying to create a Delphi version of this algorithm: void PWSfileV3::StretchKey(const unsigned char
I'm willing to create an image with certain text using the following code <?PHP
I want to create a worksheet addition of, say, two five digit numbers. Using
I have a search textbox and two image buttons on a page I created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.