Websockets: use new EarlyUpdate to remove warnings

This commit is contained in:
vis2k 2021-03-04 17:40:23 +08:00
parent 7e41302ca9
commit 7641aa73d4

View File

@ -113,22 +113,6 @@ public override void Shutdown()
server = null;
}
void LateUpdate()
{
ProcessMessages();
}
/// <summary>
/// Processes message in server and client queues
/// <para>Invokes OnData events allowing mirror to handle messages (Cmd/SyncVar/etc)</para>
/// <para>Called within LateUpdate, Can be called by user to process message before important logic</para>
/// </summary>
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<byte> 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
}
}