public GameObject ScrollParent; //父物体预制体
    // Use this for initialization
    void Start()
    {
        ClientToServerMsg.Send(FrameworkForCSharp.NetWorks.Opcodes.Client_GetAgentCreateXYQPRoomList);
        CloseBtn.onClick.Add(new EventDelegate(this.ClosePanel));

        GameEventDispatcher.Instance.addEventListener(EventIndex.AngentRoomListUpdata, this.SetInfo);
    }
    //请求服务器 获得奖励
    public void RewardUserRequest()
    {
        //获得奖励的等级
        string rewardLevel = LogicRewardsAppearance.getRewardsLevel(curPoitns);

        uint a = uint.Parse(rewardLevel);

        switch (a)
        {
        case 1:
            uint index = 1;
            ClientToServerMsg.Send(Opcodes.Client_Selfie, index);
            break;

        case 2:
            uint index1 = 2;
            ClientToServerMsg.Send(Opcodes.Client_Selfie, index1);
            break;

        case 3:
            uint index2 = 3;
            ClientToServerMsg.Send(Opcodes.Client_Selfie, index2);
            break;
        }
    }
    /// <summary>
    /// 登录授权
    /// </summary>
    public void Authorize()
    {
        Player.Instance.openID    = SystemInfo.deviceUniqueIdentifier;      //"4a14a16a941f3eeade18ba90e009f960";//SystemInfo.deviceUniqueIdentifier;//
        Player.Instance.otherName = Player.Instance.openID.Substring(0, 6); // SystemInfo.deviceUniqueIdentifier.Substring(0, 6);// Player.Instance.openID.Substring(0,6);//SystemInfo.deviceUniqueIdentifier.Substring(0, 6);//
        Player.Instance.headID    = "headid";
        Player.Instance.sex       = 1;
        ClientToServerMsg.Send(Opcodes.Client_Character_Create, Player.Instance.openID, Player.Instance.otherName, Player.Instance.headID, (byte)Player.Instance.sex);
        return;

        if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
        {
            ssdk.Authorize(PlatformType.WeChat);
            UIManager.Instance.ShowUiPanel(UIPaths.LoadingObj);
        }
        else if (Application.platform == RuntimePlatform.WindowsEditor)
        {
            // Player.Instance.openID = DateTime.Now.Ticks.ToString();
            // Player.Instance.otherName = DateTime.Now.Ticks.ToString().Substring(0, 6);
            Player.Instance.openID    = SystemInfo.deviceUniqueIdentifier;      //"4a14a16a941f3eeade18ba90e009f960";//SystemInfo.deviceUniqueIdentifier;//
            Player.Instance.otherName = Player.Instance.openID.Substring(0, 6); // SystemInfo.deviceUniqueIdentifier.Substring(0, 6);// Player.Instance.openID.Substring(0,6);//SystemInfo.deviceUniqueIdentifier.Substring(0, 6);//
            Player.Instance.headID    = "headid";
            Player.Instance.sex       = 1;
            ClientToServerMsg.Send(Opcodes.Client_Character_Create, Player.Instance.openID, Player.Instance.otherName, Player.Instance.headID, (byte)Player.Instance.sex);
        }
    }
    void Start()
    {
        transform.Find("Version").GetComponent <UILabel>().text = "版本号:" + Application.version;
        UIEventListener.Get(btnLogin).onClick   = OnClick;
        UIEventListener.Get(QuickLogin).onClick = OnClick;
        if (ServerInfo.Data.login_with_device && Application.platform == RuntimePlatform.IPhonePlayer)
        {
            //btnLogin.GetComponent<UISprite>().spriteName = "UI_login_btn_FastLogin";
            QuickLogin.SetActive(true);
            btnLogin.SetActive(false);
        }

        else
        {
            QuickLogin.SetActive(false);
            btnLogin.SetActive(true);


            if (Player.Instance.openID != "n")
            {
                btnLogin.gameObject.SetActive(false);
                ClientToServerMsg.Send(Opcodes.Client_Character_Create, Player.Instance.openID, Player.Instance.otherName, Player.Instance.headID, (byte)Player.Instance.sex);
            }
        }

        UserInfoContentBtn.onClick.Add(new EventDelegate(this.ShowUserInfoPanel));
        CloseBtn.onClick.Add(new EventDelegate(this.CloseUserInfo));
        ChoseBtn.onClick.Add(new EventDelegate(this.ChoseUserInfo));
    }
 void OnClick(GameObject go)
 {
     SoundManager.Instance.PlaySound(UIPaths.BUTTONCLICK);
     //if (go == btnBGSoundOff)
     //{
     //    Player.Instance.GameBGSoundOff = !Player.Instance.GameBGSoundOff;
     //    ChangeBGOff();
     //}
     //else if(go == btnEffectSoundOff)
     //{
     //    Player.Instance.GameEffectSoundOff = !Player.Instance.GameEffectSoundOff;
     // ChangeEffectOff();
     //}
     if (go == btnClose)
     {
         UIManager.Instance.HideUiPanel(UIPaths.PanelSetting2);
     }
     else if (go == btnOperate)
     {
         if (DzViewMain.Instance != null)
         {
             Player.Instance.Logout();
         }
         else
         {
             ClientToServerMsg.Send(FrameworkForCSharp.NetWorks.Opcodes.Client_DisposeRoom, GameData.m_TableInfo.id);
         }
     }
 }
 private void ItemClick()
 {
     if (!IsPlaying)
     {
         ClientToServerMsg.Send(Opcodes.Client_PlayerEnterRoom, InfoData.codeId, Input.location.lastData.latitude, Input.location.lastData.longitude);
     }
 }
