예제 #1
0
        protected override YxBaseGameUserInfo OnInitUser(ISFSObject userData)
        {
            var userInfo = new MahjongUserInfo();

            userInfo.Parse(userData);
            return(userInfo);
        }
예제 #2
0
 public override void SetData(ISFSObject datam, MahjongUserInfo userInfo)
 {
     if (datam.ContainsKey("laiziGang"))
     {
         mParams["laiziGang"] = new VarIntArray(datam.GetIntArray("laiziGang"));
     }
 }
예제 #3
0
 public override void SetData(ISFSObject datam, MahjongUserInfo userInfo)
 {
     if (datam.ContainsKey("visibleCards"))
     {
         mParams["nius"] = new VarIntArray(datam.GetIntArray("visibleCards"));
     }
 }
예제 #4
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     base.SetData(data, userInfo);
     //胡牌
     if (data.ContainsKey("hucardlist"))
     {
         mParams["hucardlist"] = new VarIntArray(data.GetIntArray("hucardlist"));
     }
 }
예제 #5
0
        /// <summary>
        /// 设置玩家Item信息
        /// </summary>
        private void SetPlayerInfo(int chair, MahjongUserInfo data)
        {
            if (!GameCenter.GameProcess.IsCurrState <StateGamePlaying>())
            {
                PlayersOther.ReadyState(chair, data.IsReady);
            }
            PlayerInfoItem item = this[chair];

            item.IsTing = data.IsAuto;
        }
예제 #6
0
        public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
        {
            if (data.ContainsKey("visibleCards"))
            {
                var hasLiang = data.TryGetBool(ProtocolKey.KeyHasLiang);
                mParams["liangdaoCards"] = new VarIntArray(data.GetIntArray("visibleCards"));
                mParams["hasLiang"]      = new VarBool(hasLiang);

                userInfo.IsAuto = hasLiang;
            }
        }
예제 #7
0
        public MahjongResult(int seat)
        {
            Seat  = seat;
            Chair = MahjongUtility.GetChair(seat);
            MahjongUserInfo data = GameCenter.DataCenter.Players[Chair];

            if (null != data)
            {
                Id   = data.Id;
                Name = data.NickM;
            }
        }
예제 #8
0
        public static void PlayPlayerSound(int chair, string soundName)
        {
            MahjongUserInfo data   = GameCenter.DataCenter.Players[chair];
            string          sound  = Sex(data.SexI);
            string          source = sound;

            if (LanguageVoice == (int)CtrlSwitchType.Close)
            {
                source = GameKey + sound;
            }
            PlaySound(sound + "_" + soundName, source);
        }
예제 #9
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     if (data.ContainsKey("qiduitings"))
     {
         int[] array = data.GetIntArray("qiduitings");
         userInfo.SetTinglist(array);
     }
     if (data.ContainsKey("guoval"))
     {
         mParams["guoval"] = new VarInt(data.GetInt("guoval"));
     }
 }
예제 #10
0
        private void SetPlayerInfo()
        {
            ResetPlayersItem();
            MahjongUserInfo    data        = null;
            MahjongPlayersData playersData = GameCenter.DataCenter.Players;

            for (int i = 0; i < playersData.CurrPlayerCount; i++)
            {
                data = playersData[i];
                PlayersItem[data.Chair].gameObject.SetActive(true);
                PlayersItem[data.Chair].SetDismissSelect(StateSprites[0]);
                PlayersItem[data.Chair].SetDismissInfo(data.NickM, playersData.GetPlayerHead(data.Chair));
            }
        }
예제 #11
0
        /// <summary>
        /// CPG等特效和声音
        /// </summary>
        /// <param name="chair">座位号</param>
        /// <param name="effectType">特效对象</param>
        /// <param name="music">特效声音</param>
        public static void PlayOperateEffect(int chair, PoolObjectType effectType)
        {
            MahjongUserInfo data   = GameCenter.DataCenter.Players[chair];
            string          sound  = Sex(data.SexI);
            string          source = sound;

            if (LanguageVoice == (int)CtrlSwitchType.Close)
            {
                source = GameKey + sound;
            }
            //播放特效
            GameCenter.Hud.UIPanelController.PlayPlayerUIEffect(chair, effectType);
            //播放特效声音
            PlaySound(sound + "_" + effectType.ToString(), source);
        }
예제 #12
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     //状态
     if (data.ContainsKey("xuezhanstatue"))
     {
         VarInt state = data.GetInt("xuezhanstatue");
         mParams["state"] = state;
     }
     //定缺
     if (data.ContainsKey("huanType"))
     {
         mParams["htype"] = new VarInt(data.GetInt("huanType"));
     }
     //胡牌
     if (data.ContainsKey("hucard"))
     {
         mParams["hcard"] = new VarInt(data.GetInt("hucard"));
     }
 }
예제 #13
0
        //播放麻将音效
        public static void PlayMahjongSound(int chair, int value)
        {
            MahjongUserInfo data   = GameCenter.DataCenter.Players[chair];
            string          sound  = Sex(data.SexI);
            string          source = sound;

            if (LanguageVoice == (int)CtrlSwitchType.Close)
            {
                source = GameKey + sound;
            }
            if (GameCenter.DataCenter.Config.RondomPlayMahjongSound)
            {
                int n = Random.Range(0, 2);
                if (n == 1)
                {
                    PlaySound(sound + "_" + value + "_1", source);
                    return;
                }
            }
            PlaySound(sound + "_" + value, source);
        }
예제 #14
0
 public abstract void SetData(ISFSObject datam, MahjongUserInfo userInfo);
예제 #15
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     userInfo.IsAuto = data.ContainsKey("cards");
 }
예제 #16
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     mParams["userdata"] = new VarIsfsobject(data);
 }
예제 #17
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     mParams["diling"] = new VarInt(data.TryGetInt("diling"));
 }