mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Websockets: use new EarlyUpdate to remove warnings
This commit is contained in:
parent
7e41302ca9
commit
7641aa73d4
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user