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 8881791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:24:59+00:00 2026-06-14T20:24:59+00:00

Background: I’m making an extremely basic multiplayer online game server where each game is

  • 0

Background: I’m making an extremely basic multiplayer online game server where each game is contained in it’s own room and its game data (including its room name) in a GAMES array and I want to remove the game data from the array when the room no longer exists.

I’m hoping theres something like this tht

socket.io.rooms.on('disconnect', function(roomID){
 //PSEUDO CODE// 
 //delete GAMES.getby(gameID:roomID)//
});

Otherwise I plan on looping through the games array and comparing the room names against io.sockets.manager.rooms data when a socket disconnects and deleting any inconsistencies. But I’m sure there must be a more elegant solution.

  • 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-06-14T20:25:00+00:00Added an answer on June 14, 2026 at 8:25 pm

    io.sockets.clients('room') will give you a list of sockets currently in a room, so you could do something like:

    if(io.sockets.clients('room').length > 1){
         //delete room logic here
     }
    

    Hope that helps!

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

Sidebar

Related Questions

Background: We're building an application that allows our customers to supply data in a
Background I've got an NSOutlineView that shows TrainingGroup entities. Each TrainingGroup represents a folder
Background To replace invalid zip codes. Sample Data Consider the following data set: Typo
Background I have an installation of VisualSVN on a server. under this, I have
Background: I have several builds running on a Windows Server 2003 R2 machine via
Background info: Me and a couple of friends are building this platform game in
Background: I'm running a Minecraft server for friends on a VPS, and I'm attempting
Background I have written a simple WebGL puzzle game and I want to allow
BACKGROUND I'm writing a little game using Java, slick2d and other frameworks. Slick2d does
Background Use Ajax to fire an event to the web server when a list

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.