RakNet Wrapper 0.5 Released

Blitz3D Forums/Blitz3D Userlibs/RakNet Wrapper 0.5 Released

RAKNET WRAPPER 2.483 VERSION RELEASED:

Well, The Wrapper is growing good!

It Includes:
- All Server Functions
- All Client Functions
- All BitStream Functions
- All Statistics Functions

Decls file is not commented, because it is generated automatically using Flex for Windows.

RakNet Free Wrapper Download:
www.lcuriel.arrakis.es/raknetwrapper2483.rar

Buy the Source Code of the Wrapper (2.483) from:
www.lcuriel.arrakis.es/raknet
Price: 20€

If you find useful this library, and you want to donate, please visit:

www.lcuriel.arrakis.es

History:
0.5 (26-08-05): Initial Release
0.6 (27-08-05): Added Index Player and better test.bb
0.65 (28-08-05): Added Kick player and manual kick in test.bb
0.75 (07-10-05): Updated to the 2.4 official version.
0.76 (5-12-05): Updated to the 2.415 official version.

RakNet Official Web:
www.rakkarsoft.com

The .bb test included is too basic, please someone makes a better one!

And the best thing: IT IS FREE! (For commercial you only need permission)

Cheers, KuRi.

Great!!

Nice work KuRiX.

And thanks..

/Alienforce

I think that Surreal won't update BlitzPlay anymore, and this library offer ALL the functions that BlitzPlay has and much much more!.

So let's test it to make it work perfectly!

I suggest you to download the free version of Raknet that comes with samples in C++ that are very easily adapted to my wrapper.

I am now trying to connect and disconnect players, use passwords, update positions, etc... and is working perfectly!

Hi Kurix,
Looks like a great looking api, so I'm going to download and check it out. thanks

I am going to change my blitzplay network code to this, to see if it is good. This is why i have made the wrapper. But please, if you make good tests, please let me know how it is... (faster, reliability, etc...)

EDITED: New 0.6 version Released, including the function RN_PacketGetPlayerIndex to know the index of the Player. Anyway the automatic index of raknet seems not to work perfectly and in the forums say that you must use your own.

Link: www.lcuriel.arrakis.es/RakNet0.6.rar

Now the help files are included in the rar file too. And the Test.bb file has more msg support for testing!

hope you didn't plan this as your next userlibs product :(

3cho, i don't understand your post. This is a free wrapper i am doing for personal use but i want to share with all b3d users (future versions too). I want this to be the best udp multiplayer library for b3d.

And kode is not an userlib product.

I think i don't understand what you mean :(

Thanks for the update Kurix.

I wish you'd offer a zip too.
8)

lol, sorry i mean your [K]ODE product
thx for wrapper

Thx for the wrapper, it's great! Exactly what I need.

Regards - Xaron

Hey, i have changed some things in the DLL so now you can use the internal Indexes for the players.

So you can get a number from 0 to (MAXIMUMPLAYERS-1) from every packet you receive to know who has sent it!!!

Changes in the 0.7 version!

Great, huh? xD

Thanks, very usefull!

Hey, this could be useful... I'm not making any multiplayer stuff now but for future projects this would probably rock!

Thanks a lot KuRiX for sharing your work. It seems RakNet is an excellent solution for MP stuff.

Maybe you can help me so I don't have to read tons of docs first: Is this architecture using one (the first) player as the game server? And if so, is it possible to hand over the server job to a client (eg. when the hosting player wants to quit without to end the game for the other players)?

Well, Raknet is a very very powerful library, and is still in development (so future updates will be possible).

You can use a peer to peer functions, or use the in built client server functions (that uses only the peer functions). The problem is that i have not wrapped yet all the peer to peer functions, because i only needed the client server and i needed asap.

Anyway there is a new version available (2.4) and i want to update the wrapper, and perhaps i will include some new functions.

I must say that i am using it for client sever game and is very fast and stable!

Cheers, KuRi!

Thanks, I still don't fully understand what you mean by Client/Server vs Peer2peer. When you say you want to replace BlitzPlay then I assume it is using the same structure (one player is the host, the other players are clients).

Unfortunatly BlitzPlay doesn't support taking over the server task by an other client. Well, in the old (Freeware) version of BlitzPlay it was supported, but then SurReal rewrote the entire thing from scratch with a new concept and without the mentioned support for server takeover.

The reason why I want this feature is the fact that a game may last much longer when the intial host doesn't need to stay connected all the time.

Well, in some way, Blitzplay is based on peer2peer connection too.

Basically, in UDP, you have peers, that can connect to other peers. If you consider one peer as beeing the server (so it broadcasts all the messages), then it is a client/server (a client/server is always an abstract of peer2peer).

So, if you use a peer2peer connection and you decide who is the server, you can of course select other host when one leaves...

This is not easy to explain, but i can guarantee that you can do it (if i wrap all the peer functions of course, xD)

Due to the incremented interest in the raknet wrapper, the library has been updated to the latest version of raknet, the 2.4

You can download the latest version of the wrapper (the 0.75) in the top of this page!

enjoy!

Thanks a lot for sharing. VERY useful work.

Thanks KuRiX. Excellent work.

RakNet is really much better than anything I tried yet. The seperate thread makes things very quick. Even with 3 clients onscreen on localhost it's still pretty fast. And it works pretty well together with ZoneAlarm Firewall. It asks one time (didn't even ask for server rights, surprisingly) per process. I've seen other solutions that required to lower the security level of zonealarm, or libs that used to throw a dozen of firewall alerts to the user (especially DirectPlay stuff).

There are a few drawbacks, eg: the RakNet Process will be listed as a nameless process in the task manager. This may be not a problem with the XP task manager that shows the file path, unlike win98/Me that will list the process name only. Looks pretty scary when you see blank processes in the manager (especially when you have no idea what it is).

And there have been a few messed up messages, like when I send a chat message and the server says "received data of unrecoginzed type" (or something). So I think it will be a good ideat to work out some acknowledge and error detection system, eg. a packet checksum. And a handshake that will allow the server to send the next packet.

Now I have a dumb question (probably I shoulda know, sorry): Is this System using UDP?

Well, here are a few answers.

First of all, Raknet is only UDP.

The second is, due to the first answer xD, that when a message arrives, arrives perfect. So, if you are having troubles sending chat messages i suggest you to send them like BitStreams insted of char *.

FarFlame are asking lot of questions to me via email. I think that this is a best place to ask. Perhaps i will post here his emails and my answers.

Cheers, KuRi.

i'll have to check out raknet with wrapper too.... looks good in any way ;)

I am working in a multiplayer raknet game, but i would really appreciate someone making a good raknet demo to include with my wrapper...

Cheers!

KuRiX: Great stuff!
I couldnt find out wheter Rakknet is PC only, or cross-platform...Do you happen to know?
If so, a module for BlitzMax could be created.

It is multiplatform!!! Tell me how, and i will make a BlitzMax Version!

Hi KuRiX,

I'm interested to use Raknet in a future project now being conceptualised and documented, a follow-up to a multiplayer game I have been working on in the past.

