public static NetworkSyncableVarsDirtyDataChunk ReadNetworkSyncableVarsDirtyDataChunk(this NetworkReader reader) { int dataCount = reader.ReadInt32(); NetworkSyncableVarsDirtyDataChunk chunk = new NetworkSyncableVarsDirtyDataChunk(); for (int i = 0; i < dataCount; i++) { chunk.Datas.Add(reader.ReadNetworkSyncableVarsDirtyData()); } return(chunk); }
private void PerformTargetSync(int channel, NetworkSyncableVarsDirtyDataChunk dirtyVarsToSync) { Action <NetworkConnection, NetworkSyncableVarsDirtyDataChunk> targetMethod = GetTargetPerformSyncMethod(channel); foreach (NetworkConnectionToClient conn in NetworkServer.connections.Values) { if (conn != NetworkServer.localConnection) { targetMethod.Invoke(conn, dirtyVarsToSync); } } }
private void TargetPerformSync_UnreliableNoDelay(NetworkConnection conn, NetworkSyncableVarsDirtyDataChunk varsToSync) { }
private void CmdPerformSync_UnreliableNoDelay(NetworkSyncableVarsDirtyDataChunk finalVarToSync) { PerformTargetSync(2, finalVarToSync); }
private void CmdPerformSync_Reliable(NetworkSyncableVarsDirtyDataChunk finalVarToSync) { PerformTargetSync(0, finalVarToSync); }
public static void WriteNetworkSyncableVarsDirtyDataChunk(this NetworkWriter writer, NetworkSyncableVarsDirtyDataChunk dataChunk) { writer.WriteInt32(dataChunk.Datas.Count); for (int i = 0; i < dataChunk.Datas.Count; i++) { writer.WriteNetworkSyncableVarsDirtyData(dataChunk.Datas[i]); } }