コード例 #1
0
ファイル: Room.cs プロジェクト: leancloud/Play-SDK-CSharp
        void HandleRoomCustomPropertiesChanged(UpdatePropertyNotification updatePropertyNotification)
        {
            var changedProps = CodecUtils.DeserializePlayObject(updatePropertyNotification.Attr);

            // 房间属性变化
            MergeCustomProperties(changedProps);
            Client.OnRoomCustomPropertiesChanged?.Invoke(changedProps);
        }
コード例 #2
0
ファイル: Room.cs プロジェクト: leancloud/Play-SDK-CSharp
        void HandlePlayerCustomPropertiesChanged(UpdatePropertyNotification updatePropertyNotification)
        {
            var changedProps = CodecUtils.DeserializePlayObject(updatePropertyNotification.Attr);
            // 玩家属性变化
            var player = GetPlayer(updatePropertyNotification.ActorId);

            if (player == null)
            {
                Logger.Error("No player id: {0} when player properties changed", updatePropertyNotification);
                return;
            }
            player.MergeCustomProperties(changedProps);
            Client.OnPlayerCustomPropertiesChanged?.Invoke(player, changedProps);
        }