Please, really need Network

Hello,

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???
Anotehr question, If I build 2 applications, can I connect from the client to
the server if it is running on the same machien ?

Thanks for any help

Stephane Magnenat
Stephane.magnenat at urbanet.ch

P.S. Linux version will be free :slight_smile:

Hello,

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???
Anotehr question, If I build 2 applications, can I connect from the client to
the server if it is running on the same machien ?

Thanks for any help

Just go download the source code to a MUD and look at their networking
code. Sockets are really quite simple once you’ve done it once or twice.
Look on sunsite.unc.edu for the source.On Thu, 15 Oct 1998, Stephane Magnenat wrote:


Scott M. Stone <sstone at pht.com, sstone at turbolinux.com>

Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)
http://www.pht.com http://armadillo.pht.co.jp
http://www.pht.co.jp http://www.turbolinux.com

Le Thu, 15 Oct 1998, vous avez ?crit :

Hello,

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???
Anotehr question, If I build 2 applications, can I connect from the client to
the server if it is running on the same machien ?

Thanks for any help

Just go download the source code to a MUD and look at their networking
code. Sockets are really quite simple once you’ve done it once or twice.
Look on sunsite.unc.edu for the source.

Is it multiplateform ?>On Thu, 15 Oct 1998, Stephane Magnenat wrote:


Scott M. Stone <sstone at pht.com, sstone at turbolinux.com>

Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)
http://www.pht.com http://armadillo.pht.co.jp
http://www.pht.co.jp http://www.turbolinux.com

Stephane Magnenat
Stephane.magnenat at urbanet.ch

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???

Well, when the network thread started some time ago, Sam posted a
snippet of code from Maelstrom that is crossplatform between Windows
and Linux (I don’t know about BeOS) that seems to work well enough. I
can send it to you if you want. It’s not that well commented, but if
you know anything about socket-style networking, it shouldn’t be too
bad.

Anotehr question, If I build 2 applications, can I connect from the client to
the server if it is running on the same machien ?

Yes. You just set the server to “localhost” with the right port
number, and it should work fine.On 15 Oct, Stephane Magnenat wrote:


| |/ | | | _ | | | mailto:@Knight_Walker |
| / | / / | | http://www.aros.net/~kwalker |
| \ | ___ | | |
| |\ | | / \ | | The Kobran Imperium (801)265-1299 |
|| || || || _____________________________________/

No. That will generally not be multiplatform. It will be
UNIX-specific.On 15 Oct, Stephane Magnenat wrote:

Just go download the source code to a MUD and look at their networking
code. Sockets are really quite simple once you’ve done it once or twice.
Look on sunsite.unc.edu for the source.
Is it multiplateform ?


| |/ | | | _ | | | mailto:@Knight_Walker |
| / | / / | | http://www.aros.net/~kwalker |
| \ | ___ | | |
| |\ | | / \ | | The Kobran Imperium (801)265-1299 |
|| || || || _____________________________________/

kwalker at aros.net wrote:

I’m doing a real-time strategic game with network support. The idea is
to build a client-server system. Actually, I can’t do anything because
I haven’t netowrk support on all multiplateform ! Could someone make
TCP/IP network support, with just the necessary funtions (please just
comment the parameters to the fcontions) ???

Well, when the network thread started some time ago, Sam posted a
snippet of code from Maelstrom that is crossplatform between Windows
and Linux (I don’t know about BeOS) that seems to work well enough. I
can send it to you if you want. It’s not that well commented, but if
you know anything about socket-style networking, it shouldn’t be too
bad.

The networking code in Remtris 3 (which runs on Win32 and Linux) is BSD
sockets, and the difference between the two versions is small enough to
be stashed in #ifdef’s.

BSD sockets (as an abstraction) are quite portable (except to the MacOS
it seems, they have what? TLI/STREAMS-based networking?), you can
program directly to them with a few #ifdef’s or a few wrapper functions
(easier).–
Pierre Phaneuf
Web: http://seventh.ml.org/~pp/
finger: pp at seventh.ml.org

Le Fri, 16 Oct 1998, vous avez ?crit :

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???

Well, when the network thread started some time ago, Sam posted a
snippet of code from Maelstrom that is crossplatform between Windows
and Linux (I don’t know about BeOS) that seems to work well enough. I
can send it to you if you want. It’s not that well commented, but if
you know anything about socket-style networking, it shouldn’t be too
bad.

