示例#1
0
        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);
        }
示例#2
0
        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);
                }
            }
        }
示例#3
0
 private void TargetPerformSync_UnreliableNoDelay(NetworkConnection conn, NetworkSyncableVarsDirtyDataChunk varsToSync)
 {
 }
示例#4
0
 private void CmdPerformSync_UnreliableNoDelay(NetworkSyncableVarsDirtyDataChunk finalVarToSync)
 {
     PerformTargetSync(2, finalVarToSync);
 }
示例#5
0
 private void CmdPerformSync_Reliable(NetworkSyncableVarsDirtyDataChunk finalVarToSync)
 {
     PerformTargetSync(0, finalVarToSync);
 }
示例#6
0
 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]);
     }
 }