You'll have to write a "mod" for BlitzMax.
A simple example can be found here:
http://www.blitzbasic.com/Community/posts.php?topic=42128

ps: KuRiX, I read it is also possible to work with a "master server" or some kind. How can it be done with your wrapper?

Mmm, interesting, so BMax can directly compile C Code! Wow!.

The problem is that i don't have BMax.

Anyway i think that including directly RakNet C Files will be very hard, it is programmed in hard C++. Is it possible to make a lib or dll for BMax?

And about the master server, the functions are not wrapped at this moment, but should be easy to do! I will look at them for the next wrapper version...

Hi KuRiX,

If you make a DLL, you are stuck to the Windows platform.
For BlitzMax development, IMHO not a wise decision.

Looking at the example, they "import" a C file.
You can do the same fromout BlitzMax: just import it,
you don't need to touch the C files.

To be honest, I lack experience on mod writing,
perhaps you could ask some more experienced mod writers
in the BlitzMax forums.

BlitzMax is the way to go for the future. I am waiting for the official 3D module for larger projects, but I love the language and it's worth buying! I'm not investing more time to program under Blitz3D for larger projects.

I have a Mac, so if you might decide to write the BlitzMax MOD, I'm happy to bugtest it for you.

http://www.blitzbasic.com/Community/posts.php?topic=42290

Well, not having BMax, i don't see like so easy job. I will think of it later...

ok cool, I'll use Bnet instead

Thanks for your help anyway, very much appreciated!

Well, i have created a mini web page to download the latest version of raknet (still 0.75, very very stable).

I have received some emails about buying source code for the wrapper, so i have decided to add a button to buy the source code of the Raknet Wrapper, for those interested. (Visual C++ 6.0)

This could be of interest if you want to know how to develop a wrapper or if you want to add the rest of the functions to the wrapper by yourself.

However the compiled wrapper will always be free.

Cheers, KuRiX

I would be also VERY INTERESTED in a version of your wrapper for BlitzMax !!!!!! And I am sure it's the case for a LOT of people out there....

Is not possible to use the same dll for blitzmax? I don't have blitzmax...

Why do I keep getting a Server feed of "Unknown Message Type (Type = -1)"? I'm trying to use the example to fit my game but it's not working well. Any help? I just want to run an update for client, and a seperate update for server.

The functions included that are needed is a simple chat(broadcast), Player positions (x,y,z,"yaw"), and events (ie. explosion, bullets, activated somthing, etc).


Any helpers???

Post some basic code so i can help ;)

That's the problem I don't know where to start.

I want to use seperate Functions IE...

Function Host()
RakNet Here
End Function

Function Join()
Stuff Here
End Function

Function UpdateClient()
etc
End Function

Function UpdateServer()
etc
End Function

Well, let's begin:

Host:
; Initialize the server.
Global Server=RN_GetRakServerInterface()
ok=RN_ServerStart(Server,8,0,0,60069)


Join:
;Initialize the client
ip$ = "localhost" ; CHANGE THIS TO THE SERVER IP
Global Client=RN_GetRakClientInterface()
RN_ClientConnect(Client,ip$,60069,0,0,0)


UpdateClient:
;Receiving
	packet=RN_ClientReceive(Client)
	While (packet)
		msg$=RN_PacketGetData(packet)
		BitStreamIN=RN_BitStreamCreateFromPacket(packet)
		MessageID=RN_BitStreamReadUnsignedChar(BitStreamIN)

		;MSG TYPE
		Select MessageID
			Case ID_CONNECTION_REQUEST_ACCEPTED
				Print "I am accepted, i am number : " + RN_ClientGetPlayerIndex(Client)
		
			Case ID_REMOTE_NEW_INCOMING_CONNECTION
				Print "New Remote Incoming Connection:"	+ RN_PacketGetplayerIndex(packet)
				
			Case ID_DISCONNECTION_NOTIFICATION
				Print "We have been disconnected!"				

			Case ID_REMOTE_DISCONNECTION_NOTIFICATION
				Print "Remote Client Disconnected:" + RN_PacketGetplayerIndex(packet)

			Case ID_REMOTE_NEW_INCOMING_CONNECTION
				Print "New Client Connected"			

			Case ID_REMOTE_EXISTING_CONNECTION
				Print "A Client Was Already Connected : "  + RN_PacketGetplayerIndex(packet)
				
			Case ID_RECEIVED_STATIC_DATA
				Print "Server Static Data"
				
			Case ID_REMOTE_STATIC_DATA				
				Print "Remote Static Data: " + RN_PacketGetplayerIndex(packet) + " : " + RN_BitStreamGetData(RN_ClientGetStaticClientData(Client,RN_PacketGetplayerID(packet)))

			;User Defined
			Case ID_CHAT
				Print "Chat(" + RN_PacketGetplayerIndex(packet) + "): " + Mid(msg,2,Len(msg)-1)
		
			Default
				Print msg$
		End Select
		
		packet=RN_ClientDeallocatePacket(Client,Packet)
	packet=RN_ClientReceive(Client)

	Wend


ServerUpdate:
	;Receiving
	packet=RN_ServerReceive(Server)
	While (packet)
		msg$=RN_PacketGetData(packet)
		BitStreamIN=RN_BitStreamCreateFromPacket(packet)
		MessageID=RN_BitStreamReadUnsignedChar(BitStreamIN)

		;MSG TYPE
		Select MessageID
			Case ID_NEW_INCOMING_CONNECTION
				Print "New Incoming Connection"
				Print "Player Number: "+RN_PacketGetplayerIndex(packet)
				
			Case ID_DISCONNECTION_NOTIFICATION
				Print "Client Was Disconnected:"+RN_PacketGetplayerIndex(packet)

			Case ID_RECEIVED_STATIC_DATA
				Print "Static Data Client:"+RN_PacketGetplayerIndex(packet)+" : "+RN_BitStreamGetData(RN_ServerGetStaticClientData(Server,RN_PacketGetplayerID(packet)))
				
			Case ID_CONNECTION_LOST
				Print "Disconnected Player: "+RN_PacketGetplayerIndex(packet)

			Case ID_CHAT
				Print "Chat Message: "+Mid(msg,2,Len(msg)-1)
				;BroadCast Message to All except incoming player
				;RN_ServerSend1(Server,msg$,Len(msg$)+1,HIGH_PRIORITY,RELIABLE_ORDERED,0,RN_PacketGetplayerID(packet),1)

			Case ID_MOUSE_UPDATE ; User defined, mouse position.
				len1 = RN_BitStreamReadUnsignedChar(BitStreamIN)
				str1$ = RN_BitStreamRead(BitStreamIN,len1)
				len2 = RN_BitStreamReadUnsignedChar(BitStreamIN)
				str2$ = RN_BitStreamRead(BitStreamIN,len2)
				X=RN_BitStreamReadUnsignedShort(BitStreamIN)
				Y=RN_BitStreamReadUnsignedShort(BitStreamIN)
				Print str1$
				Print str2$
				Print x
				Print y
				Flip
				;Color 0,255,0
				;Rect X-5,Y-5,10,10,0
				
			Default
				Print "Unknown Message Type (Type = " + Asc(Mid(msg,1,1)) + ")"
		End Select
		
		;Free Packet
		packet=RN_ServerDeallocatePacket(Server,packet)	

		packet=RN_ServerReceive(Server)
	Wend


