Ejemplo n.º 1
0
        protected override YxBaseGameUserInfo OnInitUser(ISFSObject userData)
        {
            var userInfo = new MahjongUserInfo();

            userInfo.Parse(userData);
            return(userInfo);
        }
Ejemplo n.º 2
0
 public override void SetData(ISFSObject datam, MahjongUserInfo userInfo)
 {
     if (datam.ContainsKey("laiziGang"))
     {
         mParams["laiziGang"] = new VarIntArray(datam.GetIntArray("laiziGang"));
     }
 }
Ejemplo n.º 3
0
 public override void SetData(ISFSObject datam, MahjongUserInfo userInfo)
 {
     if (datam.ContainsKey("visibleCards"))
     {
         mParams["nius"] = new VarIntArray(datam.GetIntArray("visibleCards"));
     }
 }
Ejemplo n.º 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"));
     }
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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"));
     }
 }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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"));
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 14
0
 public abstract void SetData(ISFSObject datam, MahjongUserInfo userInfo);
Ejemplo n.º 15
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     userInfo.IsAuto = data.ContainsKey("cards");
 }
Ejemplo n.º 16
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     mParams["userdata"] = new VarIsfsobject(data);
 }
Ejemplo n.º 17
0
 public override void SetData(ISFSObject data, MahjongUserInfo userInfo)
 {
     mParams["diling"] = new VarInt(data.TryGetInt("diling"));
 }