Page 1 of 1

DirectPlay Networking (with sources)

Posted: Tue Aug 15, 2006 10:47 pm
by Derlidio
Howdy...

Some time ago we have made a DirectPlay wrapper DLL using PureBasic. This DLL covers almost all features of DirectPlay, has full documentation in CHM format for its usage and command set, besides sample applications in some of the most common programming languages around.

We are now making it a free product and opening the sources for the community in the hope that they will be useful. So, you're free to use the library, portions of the source, or even the entire source in your commercial (or non commercial) applications, free of charge and royalty-free.

There are two versions of the source in the package (which you can download through the link at the end of this message): One is the stable version made with PB 3.94, and the other is a beta version for PB 4.

The version compiled with PB 3.94 has proved to be fully stable on all tested systems. The version compiled with PB 4.0, though, is not working so well. It has a knwon problem which arises when the library is stressed under multi-processor machines (including P4 HT).

We have faced a problem like this one when building the library with PB 3.94, which was caused by non-safe string allocations in multi-threading while working under stress on multi-processor machines. At that time, this problem was easily solved by enclosing thread string allocations inside Critical Section blocks.

When porting the code for PB 4.0 we kept all thread-safe measures, but it seems that something has changed from PB 3.94 to PB 4.0 which is now impairing the library to work properly. We have added an error handler to the 4.0 code so we could try to follow the error, but it is not pointing to a single line of code. Sometimes it happens on a 'procedure return' statement, while others it happens when the code tries to access some of the DirectPlay Objects methods.

We will keep trying to find the problem with our code for PB 4.0 in our spare time, but we would appreciate if some of you could also give it a try. The sources are well documented, and if for nothing else, they could be used as a source of research material for how to use COM in PB, how to code using interfaces, and how to handle thread safe applications.

Note: Most of the commenting scheme used on the sources will be best viewed using jaPBe instead of the official PB IDE.

best wishes...

Sources for the library:
http://www.krylarskreations.com/downloa ... Source.zip

Official web page:
http://www.krylarskreations.com/knl.shtml

Derlidio "PJoe" Siqueira
derlidio@1338inc.com
1338 Enterprises Inc.[/url]

Posted: Tue Aug 15, 2006 11:05 pm
by mskuma
Thanks very much - this ought to be interesting!

Posted: Tue Aug 15, 2006 11:06 pm
by netmaestro
This is really great, thanks a million!

Posted: Tue Aug 15, 2006 11:41 pm
by Joakim Christiansen
Nice! :D

Posted: Wed Aug 16, 2006 12:27 am
by techjunkie
Incredible work! :shock: Respect! Thank you!!!

Posted: Wed Aug 16, 2006 12:36 am
by Dare
techjunkie wrote:Incredible work! :shock: Respect! Thank you!!!
Yes. I agree. Thanks.

Posted: Wed Aug 16, 2006 3:09 am
by Shannara
Quick question, was this tested with the threadsafe compiler switch turned off?

Posted: Wed Aug 16, 2006 3:17 am
by Derlidio
@Shannara

Yeap... This has been tested with both, on and off (on PB4 code only, cos the 3.94 version doesn't need any other safety measures besides those already in the code). Actually, with the thread safe compiling turned on the code breaks even faster.

Posted: Tue Sep 19, 2006 4:50 pm
by Psychophanta
:shock: Useful
Thanks a lot!

Posted: Tue Sep 19, 2006 8:15 pm
by NoahPhense
dude.. that's some tight stuff..

- np

Posted: Tue Sep 19, 2006 9:03 pm
by thefool
Very interesting!
I already have a few ideas of what i could use this to :)

thanks!