This is only a sample of what you should do. It uses BitStreams instead of Strings (much much better). And please note that only internal messages are broadcast by server automatically. User messages (50-255) must be broadcasted manually.

Post any question you have here.
Cheers.

Very useful, thanks a lot!
Now I only need to use Gnet instead of "localhost".

Good stuff!

But where do I add the player position codes.

Ok, suppose you want to send the x,y,z to the server, and then you want the server to broadcast this position to the rest of the players...

;Make a Global BitStream instead of once every time
Global BitStreamOut=RN_BitStreamCreate1(0)
ID_POSITION_UPDATE = 60 (for example)

Function SendPosition(entity)
RN_BitStreamReset(BitStreamOut)
RN_BitStreamWriteUnsignedChar(BitStreamOut,ID_POSITION_UPDATE)
RN_BitStreamWriteFloat(BitStreamOut,entityx(entity))
RN_BitStreamWriteFloat(BitStreamOut,EntityY(Entity))
RN_BitStreamWriteFloat(BitStreamOut,EntityZ(Entity))
Ok=RN_ClientSend2(Client,BitStreamOut,NORMAL_PRIORITY,RELIABLE_ORDERED,0)

End Function


Now in the receiving loop of the server:

;Make a Global BitStream instead of once every time
Global BitStreamIN=RN_BitStreamCreate1(0)
ID_POSITION_UPDATE = 60 (for example)

while (packet) ; bla bla bla

BitStreamIN=RN_BitStreamCreateFromPacket(packet)
MessageID=RN_BitStreamReadUnsignedChar(BitStreamIN)

Select MessageID
 Case ID_POSITION_UPDATE
     X#=RN_BitStreamReadFloat(BitStreamIN)
     Y#=RN_BitStreamReadFloat(BitStreamIN)
     Z#=RN_BitStreamReadFloat(BitStreamIN)
     
     ;Here you update the local position

     ;Now BroadCast
     RN_ServerSend2(Server,RN_BitStreamIn,HIGH_PRIORITY,RELIABLE_ORDERED,0,RN_PacketGetplayerID(packet),1)



As you can see i use always bitstreams for the sending and receiving, and it is the way you should do it. There are lot of other ways of doing this, but this is an example. Good Luck, and don't forget to read the documentation in the raknet official site!

I got a MAV on the RN_ServerSend2 part

- Be sure to have initialized the BitStreamIN Variable with RN_CreateBitStream1.

- Be sure that the Server Variable of the sample is the ServerInterface you have declared before!

And please, do not copy paste the code to avoid possibly typos in my code...

oops.

working now?

Slowly. Maybe It's cause Im running seperate clients and servers on the same system.

I have been running multiple clients and servers on one machine with no problem. Make sure you set the threadpriority to some value greater than zero so the thread is not cpu intensive...

10 could be a good value! ;)

P.D: Raknet 2.412 has been released. I will update the wrapper soon!

As i promised... Raknet Wrapper is now updated to the 2.415 version. 2.413 and 2.414 were bad updated. So, although this is supposed to be a good update, please make a copy of all your actual projects before updating!

Latest Version:

www.lcuriel.arrakis.es/RakNetWrapper0.76.rar

P.D: for those who bought the source code, if you are interested in the latest version, please email me (i don't send it automatically because i suppose they have changed everything already...)

Well, there are problems with Raknet Versions greater than 2.402 so i am going to stop updating the wrapper until a new stable version comes out...

If you want to use raknet wrapper get the 0.75 version of the wrapper (corresponding to the raknet version 2.402). It is a very very stable version with all the features in it...

I am going to release a commercial project soon and i will be using that version. Newer versions are getting very buggies. I hope Rakkar will take care with the bugs he is inserting due to fast releases...

KuRiX: GREAT wrapper, Raknet! Onward to BlitzMax :-)
Hint hint :-)

Look's good, I've downloaded it and will give it a go tomorrow, Viper from the JV-ODE Physics Thread Recomened raknet. should make a great team. O yes If you need Physics I would be happy to recomend JV-ODE or for the Thread JV-ODE Thread

Yes, RakNet is very good, and now is free for NON commercial use (visit www.rakkarsoft.com for commercial licenses)...

I have updated the wrapper to the latest version, that is working perfectly (2.484). If you are interested i can release it (if i get permission from rakkar).

I have started playing with network stuff. And had a go with it last night. Raknet is pretty good, and this wrapper is quite swell :)

Just one thing, as this is my first Userlib. Is there spesific place to put the help files so that when you press F1 twice it opens the docs for the function?

The docs i attach with the wrapper are the original docs for raknet. I have not made a help file for every raknet wrapped command...

So you just put it wherever you want... because blitz3d will not automatically go to the help file...

Release new version if you can, please :)

Its always good to have the latest version.

Ok ok... here it is. This version is not backward compatible, or at least the file named raknet.bb (the only part not compatible is the packet enumerations). So check if you have correct numbers assigned to user packets.

www.lcuriel.arrakis.es/raknetwrapper2483.rar

Enjoy!

I tried that version (2483) and it crashed blitz with the test.bb's. Freezes and the window goes white, when the server is being initialised.

I went back to 075 and it worked fine again.

The test.bb file is not updated... but the new version works perfectly. I will try to update it later...

Coming back to BlitzMax and Raknet: it would be very nice to use Racknet with BlitzMax, this library seems so good!!
I am really not an expert, but I think we could use directly the source code of RackNet into BlitzMax, without the need for the dll (so that everything is cross-platform).
In the IDE, in the section "Language", there is a subsection "Advanced topics" which deals with importing C++ code... Do you guys think it will be possible/easy to do that with Racknet??
Reading this BlitzMax help, I see "Methods declared in an extern type must be declared virtual in the C++ class. " It seems it's a big limitation for wrapping RackNet. Any thoughts?

well have a go RepeatUntil. The C++ source is avaliable on thier website.

I don't have blitzmax, and i have no much time now to investigate, but should be easy, with a little tricks...

So after some research, I conclude that it won't be easy to wrap RackNet for BlitzMax. It is possible, but it will require some non negligible work (and, no, I am not candidate ;-)

Racknet is written in C++ with objects and BlitzMax is able to import *only* methods which are virtual. Of course, none of the method in RackNet are virtual, so it's impossible to import directly the functions/methods.

So one of the solution is to wrap in C the C++ method. In fact in the C function you have to make a call to the method in C++ (see mod/Pub.Mod/freeAudio.Mod for an example of what I mean). So every functions that you want to export, you need a C function that wraps it. And then BlitzMax is able to call directly this function.

But this is a lot of work...

I am not a wrapper expert at all, so are other confirming what I just said?I would be happy that someone prove me wrong...