示例#7
0
    private void OnClick(GameObject go)
    {
        SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
        if (go == btnShare)
        {
            AuthorizeOrShare.Instance.ShareCapture();
        }
        else if (go == btnRight)
        {
            if (GameData.m_IsNormalOver)
            {
                UIManager.Instance.ShowUiPanel(UIPaths.UIPanel_TotalScore, OpenPanelType.MinToMax);
                UIManager.Instance.HideUiPanel(UIPaths.UIPanel_RoundOver);
            }
            else
            {
                ClientToServerMsg.Send(Opcodes.Client_PlayerReady, GameData.m_TableInfo.id);
            }

            UIManager.Instance.HideUiPanel(UIPaths.UIPanel_RoundOver);
        }
        else if (go == ChangeTable.gameObject)
        {
            ClientToServerMsg.Send(Opcodes.Client_PiPei_ChangeDesk, (byte)GameData.GlobleRoomType, GameData.m_TableInfo.id, Input.location.lastData.latitude, Input.location.lastData.longitude);
        }

        else if (go == QuiteBtn.gameObject)
        {
            ClientToServerMsg.Send(Opcodes.Client_PlayerLeaveRoom, GameData.m_TableInfo.id, true);
        }
    }
示例#8
0
 /// <summary>
 /// 绑定邀请人
 /// </summary>
 private void BindFriend()
 {
     if (InputFiled.value != "")
     {
         ulong inviteGuid = ulong.Parse(InputFiled.value);
         ClientToServerMsg.Send(Opcodes.Client_SetInviteGuid, inviteGuid);
     }
 }
