public static void CalZorkBattleRankTeamJiFen(List <KFZorkRankInfo> rankList) { lock (TianTi5v5Service.Mutex) { List <TianTi5v5ZhanDuiData> zhanduiList = TianTi5v5Service.ZhanDuiDict.Values.ToList <TianTi5v5ZhanDuiData>(); if (zhanduiList.Count != 0) { zhanduiList.RemoveAll((TianTi5v5ZhanDuiData x) => x.ZorkJiFen == 0); zhanduiList.Sort(delegate(TianTi5v5ZhanDuiData left, TianTi5v5ZhanDuiData right) { int result; if (left.ZorkJiFen > right.ZorkJiFen) { result = -1; } else if (left.ZorkJiFen < right.ZorkJiFen) { result = 1; } else if (left.ZorkLastFightTime > right.ZorkLastFightTime) { result = 1; } else if (left.ZorkLastFightTime < right.ZorkLastFightTime) { result = -1; } else if (left.ZhanDuiID > right.ZhanDuiID) { result = -1; } else if (left.ZhanDuiID < right.ZhanDuiID) { result = 1; } else { result = 0; } return(result); }); zhanduiList = zhanduiList.GetRange(0, Math.Min(30, zhanduiList.Count)); foreach (TianTi5v5ZhanDuiData item in zhanduiList) { KFZorkRankInfo rankinfo = new KFZorkRankInfo { Key = item.ZhanDuiID, Value = item.ZorkJiFen, StrParam1 = KuaFuServerManager.FormatName(item.ZoneID, item.ZhanDuiName) }; rankList.Add(rankinfo); } } } }
private void UpdateTopZhanDuiInfo() { this.TopZhanDuiName = ""; if (this.TopZhanDui > 0) { TianTi5v5ZhanDuiData zhanduiData = TianTi5v5Service.GetZhanDuiData(this.TopZhanDui); if (null != zhanduiData) { this.TopZhanDuiName = KuaFuServerManager.FormatName(zhanduiData.ZoneID, zhanduiData.ZhanDuiName); } } }
public int SignUp_ZorkBattle(int zhanduiID, int serverID) { int result = 0; try { lock (this.Mutex) { DateTime now = TimeUtil.NowDateTime(); if (!this.CheckOpenState(now)) { result = -11004; return(result); } if (this.StateMachine.GetCurrState() != Zork5v5StateMachine.StateType.SignUp && this.StateMachine.GetCurrState() != Zork5v5StateMachine.StateType.RankAnalyse) { result = -2001; return(result); } TianTi5v5ZhanDuiData zhanduiData = TianTi5v5Service.GetZhanDuiData(zhanduiID); if (null == zhanduiData) { result = -5; return(result); } if (this.PiPeiDict.ContainsKey(zhanduiID)) { result = -5; return(result); } KF5v5PiPeiTeam pipeiTeam = new KF5v5PiPeiTeam { TeamID = zhanduiID, ServerID = serverID, GroupIndex = this.CalDuanWeiByJiFen(zhanduiData.ZorkJiFen), ZhanDouLi = zhanduiData.ZhanDouLi, ZorkJiFen = zhanduiData.ZorkJiFen, ZhanDuiName = KuaFuServerManager.FormatName(zhanduiData.ZoneID, zhanduiData.ZhanDuiName) }; this.PiPeiDict[zhanduiID] = pipeiTeam; LogManager.WriteLog(LogTypes.Analysis, string.Format("Zork::比赛报名 SeasonID:{0} Round:{1} ZhanDuiID:{2}", this.CurrentSeasonID, this.CurrentRound, zhanduiID), null, true); } return(result); } catch (Exception ex) { result = -11; LogManager.WriteLog(LogTypes.Error, "Zork5v5Service.SignUp_ZorkBattle failed!", ex, true); } return(result); }