OK, Could you please send it to me ?

Thanks :slight_smile:

Anotehr question, If I build 2 applications, can I connect from the client to
the server if it is running on the same machien ?

Yes. You just set the server to “localhost” with the right port
number, and it should work fine.

Ok, fine :-)>On 15 Oct, Stephane Magnenat wrote:


| |/ | | | _ | | | mailto:kwalker at aros.net |
| / | / / | | http://www.aros.net/~kwalker |
| \ | ___ | | |
| |\ | | / \ | | The Kobran Imperium (801)265-1299 |
|| || || || _____________________________________/

Best regards,

Stephane Magnenat
Stephane.magnenat at urbanet.ch

The networking code in Remtris 3 (which runs on Win32 and Linux) is BSD
sockets, and the difference between the two versions is small enough to
be stashed in #ifdef’s.

I’ve never seen Remtris, but like I said, when Sam posted that code
from Maelstrom, I was surprised how simple it was. Just a couple
#ifdef’s and a few typedef’s and it was the same.

BSD sockets (as an abstraction) are quite portable (except to the MacOS
it seems, they have what? TLI/STREAMS-based networking?), you can
program directly to them with a few #ifdef’s or a few wrapper functions
(easier).

Right, which could prove to be quite a problem. I like being able to
switch between sockets like file descriptors. And I like being able to
use select, read/write, and even tossing 'em to FILE * for use with
printf and stuff. It’s really nice.On 16 Oct, Pierre Phaneuf wrote:


| |/ | | | _ | | | mailto:@Knight_Walker |
| / | / / | | http://www.aros.net/~kwalker |
| \ | ___ | | |
| |\ | | / \ | | The Kobran Imperium (801)265-1299 |
|| || || || _____________________________________/

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???

Why build network support into SDL when both Linux and MS-Windows already
has it? Read up on socket programming. Here is an excellent tutorial on
socket programming for Unix:

http://www.ecst.csuchico.edu/~beej/guide/net

Robert J. Sprawls @Robert_J_Sprawls
Tactical Dynamics http://home.att.net/~sprawlsrOn Fri, 16 Oct 1998 kwalker at aros.net wrote:

On 15 Oct, Stephane Magnenat wrote:

Le Fri, 16 Oct 1998, vous avez ?crit :>On Fri, 16 Oct 1998 kwalker at aros.net wrote:

On 15 Oct, Stephane Magnenat wrote:

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???

Why build network support into SDL when both Linux and MS-Windows already
has it? Read up on socket programming. Here is an excellent tutorial on
socket programming for Unix:

http://www.ecst.csuchico.edu/~beej/guide/net

Thanks for this adresse, it is usefull.
The problem is, win32 doesn’t use exactly the same system. Does gnu-win32 can
compile UNIX program using network withouht any modifications ? Because for my
game I recompile it using mingw32 crosscompiler under Linux. Can you help me
please ?

Thanks,

Best regards,

Stephane Magnenat
Stephane.magnenat at urbanet.ch

Le Fri, 16 Oct 1998, vous avez ?crit :

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???

Why build network support into SDL when both Linux and MS-Windows already
has it? Read up on socket programming. Here is an excellent tutorial on
socket programming for Unix:

http://www.ecst.csuchico.edu/~beej/guide/net

Thanks for this adresse, it is usefull.
The problem is, win32 doesn’t use exactly the same system. Does gnu-win32 can
compile UNIX program using network withouht any modifications ? Because for my
game I recompile it using mingw32 crosscompiler under Linux. Can you help me
please ?

I know Win32 doesn’t use the same system. I take it your using djggp? Or
whatever it’s called. No, it won’t crosscompile from Win32 to Linux/Unix
because all a crosscompiler does is use a different instruction set or
reformat the binary so it is compatible with the file system. Win32 uses a
slightly different parameter system for winsock. I haven’t looked for one,
but there is probably a winsock guide out there somewhere. Use one of the
search engines and look for winsock programming.

Robert J. Sprawls @Robert_J_Sprawls
Tactical Dynamics http://home.att.net/~sprawlsrOn Sat, 17 Oct 1998, Stephane Magnenat wrote:

On Fri, 16 Oct 1998 kwalker at aros.net wrote:

On 15 Oct, Stephane Magnenat wrote:

