Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 online game
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Andy




PostPosted: Wed Feb 02, 2005 3:21 pm   Post subject: online game

im making an online card game for my friend in MFC, and i was just wondering if anyone here knows much about the net module in c++? i'd appreciate it if someone can write a tutorial or something on sending/recieving information. also, does anyone know how to change the info on a website? so i can use that to post the ip adress of the host and the clients will connect to the site to see which games they can join?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Feb 02, 2005 5:17 pm   Post subject: (No subject)

for the website, you need a serverside script (Ruby, PHP, etc) that can extract information from the URL's arguments (http://www.compsci.ca/somevalue=42) and store it in the database that another page references
wtd




PostPosted: Wed Feb 02, 2005 7:17 pm   Post subject: (No subject)

If you're using MFC (which really really sucks and should only be used if absolutely necessary), then I suggest hitting the Microsoft Developer Network.
Mazer




PostPosted: Wed Feb 02, 2005 8:52 pm   Post subject: (No subject)

**Insert anime style "shocked" face here**

Dodge... MFC? Can you ask around and see if anyone still has the wallpaper I made?

Anyways, as far as I know (and remember, I try not to claim to know very much), C++ doesn't actually have a net module. Or at least, it doesn't have it's own. There's winsock if you want to go the painful way (after a great deal of time wasted, I barely got it working in the ill fated grade 12 FP). There are other free libraries available to make working with net commands easier (and sometimes, platform independant Wink ).
I'd recommend googling RakNet. There were a few more, but I can't remember them now, I think I have a list somewhere.

EDIT: About the website thing. I don't know for sure about that, maybe tony's way is better, but here's what I was thinking before (just because it'd be easier for me):
1) Have a computer (that is running the majority of the time) to be the "master server"
2) On this computer will be a program that will just accept connections and write data to a text file (and I guess check on connections on occassion to make sure they're still going)
3) When somebody starts a game, their client should go through the steps of setting up the game, and accepting connections from people joining, but should also send information to the master server with the IP, gametype, server name, number of players, and other information like that.
4) Back to the master server: I guess this information would be stored in lists (or vectors, or whatever), and whenever it updates the information, write it to an HTML file (with proper formatting). This HTML file would be hosted on your computer's webserver for people to view and find games.

I'll repeat, I've never tried this, and I don't know all that much about networking and servers, but I suppose that'd be one way. (and I'd be glad to hear of other ideas as this will be information I can use in the near future).
Mazer




PostPosted: Thu Feb 03, 2005 10:27 am   Post subject: (No subject)

Hiyo... found that list (actually, it's a different list, but it has more stuff than the original list did).

Networking libraries with varying degrees of freedom.
Andy




PostPosted: Fri Feb 04, 2005 8:23 am   Post subject: (No subject)

sweet.. thx nick
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: