Mirror/doc/Articles
Paul Pacheco 31b07ae02f
breaking: no need to override Serialize/Deserialize in messages (#2317)
* breaking: no need to override Serialize/Deserialize in messages

Messages no longer serilize themselves.  This has been decoupled.  Serializing a message is now done
via readers and writers, which can be either generated or user provided.

This lifts some restrictions,
* you no longer need to have a default constructor in messages
* Messages types can be recursive
* struct Messages don't need to provide an empty Serialize and Deserialize method

Before:
```cs
public struct ReadyMessage : IMessageBase
{
    public void Deserialize(NetworkReader reader) { }

    public void Serialize(NetworkWriter writer) { }
}
```

After:
```cs
public struct ReadyMessage : IMessageBase
{
}
```

BREAKING CHANGE: Messages must be public
BREAKING CHANGE: Use custom reader and writer instead of Serialize/Deserialize methods

* Remove unused method

* remove unused methods

* remove unused methods

* make all messages struct

* Fix test code generator

* Get rid of MessageBase

* Rename IMessageBase -> NetworkMessage

* add MessageBase as obsolete

* Use a default request

* Empty file to make asset store happy

* Apply suggestions from code review

Co-authored-by: James Frowen <jamesfrowendev@gmail.com>

Co-authored-by: James Frowen <jamesfrowendev@gmail.com>
2020-10-06 09:31:02 +02:00
..
Components Update NetworkRigidbody.md 2020-09-27 11:44:46 +01:00
Examples Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
General Update toc.yml 2020-09-17 23:59:28 +01:00
Guides breaking: no need to override Serialize/Deserialize in messages (#2317) 2020-10-06 09:31:02 +02:00
Transports Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
toc.yml Restructure docs (#2249) 2020-09-16 22:27:05 +01:00