示例#9
0
 /// <summary>
 ///     继续游戏
 /// </summary>
 private void GoOnGame()
 {
     if (!GameData.m_IsNormalOver)
     {
         ClientToServerMsg.Send(Opcodes.Client_PlayerReady, GameData.m_TableInfo.id); //发送准备协议
     }
     UIManager.Instance.HideUiPanel(UIPaths.PanelGameOverSmall);
 }
 /// <summary>
 /// 快速登录
 /// </summary>
 public void QuickLog()
 {
     Player.Instance.openID    = SystemInfo.deviceUniqueIdentifier;      //  "92820196e9ab51daaf5d94e01a18ed77";// SystemInfo.deviceUniqueIdentifier;//  "1000293";//  "ouf9U06WBhaIqxjrHfJaWmm0-szQ";//
     Player.Instance.otherName = Player.Instance.openID.Substring(0, 6); // SystemInfo.deviceUniqueIdentifier.Substring(0, 6);//"095f39";//
     Player.Instance.headID    = "headid";
     Player.Instance.sex       = 1;
     ClientToServerMsg.Send(Opcodes.Client_Character_Create, Player.Instance.openID, Player.Instance.otherName, Player.Instance.headID, (byte)Player.Instance.sex);
     return;
 }
 void OnClick(GameObject go)
 {
     SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
     if (go == btnAgree)
     {
         ClientToServerMsg.Send(Opcodes.Client_PlayerDealQueryLeaveResult, GameData.m_TableInfo.id, true);
     }
     else if (go == btnJuJue)
     {
         ClientToServerMsg.Send(Opcodes.Client_PlayerDealQueryLeaveResult, GameData.m_TableInfo.id, false);
     }
 }
示例#12
0
 void onInviteRoomID(string msg)
 {
     if (msg.Length == 6)
     {
         Player.Instance.shareRoomID = uint.Parse(msg);
         if (SceneManager.GetActiveScene().name == "02_Main")
         {
             ClientToServerMsg.Send(Opcodes.Client_PlayerEnterRoom, Player.Instance.shareRoomID, Input.location.lastData.latitude, Input.location.lastData.longitude);
             Player.Instance.shareRoomID = 0;
         }
     }
 }
示例#13
0
 private void CreatWDHRoom()
 {
     if (!GameData.IsClubAutoCreatRoom)
     {
         ClientToServerMsg.Send(Opcodes.Client_PlayerCreateXYQPRoom, (byte)RoomType.ZB, (byte)RoundNum, (byte)PayMethod, Input.location.lastData.latitude, Input.location.lastData.longitude);
         SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
     }
     else
     {
         ClientToServerMsg.Send(Opcodes.Client_Club_Config_AutoRoom, GameData.CurrentClubInfo.Id, (byte)RoomType.ZB, (byte)RoundNum);
         SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
     }
 }
    private void SendInputChat()
    {
        string fileName = "";

        if (InputChat.value == "" || InputChat.value == "请输入聊天内容。。。")
        {
        }
        else
        {
            fileName = "2@" + Player.Instance.guid + "@" + InputChat.value;
            ClientToServerMsg.Send(Opcodes.Client_PlayerSpeak, GameData.m_TableInfo.id, fileName);
            UIManager.Instance.HideUiPanel(UIPaths.PanelChat);
        }
    }
示例#15
0
 /// <summary>
 /// 创建ddz房间
 /// </summary>
 private void CreatDDZRoom()
 {
     // CreateRoomPayType俱乐部自动开房
     if (!GameData.IsClubAutoCreatRoom)
     {
         ClientToServerMsg.Send(Opcodes.Client_PlayerCreateXYQPRoom, (byte)RoomType.NN, (byte)RoundNum, (byte)PayMethod, Input.location.lastData.latitude, Input.location.lastData.longitude, (byte)1, (byte)DiFenIndex, EnShunZhiNiu, EnBoomNiu, EnWuXiaoNiu, EnWuHuaNiu, EnXianJiaMaiMa);
         SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
     }
     else
     {
         ClientToServerMsg.Send(Opcodes.Client_Club_Config_AutoRoom, GameData.CurrentClubInfo.Id, (byte)RoomType.NN, (byte)RoundNum, (byte)1, (byte)DiFenIndex, EnShunZhiNiu, EnBoomNiu, EnWuXiaoNiu, EnWuHuaNiu, EnXianJiaMaiMa);
         SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
     }
 }
 //兑换30房卡
 private void ChangeThirtyRoomCard()
 {
     if (Player.Instance.money < 30)
     {
         GameData.ResultCodeStr = "钻石不足";
         UIManager.Instance.ShowUiPanel(UIPaths.PanelDialog, OpenPanelType.MinToMax);
     }
     else
     {
         MoneyType type = MoneyType.Card;
         uint      num  = 60;
         ClientToServerMsg.Send(Opcodes.Client_ExchangDiamondToCard, (byte)type, num);
     }
 }
