PDA

View Full Version : Best way to achieve this goal


Milkies
09-06-2006, 04:00 PM
Hi all,

I have just developed a computer game using C++ and OpenGL. It works by the application either being in "host" or "join" game state. Currently the "join" user has to enter the IP address or the "host" user to connect. However I wish for the game to be extended and for a "gaming lounge" to be implemented. So all host games can be seen and the users can choose which game to join.

However I have NO idea about server side programming. I assume the only way to achieve this is to do server side programming.

So here are my questions:

1. Programming language independantly what would be the best way to achieve what im trying to do?

2. As I have no idea how to use CGI or Perl I guess I will have to use C++ with CGI, rather than learning 2 new languages.(dont flame me as Im aware of the drawbacks. Im not trying to make the best lounge ever, just something simple so hopefully C++ with CGI will suffice). Would this be possible to do in C++/CGI (remembering im going to make it as simple as possible).

3. I currently have a server which is hosted by servage.net. It isnt a dedicated server though. This is what I intend to run the CGI script on. Now if I ping my webssite it will return the IP address x.x.x.x, however when I go to http://x.x.x.x instead of seeing my website I see the servers website. Will this become a problem when the client application attempts to connect with my serverside CGI script via http://x.x.x.x/cgi-bin/mycgiscript.cgi? If so is there anything I can do about it (without getting a dedicated server, or running my own server).... However running my own server would be easier as I wouldnt have to learn CGI lol.

4. Will a server that supports Perl/CGI automatically support c++/cgi scripts?

Thanks for any help.

ralph l mayo
09-06-2006, 05:50 PM
The best way to do this if you want to use C is probably to develop a module using the Apache module API (http://modules.apache.org/doc/API.html). In principle it's a lot like CGI; Apache gives your handler a request and it's up to you to implement the logic to decide whether to accept it and if so what to do with it, but it's lower level. The advantages are that it's the most comfortable way to work with C variants as server side languages and that it will be (assuming you don't do anything really strange in your implementation) considerably faster than using perl or similar. The primary disadvantage is that you probably don't have permission to load the module in shared hosting environments, and would need to get virtual private hosting, which is a bit more expensive.

Edit: Not that you can't use C++ through CGI, that works too, but I don't know much about it.