Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Latest commit

 

History

History
70 lines (46 loc) · 4.05 KB

README_old.md

File metadata and controls

70 lines (46 loc) · 4.05 KB

Mirror Logo

Documentation Forum Discord release

Build Quality Gate Status SonarCloud Coverage Lines of Code Technical Debt Code Smells

MirrorNG Websocket is a transport for MirrorNG suitable for building and running webgl clients.

This is based on the Ninja Websockets, a pure C# library for serving and consuming websockets.

Documentation

Check out our Documentation.

Installation

The preferred installation method is Unity Package manager.

If you are using unity 2019.3 or later:

  1. Open your project in unity
  2. Install MirrorNG
  3. Click on Windows -> Package Manager
  4. Click on the plus sign on the left and click on "Add package from git URL..."
  5. enter https://github.com/MirrorNG/MirrorNG_Websocket.git?path=/Assets/Mirror/Websocket
  6. Unity will download and install MirrorNG Websocket

Alternatively you can download it from Download Mirror. You will need to install some dependencies yourself such as cecil.

Usage

  1. In Unity create a NetworkManager gameobject from the GameObject -> Networking -> NetworkManager.
  2. Then remove the TcpTransport (the default transport), and add a WsTransport.
  3. Update the Transport reference in the NetworkManager, NetworkClient and NetworkServer components.

The WebSockets Transport component in the Inspector window

Examples

We included several small example projects.

Contributing

There are several ways to contribute to this project:

  • Pull requests for bug fixes and features are always appreciated.
  • Pull requests to improve the documentation is also welcome
  • Make tutorials on how to use this
  • Test it and open issues
  • Review existing pull requests
  • Donations

When contributing code, please keep these things in mind:

  • KISS principle. Everything needs to be as simple as possible.
  • An API is like a joke, if you have to explain it is not a good one. Do not require people to read the documentation if you can avoid it.
  • Follow C# code conventions.
  • Follow SOLID principles as much as possible.
  • Keep your pull requests small and obvious, if a PR can be split into several small ones, do so.