示例#17
0
    void Start()
    {
        ClientToServerMsg.Send(Opcodes.Client_RoomRecordBase, 0, 10000);

        listItem = new List <GameObject>();
        for (var i = 0; i < itemHistoryBase.childCount; i++)
        {
            itemHistoryBase.GetChild(i).gameObject.SetActive(false);
            listItem.Add(itemHistoryBase.GetChild(i).gameObject);
        }

        UIEventListener.Get(btnClose).onClick = OnClick;
        for (int i = 0; i < listItem.Count; i++)
        {
            UIEventListener.Get(listItem[i]).onClick = OnClick;
        }
    }
示例#18
0
    //上传玩家说话声音
    IEnumerator UploadMusic(byte[] bytes, string fileName, string file)
    {
        fileName = "1@" + fileName;
        WWWForm newForm = new WWWForm();

        newForm.AddField("path", file);
        newForm.AddField("id", fileName);
        newForm.AddBinaryData("Sound", bytes, "photo.ogg");
        WWW w = new WWW(UIPaths.CHAT_UPLOAD_SOUND_PATH, newForm);

        while (!w.isDone)
        {
            Debug.Log("not isDone!");
            yield return(new WaitForEndOfFrame());
        }
        ClientToServerMsg.Send(Opcodes.Client_PlayerSpeak, GameData.m_TableInfo.id, fileName);
        yield break;
    }
    protected override void OnAuthSuccessed()
    {
        Log.Debug("連接服務器成功...");
        ConnServer.m_IsConnectServer = true;

        if (!Player.Instance.isLogin)
        {
            ManagerScene.Instance.LoadScene(SceneType.Login);
            AmapLocationManager.Instance.StartAmapLocation();//开始定位
        }
        else
        {
            if (Player.Instance.isLogin)
            {
                ClientToServerMsg.Send(Opcodes.Client_Character_Create, Player.Instance.openID, Player.Instance.otherName, Player.Instance.headID, (byte)Player.Instance.sex);
            }
        }
    }
 /// <summary>
 /// 获取用户信息回调
 /// </summary>
 /// <param name="reqID"></param>
 /// <param name="state"></param>
 /// <param name="type"></param>
 /// <param name="data"></param>
 void OnGetUserInfoResultHandler(int reqID, ResponseState state, PlatformType type, Hashtable data)
 {
     if (state == ResponseState.Success)
     {
         string   strs = MiniJSON.jsonEncode(data);
         JsonData jd   = JsonMapper.ToObject(strs);
         Player.Instance.openID    = jd["openid"].ToString();
         Player.Instance.otherName = jd["nickname"].ToString();
         Player.Instance.headID    = jd["headimgurl"].ToString();
         Player.Instance.sex       = byte.Parse(jd["sex"].ToString());
         UIManager.Instance.HideUiPanel(UIPaths.LoadingObj);
         ClientToServerMsg.Send(Opcodes.Client_Character_Create, Player.Instance.openID, Player.Instance.otherName, Player.Instance.headID, (byte)Player.Instance.sex);
     }
     else
     {
         Debug.Log("获取信息失败");
     }
 }
    public UIButton DisposeRoomBtn;//解散房间按钮

    // public UITexture ImgHead;
    // public UILabel LBName;
    // public UILabel LBGuid;

    // Use this for initialization
    void Start()
    {
        DisposeRoomBtn.onClick.Add(new EventDelegate(() =>
        {
            // ClientToServerMsg.SendDisPosRoom(GameData.m_TableInfo.id);

            ClientToServerMsg.Send(Opcodes.Client_PlayerLeaveRoom, GameData.m_TableInfo.id, true);
            gameObject.SetActive(false);
        }));
        UIEventListener.Get(btnClose).onClick   = OnClick;
        UIEventListener.Get(btnOperate).onClick = OnClick;
        CloseBtn.onClick.Add(new EventDelegate(this.Close));

        if (Player.Instance.GameBGSoundOff)
        {
            MusicSlider.value = Player.Instance.GameBGSoundValue;
        }
        else
        {
            MusicSlider.value = 0;
        }

        if (Player.Instance.GameEffectSoundOff)
        {
            SoundEffectSlider.value = Player.Instance.GameEffectSoundValue;
        }
        else
        {
            SoundEffectSlider.value = 0;
        }

        MusicSlider.onChange.Add(new EventDelegate(this.MusicValueChange));

        SoundEffectSlider.onChange.Add(new EventDelegate(this.SoundValueChange));

        //UIEventListener.Get(btnClose).onClick = OnClick;
        //UIEventListener.Get(btnOperate).onClick = OnClick;
        //CloseBtn.onClick.Add(new EventDelegate(this.Close));
        //MusicSlider.onChange.Add(new EventDelegate(this.MusicValueChange));
        //MusicSlider.value = Player.Instance.GameBGSoundValue;
        //SoundEffectSlider.onChange.Add(new EventDelegate(this.SoundValueChange));
        //SoundEffectSlider.value = Player.Instance.GameEffectSoundValue;
    }
    /// <summary>
    /// 显示房间号
    /// </summary>
    public void SetNumShow()
    {
        for (int i = 0; i < RoomLableList.Count; i++)
        {
            if (i < num.Length)
            {
                RoomLableList[i].text = num[i].ToString();
            }
            else
            {
                RoomLableList[i].text = "";
            }
        }

        if (num.Length == 6)
        {
            ClientToServerMsg.Send(Opcodes.Client_PlayerEnterRoom, uint.Parse(_num), Input.location.lastData.latitude, Input.location.lastData.longitude);
            UIManager.Instance.HideUiPanel(UIPaths.PanelJoinRoom);
        }
    }
