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(); }
public void getFriendList() { ComLoading.Open(); Core.Data.FriendManager.getFriendListRequest(); Core.Data.FriendManager.getFriendListRequestCompletedDelegate = setFriend; }
//批量合成 void ReCombineGem() { if (Selected_Frist_GemData == null || Selected_Second_GemData == null) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9012), null); return; } if (Core.Data.playerManager.Coin < defaultNum * Core.Data.gemsManager.getGemData(Selected_Frist_GemData.configData.target).coin) { JCRestoreEnergyMsg.OpenUI(ItemManager.COIN_PACKAGE, ItemManager.COIN_BOX, 2); return; } successNum = 0; count = 0; tempId = 0; keylist = new List <int>(); CombineTimes = defaultNum; //Debug.Log (" default == " + defaultNum); for (int i = 0; i < defaultNum; i++) { SendCombineGems(); } ComLoading.Open(); }
/*向服务器发送重铸数据 * */ 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(); }
public void OnSelectAoYi() { bool noSelect = true; AoYiSlot[] aoYiSlots = aoYiGrid.GetComponentsInChildren <AoYiSlot>(); foreach (AoYiSlot aoYiSlot in aoYiSlots) { if (aoYiSlot.selectedBackground.activeSelf) { // short dragonType = aoYiSlot.aoYi.AoYiDataConfig.dragonType; if (this.currentSelectAoYiAlertType == SelectAoYiAlertType.SelectLearnAoYi) { // if(aoYiSlot.aoYi.AoYiDataConfig.unlockLevel > Core.Data.dragonManager.DragonList[dragonType - 1].RTData.lv && aoYiSlot.aoYi.ID == 0) // 没解锁 add by wxl // { // SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(6110)); // } // else // if(aoYiSlot.aoYi.AoYiDataConfig.unlockLevel <= Core.Data.dragonManager.DragonList[dragonType - 1].RTData.lv) // { ComLoading.Open(); Core.Data.dragonManager.learnAoYiRequest(aoYiSlot.aoYi.AoYiDataConfig.ID.ToString()); Destroy(gameObject); // } } else if (this.currentSelectAoYiAlertType == SelectAoYiAlertType.SelectEquipAoYi) { if (/*aoYiSlot.aoYi.AoYiDataConfig.unlockLevel <= Core.Data.dragonManager.DragonList[dragonType - 1].RTData.lv && */ aoYiSlot.aoYi.ID == 0) // 没学习 { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(6109)); } // else if(aoYiSlot.aoYi.AoYiDataConfig.unlockLevel > Core.Data.dragonManager.DragonList[dragonType - 1].RTData.lv && aoYiSlot.aoYi.ID == 0) // 没解锁 add by wxl // { // SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(6110)); // } //wxl changed // else if(aoYiSlot.aoYi.Pos != -1) // { // SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(34016)); // } else if (aoYiSlot.aoYi.ID != 0) { if (selectAoYiCompletedDelegate != null) { selectAoYiCompletedDelegate(aoYiSlot.aoYi.AoYiDataConfig); } Destroy(gameObject); } } noSelect = false; break; } } if (noSelect) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(6041)); } }
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(); } }
public void OnBtnMonsterCome() { if (LuaTest.Instance.OpenDevil == false) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(7304)); return; } if (Core.Data.playerManager.Lv < actStartLv) { string tLog = string.Format(Core.Data.stringManager.getString(7320), actStartLv.ToString()); ActivityNetController.ShowDebug(tLog); return; } if (ActivityNetController.isInActivity == false) { ActivityNetController.ShowDebug(Core.Data.stringManager.getString(29)); return; } if (ActivityNetController.isActSKTConnect == false) { ComLoading.Open(); ActivityNetController.curWaitState = 2; return; } WillToMainView(ActivityItemType.mosterComeItem, 1); DBUIController.mDBUIInstance.HiddenFor3D_UI(); gameObject.SetActive(false); }
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(); }
//下订单 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(); }
//开始旋转 public void OnBtnClick() { Core.Data.soundManager.SoundFxPlay(SoundFx.FX_Dragon, null); ComLoading.Open(); sendSer(activityAward_UI, activityAward_Error, 1); closeBtn.enabled = false; }
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(); }
public void onGameResume(string curLevel) { curStates = States.ON_RESUME; if (Application.loadedLevelName != SceneName.LOGIN_SCENE) { if (Core.NetEng.SockEngine.endPoint.Host == Core.SM.curServer.active_ip && Core.NetEng.SockEngine.endPoint.Port == Core.SM.curServer.active_port) { //activity ReconnectActivitySocket(); } else if (Core.NetEng.SockEngine.endPoint.Host == Core.SM.curServer.chat_ip && Core.NetEng.SockEngine.endPoint.Port == Core.SM.curServer.chat_port) { //chat ReconnectChatSocket(); } Core.TimerEng.OnResume(); #region added by zhangqiang TimeSpan span = DateTime.Now - pauseTime; if (span.TotalSeconds >= 10 && !Core.Data.guideManger.isDataSyncing) { ComLoading.Open(); //同步招募屋1 Core.Data.zhaomuMgr.bInit = false; Core.Data.zhaomuMgr.SendZhaomuStateMsg(); MailReveicer.Instance.SendFightMegRequest(100); } #endregion } curStates = States.ON_NETREADY; }
//打开宝石合成UI void OpenGemHechengUI() { BaseBuildingData tBuildData = Core.Data.BuildingManager.GetBuildFromBagByNum(BaseBuildingData.BUILD_YELIAN).config; if (tBuildData != null) { if (Core.Data.playerManager.Lv < tBuildData.limitLevel) { SQYAlertViewMove.CreateAlertViewMove(string.Format(Core.Data.stringManager.getString(7320), tBuildData.limitLevel.ToString()) + tBuildData.name); return; } } else { SQYAlertViewMove.CreateAlertViewMove("can't find building config "); return; } ComLoading.Open(); Gems gem = m_selBagItem.curData as Gems; FrogingSystem.ForgingRoomUI.OpenUI(() => { //关闭镶嵌宝石界面 FrogingSystem.ForgingRoomUI.Instance.DestoryForgingRoomUI(); DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag); SQYPetBoxController.mInstance.SetPetBoxType(RUIType.EMBoxType.LOOK_Gem); }); DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.H_Bag); FrogingSystem.ForgingRoomUI.Instance.GoToAndSetDia(FrogingSystem.ForgingPage.Forging_Synthetic, gem); }
void buyAoYiSlotCallBack() { if (this.buyAoYiSlot == null) { return; } int mNeedMoney = this.buyAoYiSlot.dragonLockData.price; if (this.buyAoYiSlot.dragonLockData.type == DragonLockData.PLAYER_LEVEL_TYPE) { if (Core.Data.playerManager.Coin < mNeedMoney) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35000)); return; } } else if (this.buyAoYiSlot.dragonLockData.type == DragonLockData.DIAMOND_TYPE) { if (Core.Data.playerManager.Stone < mNeedMoney) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35006)); return; } } ComLoading.Open(); Core.Data.dragonManager.buyAoYiSlotCompletedDelegate = buyAoYiSlotCompleted; Core.Data.dragonManager.buyAoYiSlotRequest(this.buyAoYiSlot.dragonLockData.dragonSlot); }
// 召唤神龙 方法 注册回调 void CallDragon() { changeCallDragonButtonState(false); ComLoading.Open(); Core.Data.dragonManager.CallDragonCompletedDelegate = CallDragonRequestCompleted; Core.Data.dragonManager.callDragonRequest(Core.Data.dragonManager.currentDragonType); }
void Start() { m_Title.SafeText(""); m_ActivityCellList = new List <UIActivitylimittimeCell>(); Invoke("Init", 0.3f); ComLoading.Open(); }
void Awake() { instance = this; nowTime = DateHelper.UnixTimeStampToDateTime(Core.Data.playerManager.RTData.systemTime).ToLocalTime(); canClick = true; ComLoading.Open(); StartCoroutine(RequestState()); }
void onNoButtonClicked() { ComLoading.Open(); Core.Data.FriendManager.agreeOrRefusedFriendRequestCompletedDelegate = agreeOrRefusedFriendRequestCompleted; // 1为 同意 2为 不同意 Core.Data.FriendManager.agreeOrRefusedFriendRequest(this.otherUserInfo, 2); }
// Use this for initialization void Start() { Data = Core.Data.HolidayActivityManager; // har = Data.har; Invoke("OneHour", 800f); ComLoading.Open(); ActivityLimitTimeRequest(); }
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(); }
void onAddClick() { ComLoading.Open(); Core.Data.FriendManager.searchFriendRequestCompletedDelegate = setSearchResult; Core.Data.FriendManager.searchUserRequest(this.searchMessage.value, this.searchOP); this.upPageButton.SetActive(false); this.downPageButton.SetActive(false); }
void Login() { ComLoading.Open(); #if CHECKCONFIG checkConfig(); #else readLocalConfig(); #endif }
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 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 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(); }
void onFightButtonClick() { ComLoading.Open(); if (friendDialogType == FriendDialogType.FriendDialog) { } else if (friendDialogType == FriendDialogType.SuDiDialog) { } }
void onSendMessage() { if (input.value == "") { return; } ComLoading.Open(); Core.Data.FriendManager.sendMessageRequestCompletedDelegate = sendMessageRequestCompleted; Core.Data.FriendManager.sendMessageRequest(otherUserInfo.g, input.value); }
void SendBattleRequest() { ComLoading.Open(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.FIGHT_FULISA, new BattleParam(Core.Data.playerManager.PlayerID, -1, 0, 0)); task.ErrorOccured += HttpResp_Error; task.afterCompleted += BattleResponseFUC; 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(); }