/**申请解散房间回调**/ public void dissoliveRoomResponse(ClientResponse response) { DissoliveRoomResponseVo dvo = JsonMapper.ToObject <DissoliveRoomResponseVo> (response.message); string plyerName = dvo.accountName; if (dvo.type == "0") { _isDissoliving = true; _dissoDialog = SceneManager.getInstance().loadPerfab("Prefab/Panel_Dissolive_Vote_View"); _dissoDialog.GetComponent <VoteView> ().iniUI(plyerName); } else if (dvo.type == "3") { _isDissoliving = false; GlobalData.isOverByPlayer = true; closeDialog(); } else if (dvo.type == "2") { _disagreeCount += 1; if (_disagreeCount >= 2) { _isDissoliving = false; TipsManager.getInstance().setTips("同意解散房间申请人数不够,本轮投票结束,继续游戏"); closeDialog(); } } }
public void testLogin(string uin) { LoginVO lvo = new LoginVO(); try { lvo.openId = "" + uin; lvo.nickName = "" + uin; lvo.headIcon = ""; lvo.unionid = "" + uin; lvo.province = "广东省"; lvo.city = "深圳"; lvo.sex = 1; lvo.IP = GameManager.getInstance().getIpAddress(); String msg = JsonMapper.ToJson(lvo); GameManager.getInstance().Server.requset(APIS.LOGIN_REQUEST, msg); AvatarVO avo = new AvatarVO(); avo.account = new Account(); avo.account.city = lvo.city; avo.account.openid = lvo.openId; avo.account.nickname = lvo.nickName; avo.account.headicon = lvo.headIcon; avo.account.unionid = lvo.city; avo.account.sex = lvo.sex; avo.IP = lvo.IP; GlobalData.getInstance().myAvatarVO = avo; } catch (Exception e) { Debug.Log(e.ToString()); TipsManager.getInstance().setTips("请先打开你的微信客户端"); return; } //GameManager.getInstance().Server.requset(new LoginRequest(null)); }
public static TipsManager getInstance() { if (_instance == null) { _instance = new TipsManager(); } return(_instance); }
/*** * 分享战绩成功回调 */ public void onShareCallBack(int reqID, ResponseState state, PlatformType type, Hashtable result) { if (state == ResponseState.Success) { TipsManager.getInstance().setTips("分享成功"); } else if (state == ResponseState.Fail) { MyDebug.Log("shar fail :" + result ["error_msg"]); } }
/**申请或同意解散房间请求**/ public void showDissoliveDialog() { if (GlobalData.getInstance().gameStatus == GameStatus.GAMING) { TipsManager.getInstance().loadDialog("申请解散房间", "你确定要申请解散房间?", onOK, onCancle); } else { TipsManager.getInstance().setTips("还没有开始游戏,不能申请退出房间"); } }
/**用户离线回调**/ public void offlineNotice(ClientResponse response) { int uuid = int.Parse(response.message); int index = _host.Data.toAvatarIndex(uuid); //申请解散房间过程中,有人掉线,直接不能解散房间 if (_isDissoliving) { closeDialog(); TipsManager.getInstance().setTips("由于" + _host.Data.AvatarList [index].account.nickname + "离线,系统不能解散房间。"); } }
public void OnPointerDown() { if (getUserList().Count > 0) { _isRecording = true; recordBtn.SetActive(true); MicrophoneManager.getInstance().StartRecord(); } else { TipsManager.getInstance().setTips("房间里只有你一个人,不能发送语音"); } }
public void init(UIStage uiStage, GameObject root, GameObject login) { this.uiStage = uiStage; this.stage = uiStage.gameObject; this.root = root; wechatAPI = stage.GetComponent <WechatHelper>(); TipsManager.getInstance().init(stage.transform); SceneManager.getInstance().init(root.transform, login); MicrophoneManager.getInstance().init(); SoundManager.getInstance(); //TODO 后面改 updateHelper = new UpdateHelper(); this.uiStage.StartCoroutine(updateHelper.updateCheck()); }
/** * 获取微信个人信息成功回调,登录 * */ public void getUserInforCallback(int reqID, ResponseState state, PlatformType type, Hashtable data) { //TipsManagerScript.getInstance ().setTips ("获取个人信息成功"); if (data != null) { MyDebug.Log(data.toJson()); LoginVO lvo = new LoginVO(); try { lvo.openId = (string)data ["openid"]; lvo.nickName = (string)data ["nickname"]; lvo.headIcon = (string)data ["headimgurl"]; lvo.unionid = (string)data ["unionid"]; lvo.province = (string)data ["province"]; lvo.city = (string)data ["city"]; string sex = data ["sex"].ToString(); lvo.sex = int.Parse(sex); lvo.IP = GameManager.getInstance().getIpAddress(); String msg = JsonMapper.ToJson(lvo); GameManager.getInstance().Server.requset(APIS.LOGIN_REQUEST, msg); AvatarVO avo = new AvatarVO(); avo.account = new Account(); avo.account.city = lvo.city; avo.account.openid = lvo.openId; avo.account.nickname = lvo.nickName; avo.account.headicon = lvo.headIcon; avo.account.unionid = lvo.city; avo.account.sex = lvo.sex; avo.IP = lvo.IP; GlobalData.getInstance().myAvatarVO = avo; MyDebug.Log(" loginvo.nickName:" + lvo.nickName); } catch (Exception e) { MyDebug.Log("微信接口有变动!" + e.Message); TipsManager.getInstance().setTips("请先打开你的微信客户端"); return; } } else { TipsManager.getInstance().setTips("微信登录失败"); } }
public void outRoomCallbak(ClientResponse response) { OutRoomResponseVo responseMsg = JsonMapper.ToObject <OutRoomResponseVo> (response.message); if (responseMsg.status_code == "0") { if (responseMsg.type == "0") { int uuid = responseMsg.uuid; if (uuid != GlobalData.getInstance().myAvatarVO.account.uuid) { int index = _data.toAvatarIndex(uuid); avatarList.RemoveAt(index); _data.AvatarList = GlobalData.getInstance().playerList; int i = 0; for (; i < avatarList.Count; i++) { var avo = avatarList [i]; _uiHelper.getCardGOs(i).PlayerItem.setAvatarVo(avo); } for (; i < 4; i++) { _uiHelper.getCardGOs(i).PlayerItem.setAvatarVo(avatarList [i]); } markselfReadyGame(); } else { exitOrDissoliveRoom(); } } else { exitOrDissoliveRoom(); } } else { TipsManager.getInstance().setTips("退出房间失败:" + responseMsg.error); } }
void onResponse(ClientResponse response) { switch (response.headCode) { case APIS.OTHER_TELE_LOGIN: disConnetNotice(); TipsManager.getInstance().setTips("你的账号在其他设备登录"); break; case APIS.TIP_MESSAGE: TipsManager.getInstance().setTips(response.message); break; case APIS.CLOSE_RESPONSE: TipsManager.getInstance().setTips("服务器关闭了"); break; case APIS.ERROR_RESPONSE: TipsManager.getInstance().setTips(response.message); break; case APIS.HOST_UPDATEDRAW_RESPONSE: dataMgr.parsePrizeCount(response.message); break; case APIS.GAME_BROADCAST: dataMgr.parseBroadCast(response.message); break; case APIS.HUPAIALL_RESPONSE: //全局结束 GlobalData.getInstance().gamingData.finalGameEndVo = JsonMapper.ToObject <FinalGameEndVo> (response.message); SceneManager.getInstance().showGameOverView(1, GlobalData.getInstance().gamingData); GlobalData.getInstance().resetDataForNewRoom(); SceneManager.getInstance().changeToScene(SceneType.HOME); break; } }