示例#23
0
 void ShowRoomID(int num)
 {
     if (num == 100)
     {
         roomIDTxt = "";
     }
     else if (num == 99 && roomIDTxt.Length > 0)
     {
         roomIDTxt = roomIDTxt.Substring(0, roomIDTxt.Length - 1);
     }
     else
     {
         if (roomIDTxt.Length < 6)
         {
             roomIDTxt += num.ToString();
             if (roomIDTxt.Length == 6)
             {
                 ClientToServerMsg.Send(Opcodes.Client_PlayerEnterRoom, uint.Parse(roomIDTxt), Input.location.lastData.latitude, Input.location.lastData.longitude);
             }
         }
     }
     LBRoomID.text = roomIDTxt;
 }
示例#24
0
    void OnApplicationFocus(bool isClose)
    {
#if !UNITY_EDITOR
        if (isClose)//获得焦点
        {
            if (ConnServer.m_IsConnectServer)
            {
                ClientToServerMsg.Send(Opcodes.Client_PlayerOnForce, GameData.m_TableInfo.id, true);
                endTime = DateTime.Now;
                TimeSpan temp = endTime - startTime;
                if (temp.Seconds > 1)
                {
                    ClientToServerMsg.Send(Opcodes.Client_PlayerEnterRoom, GameData.m_TableInfo.id, Input.location.lastData.latitude, Input.location.lastData.longitude);
                }
            }
        }
        else//失去焦点
        {
            startTime = DateTime.Now;
            Player.Instance.lastEnterRoomID = GameData.m_TableInfo.id;
            ClientToServerMsg.Send(Opcodes.Client_PlayerOnForce, GameData.m_TableInfo.id, false);
        }
#endif
    }
