#1 Open Source Unity Networking Library
Go to file
Martin Evans 28b067d3cd refactor: Generic IMessageBase to allow struct message types (#619)
* - Added a `IMessageBase` as an interface to `MessageBase`. Existing messages which inherit `MessageBase` (including ones which do not implement Serialize/Deserialize and rely on the weaver) will continue to work in exactly the same way as before!
 - Modified any methods which were generic `T where T : MessageBase` to be `T where T : IMessageBase`. this does not change things at all for all existing usages of the method.

These two changes allow end users to implement IMessageBase as a `struct` instead of `MessageBase` as a `class`, so they are no longer forced to allocate message objects in their own code.

* Update .gitignore

* Update Messages.cs

* Update MessageBaseTests.cs

* Update MessageBaseTests.cs

* Update MessageBaseTests.cs
2019-03-20 19:44:42 -05:00
.github/ISSUE_TEMPLATE update branch suggestions 2019-01-18 08:57:02 -06:00
Assets refactor: Generic IMessageBase to allow struct message types (#619) 2019-03-20 19:44:42 -05:00
docs docs: document synclists 2019-03-20 06:49:27 -05:00
ProjectSettings Mirror List Server example (#611) 2019-03-20 09:38:53 +01:00
.editorconfig Switched braces to silent as suggested by Petris 2019-02-23 07:32:17 -06:00
.gitattributes ensure future c# code has consistent EOL 2019-01-05 10:09:05 -06:00
.gitignore We don't need to commit mdb files 2019-02-07 17:48:02 -06:00
.releaserc.yml CI: Implement semantic versioning (#601) 2019-03-19 16:44:43 +01:00
appveyor.yml CI: Implement semantic versioning (#601) 2019-03-19 16:44:43 +01:00
CONTRIBUTING.md Added Documentation bullet point 2019-03-13 14:02:33 -04:00
LICENSE License updated 2018-08-24 17:01:31 +02:00
README.md Update README.md 2019-03-16 22:11:15 +01:00

Mirror Logo

Download Documentation Forum donate Build status Discord release

Mirror is a high level Networking API for Unity, built on top of the low level Telepathy library.

Mirror is built and tested for MMO Scale Networking by the developers of uMMORPG, uSurvival and Cubica.

Mirror is optimized for ease of use and probability of success. Projects that use Mirror are small, concise and maintainable. uMMORPG was possible with <6000 lines of code. We needed a networking library that allows us to launch our games, period.

With Mirror, the Server & Client are ONE project (hence the name). Instead of having one code base for the server and one for the client, we simply use the same code for both of them.

  • [Server] / [Client] tags can be used for the server-only and client-only parts.
  • [Command] are used for Client->Server, and [ClientRpc] / [TargetRpc] for Server->Client communication.
  • [SyncVar]s and SyncLists are used to automatically synchronize state.

What previously required 10.000 lines of code, now takes 1.000 lines of code. Therein lies the magic of Mirror.

Note: Mirror is based on Unity's abandoned UNET Networking system. We fixed it up and pushed it to MMO Scale.

Documentation

Check out our Documentation.

If you are migrating from UNET, then please check out our Migration Guide. Don't panic, it's very easy and won't take more than 5 minutes.

Installation

We recommend to download the most stable Mirror version from the Asset Store!

For the latest improvements, Download Mirror directly from this repository and extract it in your Assets folder.

Examples

We included several smaller example projects in Mirror.

For a fully polished, complete project example, consider uMMORPG or uSurvival.

Transports

Mirror supports many different low level networking transports:

Donations & Priority Support

Please support Mirror on Patreon. Priority support included!

Benchmarks

The Mirror Mantra

“Would you tell me, please, which way I ought to go from here?”
“That depends a good deal on where you want to get to," said the Cat.
"I dont much care where—“ said Alice.
“Then it doesnt matter which way you go,” said the Cat.
        - Alice in Wonderland (Lewis Carroll)

As Indie Developers, our #1 goal for Mirror is Ease of Use.

If you want to contribute, always follow the KISS principle. Everything needs to be as simple as possible. As result, the code will be stable, easy to understand, easy to modify and easy to maintain 5 years from now when our games are still running.

Pull Requests for bug fixes are always highly appreciated. New features will be considered very carefully and will only be merged if they are the most simple solution to the given problem.