Skip to main content
GameDev.net gamedev.net
🔒 Locked

Client and server/Dedicated server

Started by Max_Payne Oct 4, 2002 at 10:57 AM 0 replies 250+ views
Original Post
Max_Payne
Max_Payne
Hello there :D This question does not really involve network programming if you''re wondering, its more of a design issue. I have started to design the netcode for my 3D engine, it works well, all based on UDP, uses winsock and its as portable as possible. However, a new issue has come. The fact is that, right now i''m running the client and the server in the same binary, but, if i want to host this on dedicated machines, it would be dumb requiring a videocard... And i will want to port it, since i have just got an offer from a linux guy to host us a server, but he only has dual red hat servers. So now, i figured the best way to do this would be creating a dedicated server that runs as a console application, why? well, because the server wont need a 3D card, it will save resources, and the only thing i will have to port will be the few specific winsock calls. This is where i ran into problems. Right now we''re programming this in a single VC++ project, but the project is a win32 application, and therefore, cannot use int main(...). I would really like to keep this into one project because it forces us to look at the code, no files are ''hidden'' in another project file and no code gets duplicated, we can easily reuse the code. So, i started making configurations: - Client Release - Client Debug - Server Release - Server Debug I made preprocessor definitions in the project settings so that i could do things like: // server/main.cpp #ifdef SERVER int main() { ... } #endif // client/main.cpp #ifdef CLIENT int winmain() { ... } #endif This seemed like a good solution, but it seems the compiler isnt compiling any of the main functions, despite the defines specified in the project settings! And the next bad thing, since its a win32 project, i cant use int main(). I know that Quake 2 had a dedicated server that had a console window in the same binary and i''m about sure its possible to somehow change the libs to fix this, but which libs, what to add, what to remove, etc! And well, it this the best configuration in your opinion? All feedback is welcome.

Looking for a serious game project?
www.xgameproject.com
KalvinB
KalvinB
Just use multiple work spaces. The server should be quite a bit different from the client anyway. If you want to share files just set up a "common" directory that holds those files.

Ben


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.