GithubHelp home page GithubHelp logo

johannesdeml / unity-net-core-networking-sockets Goto Github PK

View Code? Open in Web Editor NEW
86.0 8.0 11.0 1.21 MB

NetCoreServer Client implementation for Unity

License: MIT License

C# 93.32% Batchfile 0.56% Ruby 6.01% Shell 0.11%
unity unity3d tcp udp sockets network client-side multiplayer realtime

unity-net-core-networking-sockets's Introduction

Unity .Net Core Networking Client

Unity Editor Screenshot

Lightweight Unity client for NetCoreServer
openupm Unity 2018.1 or later

This is an example for a unity client that works with a NetCoreServer server application. The latest version is built with Unity 2020.3.1f1 and NetCoreServer 5.0.15.

Features

  • Supports SSL, TCP & UDP
  • Client code from NetCoreServer with wrappers for unity usage
  • Precompiled server executables for windows for easy testing
  • Small GC overhead - Usage of MemoryStream
  • Async send and receive - Does not block the Main Thread
  • Low level - just plain UPD/TCP/SSL
  • Tested with local, network and remote server
Platform SSL TCP UDP
Editor ✔️ ✔️ ✔️
Android ✔️ ✔️ ✔️
iOS ✔️ ✔️ ✔️
Windows ✔️ ✔️ ✔️

Installation

You can either install the package through the package manager with OpenUPM (Recommended) or download the scripts as a unity package

OpenUPM

# Install openupm-cli
$ npm install -g openupm-cli

# Enter your unity project folder
$ cd YOUR_UNITY_PROJECT_FOLDER

# Add package to your project
$ openupm openupm add com.deml.netcore-networking

Download

Latest Unity Package

Setup

  • Unity 2020.3.1f1 (Works with older versions as well)
  • Precompiled servers an in ServerWindows, run the bat you want to test
  • Open Samples/EchoClient/Scenes/NetworkExampleClient.unity and hit play.
  • Default port is 3333 when running the bat files.

Troubleshooting

  • I can't find the samples
    • The samples are stored in Assets/NetCoreNetworking/Samples~. A symlink at Assets/Samples points to the folder. That symlink might break when pulling for the first time on Windows. There are two solutions for it:
  • The precompiled server scripts don't work

TODO

  • Split messages back into the sent chunks
  • Fix bug: Repeated asnyc sending results in some packages not being sent for UDP
  • Support Websockets

Libraries

License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.