Exemple #1
0
        public MemberCustomData(Room_UpdateMemberCustomData_Broadcast custom_data)
        {
            this.member_uid       = custom_data.member_uid;
            this.customDataNumber = custom_data.custom_data_number;
            this.custom_data      = new Dictionary <string, byte[]> ();
            foreach (Pair item in custom_data.updated_data)
            {
                this.custom_data [item.key] = item.value;
            }

            foreach (string key in custom_data.deleted_data)
            {
                if (this.custom_data.ContainsKey(key))
                {
                    this.custom_data.Remove(key);
                }
            }
        }
Exemple #2
0
        private void _RaiseRoomUpdateMemberCustomDataBroadcastEvent(ReceivedProtoEventArgs e)
        {
            int errorCode = e.errorCode;
            MemberCustomData customData = null;

            if (e.bytes != null && e.bytes.Length > 0)
            {
                Room_UpdateMemberCustomData_Broadcast b = _Deserialize <Room_UpdateMemberCustomData_Broadcast> (e.bytes);
                customData = new MemberCustomData(b);

                if (errorCode == ErrorCode.SUCCESS)
                {
                    if (PVPGlobal.roomInfo.member_infos.ContainsKey(customData.member_uid))
                    {
                        PVPGlobal.roomInfo.member_infos [customData.member_uid].OnUpdateCustomData(customData);
                    }
                }
            }

            if (ICM.handlerRegister != null && ICM.handlerRegister.roomMemberCustomDataBroadcastHandler != null)
            {
                ICM.handlerRegister.roomMemberCustomDataBroadcastHandler(errorCode, customData);
            }
        }