It is very possible that you are right, repeatuntil. Then, you would need to wrap all c++ functions into a c library, just like my wrapper.

Why can't you use the same dll i have made? Can't blitmax use dll's the same as with blitz3d?

Yeh, you can use the same DLL in BlitzMax Kuri ;)

RepeatUntil was talking about including the C/C++ source directly (as a module) instead of using a DLL, so that it would work cross-platform. Using DLLs in BlitzMax will of course only work on the Win32 platforms.

Good luck with the Granada Racer, its release can't be far away now :)

Yes, VIP3R said it all: we have to include the c/c++ code so that it's cross-platform. Using your dll will lose this feature, and that's something we don't want to lose in BlitzMax.

BUT now I realize that you already did the job for BlitzMax, Kurix!! I guess you wrapped all c++ functions into c functions, getting rid of object. So that's exactly what BlitzMax need to have, and include that directly into BlitzMax (and then just make an extern statement to declare functions).

So I think the wrapper for BlitzMax is just around the corner with a little extra work, using the wrapper of Kurix.
Kurix, would it be possible that you show us one or two functions (the code in C) you have wrapped, just to make sure your code will work with BlitzMax. I know that the wrapper code is not free, but I would like just to see 2 functions to see if that would fit.....

By the way, stupid question: you used visual C++, but of course one could re-use your code using devcpp??

Thanks!

Well, wrapping Raknet is an easy job, but you need to make some little tricks, as i commented before, for example to use the UNASSIGNED_PLAYER_ID struct as C.

Two samples of the wrapper:

/******************************************/
/* INITIALIZE THE RAKNET SERVER INTERFACE */
/******************************************/
RN_API RakServerInterface* _stdcall RN_GetRakServerInterface()
{
	RakServerInterface *rakServerInterface;
	rakServerInterface=RakNetworkFactory::GetRakServerInterface();

	return rakServerInterface;
}

/* INITIALIZE THE RAKNET CLIENT INTERFACE */
RN_API RakClientInterface* _stdcall RN_GetRakClientInterface()
{
	RakClientInterface *rakClientInterface;
	rakClientInterface=RakNetworkFactory::GetRakClientInterface();

	return rakClientInterface;
}

/******************/
/* SERVER FUNCTIONS */
/******************/
RN_API bool _stdcall RN_ServerStart(RakServerInterface *rakServerInterface,int maxplayers,int connectionvalidationinteger,int highprioritythreads,int port)
{
	if (rakServerInterface)
		return rakServerInterface->Start(maxplayers, connectionvalidationinteger, highprioritythreads, port);
	else
		return 0;
}


and of course don't forget to include all the header files and the raknetstaticlib!

Thank you very much, Kurix!
So the conclusion is that RackNet could be wrapped in BlitzMax without hundreds of hours of work. And it seems that the wrapper that Kurix already wrote would work perfectly for BlitzMax, with little modification (if Kurix agrees that someone use his wrapper for BlitzMax, after paying the 20$ for the source).

RackNet, the best networking solution, would be cross-platform for BlitzMax!! That would be neat!! But now the question:
who would like to do the work????
(noooo, I am not candidate by terrible lack of time)

But then... in blitzmax, you can import all the raknet source and then, with a wrapper .cpp you can call them?

Well, i have no time now, but in two months i could check it ;)


But then... in blitzmax, you can import all the raknet source and then, with a wrapper .cpp you can call them?


Basically, I see things like this:
- import in BlitzMax the wrapper you did, without any modification (I hope!)
- In this blitzMax file, add an extern..end extern command where you declare all functions you want to use (The equivalent of the .decls file for BlitzBasic)
- That's it!
So, it seems to me that this work could be pretty simple, like a couple of hours...... But I am sure a lot of issues will arise, and that won't be so simple...

That said, after you could go further, and wrap in BlitzMax the C function to use BlitzMax type to have object orientation!! But that's another level of complexity, and I am not sure it would be useful!

This is the example taken from the help file of BlitzMax:
//----- file: c_funcs.c -----
int Doubler( int x ){
	return x+x;
}

'----- file: app.bmx -----
Import "c_funcs.c"

Extern
	Function Doubler( x )
End Extern

Print Doubler(10)



Well, i have no time now, but in two months i could check it ;)


But you told us you haven't BlitzMax?! Let's see if someone would be interested to do that, if not, then we all count on you in 2 months!!!!!

I guess i will buy it, sooner or later, and two months is a good time to decide!

On the site of RackNet, I read this:

Use the source or a DLL?

RakNet includes the source and a pre-made DLL, along with sample projects to make a DLL, use a DLL, and use the source. You may use either in your game. During development, you will probably want to use the source so you can trace into the code for better control. During release, you will probably want to use a DLL so you don't have to make your game multithreaded, and for easier patching.



In BlitzMax, we will use the source of course (from cross-platform). But then I am worried by the fact that including the source means that the game will be multithreaded!! Is it compatible with BlitzMax?? If BlitzMax is not tread-safe, is it not a show-stopper?? Thanks to give opinion on that...

Anyway... why not using a dll just like with blitz3d?

Because we want to have Racknet on all 3 platforms supported by BlitzMax (Windows, Linux and Mac). A dll is only for windows. If you include the source, since Racknet is already multi-platform, you will have automatically the "auto-platformity".
And this is very important for BlitzMax users to use lib which are multiplatform, this is always a plus.
So I don't see other solutions, other than including the source. But then I am not sure if the multithread is a problem for BlitzMax....

I opened a new discussion in the BlitzMax forum, to get attention of BlitzMax users (and some opinion):
http://www.blitzmax.com/Community/posts.php?topic=59325

Thanks to Farflame i have detected that i had not updated the raknet.bb file in the last wrapper! so it wasn't working at all!!!

Now is fixed. Download it and enjoy Raknet! (and remember, free for NON commercial use).

Any news about this wrapper ? :)

yeah, good question...

dead project I believe .... we could do with someone taking the lead on this and rolling us a wrapper for RakNet v3.0. hint hint anyone ? :)

Saying that the wrapper is perfectly functionaly (well coped with everything I needed)

Here is the wrapper converted for blitzmax, but i get problems with samples ;/

Const DllName:String = "RakNet.dll"
Local DllHandle = LoadLibraryA(DllName)

If DLLhandle = 0 Then
	Notify "Unable to initialize RakNet.dll"
	End
EndIf

Global RN_GetUnassignedPlayerID:Int()"Win32"= GetProcAddress(DllHandle,"_RN_GetUNASSIGNEDPLAYERID@0")
Global RN_GetTime:Int()"Win32"= GetProcAddress(DllHandle,"_RN_GetTime@0")

Global RN_GetRakServerInterface:Int()"Win32"= GetProcAddress(DllHandle,"_RN_GetRakServerInterface@0")
Global RN_GetRakClientInterface:Int()"Win32"= GetProcAddress(DllHandle,"_RN_GetRakClientInterface@0")
Global RN_GetRakPeerInterface:Int()"Win32"= GetProcAddress(DllHandle,"_RN_GetRakPeerInterface@0")

