diff --git a/Assets/Mirror/Runtime/Transport/SimpleWebTransport/SimpleWebTransport.cs b/Assets/Mirror/Runtime/Transport/SimpleWebTransport/SimpleWebTransport.cs index 3d85617a6..2a56142ef 100644 --- a/Assets/Mirror/Runtime/Transport/SimpleWebTransport/SimpleWebTransport.cs +++ b/Assets/Mirror/Runtime/Transport/SimpleWebTransport/SimpleWebTransport.cs @@ -113,22 +113,6 @@ public override void Shutdown() server = null; } - void LateUpdate() - { - ProcessMessages(); - } - - /// - /// Processes message in server and client queues - /// Invokes OnData events allowing mirror to handle messages (Cmd/SyncVar/etc) - /// Called within LateUpdate, Can be called by user to process message before important logic - /// - public void ProcessMessages() - { - server?.ProcessMessageQueue(this); - client?.ProcessMessageQueue(this); - } - #region Client string GetClientScheme() => (sslEnabled || clientUseWss) ? SecureScheme : NormalScheme; string GetServerScheme() => sslEnabled ? SecureScheme : NormalScheme; @@ -204,6 +188,12 @@ public override void ClientSend(int channelId, ArraySegment segment) client.Send(segment); } + + // messages should always be processed in early update + public override void ClientEarlyUpdate() + { + client?.ProcessMessageQueue(this); + } #endregion #region Server @@ -294,6 +284,12 @@ public override Uri ServerUri() }; return builder.Uri; } + + // messages should always be processed in early update + public override void ServerEarlyUpdate() + { + server?.ProcessMessageQueue(this); + } #endregion } }