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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:35:19+00:00 2026-05-28T17:35:19+00:00

I am developing a text-based game, MUD. I have the base functions of the

  • 0

I am developing a text-based game, MUD. I have the base functions of the program ready, and now I would like to allow to connect more than one client at a time. I plan to use threads to accomplish that.

In my game I need to store information such as current position or health points for each player. I could hold it in the database, but as it will change very quick, sometimes every second, the use of database would be inefficient (am I right?).

My question is: can threads behave as “sessions”, ie hold some data unique to each user?

If yes, could you direct me to some resources that I could use to help me understand how it works?

If no, what do you suggest? Is database a good option or would you recommend something else?

Cheers,
Eleeist

  • 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-28T17:35:20+00:00Added an answer on May 28, 2026 at 5:35 pm

    Yes, they can, but this is a mind-bogglingly stupid way to do things. For one thing, it permanently locks you into a “one thread per client” model. For another thing, it makes it difficult (maybe even impossible) to implement interactions between users, which I’m sure your MUD has.

    Instead, have a collection of some kind that stores your users, with data on each user. Save persistent data to the database, but you don’t need to update ephemeral data on every change.

    One way to handle this is to have a “changed” boolean in each user. When you make a critical change to a user, write them to the database immediately. But if it’s a routine, non-critical change, just set the “changed” flag. Then have a thread come along every once in a while and write out changed users to the database (and clear the “changed” flag).

    Use appropriate synchronization, of course!

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

Sidebar

Related Questions

I've been developing a text-based PHP/MySQL RPG Game Engine since early December last year,
In a program I am developing (Linux), I need very simple text-based IPC. It
I am developing a php text based game. I am organizing tasks in games.
I am developing a game, well have an idea for a game and have
We are developing a Windows application using C#. We would like to change the
I am developing a plugin in eclipse which can generate a text file (based
Hi I am developing a simple application based upon ASP.NET MVC. I have altered
I have a question regarding an iPhone game I'm developing. At the moment, below
I am developing a php-based web application in which there is a text area
When you are developing a web-based application and you want to allow richly formatted

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.