Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / DarkTCP plugin now available

Author
Message
SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 9th Nov 2005 11:30
I have pieced together a simple and functional TCP/IP plugin for DBP. This plugin is open-source and does NOT require .NET!

Available commands are:
DS_Connect
DS_Discon
DS_Send
DS_Recieve

Easy eh? Let me know what you think, download attached.

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 10th Nov 2005 04:57
Well done. There are a couple of these kind of plugins floating around at the moment, but another one can't hurt. For your first C++ program it is impressive, however try to space out your source a bit, it's harder to read when its all squashed up together.

Tempest - P2P UDP Multiplayer Plugin - 49%
SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 10th Nov 2005 05:38
ty for the praise

The other two plugins I am aware of are Exeat's plugin, which did work for me until recently when it started throwing exceptions (and he can't help b/c he lost the source), and Cattlerustler's plugin, which requires .NET and he stopped work on, that's why I've made this one to fill the void. The game project I'm working on is useless without TCP/IP, so I had to do something.

I'll try make the source more legible.

The Glasswalker
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Dec 2005 16:41
Hey, is it possible to release a version of this capable of transmitting and recieving raw data? (bytes and words and such) I am assuming that you can't do that with this version because it could interpret special chars (like char 10) as terminator, or other functions.

I am working on a linux based server to compliment a game I am working on, but it will be highly inefficient to send plain text data for all kinds of stuff that really could be sent as a single byte or word.

Thanks!

Arcane Networking: Web hosting and dedicated servers for the masses! High Quality, Great Service, Low price! Need I say more?
http://www.arcanenetworking.com/
SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 20th Dec 2005 06:09
Did you want it to use ByRef and Size for exchanging data or would you rather have a PUSH/POP type buffer system?

Prime_8
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location: Canada
Posted: 29th Dec 2005 08:00
i like the simplicity .

I made a web servein VB6 using winsoc so i like TCP/IP world .

don;t care for teh built-in DBP commands.

any chance of a simple

DS_Listen (ip, port)

heheh that would be cool .

2 + 2 = 5 (for extreamly large values of 2)
dapaintballer 331
18
Years of Service
User Offline
Joined: 20th Dec 2005
Location: USA
Posted: 31st Dec 2005 03:28
yea, how would you code a program that listens to a port?

so if i said in my program


and the program for my computer would say


~`Gamerssoft.com'~
SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 31st Dec 2005 17:13 Edited at: 31st Dec 2005 17:16
I can add a DS_Listen command no problem, but i'm not skilled enough yet in c++ to code the dll to act like a true server, like handing off connections to other ports and keeping track of multiple connections. So for now the dll will be limited to one incomming connection (unless you loaded it multiple times for each socket you wanted to use, not sure if that would work).

I'll put it in hopefully today and post it up.

SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 31st Dec 2005 19:47
Ok, all done. Here is the new version with DS_Listen.

Attachments

Login to view attachments
dapaintballer 331
18
Years of Service
User Offline
Joined: 20th Dec 2005
Location: USA
Posted: 31st Dec 2005 21:40
wow, thanks

can you make a quick simple program source that shows how to send, wait for a response, and a small server program that when it recieves somthing it sends a reply back depending on what was sent (like a y or n)

and for DS_Listen do you put the port in ()'s?

~`Gamerssoft.com'~
dapaintballer 331
18
Years of Service
User Offline
Joined: 20th Dec 2005
Location: USA
Posted: 31st Dec 2005 21:43
whoops, i should have read the new readme, sorry

~`Gamerssoft.com'~
SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 31st Dec 2005 23:27 Edited at: 31st Dec 2005 23:34
For a simple server do:

and for a simple client:


btw, there's no winsock error checking routines in these examples, but of course in your real program it's always a good idea to check for errors after each DS call.

SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 1st Jan 2006 23:09
Version 0.2b BETA now available.
Fixes incorrect buffer size and updates sourcefile.

Attachments

Login to view attachments
dapaintballer 331
18
Years of Service
User Offline
Joined: 20th Dec 2005
Location: USA
Posted: 2nd Jan 2006 21:53
what is the main difference between ds_listen and ds_Recieve?

~`Gamerssoft.com'~
SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 3rd Jan 2006 04:17 Edited at: 3rd Jan 2006 05:04
DS_Listen only establishes that you want to accept a connection.
Once the connection has been established, DS_Recieve recieves the data that comes in.
Forgive me if I over-simplify, but I'm trying to cover the broadest audience possible:

Think of it like a telephone. DS_Listen tells the computer to wait until the phone rings and then answer it. DS_Connect tells the computer to dial a number. DS_Recieve is like the earpiece, you get data from DS_Recieve. DS_Send is like the mouthpiece, sending out the data you want to send. It would not be practical to use DS_Listen to accept connections and data b/c each time it would have to hang up the phone, then the client would have to dial again, then the server would have to answer the phone again, then get more data.

So from a server's point of view, this is what happens:

from the client's point of view:

How you format your messages doesn't matter, like instead of saying "PosPie#45,27,33" you could also say "position of pie is at 45,27,33" or "F6002D001B0021" where F6 is the command number in hex, 002D is hex for 45, etc etc. It's best send the smallest amount of characters possible to help your programs communicate faster. It doesn't matter much for peer-to-peer connections like the ones currently supported by this plugin, but later if I implimint true server-like commands and you get into dozens, hundreds or even thousands of connections, you will appreciate every single byte you can squeeze out of a packet. When I impliment the ability to send/recieve raw, that will further decrease packet sizes.

I am considering adding a DS_MsgWait to check for messages waiting to be recieved instead of having to always DS_Recieve and parse to see if it's data or null.

dapaintballer 331
18
Years of Service
User Offline
Joined: 20th Dec 2005
Location: USA
Posted: 12th Jan 2006 03:08
excelent analogy, thanks, that helps a lot

~`Gamerssoft.com'~

Login to post a reply

Server time is: 2024-04-16 11:15:10
Your offset time is: 2024-04-16 11:15:10