Hi there…
Stephane Magnenat wrote:

Le Fri, 16 Oct 1998, vous avez ?crit :

I’m doing a real-time strategic game with network support. The idea is to build
a client-server system. Actually, I can’t do anything because I haven’t
netowrk support on all multiplateform ! Could someone make TCP/IP network
support, with just the necessary funtions (please just comment the parameters
to the fcontions) ???

Why build network support into SDL when both Linux and MS-Windows already
has it? Read up on socket programming. Here is an excellent tutorial on
socket programming for Unix:

http://www.ecst.csuchico.edu/~beej/guide/net

Thanks for this adresse, it is usefull.
The problem is, win32 doesn’t use exactly the same system. Does gnu-win32 can
compile UNIX program using network withouht any modifications ? Because for my
game I recompile it using mingw32 crosscompiler under Linux. Can you help me
please ?

Yes, gnu-win32 lets you compile unmodified unix source code programs as windows
applications. However, they run under a slow and nasty unix emulation layer, which you
may or may not like. I suggest you keep on using mingw32 (as it will be faster than
cygwin32), but what we need is some kind of wrapper layer to allow for the different
functionality and naming conventions of the socket implementations.

:slight_smile:
Peter> >On Fri, 16 Oct 1998 kwalker at aros.net wrote:

On 15 Oct, Stephane Magnenat wrote:

Thanks,

Best regards,

Stephane Magnenat
Stephane.magnenat at urbanet.ch

Yes, gnu-win32 lets you compile unmodified unix source code programs as windows
applications. However, they run under a slow and nasty unix emulation layer, which you
may or may not like. I suggest you keep on using mingw32 (as it will be faster than
cygwin32), but what we need is some kind of wrapper layer to allow for the different
functionality and naming conventions of the socket implementations.

There has to be one out there on the net. The Win32 calling convetion is
only slightly different from the Unix version. I find it hard to believe
someone hasn’t done it yet.

PS. Sorry about the empty post. Hit the wrong keys in Pine.

Robert J. Sprawls @Robert_J_Sprawls
Tactical Dynamics http://home.att.net/~sprawlsrOn Sun, 18 Oct 1998, Peter Hawkins wrote:

I’ll correct some misinformation with details later, but the general gist
is:
1. Yes, sockets can be used on Win32
2. Yes, mingw32 can be used to cross-compile socket code.
3. No, you don’t need the slow and nasty emulation layer

Some simple networking code is highest on my priority list right now.
I won’t include it with SDL itself, but I will put it in the examples
and demos archive.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

I’ll correct some misinformation with details later, but the general gist
is:

Oh, rereading the posts I realized the emulation layer was for pure UNIX
socket code. Right. But the differences between Win32 socket code and
UNIX socket code are relatively small.

Though, as Knight pointed out, you can’t use Windows sockets with fprintf()
and fread() and friends.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Le Sat, 17 Oct 1998, vous avez ?crit :

Yes, gnu-win32 lets you compile unmodified unix source code programs as windows
applications. However, they run under a slow and nasty unix emulation layer, which you
may or may not like. I suggest you keep on using mingw32 (as it will be faster than
cygwin32), but what we need is some kind of wrapper layer to allow for the different
functionality and naming conventions of the socket implementations.

There has to be one out there on the net. The Win32 calling convetion is
only slightly different from the Unix version. I find it hard to believe
someone hasn’t done it yet.

So you mean mingw32 will compile unmodified Unix networking program ?
Will the Mingw32 (that is minimal) do this or not ? I think not. Have someone
already done this ?>On Sun, 18 Oct 1998, Peter Hawkins wrote:

PS. Sorry about the empty post. Hit the wrong keys in Pine.

Robert J. Sprawls sprawlsr at worldnet.att.net
Tactical Dynamics http://home.att.net/~sprawlsr

Stephane Magnenat
Stephane.magnenat at urbanet.ch

Hey,

Quick question (probably in the painfully obvious category) :

How do you READ a SDL_Color from the current palette for a surface?

setting up the palette is really obvious, but I can’t see how to read from it
without kludging it.

thanx,
/dev—
// David E. Vandewalle |Weinberg’s Law: If builders built
// vandewal at skyblue.com | buildings the way programmers wrote
// david.e.vandewalle at lmco.com | programs, then thefirst woodpecker that
// | came along would destroy civilization.