static bool CheckSerialization <T>(T one, T two, out byte[] source)
        {
            source = CSerialization.Serialize <T>(one);
            byte[] destination = CSerialization.Serialize <T>(two);

            if (source.Length != destination.Length)
            {
                return(false);
            }

            bool result = true;

            for (int i = 0; i < source.Length; i++)
            {
                if (source[i] != destination[i])
                {
                    result = false;
                    return(false);
                }
            }

            return(result);
        }
        static void SynchronizeStructArray <T>(ESyncList list, List <T> one, ref List <T> result, CClientSocket ClientSocket)
        {
            for (int i = 0; i < one.Count; i++)
            {
                bool check = true;

                if (i > (result.Count - 1))
                {
                    result.Add(one[i]);
                    check = false;
                }

                bool   sync   = true;
                byte[] source = null;

                if (check)
                {
                    if (CheckSerialization <T>(one[i], result[i], out source))
                    {
                        sync = false;
                    }
                }
                else
                {
                    source = CSerialization.Serialize <T>(one[i]);
                }

                if (sync)
                {
                    SDataSync DataSync = new SDataSync
                    {
                        index = i,
                        type  = EDataSyncType.Set,
                        list  = list,
                        data  = source
                    };

                    ClientSocket.SendPacket <SDataSync>((byte)EControllerPackets.SyncData, DataSync);
                }
            }

            if (one.Count < result.Count)
            {
                int removed = 0;

                for (int i = one.Count; i < result.Count; i++)
                {
                    int index_correction = i - removed;
                    result.RemoveAt(index_correction);

                    SDataSync DataSync = new SDataSync
                    {
                        index = index_correction,
                        type  = EDataSyncType.Remove,
                        list  = list,
                        data  = null
                    };

                    removed++;

                    ClientSocket.SendPacket <SDataSync>((byte)EControllerPackets.SyncData, DataSync);
                }
            }
        }