{"id":22884597,"url":"https://github.com/darkriftnetworking/darkrift","last_synced_at":"2025-04-06T19:12:43.296Z","repository":{"id":29229123,"uuid":"120610892","full_name":"DarkRiftNetworking/DarkRift","owner":"DarkRiftNetworking","description":"DarkRift Networking by Unordinal","archived":false,"fork":false,"pushed_at":"2024-01-25T19:25:33.000Z","size":2607,"stargazers_count":232,"open_issues_count":57,"forks_count":67,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-30T17:10:05.323Z","etag":null,"topics":["darkrift","multiplayer","networking","server","unordinal"],"latest_commit_sha":null,"homepage":"http://darkriftnetworking.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DarkRiftNetworking.png","metadata":{"files":{"readme":".github/README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-07T12:14:49.000Z","updated_at":"2025-03-27T21:46:44.000Z","dependencies_parsed_at":"2024-07-31T08:25:13.495Z","dependency_job_id":null,"html_url":"https://github.com/DarkRiftNetworking/DarkRift","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkRiftNetworking%2FDarkRift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkRiftNetworking%2FDarkRift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkRiftNetworking%2FDarkRift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkRiftNetworking%2FDarkRift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarkRiftNetworking","download_url":"https://codeload.github.com/DarkRiftNetworking/DarkRift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535519,"owners_count":20954576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["darkrift","multiplayer","networking","server","unordinal"],"created_at":"2024-12-13T19:18:33.605Z","updated_at":"2025-04-06T19:12:43.277Z","avatar_url":"https://github.com/DarkRiftNetworking.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hello!\nWelcome to the DarkRift 2 open source project!\n\nDarkRift 1 and 2 were originally written by Jamie Read. DarkRift 2 has since been open sourced under the care of Unordinal AB and the DarkRift community. Unfortunately, Unordinal is no longer able to maintain the project, so it is being cared for by the DarkRift 2 community. Support for DarkRift is 100% community driven, and we encourage new users to join our [community discord](https://discord.gg/DMdsYabNzB). \n\n# Features\n\nDarkRift is an extremely performant multithreaded networking library best used for creating multiplayer experiance that require authoritative server. \n| **High Performance**                                                                                                                                                                        | **Unlimited CCU**                                                                                                                | **Extremely Low Overhead**                                                                                                                                                                          | **Full TCP \u0026 UDP Support**                                                                                                                                               |   |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| DarkRift was designed to be as fast, efficient and as powerful as you could ever need. Our multithreading expertise helps you take advantage of every CPU core and thread in your servers.  | DarkRift has no CCU limits. Scale to thousands of players without worrying about CCU restrictions.                               | DarkRift overhead can go as low as just 3 bytes on UDP.                                                                                                                                             | DarkRift 2 introduces bi-channel communication allowing you to mix and send UDP and TCP messages quickly and reliably depending on your needs.                           |   |\n| **Embedded or Standalone**                                                                                                                                                                  | **Free, Forever**                                                                                                                | **Authoritative**                                                                                                                                                                                   | **Flexible**                                                                                                                                                             |   |\n| DarkRift provides support for both Unity embedded and standalone servers allowing you to take advantage of existing Unity features or push for extreme performance with a standalone build. | DarkRift 2 is and will remain free and open source.                                                                              | DarkRift servers are fully authoritative. They own the communication and control exactly what the client can and cannot do on your system. You write the logic, DarkRift will handle the messaging. | DarkRift is a message passing framework. It doesn't provide opinionated ways of doing things or try to force you into a programming paradigm that doesn't fit your needs |   |\n| **Loves your protocol**                                                                                                                                                                     | **Scalability**                                                                                                                  | **Deep Metrics**                                                                                                                                                                                    | **Chat Filter (Bad Word Filter) and other goodies**                                                                                                                      |   |\n| Got a favourite low level networking library you want to continue using? Swap out DarkRift's Bichannel Network Listener for any library you like.                                           | With DarkRift's state of the art server clustering, you can build a backend capable of seamlessly scaling with your player base. | Built in support for Prometheus metrics means you can directly integrate with your existing metrics and monitoring solution like Grafana or Datadog.                                                | DarkRift comes with some quality of life features including a chat filter, basic matchmaking support, custom metrics, and more.                                          |   |                             |   |\n\n# Getting Started\nGrab the latest stable version from the [download page](https://github.com/DarkRiftNetworking/DarkRift/releases/).\n\nYou can find an example of a [minimal embedded .NET server and client](#minimal-example) here, or follow Any of the below community tutorials to get started.\n\n[Bottom to Top Multiplayer with DarkRift](https://dev.to/robodoig/unity-multiplayer-bottom-to-top-46cj) - @Robodoig\n[Source Code](https://github.com/RoboDoig/multiplayer-tutorial)\n\n[FPS style tutorial](https://lukestampfli.github.io/EmbeddedFPSExample/guide/introduction.html) - @lukesta\n[Source Code](https://github.com/LukeStampfli/EmbeddedFPSExample)\n\n[Lets make An \"MMO\" series tutorial](https://benderj.com/lets-make-an-mmo-with-unity-darkrift-playfab-1/) - @Ace\n[Source Code](https://github.com/MrBabadook/)\n\n[How To Make A Multiplayer Game With DarkRift - Video Tutorial](https://www.youtube.com/watch?v=P1SayM0sqcA) - @Dexter\n\n[Tic Tac Toe Tutorial - Video Tutorial by](https://www.youtube.com/watch?v=wqs39RIXmxc) - @HappySpider\n\nFor more resources and other guides related to DarkRift and multiplayer development in general, join the [community discord](https://discord.gg/DMdsYabNzB) and see #resources.\n\n## Building\nThis project requires Microsoft Visual Studio 2022 (the free Community edition is fine) or at least one Visual C# project will fail to build in VS2019 and below. See detailed exposition in [BUILDING.md](BUILDING.md)\n\n## Source Code License\nMost source files are licensed under MPL 2.0, with some exceptions where MIT applies. See [LICENSE.md](../LICENSE.md)\n\n## Contributing\nWe are happy to see community contributions to this project. See [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Code of Conduct\nBe civil. See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)\n\n## Wiki\nThe [wiki](https://github.com/DarkRiftNetworking/DarkRift-Networking/wiki) is publicly editable and is a place for anyone to add content, code snippets, tutorials and anything that would be useful to other members of the DarkRift Networking community.\n\nFeel free to add pages and use the space as you wish. You are more than welcome (and even encouraged) to cross post from personal blogs and link to external sites (as long as it's relevant)!\n\nDarkRift Networking is not responsible for any content or links on the wiki, although we will monitor it nevertheless.\n\n## Minimal Example\n\nExamples are using plain .NET with C# 9.0 top level statements for clarity. You can also use similar code in Unity.\n\nFirst, we start a server that gets its settings from the local file server.config.\n\n```csharp\nusing DarkRift;\nusing DarkRift.Server;\n\nServerSpawnData spawnData = ServerSpawnData.CreateFromXml(\"Server.config\");\n\nvar server = new DarkRiftServer(spawnData);\n\nvoid Client_MessageReceived(object? sender, MessageReceivedEventArgs e)\n{\n    using Message message = e.GetMessage();\n    using DarkRiftReader reader = message.GetReader();\n    Console.WriteLine(\"Received a message from the client: \" + reader.ReadString());\n}\n\nvoid ClientManager_ClientConnected(object? sender, ClientConnectedEventArgs e)\n{\n    e.Client.MessageReceived += Client_MessageReceived;\n\n    using DarkRiftWriter writer = DarkRiftWriter.Create();\n    writer.Write(\"World of Hel!\");\n\n    using Message secretMessage = Message.Create(666, writer);\n    e.Client.SendMessage(secretMessage, SendMode.Reliable);\n}\n\nserver.ClientManager.ClientConnected += ClientManager_ClientConnected;\n\nserver.StartServer();\n\nConsole.ReadKey(); // Wait until key press. Not necessary in Unity.\n```\n\nThe XML file server.config looks like this (hard to make shorter).\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\" ?\u003e\n\u003c!--\n  Configuring DarkRift server to listen at ports TCP 4296 and UDP 4297.\n--\u003e\n\u003cconfiguration xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"https://www.darkriftnetworking.com/DarkRift2/Schemas/2.3.1/Server.config.xsd\"\u003e\n  \u003cserver maxStrikes=\"5\" /\u003e\n  \n  \u003cpluginSearch/\u003e\n \n  \u003clogging\u003e\n    \u003clogWriters\u003e\n      \u003clogWriter name=\"ConsoleWriter1\" type=\"ConsoleWriter\" levels=\"trace, info, warning, error, fatal\"\u003e\n        \u003csettings useFastAnsiColoring=\"false\" /\u003e\n      \u003c/logWriter\u003e\n    \u003c/logWriters\u003e\n  \u003c/logging\u003e\n\n  \u003cplugins loadByDefault=\"false\"/\u003e\n\n  \u003cdata directory=\"Data/\"/\u003e\n\n  \u003clisteners\u003e\n    \u003clistener name=\"DefaultNetworkListener\" type=\"BichannelListener\" address=\"0.0.0.0\" port=\"4296\"\u003e\n      \u003csettings noDelay=\"true\" udpPort=\"4297\" /\u003e\n    \u003c/listener\u003e\n  \u003c/listeners\u003e\n\u003c/configuration\u003e\n\n```\n\nAnd finally, here is a client that connects to the server and sends \"Hello world!\" whilst receiving a string that should be \"World of Hel!\" (just be mindful about pressing any key since that terminates the program early).\n\n```csharp\nusing DarkRift;\nusing DarkRift.Client;\nusing System.Net;\n\nvar client = new DarkRiftClient();\n\nvoid Client_MessageReceived(object? sender, MessageReceivedEventArgs e)\n{\n    using Message message = e.GetMessage();\n    using DarkRiftReader reader = message.GetReader();\n    Console.WriteLine(\"Received a message from the server: \" + reader.ReadString());\n}\n\nclient.MessageReceived += Client_MessageReceived;\n\nclient.Connect(IPAddress.Loopback, tcpPort:4296, udpPort:4297, noDelay:true);\n\nConsole.WriteLine(\"Connected!\");\n\nusing DarkRiftWriter writer = DarkRiftWriter.Create();\nwriter.Write(\"Hello world!\");\n\nusing Message secretMessage = Message.Create(1337, writer);\nclient.SendMessage(secretMessage, SendMode.Reliable);\n\nConsole.ReadKey(); // Wait until key press. Not necessary in Unity.\n```\n\nDo note that \"Connected!\" message can be printed even after \"World of Hel!\" since DR2 is multithreaded.\n\nThis was an example of embedding DarkRift into your own programs. You can instead choose to implement DarkRift.Server.Plugin (see the manual) for looser coupling.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkriftnetworking%2Fdarkrift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkriftnetworking%2Fdarkrift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkriftnetworking%2Fdarkrift/lists"}