lidgren-network-gen3 icon indicating copy to clipboard operation
lidgren-network-gen3 copied to clipboard

Target .NET Core

Open jaredthirsk opened this issue 9 years ago • 16 comments

.NET Core is new from Microsoft's new cross-platform solution to support Linux/Mac/Windows. It would be great if this library could be used in that platform.

jaredthirsk avatar Sep 15 '16 20:09 jaredthirsk

Yes please!

cakeslice avatar Sep 15 '16 21:09 cakeslice

I hate these kinds of comments, but...

+1

AlbinoGeek avatar Oct 06 '16 13:10 AlbinoGeek

I'll probably fork this later to at least try to do this, I could use this for one of my own projects... Hopefully, this doesn't really depend on anything that isn't in .NET Core

soccermitchy avatar Oct 31 '16 15:10 soccermitchy

Attempting to build it with just the default project.json from dotnet new -t Lib, getting this:

/home/mitchell/code/lidgren-network-gen3/Lidgren.Network/NetException.cs(21,22): error CS0234: The type or namespace name 'Serialization' does not exist in the namespace 'System.Runtime' (are you missing an assembly reference?)
/home/mitchell/code/lidgren-network-gen3/Lidgren.Network/Platform/PlatformWin32.cs(26,18): error CS0246: The type or namespace name 'NetworkInterface' could not be found (are you missing a using directive or an assembly reference?)
/home/mitchell/code/lidgren-network-gen3/Lidgren.Network/NetPeer.Internal.cs(18,11): error CS0246: The type or namespace name 'Thread' could not be found (are you missing a using directive or an assembly reference?)
/home/mitchell/code/lidgren-network-gen3/Lidgren.Network/NetUPnP.cs(253,11): error CS0246: The type or namespace name 'XmlDocument' could not be found (are you missing a using directive or an assembly reference?)

Not as bad as I thought it would be, but this may be a bit of a pain to port still.

soccermitchy avatar Oct 31 '16 16:10 soccermitchy

I also may end up having to make a compile-time flag to enable/disable encryption, with the flag disabled on netstandard, but enabled on netframework, which would allow building it for .net standard 1.6 (which is what I'm testing/porting it with)

soccermitchy avatar Oct 31 '16 16:10 soccermitchy

Just got it to build! Git repo URL: https://github.com/soccermitchy/lidgren-network-gen3 warning: lots of shitcode.

soccermitchy avatar Nov 01 '16 01:11 soccermitchy

soccermitchy, I was able to compile your forked library into a DLL on my Core setup, but I'm having a hard time including the DLL, or a packed .nupkg file into a new project. Any tips for how to do that?

Supergeek avatar Dec 06 '16 16:12 Supergeek

Not 100% sure how to do it, I can look up later how to upload a package to nuget so you can just add a dep in your project.json file

On Tue, Dec 6, 2016 at 11:25 AM, Supergeek [email protected] wrote:

soccermitchy, I was able to compile your forked library into a DLL on my Core setup, but I'm having a hard time including the DLL, or a packed .nupkg file into a new project. Any tips for how to do that?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lidgren/lidgren-network-gen3/issues/83#issuecomment-265195914, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbDE5TO08zFbnCGf7Av6klIZzP79MhSks5rFYxigaJpZM4J-T1r .

soccermitchy avatar Dec 06 '16 16:12 soccermitchy

I just threw the whole library directory into my project to see if I could get it to work that way. I ran into a lot of compile issues when I did that, starting with NetUPnP, so I'm not sure if it's just me. I'm not a professional developer, so I will be the first to admit it's very likely to be operator error.

From what I'm reading, referencing a DLL is basically impossible in Core right now (except for maybe the preview build tools which I haven't tried), so people recommend making their own local nuget packages. But I'm not even sure how to reference the local nuget file instead of the internet-accessible version.

Anyway, just trying to give feedback and send encouragement on the Core front. Core+Unity users do exist and some of us need socket libraries to do all the heavy lifting for us! :)

On 12/6/2016 11:47 AM, Mitchell Monahan wrote:

Not 100% sure how to do it, I can look up later how to upload a package to nuget so you can just add a dep in your project.json file

On Tue, Dec 6, 2016 at 11:25 AM, Supergeek [email protected] wrote:

soccermitchy, I was able to compile your forked library into a DLL on my Core setup, but I'm having a hard time including the DLL, or a packed .nupkg file into a new project. Any tips for how to do that?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub

https://github.com/lidgren/lidgren-network-gen3/issues/83#issuecomment-265195914,

or mute the thread

https://github.com/notifications/unsubscribe-auth/AAbDE5TO08zFbnCGf7Av6klIZzP79MhSks5rFYxigaJpZM4J-T1r

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lidgren/lidgren-network-gen3/issues/83#issuecomment-265202814, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPikjkwB5vViCJ40yGUXG1G_tEh7lC6ks5rFZG7gaJpZM4J-T1r.

Supergeek avatar Dec 06 '16 17:12 Supergeek

If I remember correctly, there is a 'nuget.config' file (or similar) where you can specify custom locations for packages, either local or remote.

On Tue, Dec 6, 2016 at 12:03 PM, Supergeek [email protected] wrote:

I just threw the whole library directory into my project to see if I could get it to work that way. I ran into a lot of compile issues when I did that, starting with NetUPnP, so I'm not sure if it's just me. I'm not a professional developer, so I will be the first to admit it's very likely to be operator error.

