Archived

This topic is now archived and is closed to further replies.

Max_Payne

Dedicated Server Console

Recommended Posts

Max_Payne    757
Me and my friends are working on a 3D engine, for our network dedicated server we are going to stick with a standard console program, nothing too fancy. I wanted to know, what is the best way of doing this because, if we use cin >> then it freezes the program, meaning the server stays idle, this means we should probably use multithreading, but are there any other options? We need to be able to print things on the console, input console commands at all times and not stop the server from running at a stable framerate. Also, does anyone have some peudo code for what I want to do

Share this post


Link to post
Share on other sites
Russell    118
I''ve only read about client/server programming with winsock some, and done a very basic client and server program, but I think you might want to try using a windows program instead of a console program, because I think it''s easier to use asynchronos sockets and it would certainly be easier to handle the keyboard events by setting up a windows message handling function. You could always call a function like GetAsynchronousKeyState() to tell if a key has been pressed, but that would require writting your own keyboard handler, which isn''t exaclty impossible. If you want to do a console, you might also try kbhit() which will tell you if a keyboard key has been hit, and look at some of the other console functions so that your console program will look nice and stuff.

Share this post


Link to post
Share on other sites