3 replies to this topic

#1gardon

Valued Member

• Members
• 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?

#2Reedbeta

DevMaster Staff

• 5310 posts
• LocationSanta Clara, CA

Posted 24 September 2007 - 02:46 AM

reedbeta.com - developer blog, OpenGL demos, and other projects

#3dave_

Senior Member

• Members
• 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?

#4gardon

Valued Member

• Members
• 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