コード例 #1
0
        internal void MessageReceived(SyncMessage message)
        {
            var dat = message.ClientData.GetSerializeAble <SyncMessageData>();

            if (dat.MaxDataset == 1)
            {
                SetData(dat.DatasetBytes);
                return;
            }
            var user = Manager.Manager.Users.GetUserFromId(message.MessageRoot.RemoteId);

            if (!ReceivedBytes.ContainsKey(user))
            {
                ReceivedBytes.Add(user, new List <byte>());
            }
            ReceivedBytes[user].AddRange(dat.DatasetBytes);
            if (dat.CurrentDataset == dat.MaxDataset)
            {
                var b = ReceivedBytes[user].ToArray();
                ReceivedBytes.Remove(user);
                SetData(b);
            }
        }