Jump to content


Server login


3 replies to this topic

#1 gardon

    Valued Member

  • Members
  • PipPipPip
  • 282 posts

Posted 24 September 2007 - 01:07 AM

Quick overview: Developing a MMORPG


It seems redundant, and a lot of time wasted to have the server listen for new clients in its main loop:


while(1)

{

listenForNewClients();  //this is the one!


HandleIncomingPackets();


HandleOutgoingPackets();

}




I'd want the server to be as fast as possible while processing game data and sending out/receiving information about other players. If I have to wait for a client to be introduced, it'll waste time.

Is there any way I can update the database by checking the "isLoggedIn" flag through some other way of login? perhaps through my website?

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5310 posts
  • LocationSanta Clara, CA

Posted 24 September 2007 - 02:46 AM

How about having a different thread to listen for new clients?
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 dave_

    Senior Member

  • Members
  • PipPipPipPip
  • 584 posts

Posted 24 September 2007 - 02:47 AM

MMO log-in can actually be quite a complicated topic.
Most professional games will have a dedicated log in server for scalability.

This also sounds like a case of premature optimisation. Is this really a bottle neck?
Doesnt seem like listening for new clients should be a CPU intensive operation.
Can you use threads to make it asynchronous?

#4 gardon

    Valued Member

  • Members
  • PipPipPip
  • 282 posts

Posted 24 September 2007 - 03:02 AM

Yea, good idea. A second thread is the way to go, thanks.

-Gardon





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users