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));
    }
Exemple #2
0
 public void Close(GameObject go)
 {
     ResetPosition();
     this.gameObject.SetActive(false);
     NiuNiuGame.Instance.FanPaiAnim();
     ClientToServerMsg.SendShowCard();
 }
 /// <summary>
 /// 俱乐部的点击
 /// </summary>
 private void ClubItemClick()
 {
     GameData.CurrentClickClubInfo    = InfoData;
     DzViewMain.Instance.ChosedClubId = InfoData.ClubId;
     ClientToServerMsg.ApplyClubRoomList(InfoData.ClubId);
     //  DzViewMain.Instance.CreatClubRoomList();
 }
    //请求服务器 获得奖励
    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;
        }
    }
Exemple #5
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);
        }
    }
 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);
     }
 }
    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);
    }
    /// <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);
        }
    }
 private void ReNameClick()
 {
     if (NameInput.value != "")
     {
         ClientToServerMsg.ReNameClub((uint)GameData.CurrentClubInfo.Id, NameInput.value);
     }
     this.gameObject.SetActive(false);
 }
Exemple #11
0
 /// <summary>
 ///     继续游戏
 /// </summary>
 private void GoOnGame()
 {
     if (!GameData.m_IsNormalOver)
     {
         ClientToServerMsg.Send(Opcodes.Client_PlayerReady, GameData.m_TableInfo.id); //发送准备协议
     }
     UIManager.Instance.HideUiPanel(UIPaths.PanelGameOverSmall);
 }
Exemple #12
0
 /// <summary>
 /// 绑定邀请人
 /// </summary>
 private void BindFriend()
 {
     if (InputFiled.value != "")
     {
         ulong inviteGuid = ulong.Parse(InputFiled.value);
         ClientToServerMsg.Send(Opcodes.Client_SetInviteGuid, inviteGuid);
     }
 }
 /// <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);
     }
 }
Exemple #15
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;
         }
     }
 }
    /// <summary>
    /// 申请加入俱乐部
    /// </summary>
    private void ApplyJoinClub()
    {
        if (string.IsNullOrEmpty(ClubIdInput.value))
        {
            return;
        }
        uint clubid;

        if (uint.TryParse(ClubIdInput.value, out clubid))
        {
            ClientToServerMsg.ApplyJoinClub(clubid);
        }
    }
Exemple #17
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);
     }
 }
Exemple #18
0
 private void AgreeBtnClick()
 {
     if (Invite)//是邀请信息
     {
         ClientToServerMsg.OperateInviteMessage(infoData.ClubId, true);
         GameData.CurrentClubInfo.InviteList.Remove(infoData);
     }
     else
     {
         ClientToServerMsg.OperatePlayerApply(infoData.ClubId, infoData.Guid, true);
         GameData.CurrentClubInfo.ApplyMemList.Remove(infoData);
     }
 }
    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);
        }
    }
Exemple #20
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);
     }
 }
Exemple #22
0
    /// <summary>
    ///进入房间
    /// </summary>
    /// <param name="go"></param>
    private void EnterRoom(GameObject go)
    {
        if (IsConfigRoom)
        {
            uint chipIndex = 0;
            if (configData.roomType == FrameworkForCSharp.Utils.RoomType.NN)
            {
                switch (configData.NiuNiuChips[0])
                {
                case 1:
                    chipIndex = 0;
                    break;

                case 2:
                    chipIndex = 1;
                    break;

                case 5:
                    chipIndex = 2;
                    break;
                }
            }


            ClientToServerMsg.ClubEnterRoom((uint)GameData.CurrentClubInfo.Id, false, 0, 0, 0, configData.clubRoomType, chipIndex, configData.YongPaiType, configData.IsJiangMa, configData.ShunZhiNiu, configData.ZhaDanNiu, configData.wuXiaoNiu, configData.WuHuaNiu, configData.XianJiaMaiMa);
        }
        else
        {
            uint chipIndex = 0;
            if (RoomInfo.roomtype == FrameworkForCSharp.Utils.RoomType.NN)
            {
                switch (RoomInfo.NiuNiuChips[0])
                {
                case 1:
                    chipIndex = 0;
                    break;

                case 2:
                    chipIndex = 1;
                    break;

                case 5:
                    chipIndex = 2;
                    break;
                }
            }

            ClientToServerMsg.ClubEnterRoom((uint)GameData.CurrentClubInfo.Id, true, 0, 0, RoomInfo.RoomId, RoomInfo.clubRoomType, chipIndex, RoomInfo.YongPaiType, RoomInfo.IsJiangMa, RoomInfo.ShunZhiNiu, RoomInfo.ZhaDanNiu, RoomInfo.wuXiaoNiu, RoomInfo.WuHuaNiu, RoomInfo.XianJiaMaiMa);
        }
    }
Exemple #23
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;
        }
    }
    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);
            }
        }
    }
Exemple #25
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;
    }
 /// <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 uint ChipChose = 0;                                                   //自己下注选择
    private void Click(GameObject go)
    {
        if (!GameData.m_TableInfo.EnXianJiaMaiMA)
        {
            if (go == ChipOneBtn.gameObject)
            {
                ChipChose = GameData.m_TableInfo.CanChipList[0];
                ClientToServerMsg.SendDropChip(GameData.m_TableInfo.CanChipList[0], OtherChipDic);
            }
            else if (go == ChipTwoBtn.gameObject)
            {
                ChipChose = GameData.m_TableInfo.CanChipList[1];
                ClientToServerMsg.SendDropChip(GameData.m_TableInfo.CanChipList[1], OtherChipDic);
            }
            else if (go == ChipThreeBtn.gameObject)
            {
                ChipChose = GameData.m_TableInfo.CanChipList[2];
                ClientToServerMsg.SendDropChip(GameData.m_TableInfo.CanChipList[2], OtherChipDic);
            }
            //  NiuNiuGame.Instance.ChipPanel.SetActive(false);
        }
        else
        {
            if (go == ChipOneBtn.gameObject)
            {
                ChipChose = GameData.m_TableInfo.CanChipList[0];
                ClientToServerMsg.SendDropChip(GameData.m_TableInfo.CanChipList[0], OtherChipDic);
            }
            else if (go == ChipTwoBtn.gameObject)
            {
                ChipChose = GameData.m_TableInfo.CanChipList[1];
                ClientToServerMsg.SendDropChip(GameData.m_TableInfo.CanChipList[1], OtherChipDic);
            }
            else if (go == ChipThreeBtn.gameObject)
            {
                ChipChose = GameData.m_TableInfo.CanChipList[2];
                ClientToServerMsg.SendDropChip(GameData.m_TableInfo.CanChipList[2], OtherChipDic);
            }
        }

        ChipOneBtn.gameObject.SetActive(false);
        ChipTwoBtn.gameObject.SetActive(false);
        ChipThreeBtn.gameObject.SetActive(false);
    }
    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;
    }
Exemple #29
0
    private void OnEnable()
    {
        int count = EmailItemList.Count;

        for (int i = 0; i < count; i++)
        {
            Destroy(EmailItemList[i]);
        }

        if (GameData.CurrentClubInfo.ApplyMemList.Count <= 0 && GameData.CurrentClubInfo.InviteList.Count <= 0)
        {
            ClientToServerMsg.GetClubMemListInfo((uint)GameData.CurrentClubInfo.Id);
        }
        else
        {
            CreatData();
        }
        //  Reset();
    }
    /// <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);
        }
    }