Global RN_DestroyRakServerInterface:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_DestroyRakServerInterface@4")
Global RN_DestroyRakClientInterface:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_DestroyRakClientInterface@4")
Global RN_DestroyRakPeerInterface:Int(rakPeerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_DestroyRakPeerInterface@4")

Global RN_ServerStart:Int(rakServerInterface:Int,maxplayers:Int,connectionvalidationinteger:Int,highprioritythreads:Int,port:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerStart@20")
Global RN_ServerInitializeSecurity (rakServerInterface:Int,privKeyE:String,privKeyN:String)"Win32"= GetProcAddress(DllHandle,"_RN_ServerInitializeSecurity@12")
Global RN_ServerDisableSecurity(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerDisableSecurity@4")
Global RN_ServerSetPassword(rakServerInterface:Int,password:String)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetPassword@8")
Global RN_ServerHasPassword:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerHasPassword@4")
Global RN_ServerDisconnect(rakServerInterface:Int,blockDuration:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerDisconnect@8")
Global RN_ServerSend1:Int(rakServerInterface:Int,data:String,length:Int,priority:Int,reliability:Int,orderingStream:Int,playerID:Int,broadcast:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSend1@32")
Global RN_ServerSend2:Int(rakServerInterface:Int,bitStream:Int,priority:Int,reliability:Int,orderingStream:Int,playerID:Int,broadcast:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSend2@28")
Global RN_ServerReceive:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerReceive@4")
Global RN_ServerDeallocatePacket:Int(rakServerInterface:Int,packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerDeallocatePacket@8")
Global RN_ServerIsActive:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerIsActive@4")
Global RN_ServerPushBackPacket(rakServerInterface:Int,packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerPushBackPacket@8")
Global RN_ServerKick(rakServerInterface:Int,playerID:Int,blockDuration)"Win32"= GetProcAddress(DllHandle,"_RN_ServerKick@12")
Global RN_ServerSetAllowedPlayers(rakServerInterface:Int,AllowedPlayers:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetAllowedPlayers@8")
Global RN_ServerGetAllowedPlayers:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetAllowedPlayers@4")
Global RN_ServerGetConnectedPlayers:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetConnectedPlayers@4")
Global RN_ServerGetPlayerIPFromID:String(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetPlayerIPFromID@8")
Global RN_ServerGetPlayerPortFromID:Int(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetPlayerPortFromID@8")
Global RN_ServerPingPlayer(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerPingPlayer@8")
Global RN_ServerGetAveragePing:Int(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetAveragePing@8")
Global RN_ServerGetLastPing:Int(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetLastPing@8")
Global RN_ServerGetLowestPing:Int(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetLowestPing@8")
Global RN_ServerStartOccasionalPing(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerStartOccasionalPing@4")
Global RN_ServerStopOccasionalPing(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerStopOccasionalPing@4")
Global RN_ServerGetSynchronizedRandomInteger:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetSynchronizedRandomInteger@4")
Global RN_ServerStartSynchronizedRandomInteger(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerStartSynchronizedRandomInteger@4")
Global RN_ServerStopSynchronizedRandomInteger(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerStopSynchronizedRandomInteger@4")
Global RN_ServerGenerateCompressionLayer:Int(rakServerInterface:Int,InptFrequencyTable:String,InptLayer:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGenerateCompressionLayer@12")
Global RN_ServerDeleteCompressionLayer:Int(rakServerInterface:Int,InptLayer:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerDeleteCompressionLayer@8")
Global RN_ServerSetTrackFrequencyTable (rakServerInterface:Int,b:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetTrackFrequencyTable@8")
Global RN_ServerGetSendFrequencyTable:Int(rakServerInterface:Int,outputFrequencyTable:String)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetSendFrequencyTable@8")
Global RN_ServerGetCompressionRatio:Float(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetCompressionRatio@4")
Global RN_ServerGetDecompressionRatio:Float(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetDecompressionRatio@4")
Global RN_ServerGetStaticServerData:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetStaticServerData@4")
Global RN_ServerSetStaticServerData(rakServerInterface:Int,data:String,length:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetStaticServerData@12")
Global RN_ServerSetStaticServerData2(rakServerInterface:Int,data:Int,length:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetStaticServerData@12")
Global RN_ServerSetRelayStaticClientData(rakServerInterface:Int,b:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetRelayStaticClientData@8")
Global RN_ServerSendStaticServerDataToClient (rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSendStaticServerDataToClient@8")
Global RN_ServerSetOfflinePingResponse(rakServerInterface:Int,data:String,length:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetOfflinePingResponse@12")
Global RN_ServerGetStaticClientData:Int(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetStaticClientData@8")
Global RN_ServerSetStaticClientData(rakServerInterface:Int,playerID:Int,data:String,length:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetStaticClientData@16")
Global RN_ServerChangeStaticClientData(rakServerInterface:Int,playerChangedId:Int,playerToSendToId:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerChangeStaticClientData@12")
Global RN_ServerGetNumberOfAddresses:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetNumberOfAddresses@4")
Global RN_ServerGetLocalIP:String(rakServerInterface:Int,index:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetLocalIP@8")
Global RN_ServerGetIndexFromPlayerID:Int(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetIndexFromPlayerID@8")
Global RN_ServerGetPlayerIDFromIndex:Int(rakServerInterface:Int,index:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetPlayerIDFromIndex@8")
Global RN_ServerAddToBanList(rakServerInterface:Int,ip:String)"Win32"= GetProcAddress(DllHandle,"_RN_ServerAddToBanList@8")
Global RN_ServerRemoveFromBanList (rakServerInterface:Int,ip:String)"Win32"= GetProcAddress(DllHandle,"_RN_ServerRemoveFromBanList@8")
Global RN_ServerClearBanList(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerClearBanList@4")
Global RN_ServerIsBanned:Int(rakServerInterface:Int,ip:String)"Win32"= GetProcAddress(DllHandle,"_RN_ServerIsBanned@8")
Global RN_ServerIsActivePlayerID:Int(rakServerInterface:Int,ip:String,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerIsActivePlayerID@12")
Global RN_ServerSetMTUSize:Int(rakServerInterface:Int,ip:String,size:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerSetMTUSize@12")
Global RN_ServerGetMTUSize:Int(rakServerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetMTUSize@4")
Global RN_ServerAdvertiseSystem(rakServerInterface:Int,host:String,remotePort:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerAdvertiseSystem@12")
Global RN_ServerGetStatistics:Int(rakServerInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ServerGetStatistics@8")

Global RN_ClientConnect:Int(rakClientInterface:Int,host:String,serverport:Int,clientport:Int,connectionvalidationinteger:Int,highprioritythreads:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientConnect@24")
Global RN_ClientDisconnect:Int(rakClientInterface:Int,blockDuration:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientDisconnect@8")
Global RN_ClientIsConnected:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientIsConnected@4")
Global RN_ClientSend1:Int(rakClientInterface:Int,data:String,length:Int,priority:Int,reliability:Int,orderingChannel:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSend1@24")
Global RN_ClientSend2:Int(rakClientInterface:Int,bitStream:Int,priority:Int,reliability:Int,orderingChannel:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSend2@20")
Global RN_ClientDeallocatePacket:Int(rakClientInterface:Int,packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientDeallocatePacket@8")
Global RN_ClientReceive:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientReceive@4")
Global RN_ClientInitializeSecurity (rakClientInterface:Int,privKeyE:String,privKeyN:String)"Win32"= GetProcAddress(DllHandle,"_RN_ClientInitializeSecurity@12")
Global RN_ClientSetPassword(rakClientInterface:Int,password:String)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSetPassword@8")
Global RN_ClientHasPassword:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientHasPassword@4")
Global RN_ClientPushBackPacket(rakClientInterface:Int,packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientPushBackPacket@8")
Global RN_ClientPingServer(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientPingServer@4")
Global RN_ClientPingServer2(RakClientInterface:Int,host:String,serverPort:Int,clientPort:Int,onlyReplyOnAcceptingConnections:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientPingServer2@20")
Global RN_ClientGetAveragePing:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetAveragePing@4")
Global RN_ClientGetLastPing:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetLastPing@4")
Global RN_ClientGetLowestPing:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetLowestPing@4")
Global RN_ClientGetPlayerPing:Int(rakClientInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetPlayerPing@8")
Global RN_ClientStartOccasionalPing(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientStartOccasionalPing@4")
Global RN_ClientStopOccasionalPing(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientStopOccasionalPing@4")
Global RN_ClientGetSynchronizedRandomInteger:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetSynchronizedRandomInteger@4")
Global RN_ClientGenerateCompressionLayer:Int(rakClientInterface:Int,InptFrequencyTable:String,InptLayer:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGenerateCompressionLayer@12")
Global RN_ClientDeleteCompressionLayer:Int(rakClientInterface:Int,InptLayer:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientDeleteCompressionLayer@8")
Global RN_ClientSetTrackFrequencyTable (rakClientInterface:Int,b:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSetTrackFrequencyTable@8")
Global RN_ClientGetSendFrequencyTable:Int(rakClientInterface:Int,outputFrequencyTable:String)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetSendFrequencyTable@8")
Global RN_ClientGetCompressionRatio:Float(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetCompressionRatio@4")
Global RN_ClientGetDecompressionRatio:Float(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetDecompressionRatio@4")
Global RN_ClientGetStaticServerData:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetStaticServerData@4")
Global RN_ClientSetStaticServerData(rakClientInterface:Int,data:String,length:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSetStaticServerData@12")
Global RN_ClientGetClientServerData:Int(rakClientInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetClientServerData@8")
Global RN_ClientSetStaticClientData(rakClientInterface:Int,playerID:Int,data:String,length:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSetStaticClientData@16")
Global RN_ClientSetStaticClientDataToBitStream(rakClientInterface:Int,playerID:Int,bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSetStaticClientDataToBitStream@12")
Global RN_ClientSetStaticClientData2(rakClientInterface:Int,playerID:Int,data:Int,length:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSetStaticClientData@16")
Global RN_ClientSendStaticClientDataToServer(rakClientInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSendStaticClientDataToServer@8")
Global RN_ClientGetStaticClientData:Int(rakClientInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetStaticClientData@8")
Global RN_ClientGetServerID(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetServerID@4")
Global RN_ClientGetPlayerID:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetPlayerID@4")
Global RN_ClientPlayerIDToDottedIP:String(rakClientInterface:Int,playerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientPlayerIDToDottedIP@8")
Global RN_ClientAllowConnectionResponseIPMigration (rakClientInterface:Int,allow:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientAllowConnectionResponseIPMigration@8")
Global RN_ClientSetMTUSize:Int(rakClientInterface:Int,ip:String,size:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientSetMTUSize@12")
Global RN_ClientGetMTUSize:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetMTUSize@4")
Global RN_ClientAdvertiseSystem(rakClientInterface:Int,host:String,remotePort:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientAdvertiseSystem@12")
Global RN_ClientGetStatistics:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetStatistics@4")
Global RN_ClientGetPlayerIndex:Int(rakClientInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_ClientGetPlayerIndex@4")

Global RN_PeerDeallocatePacket:Int(rakPeerInterface:Int,packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_PeerDeallocatePacket@8")
Global RN_PeerReceive:Int(rakPeerInterface:Int)"Win32"= GetProcAddress(DllHandle,"_RN_PeerReceive@4")
Global RN_PeerCloseConnection:Int(rakPeerInterface:Int,playerID:Int,blockDuration)"Win32"= GetProcAddress(DllHandle,"_RN_PeerCloseConnection@12")

Global RN_PacketGetData:String(packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_PacketGetData@4")
Global RN_PacketGetLength:Int(packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_PacketGetLength@4")

Global RN_PacketGetplayerID:Int(packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_PacketGetplayerID@4")
Global RN_PacketGetplayerIndex:Int(packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_PacketGetplayerIndex@4")
Global RN_PlayerIDGetPort:Int(PlayerID:Int)"Win32"= GetProcAddress(DllHandle,"_RN_PlayerIDGetPort@4")

Global RN_BitStreamCreate1:Int(initialBytesToAllocate:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamCreate1@4")
Global RN_BitStreamCreate2:Int(data:String,length:Int,copydata:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamCreate2@12")
Global RN_BitStreamReset(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReset@4")
Global RN_BitStreamDestroy(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamDestroy@4")
Global RN_BitStreamCreateFromPacket:Int(packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamCreateFromPacket@4")
Global RN_BitStreamWriteBool (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteBool@8")
Global RN_BitStreamWriteUnsignedChar (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteUnsignedChar@8")
Global RN_BitStreamWriteChar (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteChar@8")
Global RN_BitStreamWriteUnsignedShort (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteUnsignedShort@8")
Global RN_BitStreamWriteShort (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteShort@8")
Global RN_BitStreamWriteUnsignedInt (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteUnsignedInt@8")
Global RN_BitStreamWriteInt (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteInt@8")
Global RN_BitStreamWriteUnsignedLong (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteUnsignedLong@8")
Global RN_BitStreamWriteLong (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteLong@8")
Global RN_BitStreamWriteFloat (bitstream:Int,Inp:Float)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteFloat@8")
Global RN_BitStreamWriteDouble (bitstream:Int,Inp:Float)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteDouble@8")
Global RN_BitStreamWrite (bitstream:Int,Inpt:String,numberOfBytes:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWrite@12")
Global RN_BitStreamWriteCompressedUnsignedChar(bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedUnsignedChar@8")
Global RN_BitStreamWriteCompressedChar(bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedChar@8")
Global RN_BitStreamWriteCompressedUnsignedShort(bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedUnsignedShort@8")
Global RN_BitStreamWriteCompressedShort(bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedShort@8")
Global RN_BitStreamWriteCompressedUnsignedInt(bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedUnsignedInt@8")
Global RN_BitStreamWriteCompressedInt(bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedInt@8")
Global RN_BitStreamWriteCompressedUnsignedLong (bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedUnsignedLong@8")
Global RN_BitStreamWriteCompressedLong(bitstream:Int,Inp:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedLong@8")
Global RN_BitStreamWriteCompressedFloat(bitstream:Int,Inp:Float)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedFloat@8")
Global RN_BitStreamWriteCompressedDouble(bitstream:Int,Inp:Float)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteCompressedDouble@8")
Global RN_BitStreamReadBool:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadBool@4")
Global RN_BitStreamReadUnsignedChar:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadUnsignedChar@4")
Global RN_BitStreamReadChar:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadChar@4")
Global RN_BitStreamReadUnsignedShort:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadUnsignedShort@4")
Global RN_BitStreamReadShort:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadShort@4")
Global RN_BitStreamReadUnsignedInt:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadUnsignedInt@4")
Global RN_BitStreamReadInt:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadInt@4")
Global RN_BitStreamReadUnsignedLong:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadUnsignedLong@4")
Global RN_BitStreamReadLong:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadLong@4")
Global RN_BitStreamReadFloat:Float(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadFloat@4")
Global RN_BitStreamReadDouble:Float(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadDouble@4")
Global RN_BitStreamRead:String(bitstream:Int,numberOfBytes:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamRead@8")
Global RN_BitStreamReadCompressedUnsignedChar:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedUnsignedChar@4")
Global RN_BitStreamReadCompressedChar:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedChar@4")
Global RN_BitStreamReadCompressedUnsignedShort:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedUnsignedShort@4")
Global RN_BitStreamReadCompressedShort:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedShort@4")
Global RN_BitStreamReadCompressedUnsignedInt:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedUnsignedInt@4")
Global RN_BitStreamReadCompressedInt:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedInt@4")
Global RN_BitStreamReadCompressedUnsignedLong:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedUnsignedLong@4")
Global RN_BitStreamReadCompressedLong:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedLong@4")
Global RN_BitStreamReadCompressedFloat:Float(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedFloat@4")
Global RN_BitStreamReadCompressedDouble:Float(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadCompressedDouble@4")
Global RN_BitStreamResetReadPointer(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamResetReadPointer@4")
Global RN_BitStreamAssertStreamEmpty(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamAssertStreamEmpty@4")
Global RN_BitStreamPrintBits(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamPrintBits@4")
Global RN_BitStreamIgnoreBits(bitstream:Int,numberOfBits:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamIgnoreBits@8")
Global RN_BitStreamSetWriteOffset(bitstream:Int,offset:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamSetWriteOffset@8")
Global RN_BitStreamGetNumberOfBitsUsed:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamGetNumberOfBitsUsed@4")
Global RN_BitStreamGetNumberOfBytesUsed:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamGetNumberOfBytesUsed@4")
Global RN_BitStreamGetReadOffset:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamGetReadOffset@4")
Global RN_BitStreamGetNumberOfUnreadBits:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamGetNumberOfUnreadBits@4")
Global RN_BitStreamSetData(bitstream:Int,data:String,numberOfBits:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamSetData@12")
Global RN_BitStreamGetData:String(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamGetData@4")
Global RN_BitStreamGetDataPointer:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamGetDataPointer@4")
Global RN_BitStreamWriteBits(bitstream:Int,Inp:String,numberOfBitsToWrite:Int,rightAlignedBits:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteBits@16")
Global RN_BitStreamWriteAlignedBytes(bitstream:Int,Inpt:String,numberOfBytesToWrite:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWriteAlignedBytes@12")
Global RN_BitStreamReadAlignedBytes:String(bitstream:Int,numberOfBytesToRead:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadAlignedBytes@8")
Global RN_BitStreamAlignWriteToByteBoundary(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamAlignWriteToByteBoundary@4")
Global RN_BitStreamAlignReadToByteBoundary(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamAlignReadToByteBoundary@4")
Global RN_BitStreamReadBits:String(bitstream:Int,numberOfBitsToRead:Int,alignBitsToRight:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadBits@12")
Global RN_BitStreamWrite0(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWrite0@4")
Global RN_BitStreamWrite1(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamWrite1@4")
Global RN_BitStreamReadBit:Int(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamReadBit@4")
Global RN_BitStreamAssertCopyData(bitstream:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamAssertCopyData@4")
Global RN_BitStreamSetNumberOfBitsAllocated(bitstream:Int,lengthInBits:Int)"Win32"= GetProcAddress(DllHandle,"_RN_BitStreamSetNumberOfBitsAllocated@8")

Global RN_StatisticsGetmessageSendBuffer:Int(stat:Int,queue:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessageSendBuffer@8")
Global RN_StatisticsGetmessagesSent:Int(stat:Int,queue:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessagesSent@8")
Global RN_StatisticsGetmessageDataBitsSent:Int(stat:Int,queue:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessageDataBitsSent@8")
Global RN_StatisticsGetmessageTotalBitsSent:Int(stat:Int,queue:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessageTotalBitsSent@8")
Global RN_StatisticsGetpacketsContainingOnlyAcknowlegements:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetpacketsContainingOnlyAcknowlegements@4")
Global RN_StatisticsGetacknowlegementsSent:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetacknowlegementsSent@4")
Global RN_StatisticsGetacknowlegementsPending:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetacknowlegementsPending@4")
Global RN_StatisticsGetacknowlegementBitsSent:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetacknowlegementBitsSent@4")
Global RN_StatisticsGetpacketsContainingOnlyAcknowlegementsAndResends:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetpacketsContainingOnlyAcknowlegementsAndResends@4")
Global RN_StatisticsGetmessageResends:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessageResends@4")
Global RN_StatisticsGetmessageDataBitsResent:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessageDataBitsResent@4")
Global RN_StatisticsGetmessagesTotalBitsResent:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessagesTotalBitsResent@4")
Global RN_StatisticsGetmessagesOnResendQueue:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessagesOnResendQueue@4")
Global RN_StatisticsGetnumberOfUnsplitMessages:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetnumberOfUnsplitMessages@4")
Global RN_StatisticsGetnumberOfSplitMessages:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetnumberOfSplitMessages@4")
Global RN_StatisticsGettotalSplits:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGettotalSplits@4")
Global RN_StatisticsGetpacketsSent:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetpacketsSent@4")
Global RN_StatisticsGetencryptionBitsSent:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetencryptionBitsSent@4")
Global RN_StatisticsGettotalBitsSent:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGettotalBitsSent@4")
Global RN_StatisticsGetsequencedMessagesOutOfOrder:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetsequencedMessagesOutOfOrder@4")
Global RN_StatisticsGetsequencedMessagesInOrder:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetsequencedMessagesInOrder@4")
Global RN_StatisticsGetorderedMessagesOutOfOrder:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetorderedMessagesOutOfOrder@4")
Global RN_StatisticsGetorderedMessagesInOrder:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetorderedMessagesInOrder@4")
Global RN_StatisticsGetpacketsReceived:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetpacketsReceived@4")
Global RN_StatisticsGetbitsReceived:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetbitsReceived@4")
Global RN_StatisticsGetbitsWithBadCRCReceived:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetbitsWithBadCRCReceived@4")
Global RN_StatisticsGetacknowlegementsReceived:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetacknowlegementsReceived@4")
Global RN_StatisticsGetduplicateAcknowlegementsReceived:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetduplicateAcknowlegementsReceived@4")
Global RN_StatisticsGetmessagesReceived:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessagesReceived@4")
Global RN_StatisticsGetinvalidMessagesReceived:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetinvalidMessagesReceived@4")
Global RN_StatisticsGetduplicateMessagesReceived:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetduplicateMessagesReceived@4")
Global RN_StatisticsGetmessagesWaitingForReassembly:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetmessagesWaitingForReassembly@4")
Global RN_StatisticsGetinternalOutputQueueSize:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetinternalOutputQueueSize@4")
Global RN_StatisticsGetwindowSize:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetwindowSize@4")
Global RN_StatisticsGetlossySize:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetlossySize@4")
Global RN_StatisticsGetconnectionStartTime:Int(stat:Int)"Win32"= GetProcAddress(DllHandle,"_RN_StatisticsGetconnectionStartTime@4")

Global RN_CreatePlayerIDFromPacket:Int(packet:Int)"Win32"= GetProcAddress(DllHandle,"_RN_CreatePlayerIDFromPacket@4")
Global RN_DestroyPlayerID:Int(playerid:Int)"Win32"= GetProcAddress(DllHandle,"_RN_DestroyPlayerID@4")

' ----------------
' Raknet constants
' ----------------
Const ID_INTERNAL_PING:Int=0
Const ID_PING:Int=1
Const ID_PING_OPEN_CONNECTIONS:Int=2
Const ID_CONNECTED_PONG:Int=3
Const ID_REQUEST_STATIC_DATA:Int=4
Const ID_CONNECTION_REQUEST:Int=5
Const ID_SECURED_CONNECTION_RESPONSE:Int=6
Const ID_SECURED_CONNECTION_CONFIRMATION:Int=7
Const ID_RPC:Int=8
Const ID_RPC_REPLY:Int=9
Const ID_BROADCAST_PINGS:Int=10
Const ID_SET_RANDOM_NUMBER_SEED:Int=11
Const ID_RPC_MAPPING:Int=12
Const ID_DETECT_LOST_CONNECTIONS:Int=13
Const ID_OPEN_CONNECTION_REQUEST:Int=14
Const ID_OPEN_CONNECTION_REPLY:Int=15
Const ID_CONNECTION_REQUEST_ACCEPTED:Int=16
Const ID_CONNECTION_ATTEMPT_FAILED:Int=17
Const ID_NEW_INCOMING_CONNECTION:Int=18
Const ID_NO_FREE_INCOMING_CONNECTIONS:Int=19
Const ID_DISCONNECTION_NOTIFICATION:Int=20
Const ID_CONNECTION_LOST:Int=21
Const ID_RSA_PUBLIC_KEY_MISMATCH:Int=22
Const ID_CONNECTION_BANNED:Int=23
Const ID_INVALID_PASSWORD:Int=24
Const ID_MODIFIED_PACKET:Int=25
Const ID_TIMESTAMP:Int=26
Const ID_PONG:Int=27
Const ID_RECEIVED_STATIC_DATA:Int=28
Const ID_REMOTE_DISCONNECTION_NOTIFICATION:Int=29
Const ID_REMOTE_CONNECTION_LOST:Int=30
Const ID_REMOTE_NEW_INCOMING_CONNECTION:Int=31
Const ID_REMOTE_EXISTING_CONNECTION:Int=32
Const ID_REMOTE_STATIC_DATA:Int=33
Const ID_VOICE_PACKET:Int=34
Const ID_AUTOPATCHER_REQUEST_FILE_LIST:Int=35
Const ID_AUTOPATCHER_FILE_LIST:Int=36
Const ID_AUTOPATCHER_REQUEST_FILES:Int=37
Const ID_AUTOPATCHER_SET_DOWNLOAD_LIST:Int=38
Const ID_AUTOPATCHER_WRITE_FILE:Int=39
Const ID_QUERY_MASTER_SERVER:Int=40
Const ID_MASTER_SERVER_DELIST_SERVER:Int=41
Const ID_MASTER_SERVER_UPDATE_SERVER:Int=42
Const ID_MASTER_SERVER_SET_SERVER:Int=43
Const ID_ADVERTISE_SYSTEM:Int=45
Const ID_FULLY_CONNECTED_MESH_JOIN_RESPONSE:Int=46
Const ID_FULLY_CONNECTED_MESH_JOIN_REQUEST:Int=47
Const ID_REPLICATOR_DATA_PUSH_OBJECT:Int=48
Const ID_REPLICATOR_DATA_SEND_MEMORY:Int=49
Const ID_REPLICATOR_DATA_SEND_OBJECT_SCOPE:Int=50
Const ID_REPLICATOR_DATA_STOP:Int=51
Const ID_REPLICATOR_OBJECT_CREATION_REQUEST:Int=52
Const ID_REPLICATOR_OBJECT_CREATION_REQUEST_RESPONSE:Int=53
Const ID_REPLICATOR_STR_MAP_INDEX:Int=54
Const ID_REPLICATOR_PUSH_COMPLETE:Int=55
Const ID_TRANSPORT_STRING:Int=56
Const ID_REPLICA_MANAGER_CONSTRUCTION:Int=57
Const ID_REPLICA_MANAGER_DESTRUCTION:Int=58
Const ID_REPLICA_MANAGER_SCOPE_CHANGE:Int=59
Const ID_REPLICA_MANAGER_SERIALIZE:Int=60
Const ID_REPLICA_MANAGER_DOWNLOAD_COMPLETE:Int=61
Const ID_RESERVED9:Int=62
Const ID_USER_PACKET_ENUM:Int=63
Const ID_CHAT:Int= 64
Const ID_PositionUpdate:Int= 65
Const ID_KICK:Int= 66
Const ID_BAN:Int= 67

' ------------------
' MESSAGE PRIORITIES
' ------------------
Const	HIGH_PRIORITY:Int= 1
Const	MEDIUM_PRIORITY:Int= 2
Const	LOW_PRIORITY:Int= 3

' -------------------
' MESSAGE RELIABILITY
' -------------------
Const UNRELIABLE:Int= 0
Const UNRELIABLE_SEQUENCED:Int= 1
Const RELIABLE:Int= 2
Const RELIABLE_ORDERED:Int= 3
Const RELIABLE_SEQUENCED:Int= 4

' --------------------
' UNASSIGNED PLAYER ID
' --------------------
Global UNASSIGNED_PLAYER_ID:Int= RN_GetUNASSIGNEDPLAYERID()

' -------------------
' Raknet packet class
' -------------------
Type Packet
	Field PlayerID:Int
	Field Msg:String
EndType





Is Kurix still around here?

i just wanted to reanimate this thread... is kurix alive?

As said in another thread, I will post a wrapped version of RakNet 3.0 (the latest RakNet version). This will be for BlitzMax, but then somebody can write a decls file (not me).
More news later...

good to hear!!