/// <summary> /// 如果战斗还在继续,则需要向网络发起请求,告知服务器客户端失败 /// </summary> void SettleBossBattle() { bool WarIsOnGoing = BanBattleManager.Instance.War.WarIsOnGoing; TemporyData temp = Core.Data.temper; temp.GiveUpBattle = true; if (WarIsOnGoing) { ClientBattleCheckParam param = null; RequestType ReqType = RequestType.SETTLE_BOSSBATTLE; HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Igonre_Response); if (temp.currentBattleType == TemporyData.BattleType.BossBattle) { param = new ClientBattleCheckParam(temp.clientReqParam, null, null, string.Empty, null, null); } else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialShalu || temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou) { param = new ClientBTShaBuParam(temp.shaluBuOuParam, null, null, string.Empty, null, null); ReqType = RequestType.SETTLE_SHABU; } param.sequence.LeftWin = 0; task.AppendCommonParam(ReqType, param); //then you should dispatch to a real handler task.DispatchToRealHandler(); } }
//下订单 void SendPayRQ() { ComLoading.Open(); RED.Log("向服务器发送订单"); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); AccountData ad = Native.mInstace.m_thridParty.GetAccountData(); if (ad == null) { RED.LogWarning("第三方数据为null"); return; } //talking data add by wxl if (m_data != null && m_data.Present2 != null && m_data.Present2.Count != 0 && m_data.Present2[0] != null && m_data.Present2[0].Length > 1) { Core.Data.ActivityManager.OnChargeRequest(m_data.Title, m_data.ID.ToString(), m_data.Price, m_data.Present2[0][1]); } task.AppendCommonParam(RequestType.PAY, new PayParam(m_data.ID.ToString())); HttpRequest req = task.request as HttpRequest; req.Url = Core.SM.curServer.payUrl; task.ErrorOccured += HttpResp_Error; task.afterCompleted += HttpResp_UI; task.DispatchToRealHandler(); }
void SendMsg() { ComLoading.Open(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.GET_COMBO, new GetComboParam(Core.Data.playerManager.PlayerID)); task.ErrorOccured = (BaseHttpRequest b, string error) => { ConsoleEx.DebugLog("______Error =" + error.ToString()); ComLoading.Close(); }; task.afterCompleted = (BaseHttpRequest request, BaseResponse response) => { ComLoading.Close(); if (response.status != BaseResponse.ERROR) { isFristOpenClient = false; ComboResponse resp = response as ComboResponse; RTPlayer player = Core.Data.playerManager.RTData; player.TotalCombo = resp.data.combo.total; player.TotalGambleWin = resp.data.gamble.win; player.TotalGambleLose = resp.data.gamble.lose; UIOptionController.CreatOptionCtrl(DBUIController.mDBUIInstance._TopRoot); } else { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getNetworkErrorString(response.errorCode)); } }; task.DispatchToRealHandler(); }
/*向服务器发送重铸数据 * */ void SendRecastMsg() { if (Core.Data.playerManager.RTData.curStone < int.Parse(view.Lab_stone.text)) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35006)); return; } Send_GemRecastSystem param = new Send_GemRecastSystem(); param.gid = Core.Data.playerManager.PlayerID; param.eqid = SelectedEqudata.ID; param.locks = view.GetLockAarry(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.GEM_RECASTING, param); task.ErrorOccured += testHttpResp_Error; task.afterCompleted += testHttpResp_UI; //then you should dispatch to a real handler task.DispatchToRealHandler(); ComLoading.Open(); }
void SendHeChengMsg() { HeChengParam param = new HeChengParam(); param.gid = Core.Data.playerManager.PlayerID; param.mr = m_mainData.pid; List <int> list = new List <int> (); for (int i = 0; i < m_subData.Length; i++) { if (m_subData [i] != null) { list.Add(m_subData [i].pid); } } param.el = list.ToArray(); param.ty = m_nType + 1; HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.HECHENG, param); task.ErrorOccured += testHttpResp_Error; task.afterCompleted += testHttpResp_UI; //then you should dispatch to a real handler task.DispatchToRealHandler(); }
void SendQianLiXunLianMsg(int target, int tNum) { if (m_nType == 1) { if (Core.Data.playerManager.RTData.curCoin < NEEDCOIN) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35000)); return; } } else { if (Core.Data.playerManager.RTData.curStone < NEEDSTONE) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35006)); return; } } ComLoading.Open(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.QIANLIXUNLIAN, new QianLiXunLianParam(Core.Data.playerManager.PlayerID, m_data.pid, m_nType, target, tNum)); task.ErrorOccured += testHttpResp_Error; task.afterCompleted += testHttpResp_UI; //then you should dispatch to a real handler task.DispatchToRealHandler(); }
void OnDayChanged(TimerTask tTask) { /// /// 新手引导的时候不能执行 /// if (Core.Data.guideManger.isGuiding) { return; } HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.MESSAGE_INFORMATION, new PlayerIDParam(Core.Data.playerManager.PlayerID, 100)); task.afterCompleted = (BaseHttpRequest request, BaseResponse response) => { recordDayChanged(Core.Data.playerManager.RTData.systemTime); /// /// -------- 弹出提醒用户签到 -------- /// if (CurScenesName == SceneName.MAINUI) { string content = Core.Data.stringManager.getString(55); string btn = Core.Data.stringManager.getString(5030); UIInformation.GetInstance().SetInformation(content, btn, DBUIController.mDBUIInstance.SyncBackToMainUI, DBUIController.mDBUIInstance.SyncBackToMainUI); } }; task.ErrorOccured = (BaseHttpRequest request, string error) => { ConsoleEx.DebugLog("SendFightRequest is error!"); }; task.DispatchToRealHandler(); }
public void Fight(int floorID, int[] array = null, int teamID = 1) { ComLoading.Open(); //赋值floordata Core.Data.newDungeonsManager.FloorList.TryGetValue(floorID, out floordata); //added by zhangqiang ao rember level if (Core.Data.playerManager.RTData.curTeam.validateMember == 0) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5031)); ComLoading.Close(); return; } Core.Data.temper.mPreLevel = Core.Data.playerManager.RTData.curLevel; Core.Data.temper.mPreVipLv = Core.Data.playerManager.RTData.curVipLevel; HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); //int flag =0 ; //检测该关卡是否是这一章节的最后一个关卡 //bool isLastFloorOfChapter = false; task.AppendCommonParam(RequestType.NEW_PVE_BOSSBATTLE, new ClientBattleParam(Core.Data.playerManager.PlayerID, floorID, 0, 0, 0, 0, Core.Data.guideManger.isGuiding ? 1 : 0, array, teamID)); task.ErrorOccured += HttpResp_Error; task.afterCompleted += BattleResponseFUC; task.DispatchToRealHandler(); }
public void SendMsg() { ComLoading.Open(); if (NoticeManager.openSign && NoticeManager.firstShowState == 1) { ComLoading.Close(); SetSevenRewardDetail(NoticeManager._AlertInfo.sevenSgin); if (Core.Data.guideManger.isGuiding) { Core.Data.guideManger.AutoRUN(); } } else { GetSevenRewardListParam param = new GetSevenRewardListParam(int.Parse(Core.Data.playerManager.PlayerID)); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.SEVENDAYREWARD, param); task.ErrorOccured += testHttpResp_Error; task.afterCompleted += testHttpResp_UI; task.DispatchToRealHandler(); } }
void SendBattleRequest() { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.FIGHT_FULISA, new BattleParam(Core.Data.playerManager.PlayerID, -1, 0, 0)); task.afterCompleted = BattleResponseFUC; task.DispatchToRealHandler(); }
// void OnGUI() // { // if(GUI.Button(new Rect(0,300,100,50),"GET MAIL MESSAGE")) // { // GetMail (); // } // } //发送战报请求 public void SendFightMegRequest(int sync = 0) { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.MESSAGE_INFORMATION, new PlayerIDParam(Core.Data.playerManager.PlayerID, sync)); task.afterCompleted += FightMegCompleted; task.ErrorOccured = (BaseHttpRequest request, string error) => { Debug.Log("SendFightRequest is error!"); ComLoading.Close(); }; task.DispatchToRealHandler(); }
//发送信息请求 public void SendMegRequest() { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.MESSAGE_EMAIL, new PlayerIDParam(Core.Data.playerManager.PlayerID)); task.afterCompleted += MegCompleted; task.ErrorOccured = (BaseHttpRequest request, string error) => { Debug.Log("SendMegRequest is error! [" + error + "]"); }; task.DispatchToRealHandler(); }
public void OnCheck() { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.DOWNLOAD_CHECK, new DownloadCheckParam(int.Parse(Core.Data.playerManager.PlayerID))); task.afterCompleted += CheckAfterCompleted; task.ErrorOccured += CheckAllErrorBack; task.DispatchToRealHandler(); }
public void SendGetNowMsg(int moneytype) { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.BUILD_GET, new BuildGetParam(Core.Data.playerManager.PlayerID, m_data.RTData.id, moneytype)); task.afterCompleted += CollectSourceRequest; task.DispatchToRealHandler(); ComLoading.Open(); }
//检测召唤神龙 请求 public void ChectCallDragonIsFinish(int type) { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.GET_CALLDRAGONISFINISH, new GetCallDragonIsFinishParam(int.Parse(Core.Data.playerManager.PlayerID), type)); task.afterCompleted += BackCheckCallDragon; task.ErrorOccured += CheckCallDragonError; task.DispatchToRealHandler(); }
void SendUseWheelMsg() { ComLoading.Open(); SetUseButtonEnable(false); SetResetButtonEnable(false); Btn_Back.enabled = false; HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.USE_BIGWHEEL, new BigWheelListParam(Core.Data.playerManager.PlayerID)); task.ErrorOccured = (BaseHttpRequest request, string error) => { ComLoading.Close(); Btn_Back.enabled = true; }; task.afterCompleted = (BaseHttpRequest requset, BaseResponse response) => { if (response != null && response.status != BaseResponse.ERROR) { ComLoading.Close(); res = response as UseBigWheelResponse; if (res.data != null) { NeedID = GetRewardIndex(res.data.p[0]); } else { SQYAlertViewMove.CreateAlertViewMove("Server Data error [p=null]"); Btn_Back.enabled = true; return; } if (wheels.Count == 1) { wheels[NeedID].isSelected = true; if (LastSelected != null) { LastSelected.isSelected = false; } OnBigWheelAnimationFinished(); } else { isRUN = true; } AddRewardToBag(res.data.p); Core.Data.playerManager.RTData.curStone += res.data.stone; //talking data add by wxl Core.Data.ActivityManager.OnPurchaseVirtualCurrency(ActivityManager.BigWheelType, 1, Mathf.Abs(res.data.stone)); // UIMiniPlayerController.Instance.freshPlayerInfoView (); DBUIController.mDBUIInstance.RefreshUserInfo(); } }; task.DispatchToRealHandler(); }
public void OnReceive() { ComLoading.Open(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.DOWNLOAD_RECEOVE, new DownloadReceoveParam(int.Parse(Core.Data.playerManager.PlayerID), SoftwareInfo.VersionCode, 0)); task.afterCompleted += ReceiveAfterCompleted; task.ErrorOccured += ReceiveAllErrorBack; task.DispatchToRealHandler(); }
public void RefreshSecretShop() { RefreshSecretShopParam param = new RefreshSecretShopParam(int.Parse(Core.Data.playerManager.PlayerID), _ShopType); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.REFRESH_SECRETSHOP, param); task.afterCompleted += BackRefreshSecretShop; task.DispatchToRealHandler(); ComLoading.Open(); }
public void SyncCallDragonTime() { GetPayCntParam param = new GetPayCntParam(Core.Data.playerManager.PlayerID); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.SYNC_CALLDRAGONTIME, param); task.afterCompleted += BackSyncCallDragonTime; task.DispatchToRealHandler(); checkTime = true; }
void SendRequest() { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.GETVIPGIFT, new GetVipGiftParam(int.Parse(Core.Data.playerManager.PlayerID))); task.afterCompleted = GetComplete; task.DispatchToRealHandler(); }
//发送列表请求 or 重置大转盘 void SendListMsg(RequestType requestType) { ComLoading.Open(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(requestType, new BigWheelListParam(Core.Data.playerManager.PlayerID)); task.ErrorOccured = (BaseHttpRequest request, string error) => { ComLoading.Close(); SQYAlertViewMove.CreateAlertViewMove(error); }; task.afterCompleted = (BaseHttpRequest requset, BaseResponse response) => { ComLoading.Close(); if (response.status != BaseResponse.ERROR) { wheels.Clear(); wheels.AddRange(wheels_object.ToArray()); BigWheelListResponse res = response as BigWheelListResponse; if (res.data != null && res.data.awardList.Count > 0) { ShowBigWheelList(res.data.awardList); flushCount = res.data.flushCount; totalCount = res.data.totalCount; ShowResetButton(); ShowUseButton(res.data.needStone); if (wheels.Count > 0) { foreach (BigWheelReward rewardObj in wheels) { if (rewardObj.isSelected) { rewardObj.isSelected = false; } } WheelIndex = 0; LastSelected = wheels[0]; LastSelected.isSelected = true; } } else { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9118)); } } else { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getNetworkErrorString(response.errorCode)); } }; task.DispatchToRealHandler(); }
//邮件操作 (操作类型 1:设置为已读,2:删除) void MailOperation(int type, params int [] mail) { ComLoading.Open(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); ChangeMailStateParam param = new ChangeMailStateParam(); param.gid = Core.Data.playerManager.PlayerID; param.ids = mail; param.type = type; //消息类型 1:战报,2,邮件 param.msgType = 2; task.AppendCommonParam(RequestType.CHANGE_MAIL_STATE, param); task.afterCompleted = (BaseHttpRequest request, BaseResponse response) => { ComLoading.Close(); if (response.status != BaseResponse.ERROR) { ChangeMailStateResponse res = response as ChangeMailStateResponse; // Debug.Log(res.data); if (res.data) { //操作成功 //标记已读 if (type == 1) { foreach (int id in mail) { MailReveicer.Instance.SetMailState(id, 1); } } else if (type == 2) { //删除邮件 foreach (int id in mail) { MailReveicer.Instance.SetMailState(id, 2); } } //刷新邮件 MailBox._mInstance._view.RefreshMsg(); // //刷新邮箱的状态 // MailBox._mInstance._view.SetNewSgin(MailReveicer.Instance.mailState); if (type == 2) { OnBtnClick("Close"); } } } }; task.ErrorOccured = (BaseHttpRequest request, string error) => { Debug.Log("Mail[" + mail[0] + "] Operation[" + type.ToString() + "] is error![" + error + "]"); }; task.DispatchToRealHandler(); }
public void SendGetNowMsg() { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.BUILD_GET, new BuildGetParam(Core.Data.playerManager.PlayerID, m_data.RTData.id)); task.ErrorOccured += testHttpResp_Error; task.afterCompleted += testHttpResp_UI; task.DispatchToRealHandler(); ComLoading.Open(); }
void NewFinalTrialStateRequest() { // ComLoading.Open(); NewFinalTrialStateParam param = new NewFinalTrialStateParam(int.Parse(Core.Data.playerManager.PlayerID)); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.NEW_FINALTRIAL_STATE, param); task.afterCompleted += SetNewFinalTrialData; task.DispatchToRealHandler(); }
public void qiangDuoBuyItem(int plistID) { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.QIANGDUO_GOLD_BUY_ITEM, new QiangDuoGoldBuyItemParam(int.Parse(Core.Data.playerManager.PlayerID), plistID)); task.afterCompleted = qiangDuoBuyItemCompleted; task.ErrorOccured = qiangDuoBuyItemError; task.DispatchToRealHandler(); }
public void getFriendListRequest() { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.GET_FRIEND_LIST, new GetFriendListParam(Core.Data.playerManager.PlayerID, this.friendListCurrentPage, 0)); task.afterCompleted = getFriendListRequestCompleted; task.ErrorOccured = getFriendListRequestError; task.DispatchToRealHandler(); }
public void VipRequest() { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.VIPSHOPINFO, new GetVipShopParam(int.Parse(Core.Data.playerManager.PlayerID))); task.afterCompleted = getDateCompleted; task.ErrorOccured = getDateError; task.DispatchToRealHandler(); }
void ActivityLimitTimeRequest() { ActivityLimitTimeParam param = new ActivityLimitTimeParam(int.Parse(Core.Data.playerManager.PlayerID)); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.ACTIVITYLIMITTIME, param); task.afterCompleted += activityAward_UI; task.DispatchToRealHandler(); }
public void FinalTrialRankCheckInfoRequest(int mEnemyid) { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.CHECK_TEAMRANKINFO, new NewFinalTrialRankCheckInfoParam(int.Parse(Core.Data.playerManager.PlayerID), mEnemyid)); task.afterCompleted = SetFinalTrialRankData; task.DispatchToRealHandler(); ComLoading.Open(); }
void GetVipRewardRequest() { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.GETVIPLEVELREWARD, new GetVipLevelRewardParam(int.Parse(Core.Data.playerManager.PlayerID), m_Id)); task.afterCompleted = getDateCompleted; task.ErrorOccured = getDateError; task.DispatchToRealHandler(); ComLoading.Open(); }