{"id":652,"date":"2020-02-13T00:39:20","date_gmt":"2020-02-13T08:39:20","guid":{"rendered":"https:\/\/gmr.dev\/blog\/?p=652"},"modified":"2021-11-21T18:29:15","modified_gmt":"2021-11-22T02:29:15","slug":"networking-in-c-a-simple-library","status":"publish","type":"post","link":"https:\/\/rose.dev\/blog\/2020\/02\/13\/networking-in-c-a-simple-library\/","title":{"rendered":"Networking in C#, a simple library"},"content":{"rendered":"\n<p>Recently I wanted to make a simple multiplayer game in Unity, but I didn&#8217;t want to use their terribly made <a rel=\"noreferrer noopener\" aria-label=\"UNET (opens in a new tab)\" href=\"https:\/\/docs.unity3d.com\/Manual\/UNet.html\" target=\"_blank\">UNET<\/a>, as even though it&#8217;s barely a few years old, it&#8217;s already deprecated. I also didn&#8217;t want to go with a third party like <a rel=\"noreferrer noopener\" aria-label=\"Photon Networking  (opens in a new tab)\" href=\"https:\/\/www.photonengine.com\/pun\" target=\"_blank\">Photon Networking<\/a>, because I don&#8217;t want to pay for CCU (Concurrent User) usage, server costs, and other misc fees.<\/p>\n\n\n\n<p>No, what I wanted was a solution such as Minecraft implements, where you directly connect to a server and it&#8217;s served through peer-to-peer networking, with one player being a server. The solution? A small library called <a rel=\"noreferrer noopener\" aria-label=\"LiteNetLib (opens in a new tab)\" href=\"https:\/\/github.com\/RevenantX\/LiteNetLib\" target=\"_blank\">LiteNetLib<\/a>. This library allows you to build multiplayer games in .NET (C#), including Unity, with no limitations on usage, including player count. It was exactly what I needed.<\/p>\n\n\n\n<p>The documentation is slightly sparse but it wasn&#8217;t rocket science to get a small example up and running, and the developer seems pretty open to questions. There&#8217;s also a small sample included so you can see what it entails.<\/p>\n\n\n\n<p>Cheers!<\/p>\n<hr>\r\nIt helps me if you share this post\r\n<br\/>\r\n<br\/>\r\nPublished 2020-02-13 00:39:20 ","protected":false},"excerpt":{"rendered":"<p>Recently I wanted to make a simple multiplayer game in Unity, but I didn&#8217;t want to use their terribly made UNET, as even though it&#8217;s barely a few years old, it&#8217;s already deprecated. I also didn&#8217;t want to go with a third party like Photon Networking, because I don&#8217;t want to pay for CCU (Concurrent &hellip; <a href=\"https:\/\/rose.dev\/blog\/2020\/02\/13\/networking-in-c-a-simple-library\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Networking in C#, a simple library<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[832,833],"tags":[],"class_list":["post-652","post","type-post","status-publish","format-standard","hentry","category-software","category-technology"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/posts\/652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/comments?post=652"}],"version-history":[{"count":1,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/posts\/652\/revisions"}],"predecessor-version":[{"id":1043,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/posts\/652\/revisions\/1043"}],"wp:attachment":[{"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/media?parent=652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/categories?post=652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/tags?post=652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}