Mirror/doc/Articles/Guides
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
..
Communications Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
CommunityGuides Update index.md 2020-09-21 12:27:54 +01:00
DevServer Update index.md 2020-10-01 17:03:15 +01:00
GameObjects Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
Sync Document how to use new synclists 2020-10-02 13:56:20 -05:00
Attributes.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
Authority.md Update Authority.md 2020-09-24 14:30:06 +01:00
BestPractices.md breaking: no need to override Serialize/Deserialize in messages (#2317) 2020-10-06 09:31:02 +02:00
ClockSync.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
DataTypes.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
FAQ.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
IDs.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
index.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
NetworkBehaviour.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
Profiler.md Update Profiler.md (#2304) 2020-10-02 09:10:05 +02:00
Profiler.png Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
Resources.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
Serialization.md jagged arrays are fine 2020-10-05 16:26:19 -05:00
toc.yml Update toc.yml 2020-09-17 16:13:35 +01:00
UNetDirections.jpg Restructure docs (#2249) 2020-09-16 22:27:05 +01:00
Visibility.md Restructure docs (#2249) 2020-09-16 22:27:05 +01:00