예제 #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]);
     }
 }