Advertisement Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    557
  • comments
    1237
  • views
    423690

I'm on my lunch break

Sign in to follow this  
Evil Steve

107 views

How exciting.

I did some work to TEH MMORPG!!1 stress tester. It now runs clients in individual threads. However, since I use async sockets, the window message pump that feeds my sockets has to run from the main thread. Which might not seem like a problem, except that my socket class isn't thread safe. I added some basic synchronization, but you still can't safely read from the sockets buffer. The buffer is a std::vector, which is filled from the main thread in the window proc. And all my code for reading from it just returns a pointer to the first element of the vector. Bad idea.
So, I now need to write a thread safe reading function, that'll take the mutex, copy it into a buffer, and return the buffer.
I also need a critical section for each thread, in theory. I might just use one global critical section though, since this'll hardly be used multithreaded.

The servers are almost done. They can handle chat messages, clients changing zones, and clients entering/leaving. The only thing remaining is to save charcter data when a client disconnects. So that'll take 5 mins or so to actualy write. After that, I need to do some more work to the stress tester. I'd also like to try moving my database to an external host, such as another server / web hosting / whatever. Just for fun. The login server should really run on the same machine as the DB anyway. Maybe. I dunno.

Right, back to State of Emergency 2....

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!