示例#25
0
 private void InsteadCreatWDHRoom()
 {
     ClientToServerMsg.Send(Opcodes.Client_AgentCreateXYQPRoom, (byte)RoomType.ZB, (byte)RoundNum, (byte)0, Input.location.lastData.latitude, Input.location.lastData.longitude);
     SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
 }
    void OnClick(GameObject go)
    {
        string fileName = "";

        switch (go.name)
        {
        case "BgMask":
            UIManager.Instance.HideUiPanel(UIPaths.PanelChat);
            break;

        case "SendSprite":
            if (InputChat.value == "" || InputChat.value == "请输入聊天内容。。。")
            {
            }
            else
            {
                fileName = "2@" + Player.Instance.guid + "@" + InputChat.value;
                ClientToServerMsg.Send(Opcodes.Client_PlayerSpeak, GameData.m_TableInfo.id, fileName);
                UIManager.Instance.HideUiPanel(UIPaths.PanelChat);
            }

            break;

        case "btnTxt":
            break;

        case "face1001":
        case "face1002":
        case "face1003":
        case "face1004":
        case "face1005":
        case "face1006":
        case "face1007":
            string faceID = go.name.Substring(4);
            fileName = "3@" + Player.Instance.guid + "@" + faceID;
            ClientToServerMsg.Send(Opcodes.Client_PlayerSpeak, GameData.m_TableInfo.id, fileName);
            UIManager.Instance.HideUiPanel(UIPaths.PanelChat);
            break;

        case "ItemSprite0":
        case "ItemSprite1":
        case "ItemSprite2":
        case "ItemSprite3":
        case "ItemSprite4":
        case "ItemSprite5":
        case "ItemSprite6":
        case "ItemSprite7":
            string txtIndex = go.name.Substring(10);
            fileName = "5@" + Player.Instance.guid + "@" + txtIndex;
            ClientToServerMsg.Send(Opcodes.Client_PlayerSpeak, GameData.m_TableInfo.id, fileName);
            UIManager.Instance.HideUiPanel(UIPaths.PanelChat);
            break;

        case "MItemSprite0":
        case "MItemSprite1":
        case "MItemSprite2":
        case "MItemSprite3":
        case "MItemSprite4":
        case "MItemSprite5":
        case "MItemSprite6":
        case "MItemSprite7":
        case "MItemSprite8":
            string txtIndex1 = go.name.Substring(11);
            fileName = "6@" + Player.Instance.guid + "@" + txtIndex1;
            ClientToServerMsg.Send(Opcodes.Client_PlayerSpeak, GameData.m_TableInfo.id, fileName);
            UIManager.Instance.HideUiPanel(UIPaths.PanelChat);
            break;
        }
    }
    void OnClick(GameObject go)
    {
        SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
        byte index = 0;

        switch (go.name)
        {
        case "btnCreate":
            ClientToServerMsg.Send(FrameworkForCSharp.NetWorks.Opcodes.Client_PlayerCreateXYQPRoom, roundIndex, fangChongIndex, shengPaiIndex, daZiIndex, playerIndex, payIndex,
                                   Input.location.lastData.latitude, Input.location.lastData.longitude);
            break;

        case "btnClose":
            UIManager.Instance.HideUiPanel(UIPaths.UIPanel_CreateRoom);
            break;

        case "btnRound0":
        case "btnRound1":
        case "btnRound2":
            index = byte.Parse(go.name.Substring(8));
            if (index == roundIndex)
            {
                return;
            }
            TranBtnBase.Find("btnRound" + index).Find("txt").GetComponent <UILabel>().color      = chooseColor;
            TranBtnBase.Find("btnRound" + roundIndex).Find("txt").GetComponent <UILabel>().color = normalColor;
            TranBtnBase.Find("btnRound" + index).GetComponent <UISprite>().spriteName            = "UI_create_btn_check_1";
            TranBtnBase.Find("btnRound" + roundIndex).GetComponent <UISprite>().spriteName       = "UI_create_btn_check_2";
            roundIndex = index;
            break;

        case "btnFangChong0":
        case "btnFangChong1":
            index = byte.Parse(go.name.Substring(12));
            if (index == fangChongIndex)
            {
                return;
            }
            TranBtnBase.Find("btnFangChong" + index).Find("txt").GetComponent <UILabel>().color          = chooseColor;
            TranBtnBase.Find("btnFangChong" + fangChongIndex).Find("txt").GetComponent <UILabel>().color = normalColor;
            TranBtnBase.Find("btnFangChong" + index).GetComponent <UISprite>().spriteName          = "UI_create_btn_check_1";
            TranBtnBase.Find("btnFangChong" + fangChongIndex).GetComponent <UISprite>().spriteName = "UI_create_btn_check_2";
            fangChongIndex = index;
            break;

        case "btnCards0":
        case "btnCards1":
            index = byte.Parse(go.name.Substring(8));
            if (index == shengPaiIndex)
            {
                return;
            }
            TranBtnBase.Find("btnCards" + index).Find("txt").GetComponent <UILabel>().color         = chooseColor;
            TranBtnBase.Find("btnCards" + shengPaiIndex).Find("txt").GetComponent <UILabel>().color = normalColor;
            TranBtnBase.Find("btnCards" + index).GetComponent <UISprite>().spriteName         = "UI_create_btn_check_1";
            TranBtnBase.Find("btnCards" + shengPaiIndex).GetComponent <UISprite>().spriteName = "UI_create_btn_check_2";
            shengPaiIndex = index;
            break;

        case "btnDaZi0":
        case "btnDaZi1":
        case "btnDaZi2":
        case "btnDaZi3":
            index = byte.Parse(go.name.Substring(7));
            if (index == daZiIndex)
            {
                return;
            }
            TranBtnBase.Find("btnDaZi" + index).Find("txt").GetComponent <UILabel>().color     = chooseColor;
            TranBtnBase.Find("btnDaZi" + daZiIndex).Find("txt").GetComponent <UILabel>().color = normalColor;
            TranBtnBase.Find("btnDaZi" + index).GetComponent <UISprite>().spriteName           = "UI_create_btn_check_1";
            TranBtnBase.Find("btnDaZi" + daZiIndex).GetComponent <UISprite>().spriteName       = "UI_create_btn_check_2";
            daZiIndex = index;
            break;

        case "btnPlayer0":
        case "btnPlayer1":
        case "btnPlayer2":
            index = byte.Parse(go.name.Substring(9));
            if (index == playerIndex)
            {
                return;
            }
            TranBtnBase.Find("btnPlayer" + index).Find("txt").GetComponent <UILabel>().color       = chooseColor;
            TranBtnBase.Find("btnPlayer" + playerIndex).Find("txt").GetComponent <UILabel>().color = normalColor;
            TranBtnBase.Find("btnPlayer" + index).GetComponent <UISprite>().spriteName             = "UI_create_btn_check_1";
            TranBtnBase.Find("btnPlayer" + playerIndex).GetComponent <UISprite>().spriteName       = "UI_create_btn_check_2";
            playerIndex = index;
            break;

        case "btnPay0":
        case "btnPay1":
            index = byte.Parse(go.name.Substring(6));
            if (index == payIndex)
            {
                return;
            }
            TranBtnBase.Find("btnPay" + index).Find("txt").GetComponent <UILabel>().color    = chooseColor;
            TranBtnBase.Find("btnPay" + payIndex).Find("txt").GetComponent <UILabel>().color = normalColor;
            TranBtnBase.Find("btnPay" + index).GetComponent <UISprite>().spriteName          = "UI_create_btn_check_1";
            TranBtnBase.Find("btnPay" + payIndex).GetComponent <UISprite>().spriteName       = "UI_create_btn_check_2";
            payIndex = index;
            break;
        }
    }