From what I'm reading, referencing a DLL is basically impossible in Core right now (except for maybe the preview build tools which I haven't tried), so people recommend making their own local nuget packages. But I'm not even sure how to reference the local nuget file instead of the internet-accessible version.

Anyway, just trying to give feedback and send encouragement on the Core front. Core+Unity users do exist and some of us need socket libraries to do all the heavy lifting for us! :)

On 12/6/2016 11:47 AM, Mitchell Monahan wrote:

Not 100% sure how to do it, I can look up later how to upload a package to nuget so you can just add a dep in your project.json file

On Tue, Dec 6, 2016 at 11:25 AM, Supergeek [email protected] wrote:

soccermitchy, I was able to compile your forked library into a DLL on my Core setup, but I'm having a hard time including the DLL, or a packed .nupkg file into a new project. Any tips for how to do that?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub

<https://github.com/lidgren/lidgren-network-gen3/issues/ 83#issuecomment-265195914>,

or mute the thread

<https://github.com/notifications/unsubscribe-auth/ AAbDE5TO08zFbnCGf7Av6klIZzP79MhSks5rFYxigaJpZM4J-T1r>

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/lidgren/lidgren-network-gen3/issues/ 83#issuecomment-265202814>, or mute the thread <https://github.com/notifications/unsubscribe- auth/AAPikjkwB5vViCJ40yGUXG1G_tEh7lC6ks5rFZG7gaJpZM4J-T1r>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lidgren/lidgren-network-gen3/issues/83#issuecomment-265207431, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbDE37j3NB4_jM1XvbCViveSgApABJ5ks5rFZVfgaJpZM4J-T1r .

soccermitchy avatar Dec 06 '16 20:12 soccermitchy

I just uploaded a package to NuGet for this: https://www.nuget.org/packages/Lidgren.Network.Core. For the version, I just grabbed the version from the .csproj file from the official gh repo.

On Tue, Dec 6, 2016 at 3:20 PM, Mitchell Monahan [email protected] wrote:

If I remember correctly, there is a 'nuget.config' file (or similar) where you can specify custom locations for packages, either local or remote.

On Tue, Dec 6, 2016 at 12:03 PM, Supergeek [email protected] wrote:

I just threw the whole library directory into my project to see if I could get it to work that way. I ran into a lot of compile issues when I did that, starting with NetUPnP, so I'm not sure if it's just me. I'm not a professional developer, so I will be the first to admit it's very likely to be operator error.

From what I'm reading, referencing a DLL is basically impossible in Core right now (except for maybe the preview build tools which I haven't tried), so people recommend making their own local nuget packages. But I'm not even sure how to reference the local nuget file instead of the internet-accessible version.

Anyway, just trying to give feedback and send encouragement on the Core front. Core+Unity users do exist and some of us need socket libraries to do all the heavy lifting for us! :)

On 12/6/2016 11:47 AM, Mitchell Monahan wrote:

Not 100% sure how to do it, I can look up later how to upload a package to nuget so you can just add a dep in your project.json file

On Tue, Dec 6, 2016 at 11:25 AM, Supergeek [email protected] wrote:

soccermitchy, I was able to compile your forked library into a DLL on my Core setup, but I'm having a hard time including the DLL, or a packed .nupkg file into a new project. Any tips for how to do that?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub

<https://github.com/lidgren/lidgren-network-gen3/issues/83# issuecomment-265195914>,

or mute the thread

<https://github.com/notifications/unsubscribe-auth/AAbDE5TO0 8zFbnCGf7Av6klIZzP79MhSks5rFYxigaJpZM4J-T1r>

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/lidgren/lidgren-network-gen3/issues/83# issuecomment-265202814>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AAPikjkwB5vViCJ40yGUXG1G_tEh7lC6ks5rFZG7gaJpZM4J-T1r>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lidgren/lidgren-network-gen3/issues/83#issuecomment-265207431, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbDE37j3NB4_jM1XvbCViveSgApABJ5ks5rFZVfgaJpZM4J-T1r .

soccermitchy avatar Dec 06 '16 23:12 soccermitchy

Much appreciated, thank you. VS Code picked it up and installed it without issue.

Then I took the Chat Server example (https://github.com/lidgren/lidgren-network-gen3/blob/master/Samples/Chat/ChatServer/Program.cs) and took out all of the Windows forms stuff and it compiled fine.

Looks good so far!

On 12/6/2016 6:39 PM, Mitchell Monahan wrote:

I just uploaded a package to NuGet for this: https://www.nuget.org/packages/Lidgren.Network.Core. For the version, I just grabbed the version from the .csproj file from the official gh repo.

Supergeek avatar Dec 07 '16 00:12 Supergeek

I'm happy to help on this if needed. I am a professional developer and i have also been using lidgren since the original Gen1 back when we have to create our own heartbeat thread :)

willthiswork89 avatar Jul 20 '17 13:07 willthiswork89

Was your .net core code port ever merged into the mainline?

lkingsford avatar Jul 26 '18 11:07 lkingsford

As far as I'm aware, it was not, but it also was never high enough quality of a port that I didn't really consider doing a PR with it.

soccermitchy avatar Jul 26 '18 13:07 soccermitchy

a .NETStandard 2.0/multi-target SLN option was merged in May, this can likely be closed

danielcrenna avatar Sep 27 '18 20:09 danielcrenna