Click to See Complete Forum and Search --> : DOS Network programming [C]


k992637
03-29-2001, 08:56 AM
Ok, so I've made some sort of Dungeons and Dragons game in C that plays in a Console. I want to make a two player version (or more?) where two people on a LAN can play together against a common enemy! How can learn about making programs talk across a network? All it needs to do is transmit simple commands like "Pick object" ect. I really don't even know where to begin! What protocols could I use? TCP/IP?
Thanks in advance!

Racer^
03-29-2001, 10:24 AM
Even though the program you are making runs in DOS, I recommend that you create a TCP/IP network interface that uses a Windows based TCP/IP library to do LAN/Internet gaming.

There are a few main reasons for this:
1. You would have to use DOS network drivers which are a pain and sometimes don't even exist

2. You would probably have to program separate interfaces for a network card and a modem in DOS. However, Windows makes a connection through whatever TCP/IP enabled device you decide to use

3. The Windows TCP/IP libraries available are much more developed (and more common) then their DOS counterparts

By the way, it is possible to run Windows TCP/IP in DOS (without booting to Windows) but this is often difficult or even impossible to do and depends on your network card. If you want to be able to run this program in plain old DOS (no DOS box), separate the LAN interface into a different executable so as to not require Windows when you are playing single-player.

------------------
TBird 880 (oc 110 x 8) /
ABit KT7 w/ 256 MB RAM /
TNT2 16MB