
DarkTCP Plugin by SirFire
Version 0.1 BETA


Legal mumbo-jumbo:
------------------------------------------------------------------------
This plugin is not affiliated with The Game Creators.  I am not either.
Use this plugin at your own risk.  You are free to modify and
distribute any of the included files for any purpose.  If you make
any serious money with this plugin, I wouldn't mind recieving some
spare change.  ;)


Available Commands:
------------------------------------------------------------------------
DS_Connect (<ip string>,<port integer>)
DS_Discon ()
DS_Send (<text string>)
DS_Recieve ()


Description of Commands:
------------------------------------------------------------------------
DS_Connect - Example:  a=DS_Connect("68.111.53.43",80)
	This command will connect to a server on a port and return
	0 if successful or a winsock error code if unsuccessful.

DS_Discon - Example:  a=DS_Discon()
	This command will disconnect from a server and close a socket.
	Returns 0 if successful or a winsock error code if unsuccessful.

DS_Send - Example:  a=DS_Send("Hello World!")
	This command sends a string.  Returns 0 if successful or a
	winsock error code if unsuccessful.
DS_Recieve - Example:  a$=DS_Recieve()
	This command recieves a string.  Returns "NULL" if there is
	no string to recieve, or "ERR" if a winsock error occurred.


Installation:
------------------------------------------------------------------------
1.  Close any instance of DBP that is running.
2.  Place the darktcp.dll file in your DarkBasic Pro\compiler\plugins-user
folder.
3.  If desired, modify your editor's keyword file (see below).
4.  Re-start DBP


General Notes:
------------------------------------------------------------------------
1.  This program has not been tested for any other TGC product.
    It may or may not work on anything other that DBP.
2.  When sending a string, you must provide your own end-of-line
    character in order to execute the send.  The required character
    is chr$(10).
3.  The current string size limitation is 254.
4.  This plugin does not require .NET
5.  For explanations of winsock error codes, see
    http://www.sockets.com/err_lst1.htm
6.  Visit the DarkTCP forum board on my website to stay current:
    http://manifestdreams.no-ip.info/
7.  If you want the keywords to show up in the IDE, add these lines
    to your BIDEKeywords.ini file:
	DS_Connect=commands\darktcp.dll\DS_Connect.htm=(IPstring,port)
	DS_Send=commands\darktcp.dll\DS_Send.htm=(String)
	DS_Recieve=commands\darktcp.dll\DS_Recieve=()*no parameters*
	DS_Discon=commands\darktcp.dll\DS_Discon.htm=()*no parameters*
8.  Included source code was written in Visual c++ 2005.
9.  I am a C++ noob.  This is my first c++ "program".  So if you
    find any bugs, have suggestions, or have made improvements, please
    visit my website mentioned earlier.


Example program:
------------------------------------------------------------------------
a=DS_Connect ("127.0.0.1",9999)
if a<>0 then shower(a)
a=DS_Send ("dfdasfads"+chr$(13)+chr$(10))
if a<>0 then shower(a)
for x=1 to 10
a$=DS_Recieve()
print a$
wait key
next x
a=DS_Discon ()
if a<>0 then shower(a)
wait key

FUNCTION shower(a)
print "Error "+str$(a)+" reported by Winsock."
endfunction
------------------------------------------------------------------------


Thanks:
Sarcasm Stealth Squad
APEXnow
and others