Advertisement

networking

Started by June 13, 2000 03:10 PM
6 comments, last by djsteffey 24 years, 5 months ago
Is there any way to test multi-player via tcp/ip with only one comp. Like could i start one game as the server then start another game as the client and tell the client to connect to my own IP address ? "Now go away or I shall taunt you a second time" - Monty Python and the Holy Grail

You can set up your server on your machine and then tell your client to connect to "localhost", that''s how I test a lot of my code when I''m just starting out. It also helps you make sure your code IS working, and packet loss is not to blame for something going wrong(of course you need to correct for things like that later, but it helps verify your initial work).

Advertisement
what would be easier to woirk with ?
Direct Play or use windows sockets directly ?
MY game runs in DirectDraw full screen exclusive.....
if I use the windows buttons in one session of the game to switch to the other session, will there be a problem ?

I''ve never used direct play. I prefer sockets myself, and if you are interested in portability(to say Linux) sockets are the way to go(almost every platform with networking supports sockets style access).


If you do use sockets, you need to write a layer on top of it to provide additional functionality(this is similiar in purpose to what DirectPlay does although your implementation will probably vary).


I have a library I wrote for sockets(works on both *nix and Windows) it supports a message passing style of connection. A client connects to a server and gets a message queque, the server is sent a message in its message queque. The server can create additional named message queques on the client. A "message" in this case is a message number(int), and an array of bytes(whose interpretation is up to you). Its a fairly simple abstraction, but it makes programming a client/server app pretty simple. It uses lots of threads for scalable performance issues and to make up for differences in the Windows and BSD style sockets handle asynchronous I/O. If you''re interested in talking further, or want to look at some of my code, I''ll be glad to help.

If you could mail me your code and let me have a look, it would be greatly apprecieated..........I was thinking of doing it that way by using sockets and just writing my own functions using sockets to do what I want.......but I am not real familiar with sockets......although I do have this programming book but it doesnt go into much detail about networking or sockets.......
I could look over your code and it would help me to learn it
mailto:djsteffe@unity.ncsu.edu


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

Advertisement
I could use your code as well.
razorz@www.com thanx in advance
quote: Original post by ncsu121978

what would be easier to woirk with ?
Direct Play or use windows sockets directly ?


Personal choice, the general side tends to lean toward sockets, but I would guess that this is primarily because of the lack of tutorials on directplay.

Once you get past dplay initialization troubles it''s easy sailing.
___________________________Freeware development:ruinedsoft.com

This topic is closed to new replies.

Advertisement