public void SkipChallengeBtnClick() { yuan.YuanMemoryDB.YuanRow yr = null; if (bossTowerInfoDic.TryGetValue(skipLayers, out yr)) { if (int.TryParse(yr["needbloodstone"].YuanColumnText.Trim(), out needBloodstone)) { PanelStatic.StaticWarnings.warningAllEnterClose.btnEnter.target = this.gameObject; PanelStatic.StaticWarnings.warningAllEnterClose.btnEnter.functionName = "RequestWipeOut"; string tipInfo = ""; if (needBloodstone > 0) { tipInfo = string.Format("{0}{1}{2}{3}{4}", StaticLoc.Loc.Get("tower006"), needBloodstone, StaticLoc.Loc.Get("tower007"), skipLayers, StaticLoc.Loc.Get("tower008"));//花费XX血石直接获得XX层的奖励 } else { tipInfo = ""; } PanelStatic.StaticWarnings.warningAllEnterClose.Show(StaticLoc.Loc.Get("meg0154"), tipInfo); } else { needBloodstone = -1; } } else { needBloodstone = -1; } }
void ShowRobotytList() { robotyt = new yuan.YuanMemoryDB.YuanTable("", ""); objRobotRow = BtnGameManager.yt[0].CopyTo(); objRobotRow["ProID"].YuanColumnText = "1"; objRobotRow["PlayerLevel"].YuanColumnText = "2"; objRobotRow["PlayerName"].YuanColumnText = StaticLoc.Loc.Get("info1071"); objRobotRow["PlayerID"].YuanColumnText = "-10"; objRobotRow1 = BtnGameManager.yt[0].CopyTo(); objRobotRow1["ProID"].YuanColumnText = "2"; objRobotRow1["PlayerLevel"].YuanColumnText = "2"; objRobotRow1["PlayerName"].YuanColumnText = StaticLoc.Loc.Get("info1072"); objRobotRow1["PlayerID"].YuanColumnText = "-10"; objRobotRow2 = BtnGameManager.yt[0].CopyTo(); objRobotRow2["ProID"].YuanColumnText = "3"; objRobotRow2["PlayerLevel"].YuanColumnText = "2"; objRobotRow2["PlayerName"].YuanColumnText = StaticLoc.Loc.Get("info1073"); objRobotRow2["PlayerID"].YuanColumnText = "-10"; objRobotRow2["EquipItem"].YuanColumnText = "3101143624100000003000000;;;;;;6201322311121000000000000,01;;;;;;"; objRobotRow2["Skill"].YuanColumnText = "30;20;20;20;20;20;10;10;00;20;20;20;10;10;00;20;20;20;10;10;20;10;10;"; objRobotRow2["SkillsPostion"].YuanColumnText = "0,,;0,,;24,14,ProID_314;12,03,ProID_303;"; // robotyt.Add (objRobotRow); // robotyt.Add (objRobotRow1); robotyt.Add(objRobotRow2); }
public void GetPage(string mPageId) { yuan.YuanMemoryDB.YuanRow row = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytGameItem.SelectRowEqual("id", mPageId); if (row != null) { if (row["ItemID"].YuanColumnText.Substring(0, 2) == "88") { PanelStatic.StaticBtnGameManager.invcl.SendMessage("AddNewDaojuItemAsID", row["ItemID"].YuanColumnText + ",01", SendMessageOptions.DontRequireReceiver); } else if (row["ItemID"].YuanColumnText.Substring(0, 2) == "72") { PanelStatic.StaticBtnGameManager.invcl.SendMessage("AddNewRideItemAsID", row["ItemID"].YuanColumnText, SendMessageOptions.DontRequireReceiver); } else if (row["ItemID"].YuanColumnText.Substring(0, 2) == "70") { PanelStatic.StaticBtnGameManager.invcl.SendMessage("AddBagDigestItemAsID", row["ItemID"].YuanColumnText, SendMessageOptions.DontRequireReceiver); } else if (row["ItemID"].YuanColumnText.Substring(0, 2) == "71") { PanelStatic.StaticBtnGameManager.invcl.SendMessage("AddBagSoulItemAsID", row["ItemID"].YuanColumnText, SendMessageOptions.DontRequireReceiver); } else { PanelStatic.StaticBtnGameManager.invcl.SendMessage("AddBagItemAsID", row["ItemID"].YuanColumnText + ",01", SendMessageOptions.DontRequireReceiver); } //PanelStatic.StaticBtnGameManager.invcl.SendMessage("AddBagItemAsID", row["ItemID"].YuanColumnText+",01", SendMessageOptions.DontRequireReceiver); PanelStatic.StaticWarnings.warningAllEnter.Show(StaticLoc.Loc.Get("info358"), StaticLoc.Loc.Get("info501")); } else { PanelStatic.StaticWarnings.warningAllEnter.Show(StaticLoc.Loc.Get("info358"), StaticLoc.Loc.Get("info502")); } }
/// <summary> /// 更新玩家信息 /// </summary> public void RefreshPlayerInfo() { if (yr != null && yr.ContainsKey("PlayerName")) { lblPlayerName.text = yr["PlayerName"].YuanColumnText.Trim(); lblPlayerLevel.text = yr["PlayerLevel"].YuanColumnText.Trim(); lblPlayerPro.text = RefreshList.GetPro(yr["ProID"].YuanColumnText.Trim()); lblPrestige.text = yr["Prestige"].YuanColumnText.Trim(); lblRanking.text = yr["VSRanking"].YuanColumnText.Trim(); if (yr["GuildName"].YuanColumnText.Trim() == "") { lblGuild.text = StaticLoc.Loc.Get("info689"); } else { lblGuild.text = yr["GuildName"].YuanColumnText.Trim(); } yrLoaction = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytMapLevel.SelectRowEqual("MapID", yr["Place"].YuanColumnText.Trim()); lblLocation.text = yrLoaction["MapName"].YuanColumnText.Trim(); if (btnTalk != null) { btnTalk.playerID = yr["PlayerID"].YuanColumnText.Trim(); } } }
MainTaskReward getTaskReward(yuan.YuanMemoryDB.YuanRow rows, MainTaskReward reward, string str) { reward = new MainTaskReward(); reward.itemId = rows[str].YuanColumnText; reward.exp = GetIntDBAsName("RewardExp", 0, rows); reward.gold = GetIntDBAsName("RewardGold", 0, rows); reward.rank = GetIntDBAsName("RewardBloodStone", 0, rows); reward.taskDescription = rows["TaskInfo"].YuanColumnText; return(reward); }
int GetIntDBAsName(string name, int ret, yuan.YuanMemoryDB.YuanRow rows) { int i = 0; try{ i = int.Parse(rows[name].YuanColumnText); return(i); }catch (System.Exception e) { Debug.Log(e.ToString()); return(ret); } }
void ShowTime() { if (Application.loadedLevelName == "Map911") { ActiveID = "9"; yuan.YuanMemoryDB.YuanRow yr = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytActivity.SelectRowEqual("id", ActiveID); string Tim = yr["ActivityTimePeriods"].YuanColumnText; string[] strt = Tim.Split('-'); string ActivityEndTime = strt[1]; // string ActivityEndTime = "15:30"; string timMe = InRoom.GetInRoomInstantiate().serverTime.ToString("d").Trim() + " " + ActivityEndTime + ":00"; int LastTime = (int)((DateTime.Parse(timMe) - InRoom.GetInRoomInstantiate().serverTime).TotalSeconds); int hours = (int)(LastTime / (60 * 60)); int minutes = LastTime % (60 * 60) / 60; int seconds = LastTime % (60 * 60) % 60; if (LastTime >= 0) { LblTime.text = string.Format("{0:00}:{1:00}:{2:00}", hours, minutes, seconds); } } if (Application.loadedLevelName == "Map912") { ActiveID = "22"; yuan.YuanMemoryDB.YuanRow yr = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytActivity.SelectRowEqual("id", ActiveID); string Tim = yr["ActivityTimePeriods"].YuanColumnText; string[] strt = Tim.Split('-'); string ActivityEndTime = strt[1]; // string ActivityEndTime = "15:30"; string timMe = InRoom.GetInRoomInstantiate().serverTime.ToString("d").Trim() + " " + ActivityEndTime + ":00"; int LastTime = (int)((DateTime.Parse(timMe) - InRoom.GetInRoomInstantiate().serverTime).TotalSeconds); int hours = (int)(LastTime / (60 * 60)); int minutes = LastTime % (60 * 60) / 60; int seconds = LastTime % (60 * 60) % 60; if (LastTime >= 0) { LblTime.text = string.Format("{0:00}:{1:00}:{2:00}", hours, minutes, seconds); } } else { return; } }
/// <summary> /// 从特定字典集合组合表和字典参数 /// </summary> /// <param name="dic"></param> public static void CopyToDictionaryAndParms(this yuan.YuanMemoryDB.YuanTable my, Dictionary <short, object> dic) { if (dic.Count > 0) { my.Refresh(); my.DeleteRows.Clear(); my.Clear(); foreach (KeyValuePair <short, object> item in dic) { if (item.Key == 0) { Dictionary <string, string> tempDic = ((Dictionary <object, object>)item.Value).DicObjTo <string, string>(); my.TableName = tempDic["TableName"]; my.TableKey = tempDic["TableKey"]; } else if (item.Key == 1) { my.mParms = ((Dictionary <object, object>)item.Value).DicObjTo <short, object>().ToByteObject(); } else { string[] listDc = (string[])item.Value; int dcNum = 0; string dcStr = string.Empty; foreach (string dc in listDc) { if (dcNum == 0) { dcStr = dc; } else { if (my.Count < dcNum) { yuan.YuanMemoryDB.YuanRow tempRow = new yuan.YuanMemoryDB.YuanRow(); tempRow.Add(dcStr, dc); my.Rows.Add(tempRow); } else { my.Rows[dcNum - 1].Add(dcStr, dc); } } dcNum++; } } } } }
/// <summary> /// 拍卖到时间时,移除此条拍卖 /// </summary> /// <param name="index"></param> public void RemoveItem(int index) { yuan.YuanMemoryDB.YuanTable yTable = AuctionCompany.auctionCompany.auctionTable; yuan.YuanMemoryDB.YuanRow yRow = yTable.SelectRowEqual("id", index.ToString()); if (null == yRow) { return; } yTable.Rows.Remove(yRow); m_scrollView.UpdateListItem(AuctionCompany.auctionCompany.auctionTable.Rows.Count); aucTable = AuctionCompany.auctionCompany.auctionTable; }
private int maxTowerLevel = 30;// 困魔塔最大层数 // Use this for initialization void Start() { yuan.YuanMemoryDB.YuanTable bossTower = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytBosstower; List <string> ids = bossTower.GetColumnText("id"); maxTowerLevel = ids.Count; int layer = 0; yuan.YuanMemoryDB.YuanRow yRow = null; string item = ""; for (int i = 0; i < ids.Count; i++) { layer = int.Parse(ids[i]); yRow = bossTower.SelectRowEqual("id", ids[i]); bossTowerInfoDic.Add(layer, yRow); item = yRow["itemlist"].YuanColumnText.Trim(); if (string.IsNullOrEmpty(item)) { continue; } string[] items = item.Split(';'); itemList.Add(layer, items); if (i == maxTowerLevel - 1) { //显示首次通关奖励 string rewardItem = yRow["rewarditem"].YuanColumnText.Trim(); if (!string.IsNullOrEmpty(rewardItem)) { firstRewardItem.SetItemInfo(rewardItem); firstRewardItem.DisableItem(); } } } //if (isFirst) //{ // //yield return new WaitForSeconds(1.0f); // InitItemGrid(); // InitGoldAndExp(currLayer); // isFirst = false; //} if (!BtnGameManagerBack.isTown()) { closeBtn.SetActive(false); } }
private void BtnActivityClick(GameObject sender) { BtnActivity tempBtn = sender.GetComponent <BtnActivity>(); if (tempBtn != null && tempBtn.yr != null && tempBtn.yr.ContainsKey("ActivityName")) { lblTitle.text = tempBtn.yr["ActivityName"].YuanColumnText; lblActivityInfo.text = tempBtn.yr["ActivityInfo"].YuanColumnText; lblActivityTime.text = tempBtn.yr["ActivityTimeStart"].YuanColumnText.Substring(9, tempBtn.yr["ActivityTimeStart"].YuanColumnText.Length - 9) + "-" + tempBtn.yr["ActivityTimeEnd"].YuanColumnText.Substring(9, tempBtn.yr["ActivityTimeEnd"].YuanColumnText.Length - 9); yrSelect = tempBtn.yr; // if(yrSelect["Type"].YuanColumnText=="2") // { // SetTaskFun("ActivtyPVP"); // } // else // { SetTaskFun(); // } listItem.Clear(); for (int i = 1; i < 4; i++) { if (tempBtn.yr["AcitvityTool" + i.ToString()].YuanColumnText != "") { string[] strTemp = tempBtn.yr["AcitvityTool" + i.ToString()].YuanColumnText.Split(','); listSprite[i - 1].gameObject.SetActive(true); if (strTemp.Length > 1) { listSprite[i - 1].lblNum.text = strTemp[1]; } else { listSprite[i - 1].lblNum.text = "01"; } listSprite[i - 1].itemID = strTemp[0] + ",01"; listItem.Add(strTemp[0] + ",01"); object[] parms = new object[2]; parms[0] = strTemp[0] + ",01"; parms[1] = listSprite[i - 1].spriteBenefits; invMaker.SendMessage("SpriteName", parms, SendMessageOptions.DontRequireReceiver); } else { listSprite[i - 1].gameObject.SetActive(false); } } gridReward.repositionNow = true; } }
void InitGoldAndExp(int layer) { yuan.YuanMemoryDB.YuanRow yr = null; if (bossTowerInfoDic.TryGetValue(layer, out yr)) { gold = int.Parse(yr["money"].YuanColumnText.Trim()); SetGoldNum(yr["money"].YuanColumnText); SetExpNum(yr["exp"].YuanColumnText); } else { SetGoldNum("0"); SetExpNum("0"); } }
/// <summary> /// ÉèÖû°´Å¥ /// </summary> /// <param name="btn">°´Å¥</param> /// <param name="yr">±í</param> private void SetBtnAcitivty(BtnActivity btn, yuan.YuanMemoryDB.YuanRow yr) { btn.yr = yr; btn.lblText.text = btn.yr["ActivityName"].YuanColumnText; btn.lblTime.text = btn.yr["ActivityTimeStart"].YuanColumnText.Substring(9, btn.yr["ActivityTimeStart"].YuanColumnText.Length - 9) + "-" + btn.yr["ActivityTimeEnd"].YuanColumnText.Substring(9, btn.yr["ActivityTimeEnd"].YuanColumnText.Length - 9); // if (BtnGameManager.yt.Rows[0]["CompletTask"].YuanColumnText.IndexOf( btn.yr["ActivityTaskID"].YuanColumnText) == -1) // { // btn.btnDisable.Disable = false; // } // else // { // btn.btnDisable.Disable = true; // } btn.MyMessage.target = this.gameObject; btn.MyMessage.functionName = "BtnActivityClick"; }
/// <summary> /// 检测是否在加成时间段内 /// </summary> public void AnlasyAddtion() { yuan.YuanMemoryDB.YuanRow yrZeor = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytPlayerService.SelectRowEqual("VIPType", "0"); lblMakeGold2.text = yrZeor["blood"].YuanColumnText + ":" + yrZeor["gold"].YuanColumnText; yuan.YuanMemoryDB.YuanRow yrOne = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytPlayerService.SelectRowEqual("VIPType", "1"); lblMakeGold5.text = yrOne["blood"].YuanColumnText + ":" + yrOne["gold"].YuanColumnText; yuan.YuanMemoryDB.YuanRow yrFive = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytPlayerService.SelectRowEqual("VIPType", "5"); lblMakeGold10.text = yrFive["blood"].YuanColumnText + ":" + yrFive["gold"].YuanColumnText; System.DateTime nowTime = System.DateTime.Parse(InRoom.GetInRoomInstantiate().serverTime.TimeOfDay.ToString()); foreach (MakeGoldTimes item in listTime) { if (nowTime >= item.startTime && nowTime <= item.endTime) { canAddtion = true; return; } } canAddtion = false; }
void ShowNum() { if (SprMe.spriteName == "884" && SprMe.spriteName != "") { LblNumMe.enabled = true; } else { LblNumMe.enabled = false; } yuan.YuanMemoryDB.YuanRow yr = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytPlayerService.SelectRowEqual("VIPType", BtnGameManager.yt.Rows[0]["Serving"].YuanColumnText); if (int.Parse(yr["canEatPower"].YuanColumnText) == -1) { LblNumMe.text = ""; } else { string NumNow = (int.Parse(yr["canEatPower"].YuanColumnText) - int.Parse(BtnGameManager.yt.Rows[0]["useEatPower"].YuanColumnText)).ToString(); LblNumMe.text = string.Format("{0}{1}{2}{3}", StaticLoc.Loc.Get("info1203"), NumNow, "/", yr["canEatPower"].YuanColumnText); } }
/// <summary> /// 刷新活动列表 /// </summary> void RefreshActivityGrid() { //Debug.Log("==============RefreshActivityGrid==========" + activityIDAndState.Count); foreach (KeyValuePair <string, int> kvp in activityIDAndState) { string activityID = kvp.Key; int activityState = kvp.Value; string activityName = null; string activityTimeStart = null; int activityMinLevel = -1; int activityMaxLevel = -1; int playerLevel = -1; yuan.YuanMemoryDB.YuanRow yrActivity = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytActivity.SelectRowEqual("id", activityID); playerLevel = int.Parse(BtnGameManager.yt[0]["PlayerLevel"].YuanColumnText); if (yrActivity != null) { activityName = yrActivity["ActivityName"].YuanColumnText; //activityTimeStart = yrActivity["ActivityTimeStart"].YuanColumnText; activityTimeStart = StaticLoc.Loc.Get("meg0174") + yrActivity["ActivityTimePeriods"].YuanColumnText; activityMinLevel = int.Parse(yrActivity["ActivityLevel"].YuanColumnText); activityMaxLevel = int.Parse(yrActivity["ActivityLevelEnd"].YuanColumnText); } if (1 == activityState && playerLevel >= activityMinLevel && playerLevel <= activityMaxLevel) //if (1 == activityState) { AddActivityItem(activityID, activityName, activityTimeStart); } else if (2 == activityState || playerLevel < activityMinLevel || playerLevel > activityMaxLevel) //else if (2 == activityState) { RemoveActivityItem(activityID); } gridActivity.repositionNow = true; } }
/// <summary> /// 获取所有的战场信息 /// </summary> public void GetBattlefieldInfo() { List <string> ids = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytBattlefield.GetColumnText("id"); int key = -1; yuan.YuanMemoryDB.YuanRow value = null; for (int i = 0; i < ids.Count; i++) { if (!int.TryParse(ids[i].Trim(), out key) || 4 == key)//id为4的表示单人PVP { continue; } value = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytBattlefield.SelectRowEqual("id", ids[i]); if (null != value && -1 != key) { battlefieldInfoDic.Add(key, value); } } }
public void BattleItemClick(GameObject sender) { if (isSingleMatching || isTeamMatching) { for (int i = 0; i < childItems.Count; i++) { if (selectedID == childItems[i].ItemID) { childItems[i].transform.GetComponent <UIToggle>().value = true; } } PanelStatic.StaticWarnings.warningAllTime.Show("", StaticLoc.Loc.Get("battle009")); return; } PVPBattleItem item = sender.GetComponent <PVPBattleItem>(); selectedID = item.ItemID; if (battlefieldInfoDic.ContainsKey(selectedID)) { yuan.YuanMemoryDB.YuanRow yrBattle = null; if (battlefieldInfoDic.TryGetValue(selectedID, out yrBattle)) { SetBattleInfo(yrBattle["description"].YuanColumnText); SetConditionInfo(string.Format("{0}-{1}{2}", yrBattle["minLevel"].YuanColumnText, yrBattle["maxLevel"].YuanColumnText, StaticLoc.Loc.Get("battle005"))); } } else { Debug.LogError("PanelPVPBattlefield::BattleItemClick---------------selectedID is not contained in battlefieldInfoDic!"); } //OnDisable(); //OnEnable(); }
public void ShowNewNum() { if (int.Parse(BtnGameManager.yt.Rows[0]["Serving"].YuanColumnText) >= 1) { btnMGold2.isEnabled = true; LblVip2.text = StaticLoc.Loc.Get("buttons062"); } else { btnMGold2.isEnabled = false; LblVip2.text = StaticLoc.Loc.Get("info1204"); } if (int.Parse(BtnGameManager.yt.Rows[0]["Serving"].YuanColumnText) >= 5) { btnMGold2.isEnabled = true; btnMGold3.isEnabled = true; LblVip3.text = StaticLoc.Loc.Get("buttons062"); } else { btnMGold3.isEnabled = false; LblVip3.text = StaticLoc.Loc.Get("info1205"); } yuan.YuanMemoryDB.YuanRow yr = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytPlayerService.SelectRowEqual("VIPType", BtnGameManager.yt.Rows[0]["Serving"].YuanColumnText); // yr["blood"].YuanColumnText // Debug.Log("ran==========================================="+BtnGameManager.yt.Rows[0]["useMakeGold"].YuanColumnText+"=================================="+yr["canMakeGold"].YuanColumnText); string NumNow = (int.Parse(yr["canMakeGold"].YuanColumnText) - int.Parse(BtnGameManager.yt.Rows[0]["useMakeGold"].YuanColumnText)).ToString(); LblNumMe.text = string.Format("{0}{1}{2}", NumNow, "/", yr["canMakeGold"].YuanColumnText); // BtnGameManager.yt.Rows[0]["canMakeGold"].YuanColumnText }
private IEnumerator ReadInfo() { switch (pvpType) { case PVPType.Colosseum: lblNull2.gameObject.active = false; lblNull4.gameObject.active = false; lblCPlayerChallengeNum.text = (10 - int.Parse(BtnGameManager.yt.Rows[0]["PVPTimes"].YuanColumnText)).ToString(); lblCPlayerLevel.text = InRoom.isUpdatePlayerLevel?InRoom.playerLevel: BtnGameManager.yt.Rows[0]["PlayerLevel"].YuanColumnText; lblCPlayerName.text = BtnGameManager.yt.Rows[0]["PlayerName"].YuanColumnText; lblCPlayerPower.text = BtnGameManager.yt.Rows[0]["ColosseumFighting"].YuanColumnText; lblCPlayerPro.text = RefreshList.GetPro(BtnGameManager.yt.Rows[0]["ProID"].YuanColumnText); //lblCPlayerRanking.text = BtnGameManager.yt.Rows[0]["Rank"].YuanColumnText; lblCPlayerTitle.text = BtnGameManager.yt.Rows[0]["SelectTitle"].YuanColumnText; picCHead.atlas = yuanPicManager.picPlayer[BtnGameManager.yt.Rows[0]["ProID"].YuanColumnText.Parse(0) - 1].atlas; picCHead.spriteName = yuanPicManager.picPlayer[BtnGameManager.yt.Rows[0]["ProID"].YuanColumnText.Parse(0) - 1].spriteName; if (BtnGameManagerBack.isInPVPOne) { if (lblInPVP != null) { lblInPVP.gameObject.SetActiveRecursively(true); } } else { if (lblInPVP != null) { lblInPVP.gameObject.SetActiveRecursively(false); } } SetNoteString("PVP1Info", lblCPlayerNote); lblCPlayerRanking.text = PVPRankNum.ToString(); //sqlMy=string.Format ("Select (Select count(*) from {3} where a.{0}<{0} or (a.{0}={0} and a.PlayerID<PlayerID)) as ROW_NUMBER,a.{0},a.{1},a.PlayerID from {3} a where PlayerID={2} order by ROW_NUMBER", "ColosseumPoint", "PlayerName", BtnGameManager.yt.Rows[0]["PlayerID"].YuanColumnText, "PlayerInfo"); //InRoom.GetInRoomInstantiate().GetYuanTable(sqlMy, "DarkSword2", ytRanking); InRoom.GetInRoomInstantiate().GetRankOne(yuan.YuanPhoton.RankingType.Abattoir, BtnGameManager.yt.Rows[0]["PlayerID"].YuanColumnText, ytRanking); while (ytRanking.IsUpdate) { yield return(new WaitForSeconds(0.1f)); } // lblCPlayerRanking.text = ytRanking.myRank.ToString (); break; case PVPType.Battlefield: lblNull2.gameObject.active = false; lblNull4.gameObject.active = false; lblBPlayerdedication.text = BtnGameManager.yt.Rows[0]["PVPPoint"].YuanColumnText.Parse(0).ToString(); lblBPlayerMilitary.text = BtnGameManager.yt.Rows[0]["Rank"].YuanColumnText; lblBPlayerName.text = BtnGameManager.yt.Rows[0]["PlayerName"].YuanColumnText; picBHead.atlas = yuanPicManager.picPlayer[BtnGameManager.yt.Rows[0]["ProID"].YuanColumnText.Parse(0) - 1].atlas; picBHead.spriteName = yuanPicManager.picPlayer[BtnGameManager.yt.Rows[0]["ProID"].YuanColumnText.Parse(0) - 1].spriteName; // lblBPlayerNowLegion.text = BtnGameManager.yt.Rows[0][""].YuanColumnText; //lblBPlayerPost.text = BtnGameManager.yt.Rows[0][""].YuanColumnText; if (BtnGameManagerBack.isInLegion) { if (lblInPVP != null) { lblInPVP.gameObject.SetActiveRecursively(true); } } else { if (lblInPVP != null) { lblInPVP.gameObject.SetActiveRecursively(false); } } SetPVP8NoteString("PVP8Info", lblBPlayerNote); //sqlMy=string.Format ("Select (Select count(*) from {3} where a.{0}<{0} or (a.{0}={0} and a.PlayerID<PlayerID)) as ROW_NUMBER,a.{0},a.{1},a.PlayerID from {3} a where PlayerID={2} order by ROW_NUMBER", "BattlefieldDedication", "PlayerName", BtnGameManager.yt.Rows[0]["PlayerID"].YuanColumnText, "PlayerInfo"); //InRoom.GetInRoomInstantiate().GetYuanTable(sqlMy, "DarkSword2", ytRanking); InRoom.GetInRoomInstantiate().GetRankOne(yuan.YuanPhoton.RankingType.Rank, BtnGameManager.yt.Rows[0]["PlayerID"].YuanColumnText, ytRanking); while (ytRanking.IsUpdate) { yield return(new WaitForSeconds(0.1f)); } lblBPlayerRanking.text = PVPRankNum.ToString(); break; case PVPType.Lists: lblNull2.gameObject.active = false; lblNull4.gameObject.active = false; lblListsPoint.text = BtnGameManager.yt.Rows[0]["ListsPoint"].YuanColumnText; lblCeiling.text = BtnGameManager.yt.Rows[0]["ListsCeiling"].YuanColumnText; if (BtnGameManager.yt.Rows[0]["Corps2v2ID"].YuanColumnText != "" || BtnGameManager.yt.Rows[0]["Corps4v4ID"].YuanColumnText != "") { if (BtnGameManagerBack.isInPVP) { if (lblInPVP != null) { lblInPVP.gameObject.SetActiveRecursively(true); } } else { if (lblInPVP != null) { lblInPVP.gameObject.SetActiveRecursively(false); } } //InRoom.GetInRoomInstantiate().GetYuanTable(string.Format("Select * from Corps where id ='{0}' or id='{1}'", BtnGameManager.yt.Rows[0]["Corps2v2ID"].YuanColumnText, BtnGameManager.yt.Rows[0]["Corps4v4ID"].YuanColumnText), "DarkSword2", ytCrop); InRoom.GetInRoomInstantiate().GetTableForID(BtnGameManager.yt.Rows[0]["Corps2v2ID"].YuanColumnText, yuan.YuanPhoton.TableType.Corps, ytCrop); while (ytCrop.IsUpdate) { yield return(new WaitForSeconds(0.5f)); } //Debug.Log("-------------------------------yyyyyyyyyyyyyyyyyyyyyyyyy:" + yuan.YuanPhoton.CorpType.PVP2.ToString()); if (ytCrop.Rows.Count > 0) { yrPVP2 = ytCrop.SelectRowEqual("PlayerNumber", "2"); yrPVP4 = ytCrop.SelectRowEqual("PlayerNumber", "4"); if (yrPVP2 != null) { lblL2Fail.text = yrPVP2["FailNum"].YuanColumnText == ""?"0":yrPVP2["FailNum"].YuanColumnText; lblL2Game.text = (yrPVP2["FailNum"].YuanColumnText.Parse(0) + yrPVP2["VictoryNum"].YuanColumnText.Parse(0)).ToString(); lblL2Victory.text = yrPVP2["VictoryNum"].YuanColumnText == ""?"0":yrPVP2["VictoryNum"].YuanColumnText; if (lblL2Game.text.Parse(0) == 0) { lblL2Winning.text = "0%"; } else { lblL2Winning.text = (yrPVP2["VictoryNum"].YuanColumnText.Parse(0) / lblL2Game.text.Parse(0) * 100).ToString() + "%"; } lblL2ListsLevel.text = yrPVP2["SelfLevel"].YuanColumnText; //lblL2ListsRanking.text = yrPVP2["Ranking"].YuanColumnText; lblL2ListsRanking.text = BtnGameManager.yt[0]["Rank"].YuanColumnText; } else { lblNull2.gameObject.active = true; objPVP2.SetActiveRecursively(false); } if (yrPVP4 != null) { lblL4Fail.text = yrPVP4["FailNum"].YuanColumnText == ""?"0":yrPVP4["FailNum"].YuanColumnText; lblL4Game.text = (yrPVP4["FailNum"].YuanColumnText.Parse(0) + yrPVP4["VictoryNum"].YuanColumnText.Parse(0)).ToString(); lblL4Victory.text = yrPVP4["VictoryNum"].YuanColumnText == ""?"0":yrPVP4["VictoryNum"].YuanColumnText; if (lblL4Game.text.Parse(0) == 0) { lblL4Winning.text = "0%"; } else { lblL4Winning.text = (yrPVP4["VictoryNum"].YuanColumnText.Parse(0) / lblL2Game.text.Parse(0) * 100).ToString() + "%"; } lblL4ListsLevel.text = yrPVP4["SelfLevel"].YuanColumnText; //lblL4ListsRanking.text = yrPVP4["Ranking"].YuanColumnText; lblL4ListsRanking.text = BtnGameManager.yt[0]["Rank"].YuanColumnText; } else { lblNull4.gameObject.active = true; objPVP4.SetActiveRecursively(false); } } else { lblNull2.gameObject.active = true; lblNull4.gameObject.active = true; this.gameObject.SetActiveRecursively(false); } } else { lblNull2.gameObject.active = true; this.gameObject.SetActiveRecursively(false); } break; } }
private void InsBtn(yuan.YuanMemoryDB.YuanRow yrGameItem, yuan.YuanMemoryDB.YuanRow yrStore, UIGrid mGrid, string btnFunction, bool mActive, List <BtnItem> list) { yrGameItem = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytGameItem.SelectRow("ItemID", yrStore["ItemID"].YuanColumnText.Substring(0, 4)); if (yrGameItem == null) { yrGameItem = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytPlayerPet.SelectRow("ItemID", yrStore["ItemID"].YuanColumnText); } if (yrGameItem == null && yrStore["ItemID"].YuanColumnText.IndexOf("J") != -1) { yrGameItem = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytBlueprint.SelectRow("id", yrStore["ItemID"].YuanColumnText.Substring(1, yrStore["ItemID"].YuanColumnText.Length - 1)); } if (yrGameItem != null) { GameObject tempObj = (GameObject)Instantiate(btnItem); BtnItem tempBtn = tempObj.GetComponent <BtnItem>(); list.Add(tempBtn); if (yrGameItem.ContainsKey("Name")) { tempBtn.lblName.text = yrGameItem["Name"].YuanColumnText; } else if (yrGameItem.ContainsKey("BlueprintName")) { tempBtn.lblName.text = yrGameItem["BlueprintName"].YuanColumnText; } tempBtn.infoBar = this.infoBar; tempBtn.ItemNeedBlood = int.Parse(yrStore["ItemNeedBlood"].YuanColumnText); tempBtn.ItemNeedCash = int.Parse(yrStore["ItemNeedCash"].YuanColumnText); tempBtn.lblFavorable.text = yrStore["ItemDiscount"].YuanColumnText; tempBtn.storeItemID = yrStore["id"].YuanColumnText; tempBtn.ItemID = yrStore["ItemID"].YuanColumnText; tempBtn.myMessage.target = this.gameObject; tempBtn.myMessage.functionName = btnFunction; tempBtn.gameObject.SendMessage("SetBtn", tempBtn); object[] objParms = new object[2]; objParms[0] = tempBtn.ItemID; objParms[1] = tempBtn.spriteBackground; PanelStatic.StaticBtnGameManager.invcl.SendMessage("SetYanSeAsID", objParms, SendMessageOptions.DontRequireReceiver); //if (yrStore["isStart"].YuanColumnText.Trim() == "1") //{ // tempBtn.IsFavorable = true; // tempBtn.DtEnd = System.DateTime.Parse(yrStore["ItemEndTime"].YuanColumnText); //} //else //{ // tempBtn.IsFavorable = false; //} System.TimeSpan timeSpan = new System.TimeSpan(0, 0, 1); DateTime dt = DateTime.Parse(yrStore["ItemEndTime"].YuanColumnText.Trim()); //TimeSpan ts = dt.TimeOfDay - DateTime.Now.TimeOfDay; TimeSpan ts = dt.TimeOfDay - InRoom.GetInRoomInstantiate().serverTime.TimeOfDay; ts = ts.Subtract(timeSpan); if (ts.Hours <= 0 && ts.Minutes <= 0 && ts.Seconds <= 0) { // 结束打折 tempBtn.IsFavorable = false; } else { // 正在打折 tempBtn.IsFavorable = true; tempBtn.DtEnd = System.DateTime.Parse(yrStore["ItemEndTime"].YuanColumnText); } tempBtn.gameObject.SetActiveRecursively(mActive); if (!mGrid.gameObject.active) { tempObj.SetActiveRecursively(false); } tempBtn.yr = yrStore; tempBtn.transform.parent = mGrid.transform; tempBtn.myCheck.group = 6; tempBtn.transform.localScale = new Vector3(1, 1, 1); tempBtn.transform.localPosition = Vector3.zero; } }
public IEnumerator BtnRevengeClick() { for (int i = 0; i < listPVP1.Count; i++) { listPVP1[i].gameObject.SetActiveRecursively(false); } listTabel.SetZore(); string[] strPlayer = BtnGameManager.yt[0]["pvp1BeInfo"].YuanColumnText.Split(';'); if (BtnGameManager.yt[0]["pvp1BeInfo"].YuanColumnText != "" && strPlayer.Length > 0) { List <string> listPlayer = new List <string>(); List <string> listPlayerMemery = new List <string>(); listPlayer.CopyTo(strPlayer); for (int i = 0; i < strPlayer.Length; i++) { string[] tempPlayer = strPlayer[i].Split(','); if (strPlayer[i] != "" && tempPlayer[2] != "2") { if (!listPlayer.Contains(tempPlayer[0])) { listPlayer.Add(tempPlayer[0]); listPlayerMemery.Add(strPlayer[i]); } } } for (int i = 0; i < strPlayer.Length; i++) { string[] tempPlayer = strPlayer[i].Split(','); if (strPlayer[i] != "" && !listPlayer.Contains(strPlayer[i])) { if (!listPlayer.Contains(tempPlayer[0])) { listPlayer.Add(tempPlayer[0]); listPlayerMemery.Add(strPlayer[i]); } } } if (listPlayer.Count > 0) { //System.Text.StringBuilder strSqlFirend = new System.Text.StringBuilder(); //strSqlFirend.Append("Select PlayerID,PlayerName,ProID,PlayerLevel from PlayerInfo where "); //for (int i = 0; i < listPlayer.Count; i++) //{ // // if (i != 0 && listPlayer[i] != "") // { // strSqlFirend.AppendFormat(" or PlayerID={0}", listPlayer[i].Split(',')[0]); // } // else if (listPlayer[i] != "") // { // strSqlFirend.AppendFormat("PlayerID={0}", listPlayer[i].Split(',')[0]); // } //} //InRoom.GetInRoomInstantiate ().GetPlayerList(listPlayer.ToArray (),ytRevenge,"DarkSword2","PlayerInfo"); InRoom.GetInRoomInstantiate().GetTablesSomeForIDs(listPlayer.ToArray(), strRows, yuan.YuanPhoton.TableType.PlayerInfo, ytRevenge); while (ytRevenge.IsUpdate) { yield return(new WaitForSeconds(0.1f)); } List <yuan.YuanMemoryDB.YuanRow> listRow = new List <yuan.YuanMemoryDB.YuanRow>(); //try //{ for (int i = 0; i < listPlayerMemery.Count; i++) { yuan.YuanMemoryDB.YuanRow tempRow = ytRevenge.SelectRowEqual("PlayerID", listPlayerMemery[i].Split(',')[0]); if (tempRow != null) { tempRow = tempRow.CopyTo(); tempRow.Add("pvp1BeInfo", listPlayerMemery[i]); //tempRow["pvp1BeInfo"].YuanColumnText=listPlayerMemery[i]; //tempRow.Add("pvp1BeInfo", listPlayer[i]); listRow.Add(tempRow); } } ytRevenge.Rows = listRow; listTabel.SetFrist(ytRevenge, SetPVP1RevengeList, maxListNum); //} //catch (System.Exception ex) //{ // Debug.LogWarning(ex.ToString()); //} } } }
public const int ACTIVITY_TYPE_BOSS = 3; //"BOSS活动"; /// <summary> /// 活动Item被点击 /// </summary> /// <param name="sender"></param> public void BtnActivityOnClick(GameObject sender) { BtnActivity btnActivity = sender.GetComponent <BtnActivity>(); yuan.YuanMemoryDB.YuanRow yrActivity = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytActivity.SelectRowEqual("id", btnActivity.activityID); string activityInfo = ""; //活动内容 string activityConditionInfo = ""; //活动条件 string victoryCondition = ""; // 胜利条件 string[] activityTool = new string[3]; //三种奖励物品 int activityType = 0; //活动类型 if (yrActivity != null) { activityInfo = yrActivity["ActivityInfo"].YuanColumnText; activityConditionInfo = yrActivity["ActivityConditionInfo"].YuanColumnText; victoryCondition = yrActivity["winInfo"].YuanColumnText; activityTool[0] = yrActivity["AcitvityTool1"].YuanColumnText; activityTool[1] = yrActivity["AcitvityTool2"].YuanColumnText; activityTool[2] = yrActivity["AcitvityTool3"].YuanColumnText; listItem.Clear(); if (!string.IsNullOrEmpty(activityTool[0])) { listSprite[0].gameObject.SetActive(true); string[] tool1 = activityTool[0].Split(','); listItem.Add(tool1[0] + ",01"); } else { listSprite[0].gameObject.SetActive(false); } if (!string.IsNullOrEmpty(activityTool[1])) { listSprite[1].gameObject.SetActive(true); string[] tool2 = activityTool[1].Split(','); listItem.Add(tool2[0] + ",01"); } else { listSprite[1].gameObject.SetActive(false); } if (!string.IsNullOrEmpty(activityTool[2])) { listSprite[2].gameObject.SetActive(true); string[] tool3 = activityTool[2].Split(','); listItem.Add(tool3[0] + ",01"); } else { listSprite[2].gameObject.SetActive(false); } activityType = int.Parse(yrActivity["ActivityType"].YuanColumnText); } BtnEnterActivity.activityID = btnActivity.activityID; BtnEnterActivity.activityType = activityType; ActivityControl.activityControl.ShowActivityInfo(activityInfo, activityConditionInfo, victoryCondition, activityTool); if (btnActivity.canGetReward && activityType != ACTIVITY_TYPE_BOSS) { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.GetReward);//如果能领取奖励按钮上就显示领取奖励 } else if (btnActivity.isCancelQueue) { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.CancelQueue); // 如果已经排过队了,按钮状态需要变成退出排队状态 } else { if (activityType == ACTIVITY_TYPE_NORAML || activityType == ACTIVITY_TYPE_BOSS) { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.JoinActivity); } else if (activityType == ACTIVITY_TYPE_BATTLEFIELD) { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.ActivityQueue); } else if (activityType == ACTIVITY_TYPE_TASK) { //BtnGameManagerBack.my.taskActivityState string temp = BtnGameManager.yt.Rows[0]["EveryDayTaskActivity"].YuanColumnText; if (!temp.Equals("")) { string[] active = temp.Split(';'); if (temp.IndexOf(btnActivity.activityID) != -1) { for (int i = 0; i < active.Length; i++) { string[] singleActive = active[i].Split(','); if (btnActivity.activityID == singleActive[0]) { if (0 == int.Parse(singleActive[1])) { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.ContinueActivity); } else if (1 == int.Parse(singleActive[1])) { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.GetReward); } if (2 == int.Parse(singleActive[1])) { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.WasDone); } } } } else { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.JoinActivity); } } else { BtnEnterActivity.btnEnterActivity.SwitchBtnState(BtnState.JoinActivity); } } } // BtnEnterActivity.activityID = btnActivity.activityID; }
private void GetBtn() { yuan.YuanMemoryDB.YuanRow yrGameItem = null; foreach (yuan.YuanMemoryDB.YuanRow yrStore in ytStoreItem.Rows) { if (yrStore["ItemType"].YuanColumnText.Trim() == "1") { //if (yrStore["isStart"].YuanColumnText.Trim() == "1") //{ // InsBtn(yrGameItem, yrStore, gridFavorable, "SetFavorableInfo",true); //} System.TimeSpan timeSpan = new System.TimeSpan(0, 0, 1); DateTime dt = DateTime.Parse(yrStore["ItemEndTime"].YuanColumnText.Trim()); //TimeSpan ts = dt.TimeOfDay - DateTime.Now.TimeOfDay; TimeSpan ts = dt.TimeOfDay - InRoom.GetInRoomInstantiate().serverTime.TimeOfDay; ts = ts.Subtract(timeSpan); if (ts.Hours <= 0 && ts.Minutes <= 0 && ts.Seconds <= 0) { // 结束打折 } else { // 正在打折 InsBtn(yrGameItem, yrStore, gridFavorable, "SetFavorableInfo", true, listBtnFavorable); } InsBtn(yrGameItem, yrStore, gridItem, "SetItemInfo", true, listBtnItem); } else if (yrStore["ItemType"].YuanColumnText.Trim() == "2") { if (InRoom.GetInRoomInstantiate().GetServerSwitchString(yuan.YuanPhoton.BenefitsType.PetBuySwitch) == "1") { //if (yrStore["isStart"].YuanColumnText.Trim() == "1") //{ // InsBtn(yrGameItem, yrStore, gridFavorable, "SetFavorableInfo",true); //} System.TimeSpan timeSpan = new System.TimeSpan(0, 0, 1); DateTime dt = DateTime.Parse(yrStore["ItemEndTime"].YuanColumnText.Trim()); //TimeSpan ts = dt.TimeOfDay - DateTime.Now.TimeOfDay; TimeSpan ts = dt.TimeOfDay - InRoom.GetInRoomInstantiate().serverTime.TimeOfDay; ts = ts.Subtract(timeSpan); if (ts.Hours <= 0 && ts.Minutes <= 0 && ts.Seconds <= 0) { // 结束打折 } else { // 正在打折 InsBtn(yrGameItem, yrStore, gridFavorable, "SetFavorableInfo", true, listBtnFavorable); } InsBtn(yrGameItem, yrStore, gridMonster, "SetMtemInfo", true, listBtnMonster); } } } gridFavorable.repositionNow = true; gridItem.repositionNow = true; gridMonster.repositionNow = true; SetFirstFavorable(); SetFirstItem(); SetFirstMonster(); }