/// <summary> /// 发送准备 /// </summary> public void SendReady(CallBack call = null) { CommonSendProto req = new CommonSendProto(); NetProcess.SendRequest <CommonSendProto>(req, GoldFlowerProtoIdMap.CMD_SendRready, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { } else if (ack.code == 104 || ack.code == 105 || ack.code == 24 || ack.code == 13 || ack.code == 7 || ack.code == 6) { bool gold = XXGoldFlowerGameModel.Inst.mGoldPattern; XXGoldFlowerGameModel.Inst.CleanMode(); Global.Inst.GetController <MainController>().OpenWindow(); CloseWindow(); } else { //GameUtils.ShowErrorTips(ack.code); if (call != null) { call(); } } }); }
/// <summary> /// 离开房间 /// </summary> public void SendLeaveRoom() { CommonSendProto req = new CommonSendProto(); NetProcess.SendRequest <CommonSendProto>(req, TenProtoIdMap.CMD_SendLeaveRoom, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { } else if (ack.code == 104 || ack.code == 105 || ack.code == 24 || ack.code == 13 || ack.code == 7 || ack.code == 6) { bool gold = TenModel.Inst.mGoldPattern; TenModel.Inst.CleanModel(); Global.Inst.GetController <GamePatternController>().SendGetRoomList((patternView) => { SQSceneLoader.It.LoadScene("HALL", () => { Global.Inst.GetController <GamePatternController>().OpenWindow(); CloseWindow(); }); if (!gold) { patternView.BackToFriendWidget(); } }); } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 自动换桌 /// </summary> /// <param name="msg"></param> private void NetOnAutoChangDesk(MessageData msg) { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); SendChangGoldPattern(); mView.NetOnAutoChangDesk(); }
/// <summary> /// 聊天 /// </summary> /// <param name="info"></param> public void SendChat(SendReceiveGameChat info) { NetProcess.SendRequest <SendReceiveGameChat>(info, ProtoIdMap.CMD_FinishTask, (msg) => { CommonRecieveProto data = msg.Read <CommonRecieveProto>(); //if (data.code == 1) { Debug.Log("聊天"); } }); }
//开始游戏 public void StartGame() { NetProcess.SendRequest <CommonSendProto>(null, GoldFlowerProtoIdMap.CMD_SendStartGame, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 发送操作指令 /// </summary> /// <param name="req"></param> public void SendGameOpt(TenSendGameOpt req) { NetProcess.SendRequest <TenSendGameOpt>(req, TenProtoIdMap.CMD_SendGameOpt, (Msg) => { CommonRecieveProto ack = Msg.Read <CommonRecieveProto>(); if (ack.code == 1) { } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 发送聊天 /// </summary> /// <param name="req"></param> public void SendGameChat(SendReceiveGameChat req) { NetProcess.SendRequest <SendReceiveGameChat>(req, MJProtoMap.CMD_SendChat, (Msg) => { CommonRecieveProto ack = Msg.Read <CommonRecieveProto>(); if (ack.code == 1) { } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 发送亮牌 /// </summary> public void SendShowCard() { CommonSendProto req = new CommonSendProto(); NetProcess.SendRequest <CommonSendProto>(req, GoldFlowerProtoIdMap.CMD_SendShowCard, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 添加联盟 /// </summary> /// <param name="id"></param> public void SendAddClubConpany(string id) { SendAddClubConpany req = new global::SendAddClubConpany(); req.clubId = id; NetProcess.SendRequest <SendAddClubConpany>(req, ProtoIdMap.CMD_SendAddClubConpany, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { Global.Inst.GetController <CommonTipsController>().ShowTips("申请已发送!"); } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 发送指令 /// </summary> /// <param name="opt"></param> public void SendOpt(SendGoldFlowerOpt opt, CallBack call = null) { NetProcess.SendRequest <SendGoldFlowerOpt>(opt, GoldFlowerProtoIdMap.CMD_SendOpt, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { if (call != null) { call(); } } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 操作指令 /// </summary> /// <param name="info"></param> public void SendInstructions(OptRequest info, CallBack call) { NetProcess.SendRequest <OptRequest>(info, MJProtoMap.Cmd_SendDealIns, (msg) => { CommonRecieveProto data = msg.Read <CommonRecieveProto>(); if (data.code == 1) { Debug.Log("操作指令"); if (call != null) { call(); } } else if (data.code > 0) { GameUtils.ShowErrorTips(data.code); } }, false); }
/// <summary> /// 发送 操作的指令请求 /// </summary> /// <param name="data"></param> public void SendOptRequest(OptRequest req, System.Action finish = null, bool show = true) { NetProcess.SendRequest <OptRequest>(req, MJProtoMap.Cmd_SendDealIns, (msg) => { CommonRecieveProto data = msg.Read <CommonRecieveProto>(); if (data.code == 107)//金币不足,返回俱乐部界面 { GameUtils.ShowErrorTips(data.code); Global.Inst.GetController <MJGameController>().BackToClub(); } }, show); if (finish != null) { finish(); } if (req.ins == eMJInstructionsType.HIT && mGameUI.mSelfPlayer != null) { mGameUI.mSelfPlayer.ShowInstructions(null); } }
public void SendReadMessage(int id, CallBack call) { SendReadMessageReq req = new SendReadMessageReq(); req.id = id; NetProcess.SendRequest <SendReadMessageReq>(req, ProtoIdMap.CMD_SendReadMessage, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { if (call != null) { call(); } } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 取消联盟 /// </summary> /// <param name="clubid"></param> /// <param name="call"></param> public void SendCancelCompany(string clubid, Action call) { SendCancalCompanyReq req = new SendCancalCompanyReq(); req.clubId = clubid; NetProcess.SendRequest <SendCancalCompanyReq>(req, ProtoIdMap.CMD_SendCancelCompany, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { if (call != null) { call(); } } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 存仓库 /// </summary> /// <param name="gold"></param> /// <param name="call"></param> public void SendSaveWare(float gold, Action call) { SendSaveOutWare req = new SendSaveOutWare(); req.glod = gold; NetProcess.SendRequest <SendSaveOutWare>(req, ProtoIdMap.CMD_SendSaveInWare, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { PlayerModel.Inst.UserInfo.wareHouse += gold; if (call != null) { call(); } } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 发送反馈 /// </summary> /// <param name="content"></param> public void SendFeedBack(string content, CallBack call) { FeedBackProto req = new FeedBackProto(); req.content = content; NetProcess.SendRequest <FeedBackProto>(req, ProtoIdMap.CMD_SendFeedBack, (msg) => { CommonRecieveProto data = msg.Read <CommonRecieveProto>(); if (data.code == 1) { Global.Inst.GetController <CommonTipsController>().ShowTips("非常感谢您的宝贵意见,我们将及时处理"); if (call != null) { call(); } } else { GameUtils.ShowErrorTips(data.code); } }); }
/// <summary> /// 修改密码 /// </summary> /// <param name="psd"></param> /// <param name="call"></param> public void FixPassword(string lastPwd, string newPwd, CallBack call) { SendFixPsdReq req = new SendFixPsdReq(); req.lastPwd = lastPwd; req.newPwd = newPwd; NetProcess.SendRequest <SendFixPsdReq>(req, ProtoIdMap.CMD_FixPsd, (msg) => { CommonRecieveProto data = msg.Read <CommonRecieveProto>(); if (data.code == 1) { if (call != null) { call(); } } else { GameUtils.ShowErrorTips(data.code); } }); }
/// <summary> /// 离开房间 /// </summary> public void SendLeaveRoom() { CommonSendProto req = new CommonSendProto(); NetProcess.SendRequest <CommonSendProto>(req, GoldFlowerProtoIdMap.CMD_SendLeaveRoom, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { } else if (ack.code == 104 || ack.code == 105 || ack.code == 24 || ack.code == 13 || ack.code == 7 || ack.code == 6) { Global.Inst.GetController <MainController>().SendGetWareInfo(() => { if (XXGoldFlowerGameModel.Inst.mGoldPattern) {//平台房 XXGoldFlowerGameModel.Inst.CleanMode(); Global.Inst.GetController <SelectRoomController>().SendGetGoldPeopleNum((data) => { SelectRoomView v = Global.Inst.GetController <SelectRoomController>().OpenWindow() as SelectRoomView; v.SetData(data); Global.Inst.GetController <MainController>().OpenWindow(); CloseWindow(); }); } else { Global.Inst.GetController <MainController>().OpenWindow(); CloseWindow(); } }); } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 实名认证 /// </summary> /// <param name="realName"></param> /// <param name="idCard"></param> /// <param name="call"></param> public void SendCheckRealName(string realName, string idCard, Action call) { SendCheckRealName req = new global::SendCheckRealName(); req.realName = realName; req.idCard = idCard; NetProcess.SendRequest <SendCheckRealName>(req, ProtoIdMap.CMD_SendCheckIdCard, (msg) => { CommonRecieveProto data = msg.Read <CommonRecieveProto>(); if (data.code == 1) { if (call != null) { call(); } Global.Inst.GetController <CommonTipsController>().ShowTips("认证成功!"); } else { GameUtils.ShowErrorTips(data.code); } }); }
/// <summary> /// 设置抽成比例 /// </summary> /// <param name="chouCheng"></param> public void SendChangChouCheng(float chouCheng, Action call) { SendChangChouCheng req = new global::SendChangChouCheng(); req.clubId = GamePatternModel.Inst.mClubId; req.chouCheng = chouCheng; NetProcess.SendRequest <SendChangChouCheng>(req, ProtoIdMap.CMD_SendChangChouCheng, (msg) => { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); if (ack.code == 1) { GamePatternModel.Inst.mChouCheng = chouCheng; Global.Inst.GetController <CommonTipsController>().ShowTips("设置抽成比例成功!"); } else { if (call != null) { call(); } GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 金币不足 /// </summary> /// <param name="msg"></param> private void NetOnGoldLess(MessageData msg) { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); Global.Inst.GetController <CommonTipsController>().ShowTips("您的金币不足"); }
/// <summary> /// 代理的房卡不足 /// </summary> /// <param name="msg"></param> private void NetOnRoomCardLess(MessageData msg) { CommonRecieveProto ack = msg.Read <CommonRecieveProto>(); Global.Inst.GetController <CommonTipsController>().ShowTips("房卡不足!"); }