From efa9c33bd2ce472fb1f2d295241168c683de3204 Mon Sep 17 00:00:00 2001 From: Alven <72870405+ooonush@users.noreply.github.com> Date: Tue, 7 May 2024 08:29:02 +0500 Subject: [PATCH] Removed Serialization Limitation info from README --- README.md | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/README.md b/README.md index 2ca49fe..85fd51b 100644 --- a/README.md +++ b/README.md @@ -67,36 +67,6 @@ As you can see, the `PlayerId` string is only available on the server, which ens Clients cannot recognize the PlayerId of other players, and so that they can still distinguish between players, there is a ClientPlayerId. This is a unique player identifier that is available to both server and clients. -### Unity technical limitations. -You may need to synchronize SessionPlayer over the network. For example, send it using Rpc, or use it in [SyncVar]. -SessionManagement supports a custom serializer that allows you to do this. -But unfortunately, due to Unity limitations, FishNet can't find custom serializers in other Assemblies. - -You get similar errors in the console: -![image](https://github.com/ooonush/com.alven.fishnet.sessionmanagement/assets/72870405/bb35c321-d9a9-4a43-bfdd-9e9b541cf256) - -This means that you need to write a custom serializer in each Assembly in which you want to synchronize SessionPlayer. - -To do this, you can simply copy this script anywhere in your assembly: - -```csharp -using FishNet.Alven.SessionManagement; -using FishNet.Serializing; - -public static class SessionPlayerSerializer -{ - public static void WriteSessionPlayer(this Writer writer, SessionPlayer player) - { - FishNet.Alven.SessionManagement.SessionPlayerSerializer.WriteSessionPlayer(writer, player); - } - - public static SessionPlayer ReadSessionPlayer(this Reader reader) - { - return FishNet.Alven.SessionManagement.SessionPlayerSerializer.ReadSessionPlayer(reader); - } -} -``` - ## ServerSessionManager. `ServerSessionManager`, oddly enough, is responsible for the server side of Session Management. This is similar to `ServerManager`.