K-NetLib a great network library

BlitzMax Forums/BlitzMax Programming/K-NetLib a great network library

Filax(Posted 2006) [#1]
Hi

I have fond by hazard a fantastic network library !
compatible blitz3d, purebasic, C++, delphi etc

http://www.krylarskreations.com/devtools.shtml

Features ? :

* Client/Server and Peer-to-Peer support

* Byte/Word/Long/Float/String/Array sends and receives
* Group controls

* Passive file transfers that allow your users to continue
chatting/playing while the file transfer in the background

* Built-in Bezier-Spline functionality to allow easy
calculation of smooth lines for multiplayer games

* Advanced error-handling routines to keep you informed
during your development cycle

* INI file commands to allow loading and saving of
initialization strings for your K-NetLib application

* Ban controls that allow one-time kicks, bans, and permanent bans stored in a file for your game

* ...and more!

It's very easy to code ! i have made thanslation for
blitzmax, here is the code, and i have made online
test with more than 8 player, it's really speed !

It's a great great job !

BLTIZMAX INCLUDE : Include "K-NetLib.bmx"



And another used include : Include "K-Nework.bmx"




and one example client / server :






Boiled Sweets(Posted 2006) [#2]
awesome work Filax but how about a Blitz 3d version ;-)


Filax(Posted 2006) [#3]
In the original package ! (see site) there is an example for
blitz 3D !

Here is an example with spline :




Boiled Sweets(Posted 2006) [#4]
AHA! Cool!


Filax(Posted 2006) [#5]
See spline example !


Jake L.(Posted 2006) [#6]
Yes, it's great. I tested it on it's release but ran into compatibility-issues. It refused to initialize on my laptop allthough other Apps/Games using Directplay worked well on this machine.

Beside that I liked it very much.


kfprimm(Posted 2006) [#7]
Just found a bug, it's in the original k-netlib.bb
Const KNL_INI_LinkTunning:Int = 128 		' Allows DX To tune the network flow.

needs to be,
Const KNL_INI_LinkTuning:Int = 128 		' Allows DX To tune the network flow.

It's amazing what Strict finds :)


Booticus(Posted 2006) [#8]
Thanks Filax! Awesome as always!


@rtur(Posted 2006) [#9]
It requres DirectX 9 to work, as I understood. It is not very good thing :(


Filax(Posted 2006) [#10]
Who have not directx 9 installed ?


@rtur(Posted 2006) [#11]
I'm developing casual games with B3D, so targeting on old systems, office comps etc with minimum DirectX 7 installed.
But this lib is realy good. Shame if it cannot be run on systems with only DirectX7 installed:(


Armitage 1982(Posted 2006) [#12]
@ @rtur : And why not offer the redist DX9 with your game ?

Exellent piece of software !
Thanks for this Filax ;)


ckob(Posted 2006) [#13]
hmm anyone get the file sending working with this?


Filax(Posted 2006) [#14]
? what ckob ?


FlameDuck(Posted 2006) [#15]
Who have not directx 9 installed ?
People with a Mac.


Filax(Posted 2006) [#16]
Lol it's sure Flame :) but mac people don't usee DLL too :)


Winni(Posted 2006) [#17]
>>Who have not directx 9 installed ?
>People with a Mac.
People with Linux.

BlitzMax was designed to be platform independent, but by using DirectX you give that up and tie yourself to Windows.


Dreamora(Posted 2006) [#18]
It was designed to support platform independence. This actually does not mean that you need to support it. Especially if you are a one men or small team. BM is not "copy and one click" multiplatform.


Winni(Posted 2006) [#19]
Yep, there is no copy-and-one-click-multiplatform tool - Java included. And of course you are right, you do not have to support multiple platforms.

However, there seems to be a tendency that many of the third party add-ons for BlitzMax are going to be available for the Windows platform only. And that is NOT a good development.


tonyg(Posted 2006) [#20]
I must be missing something here.
Filax has wrapped a Windows only (DirectPlay), non-Bmax product and made it freely available.
How is he supposed to make it magically cross-platform?


Dreamora(Posted 2006) [#21]
Winni: Nobody prevents you from writting a cross plattform version or a similar modul which is cross plattform.
Its the decision of the ones writting the moduls for which plattform it is and I'm glad that at least 3rd party modul writters make sure that the stuff works with acceptable hardware / driver support on current gen windows systems, unlike Max2D.


ckob(Posted 2006) [#22]
well you could always try to make directx crossplatform ;P

just kidding for those without a sense of humor


Filax(Posted 2006) [#23]
tonyg : Maybe by re-compiling the DLL for others
OS ? library is made with purebasic ? i don't know...


tonyg(Posted 2006) [#24]
The lib is written in Purebasic but uses the DirectPlay8 interface.


Stu_ovine(Posted 2006) [#25]
Typical just as I find a good library - development stops on it :S


Winni(Posted 2006) [#26]
TonyG:
I´m not saying anything against Filax´work! I only said that in general it is not a good thing that most of stuff coming out these days is Windows-only - just like there was no other platform supported by BlitzMax.

Dreamora:
You´re right. Like the old Fritz said: "In meinem Land soll jeder nach seiner eigenen Facon glücklich werden." For non-german speakers roughly translated: In my country everybody shall become happy following their own beliefs. There´s nothing wrong with that.

As for the idea with writing the module: Thank you, but when time allows I am already porting an NNTP server that I had written in C# to BlitzMax. By the way, the Max version uses TeaMonkey´s SQLite wrapper and SQLiter from Pyroplaysite - cross platform stuff.

-- If -- I finally have enough time to finish it, I will post it here in case somebody might have a use for it. At the moment, there is a good chance that I might stroll down the Java alley, at least for a while to see how life is down there.

Anyway - The C# version still is in two versions on my website (and under GPL), one for .NET with an installer and bundled with the MSDE 2000 (a remainder from the time when I was still using Windows: www.wmaus.net/nomad.zip), the other version is source code only for Mono and MySQL (www.wmaus.net/MonoNomad.zip). Once you get it compiled, the Mono version will work on OS X, Linux and Windows.

I wrote that thing to learn C#, and even though the source code is multithreaded, it´s dirty and really sucks. I already like my BlitzMax version better; it naturally is not multithreaded, but it is MUCH "cleaner" and solves some problems that the C# version had.

Whatsoever, none of that has anything to do with the original subject, which for me simply is: I find it sad that people use BlitzMax mostly for Win32-only stuff, even though it is capable of doing so much more. Period and good night. ;-)


xlsior(Posted 2006) [#27]
I´m not saying anything against Filax´work! I only said that in general it is not a good thing that most of stuff coming out these days is Windows-only - just like there was no other platform supported by BlitzMax.


what do you expect?

Windows has a 90% market share, while Apple and Linux are both hovering around 5%. And on top of that, Apple's 5% is divided between PPC and Intel.

Until those numbers change significantly, nothing is going to change. You're bound to see many external libraries tied to the individual platforms -- predominantly windows, thanks to its huge market share.


Filax(Posted 2006) [#28]
I agree ...


Winni(Posted 2006) [#29]
> what do you expect?

I certainly don't expect it, but I wish for this: A change in the mindset.


> Until those numbers change significantly, nothing is going to change. You're bound to see many external libraries tied to the individual platforms -- predominantly windows, thanks to its huge market share.


Which in itself is a self-fulfilling prophecy, fulfilling the circle to ensure that Windows stays the predominantly platform.

By the way, the market share of the target platform is not always relevant for the income it generates. You will find enough people who will tell you that OS X, although it has a much smaller share, generates at least as much income for them as the Windows version of their products. But that certainly cannot be generalized and what works for some companies does not necessarily work for others. However, I think it is safe to say that Mac users typically are willing to pay for good, Mac-like stuff, while Linux users usually mostly want "free" (as both in beer and speech) stuff. And on Windows... One of my old companies went bankrupt, but you can still download our products from the eDonkey network. You get the idea.

Anyway, guys, thanks for the discussion and your comments. Now let's move on to a new topic. ;-)


Tyler(Posted 2006) [#30]
Hmm, seems I'm getting a compile error involving CStrings (and although I know it has something to do with the $z on the end of some of these variables, I have no clue how to fix it) Any help would be great :D Thanks.


xlsior(Posted 2006) [#31]
which in itself is a self-fulfilling prophecy, fulfilling the circle to ensure that Windows stays the predominantly platform.


Yup.

Wether we like it or not, Microsoft has an amazing cash-cow going, and they are doing everything they can to keep it that way. They are going out of their way to keep 'proprietary' information from leveling the playing field, even after being tied in court for year upon year, and hundreds of millions of euro's in fines for failure to comply.


ckob(Posted 2006) [#32]
well I still havent got the file sending crap to work lol.


Steffenk(Posted 2006) [#33]
Maybe i'm a bit off-topic, but I think this http://enet.bespin.org/ (enet) looks like quite a good netlib, has anyone done a bmax wrapper for it?


deps(Posted 2006) [#34]
gnet is based on it. :)


Armitage 1982(Posted 2006) [#35]
A Great lib Filax :)
I know "K-NetLib.bmx" need to be modify for our need but :
Local LogFile:String = AppDir$ + "nsg_server.log"
...
Local LogFile:String = AppDir$ + "nsg_client.log"

Should be :
Local LogFile:String = AppDir$ +"/"+ "nsg_server.log"
...
Local LogFile:String = AppDir$ +"/"+ "nsg_client.log"

Thanks for your work :D


Filax(Posted 2007) [#36]
Do you think that KNetlib is equal to RakNet lib ?
Because i find that the Raknet library is a little bit
abusive ;/ 100$ only for one product :(


*(Posted 2007) [#37]
Its a nice lib, but I will continue work on my own BlitzMax networking library as I need it to be able to be compiled on Linux, Mac OSX as well as Win32 that was the main reason for buying BlitzMax :)


panton(Posted 2007) [#38]
Where to download the original version? i want a blitz3d version


andre72(Posted 2007) [#39]
You just have to fellow the Filax in the first post to find it ...
Here's the link to the download section:
http://www.chromatick.com.br/knl/index.php


panton(Posted 2007) [#40]
but where to download the blitz3d version?