Sign in to follow this  
Postie

Using RakNet with C#

Recommended Posts

Postie    1559
Hi guys,
 
I'm building a Open World Survival RPG in C# and I'm looking for advice on network libraries. I started out by rolling my own socket connections, but got a short way into it and thought "there must be existing libraries out there" and starting looking around.  I came across RakNet relatively quickly and people say good things about it, so I decided to give it a try.
 
I grabbed the source and I've spent 4 hours trying to get the examples compiling. I followed the c# tutorial and ran into issues, such as the build failing due to missing folders. So I fixed that by creating the folders. Then there were files missing from the project. I found them and added them to the project. None of the generated files have any standard "using" clauses, so I add the required "using" clauses to the generated code. Now I'm stuck with build errors such as "Cannot implicitly convert type 'RakNet.Row' to 'RakNet.TableRow'" or "Cannot apply indexing with [] to an expression of type 'RakNet.SWIGTYPE_p_DataStructures__ListT_DataStructures__Table__Cell_p_t'"... the list goes on...
 
It seems like parts of the RakNet source are out of date or the c# source generated by swig is messed up somehow. Or perhaps the swig tutorial I followed isn't up to date?
 
This brings me to my questions:
 
1) Does anyone know what I'm doing wrong with RakNet, and is it salvageable?
2) Can anyone suggest a different networking library for use with C# for simple multiplayer (8 simultaneous players) which may be easier to get up and running?
3) Should I just go back to rolling my own? 
 

Share this post


Link to post
Share on other sites
NathanRidley    1092
I could be wrong, but my understanding is that lidgren is the game networking library of choice when it comes to developing in C# and .Net.

The old repository is here, which you'll want for the getting started guides and tutorials:
https://code.google.com/p/lidgren-network-gen3/

The new repository is here, which you'll want for an up-to-date codebase:
https://github.com/lidgren/lidgren-network-gen3

It doesn't seem to have a NuGet package, as best I can tell. Edited by axefrog

Share this post


Link to post
Share on other sites
Postie    1559

I saw lidgren mentioned in a few of the articles I found, but was swayed towards RakNet. Time for me to check it out..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this