예제 #1
0
        //投票 解散房间 2发起 3同意 -1拒绝
        public void SendRequestHandsUp(object data)
        {
            int            type     = (int)data;
            JlGameUserInfo userInfo = GameData.GetPlayerInfo <JlGameUserInfo>();

            if (GameData.CreateRoomInfo.CurRound > 0)
            {
                ISFSObject iobj = new SFSObject();
                iobj.PutUtfString("cmd", "dismiss");
                iobj.PutInt(RequestKey.KeyType, type);
                iobj.PutInt(RequestKey.KeyId, int.Parse(userInfo.UserId));
                SendFrameRequest("hup", iobj);
            }
            else
            {
                //局外只有房主才能解散,其他玩家只能退出
                if (int.Parse(userInfo.UserId) == GameData.OwnerId)
                {
                    SendFrameRequest("dissolve", new SFSObject());
                }
                else
                {
                    EventObj.SendEvent("GameManagerEvent", "Quit", null);
                }
            }
        }
예제 #2
0
        IEnumerator AllocateCard(int[] cards, string[] everyCardNum, int selfSeat)
        {
            var playerArr = _gdata.PlayerList;

            for (int i = 0; i < playerArr.Length; i++)
            {
                for (int j = 0; j < int.Parse(everyCardNum[i]); j++)
                {
                    yield return(new WaitForSeconds(0.0001f));

                    bool isSelf = selfSeat == i;
                    _gdata.GetPlayer <JlGamePlayer>(i).GetCardsOnStart(CardsList[CardsList.Count - 1], isSelf, int.Parse(everyCardNum[i]));
                    CardsList.RemoveAt(CardsList.Count - 1);
                    EventObj.SendEvent("SoundEvent", "PlayEffect", new JlGameSound.SoundData(JlGameSound.EnAudio.Sendcard, _gdata.GetPlayerInfo <JlGameUserInfo>().SexI));
                }
            }
            yield return(new WaitForSeconds(0.5f));

            for (int i = 0; i < playerArr.Length; i++)
            {
                _gdata.GetPlayer <JlGamePlayer>(i).SetCardValue(cards, cards.Length);
            }
        }