mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Client Broadcast: Traditional + FastPaced
This commit is contained in:
parent
5097d82707
commit
cb816b58f7
@ -1539,11 +1539,12 @@ static void Broadcast()
|
||||
// NetworkServer.Destroy)
|
||||
if (identity != null)
|
||||
{
|
||||
// 'Traditional' sync: send Traditional components over reliable.
|
||||
using (NetworkWriterPooled writer = NetworkWriterPool.Get())
|
||||
{
|
||||
// get serialization for this entity viewed by this connection
|
||||
// (if anything was serialized this time)
|
||||
identity.SerializeClient(writer);
|
||||
identity.SerializeClient(SyncMethod.Traditional, writer);
|
||||
if (writer.Position > 0)
|
||||
{
|
||||
// send state update message
|
||||
@ -1552,7 +1553,26 @@ static void Broadcast()
|
||||
netId = identity.netId,
|
||||
payload = writer.ToArraySegment()
|
||||
};
|
||||
Send(message);
|
||||
Send(message, Channels.Reliable);
|
||||
}
|
||||
}
|
||||
|
||||
// 'Fast Paced' sync: send Fast Paced components over unreliable
|
||||
// state is always 'initial' since unreliable delivery isn't guaranteed,
|
||||
using (NetworkWriterPooled writer = NetworkWriterPool.Get())
|
||||
{
|
||||
// get serialization for this entity viewed by this connection
|
||||
// (if anything was serialized this time)
|
||||
identity.SerializeClient(SyncMethod.FastPaced, writer);
|
||||
if (writer.Position > 0)
|
||||
{
|
||||
// send state update message
|
||||
EntityStateMessage message = new EntityStateMessage
|
||||
{
|
||||
netId = identity.netId,
|
||||
payload = writer.ToArraySegment()
|
||||
};
|
||||
Send(message, Channels.Unreliable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user