示例#28
0
    void onPlayerInfo(NetworkMessage message)
    {
        Log.Debug("个人信息");
        Player.Instance.guid      = message.readUInt64();
        Player.Instance.account   = message.readString();
        Player.Instance.otherName = message.readString();
        Player.Instance.headID    = message.readString();

        Player.Instance.RoomCard = message.readInt64();  //房卡
        Player.Instance.money    = message.readInt64();  //钻石
        Player.Instance.Gold     = message.readInt64();  //金币
        Player.Instance.Ip       = message.readString(); //ip

        Player.Instance.shareUrl        = message.readString();
        Player.Instance.lastEnterRoomID = message.readUInt32();//(0,房间id)
        Player.Instance.sex             = message.readUInt8();

        UIPaths.CHAT_UPLOAD_SOUND_PATH = message.readString();
        UIPaths.CHAT_DOWN_SOUND_PATH   = message.readString();
        Player.Instance.isDaiLi        = message.readBool();


        GameData.m_PaoMaDengList.Clear();
        uint count = message.readUInt32();

        for (int i = 0; i < count; i++)
        {
            string content = message.readString();
            GameData.m_PaoMaDengList.Add(content);
        }


        Player.Instance.content            = message.readString();
        ServerInfo.Data.version            = message.readString();
        ServerInfo.Data.update_android_url = message.readString();
        ServerInfo.Data.update_ios_url     = message.readString();
        ServerInfo.Data.update_message     = message.readString();
        ServerInfo.Data.login_with_device  = message.readBool();


        string[] strs = ServerInfo.Data.update_message.Split('@');
        ServerInfo.Data.update_message = strs[0];
        //GameData.IsAppStore = strs[1] == "AppStore" ? true : false;
        //GameData.ShareImageURL = strs[2];
        //GameData.RechargeURL = strs[3];


        Player.Instance.everydayShareCount = message.readUInt32();
        Player.Instance.InviteGuid         = message.readUInt64();

        bool HaveEmail = message.readBool();//是否有邮件

        Player.Instance.HaveEmail = HaveEmail;

        uint ClubCount = message.readUInt32();//加入的俱乐部个数

        GameData.PKClubInfoList = new List <PkClubInfo>();
        for (int i = 0; i < ClubCount; i++)
        {
            bool exist = message.readBool();
            if (exist)
            {
                PkClubInfo info = new PkClubInfo();
                info.ClubId    = message.readUInt32(); //俱乐部id
                info.ClubName  = message.readString(); //俱乐部名称
                info.RoomCount = message.readInt32();  //俱乐部房间数

                GameData.PKClubInfoList.Add(info);
            }
            else
            {
                message.readBool();
                continue;
            }
        }

        /*
         * int Messagecount = message.readInt32();//邀请玩家加入俱乐部的消息列表
         * GameData.InviteClubIdAndName = new List<ClubInfo>();
         * for (int i = 0; i < Messagecount; i++)
         * {
         *  ClubInfo info = new ClubInfo();
         *  uint InviteClubId = message.readUInt32();
         *  string ClubName = message.readString();
         *  info.Id = (int)InviteClubId;
         *  info.ClubName = ClubName;
         *  GameData.InviteClubIdAndName.Add(info);
         * }
         */


        if (Player.Instance.lastEnterRoomID != 0)
        {
            Debug.Log("duanlian的房间" + Player.Instance.lastEnterRoomID);
            ClientToServerMsg.Send(Opcodes.Client_PlayerEnterRoom, Player.Instance.lastEnterRoomID, Input.location.lastData.latitude, Input.location.lastData.longitude);
        }
        else
        {
            ManagerScene.Instance.LoadScene(SceneType.Main);
            //if (Player.Instance.shareRoomID != 0)
            //{
            //    ClientToServerMsg.Send(Opcodes.Client_PlayerEnterRoom, Player.Instance.shareRoomID, Input.location.lastData.latitude, Input.location.lastData.longitude);
            //    Player.Instance.shareRoomID = 0;
            //}
            //else
            //{
            //    ManagerScene.Instance.LoadScene(SceneType.Main);
            //}
        }



        Player.Instance.isLogin = true;
    }
 private void DisPoseRoom()
 {
     ClientToServerMsg.Send(Opcodes.Client_PlayerDisposeRoom, RoomId);
 }
示例#30
0
 /// <summary>
 /// 代理替人开房
 /// </summary>
 private void InsteadCreatDDZRoom()
 {
     ClientToServerMsg.Send(Opcodes.Client_AgentCreateXYQPRoom, (byte)RoomType.NN, (byte)RoundNum, (byte)0, Input.location.lastData.latitude, Input.location.lastData.longitude, (byte)1, (byte)DiFenIndex, EnShunZhiNiu, EnBoomNiu, EnWuXiaoNiu, EnWuHuaNiu, EnXianJiaMaiMa);
     SoundManager.Instance.PlaySound(UIPaths.SOUND_BUTTON);
 }