public void StartActivity(AllianceWar _this) { var am = ServerAllianceManager.GetAllianceByServer(_this.ServerId); if (am == null) { Logger.Error("StartActivity not find GetAllianceByServer!server={0},", _this.ServerId); return; } DBServerAllianceData data; if (!am.mDBData.TryGetValue(_this.ServerId, out data)) { Logger.Error("In BidOver() can't find data!"); return; } PlayerLog.WriteLog((ulong)LogType.AllianceWar, "StartActivity(), ServerId = {0}", _this.ServerId); _this.SetStatus((int)eAllianceWarState.WaitStart); var now = DateTime.Now; _this.StartHour = now.Hour; _this.StartMin = now.Minute; _this.AllianceIds.Clear(); _this.AlliancePlayers.Clear(); _this.EnterPlayerCount.Clear(); _this.AllianceIds.Add(data.Occupant); _this.AllianceIds.AddRange(data.Challengers); foreach (var id in _this.AllianceIds) { _this.AlliancePlayers.Add(id, new List <ulong>()); _this.EnterPlayerCount.Add(id, 0); } }
//发放每日奖励 public void SendReward() { var item = new ItemBaseData(); item.ItemId = -1; var args = new StringArray(); foreach (var server in ServerAllianceManager.Servers.Values) { foreach (var data in server.mDBData.Values) { var alliance = ServerAllianceManager.GetAllianceById(data.Occupant); if (alliance == null) { continue; } var serverAlliance = alliance.Dad; foreach (var id in alliance.mDBData.Members) { var member = serverAlliance.GetCharacterData(id); if (member == null) { continue; } var tbGA = Table.GetGuildAccess(member.Ladder); if (tbGA == null) { Logger.Error("In SendReward().tbGA == null"); continue; } SendMailToCharacter(id, tbGA.MailId, item, args); } } } }
/// <summary> /// 报名成功 /// </summary> private void OnEnrollSuccess(int allianceId) { var alliance = ServerAllianceManager.GetAllianceById(allianceId); if (alliance == null) { return; } var tbMail = Table.GetMail(5001); var message = Utils.WrapDictionaryId(50001020); foreach (var memId in alliance.mDBData.Members) { if (tbMail != null) { Utility.SendMail(memId, tbMail.Title, tbMail.Text, new Dict_int_int_Data()); } TeamCharacterProxy toCharacterProxy; if (TeamServer.Instance.ServerControl.Proxys.TryGetValue(memId, out toCharacterProxy)) { var chattoCharacterProxy = toCharacterProxy as TeamProxy; if (chattoCharacterProxy != null) { chattoCharacterProxy.SyncAllianceChatMessage((int)eChatChannel.Guild, 0, string.Empty, new ChatMessageContent { Content = message }); } } } }
// 按对应轮次的比赛积分进行排名,积分相同时则比较战力 private IOrderedEnumerable <KeyValuePair <int, long> > GetSortScore(DBUnionBattleData dbData) { if (dbData == null) { return(null); } var fpDict = new Dictionary <int, long>(); foreach (var allianceId in dbData.EnrollList) { long w = 0L; int score; if (dbData.Scores.TryGetValue(allianceId, out score)) { w += (score * 1000000000L); } var alliance = ServerAllianceManager.GetAllianceById(allianceId); if (alliance != null) { w += alliance.GetTotleFightPoint(); } fpDict[allianceId] = w; } var sortList = fpDict.OrderBy(s => s.Value); return(sortList); }
public void OnAllianceEvent(LodeManager _this, int allianceId, int EventType, int param = 1) { if (_this.mDbData.ActivityInfo.ActivityStatus == 0) { return; } var alliance = ServerAllianceManager.GetAllianceById(allianceId); if (alliance == null) { return; } bool bSend = false; DBAllianceTaskList db = GetAllianceActive(_this, alliance); for (int i = 0; i < _this.mDbData.ActivityInfo.aTaskIDs.Count; i++) { int id = _this.mDbData.ActivityInfo.aTaskIDs[i]; DBAllianceTask t; if (db.TaskList.TryGetValue(id, out t) == false) { continue; } if (t.Type == EventType && t.Count < t.Need) { t.Count += param; if (t.Count > t.Need) { t.Count = t.Need; } } if (t.Count >= t.Need) { bSend = true; } } if (EventType == eHoldFlag) { db.Flags++; } if (bSend == true) { foreach (var id in alliance.mDBData.Members) { TeamCharacterProxy Proxy; if (TeamServer.Instance.ServerControl.Proxys.TryGetValue(id, out Proxy)) { if (null != Proxy) { Proxy.SCNotifyAllianceActiveTask(_this.mDbData.ActivityInfo); } } } } }
public void AllianceWarBegin(int serverId, DateTime time) { var allianceManager = ServerAllianceManager.GetAllianceByServer(serverId); if (allianceManager == null) { return; } DBServerAllianceData data; if (allianceManager.mDBData.TryGetValue(serverId, out data)) { data.Challengers.Clear(); //排序整理出前两名 var datas = data.BidDatas; var order = datas.OrderByDescending(o => o.Value); var e = order.GetEnumerator(); for (var i = 0; e.MoveNext(); i++) { var cur = e.Current; var a = ServerAllianceManager.GetAllianceById(cur.Key); if (a == null) { Logger.Error("In BidOver().alliance == null! id = {0}", cur.Key); continue; } if (i < 2) { data.Challengers.Add(cur.Key); } } allianceManager.GetServerData(data.ServerId).LastBattleTime = 0; allianceManager.SetFlag(data.ServerId); var war = AllianceWarManager.WarDatas[serverId]; war.BidOver(); war.BattleFieldGuid = 0; if (GameMaster.StartActivityTrigger != null) { TeamServerControl.tm.DeleteTrigger(GameMaster.StartActivityTrigger); } GameMaster.StartActivityTrigger = TeamServerControl.tm.CreateTrigger(time, war.StartActivity); if (GameMaster.StartFightTrigger != null) { TeamServerControl.tm.DeleteTrigger(GameMaster.StartFightTrigger); } GameMaster.StartFightTrigger = TeamServerControl.tm.CreateTrigger(time.AddMinutes(10), war.StartActivity); } }
//增加战盟资金 //addGmGMCommand("!!UnionMoneyAdd", CommandType.GMTeam); public void UnionMoneyAdd(ulong guid, int value) { if (value <= 0) { return; } var a = ServerAllianceManager.GetAllianceByCharacterId(guid); if (a == null) { return; } a.SetMoney(a.Money + value); }
public void SetStatus(AllianceWar _this, int stat) { if (_this.dbData == null) { return; } _this.dbData.Status = stat; var allianceManager = ServerAllianceManager.GetAllianceByServer(_this.ServerId); if (allianceManager != null) { allianceManager.SetFlag(_this.ServerId); } }
public void AllianceWarStartBid(int serverId) { var allianceManager = ServerAllianceManager.GetAllianceByServer(serverId); if (allianceManager == null) { return; } var war = AllianceWarManager.WarDatas[serverId]; if (war == null) { return; } war.StartBid(); }
public void PlayerLeave(ulong characterId) { var alliance = ServerAllianceManager.GetAllianceByCharacterId(characterId); if (alliance == null) { Logger.Error("In PlayerEnterSuccess(). alliance == null! characterId = {0}", characterId); return; } var serverId = alliance.ServerId; serverId = SceneExtension.GetServerLogicId(serverId); var war = AllianceWarManager.WarDatas[serverId]; war.PlayerLeave(characterId, alliance.AllianceId); }
public void OnAllianceAddScore(LodeManager _this, int allianceId, int add) { var alliance = ServerAllianceManager.GetAllianceById(allianceId); if (alliance == null) { return; } if (_this.mDbData.ActivityInfo.ActivityStatus == 1) {//活动数据 DBAllianceTaskList db = GetAllianceActive(_this, alliance); if (db == null) { return; } db.Score += add; } }
public ErrorCodes AllianceWarBid(ulong guid, int value) { var alliance = ServerAllianceManager.GetAllianceByCharacterId(guid); if (alliance == null) { return(ErrorCodes.Error_CharacterNoAlliance); } var allianceId = alliance.AllianceId; var serverId = alliance.ServerId; var logicServerId = SceneExtension.GetServerLogicId(serverId); var allianceManager = ServerAllianceManager.GetAllianceByServer(logicServerId); if (allianceManager == null) { return(ErrorCodes.Error_AllianceState); } var dbAlliance = allianceManager.GetServerData(serverId); if (dbAlliance == null) { return(ErrorCodes.Error_AllianceState); } var dbAllianceNew = allianceManager.GetServerData(logicServerId); if (dbAllianceNew == null) { return(ErrorCodes.Error_AllianceState); } if (allianceId == dbAllianceNew.Occupant) { return(ErrorCodes.Error_OccupantNoNeedBid); } var bidDatas = dbAlliance.BidDatas; int price; bidDatas.TryGetValue(allianceId, out price); price += value; bidDatas[allianceId] = price; return(ErrorCodes.OK); }
//战斗结束 public void BattleTimeOver(AllianceWar _this) { PlayerLog.WriteLog((ulong)LogType.AllianceWar, "BattleTimeOver(), ServerId = {0}", _this.ServerId); _this.SetStatus((int)eAllianceWarState.WaitBid); var allianceManager = ServerAllianceManager.GetAllianceByServer(_this.ServerId); if (allianceManager != null) { var dbData = allianceManager.GetServerData(_this.ServerId); if (dbData != null) { dbData.Challengers.Clear(); dbData.LastBattleTime = DateTime.Now.ToBinary(); } allianceManager.SetFlag(_this.ServerId); } ClearData(_this); Init(_this); }
public int OnPlayerHoldLode(LodeManager _this, int allianceId, int sceneId) { if (_this.mDbData.ActivityInfo.ActivityStatus == 0) { return((int)ErrorCodes.Error_Lode_Hold_ErrorTime); } DBSceneLode l; if (false == _this.mDbData.SceneLodeList.TryGetValue(sceneId, out l)) { return((int)(ErrorCodes.Error_Lode_ErrorId)); } var tbFlag = Table.GetWarFlag(l.FlagId); if (tbFlag == null) { return((int)(ErrorCodes.Error_Lode_ErrorId)); } DateTime st = DateTime.Now.Date.AddHours((int)(tbFlag.BelongToTime[0] / 100)).AddMinutes(tbFlag.BelongToTime[0] % 100); DateTime ed = DateTime.Now.Date.AddHours((int)(tbFlag.BelongToTime[1] / 100)).AddMinutes(tbFlag.BelongToTime[1] % 100); DateTime rstTime = new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(l.ResetTime); if (rstTime < DateTime.Now) { l.ResetTime += 60 * 60 * 24; l.TeamId = 0; l.TeamName = ""; } if (DateTime.Now < st || DateTime.Now > ed) { return((int)ErrorCodes.Error_Lode_Hold_ErrorTime); } l.TeamId = allianceId; l.TeamName = ServerAllianceManager.GetAllianceName(allianceId); _this.bDirty = true; OnAllianceEvent(_this, allianceId, eHoldFlag); return((int)ErrorCodes.OK); }
public ErrorCodes OnPlayerApplyMissionReward(LodeManager _this, int allianceId, ulong charId, int missionId, int meritPoint, int add, FieldRankBaseData data) { if (_this.mDbData.ActivityInfo.ActivityStatus == 0) { return(ErrorCodes.Error_ActivityOver); } var tb = Table.GetObjectTable(missionId); if (allianceId > 0) { var alliance = ServerAllianceManager.GetAllianceById(allianceId); if (alliance == null) { return(ErrorCodes.Error_CharacterNoAlliance); } if (tb.TaskType == 1) { ErrorCodes err = CheckAllianceMission(_this, alliance, missionId); if (err != ErrorCodes.OK) { return(err); } } //if (meritPoint > 0) //{ // var member = alliance.Dad.GetCharacterData(charId); // if (member != null) // { // member.MeritPoint += meritPoint; // } //} } OnPlayerAddScore(_this, charId, allianceId, add, data); return(ErrorCodes.OK); }
// public void BidOver(AllianceWar _this) { var am = ServerAllianceManager.GetAllianceByServer(_this.ServerId); if (am == null) { Logger.Error("StartActivity not find GetAllianceByServer!server={0},", _this.ServerId); return; } DBServerAllianceData data; if (!am.mDBData.TryGetValue(_this.ServerId, out data)) { Logger.Error("In BidOver() can't find data!"); return; } am.BidOver(); var msgData = new AllianceWarChallengerData(); foreach (var id in data.Challengers) { var allliance = ServerAllianceManager.GetAllianceById(id); if (allliance == null) { Logger.Error("In BidOver(). alliance == null!! id = {0}", id); continue; } msgData.ChallengerId.Add(id); msgData.ChallengerName.Add(allliance.Name); } _this.SetStatus((int)eAllianceWarState.WaitEnter); var sId = SceneExtension.GetServerLogicId(_this.ServerId); TeamServer.Instance.TeamAgent.NotifyAllianceWarChallengerData((uint)sId, msgData); PlayerLog.WriteLog((ulong)LogType.AllianceWar, "BidOver(), ServerId = {0}, Challengers = {1}", _this.ServerId, data.Challengers.GetDataString()); }
public ErrorCodes CheckPlayerEnter(AllianceWar _this, int serverId, ulong characterId) { var allianceManager = ServerAllianceManager.GetAllianceByServer(serverId); var character = allianceManager.GetCharacterData(characterId); if (character.Level < StaticParam.AllianceWarLevelLimit) { return(ErrorCodes.Error_LevelNoEnough); } var now = DateTime.Now; var serverData = allianceManager.GetServerData(serverId); var lastTime = DateTime.FromBinary(serverData.LastBattleTime); if (lastTime.Year == now.Year && lastTime.DayOfYear == now.DayOfYear) { return(ErrorCodes.Error_AllianceWarOver); } if (serverData.Challengers.Count == 0) { //无人报名,本次城战取消 return(ErrorCodes.Error_AllianceWarCancel); } return(ErrorCodes.OK); }
public void FinalLogic(LodeManager _this) { #region 给排行前的玩家添加称号 //给排行前的玩家添加称号 do { List <DBAllianceTaskList> l = new List <DBAllianceTaskList>(); List <int> lName = new List <int>(); foreach (var v in _this.mDbData.ActivityInfo.AllianceTaskList) { lName.Add(v.Key); } for (int i = 0; i < lName.Count; i++) { l.Add(_this.mDbData.ActivityInfo.AllianceTaskList[lName[i]]); } l.Sort((a, b) => { if (b.Flags > a.Flags) { return(1); } if (b.Flags < a.Flags) { return(-1); } return(b.Score - a.Score); }); if (l.Count == 0) { break; } var al = l[0]; var alliance = ServerAllianceManager.GetAllianceById(al.Id); if (alliance == null) { break; } { Dictionary <int, Dict_int_int_Data> title = new Dictionary <int, Dict_int_int_Data>(); { var tb = Table.GetNameTitle(8000); if (tb == null) { break; } Dict_int_int_Data tmp = new Dict_int_int_Data(); tmp.Data.Add(tb.FlagId, 1); title.Add((int)eAllianceLadder.Chairman, tmp); } { var tb = Table.GetNameTitle(8001); if (tb == null) { break; } Dict_int_int_Data tmp = new Dict_int_int_Data(); tmp.Data.Add(tb.FlagId, 1); title.Add((int)eAllianceLadder.ViceChairman, tmp); } { var tb = Table.GetNameTitle(8002); if (tb == null) { break; } Dict_int_int_Data tmp = new Dict_int_int_Data(); tmp.Data.Add(tb.FlagId, 1); title.Add((int)eAllianceLadder.Elder, tmp); } { var tb = Table.GetNameTitle(8003); if (tb == null) { break; } Dict_int_int_Data tmp = new Dict_int_int_Data(); tmp.Data.Add(tb.FlagId, 1); title.Add((int)eAllianceLadder.Member, tmp); } var dad = alliance.Dad; foreach (var id in alliance.mDBData.Members) { var m = dad.GetCharacterData(id); if (m == null) { continue; } if (title.ContainsKey(m.Ladder) == true) { ChangeNameTitle(id, title[m.Ladder]); } } } } while (false); #endregion #region 给排行前的工会中的玩家添加称号 //给排行前的工会中的玩家添加称号 { Dictionary <int, Dict_int_int_Data> title = new Dictionary <int, Dict_int_int_Data>(); { var tb = Table.GetNameTitle(9000); if (tb != null) { Dict_int_int_Data tmp = new Dict_int_int_Data(); tmp.Data.Add(tb.FlagId, 1); title.Add(0, tmp); } } { var tb = Table.GetNameTitle(9001); if (tb != null) { Dict_int_int_Data tmp = new Dict_int_int_Data(); tmp.Data.Add(tb.FlagId, 1); title.Add(1, tmp); } } { var tb = Table.GetNameTitle(9002); if (tb != null) { Dict_int_int_Data tmp = new Dict_int_int_Data(); tmp.Data.Add(tb.FlagId, 1); title.Add(2, tmp); } } for (int i = 0; i < 3 && i < _this.mDbData.ActivityInfo.PlayerTaskList.Count; i++) { var id = _this.mDbData.ActivityInfo.PlayerTaskList[i].guid; if (title.ContainsKey(i) == true) { ChangeNameTitle(id, title[i]); } } } #endregion }
/// <summary> /// 发奖 /// </summary> private void Award() { var dbData = UnionBattleManager.mDBData; // 参与奖 for (var i = 1; i < dbData.Group4.Count; ++i) { var groupData = dbData.Group4[i]; //foreach (var allianceId in groupData.Ids) //{ // var alliance = ServerAllianceManager.GetAllianceById(allianceId); // if (alliance != null) // { // foreach (var member in alliance.mDBData.Members) // { // TeamServer.Instance.LogicAgent.SSSendMailById(member, 999, // (int)SendToCharacterMailType.Normal, string.Empty, string.Empty); // } // } //} } var finalRank = new List <int>(); finalRank.Add(dbData.FinalVictory); foreach (var i in dbData.SemiVictory) { if (!finalRank.Contains(i)) { finalRank.Add(i); } } foreach (var i in dbData.QuarterVictory) { if (!finalRank.Contains(i)) { finalRank.Add(i); } } //foreach (var i in dbData.FinalGroup[0].Ids) //{ // if (!finalRank.Contains(i)) // finalRank.Add(i); //} foreach (var allianceId in finalRank) { var alliance = ServerAllianceManager.GetAllianceById(allianceId); if (alliance != null) { foreach (var member in alliance.mDBData.Members) { TeamServer.Instance.LogicAgent.SSSendMailById(member, 999, (int)SendToCharacterMailType.Normal, string.Empty, string.Empty); } } } UnionBattleManager.Dirty = true; }
//战斗结束 public void BattleOver(AllianceWar _this, int occupantId) { _this.SetStatus((int)eAllianceWarState.WaitBid); var allianceManager = ServerAllianceManager.GetAllianceByServer(_this.ServerId); var dbData = allianceManager.GetServerData(_this.ServerId); var oldOccupant = dbData.Occupant; dbData.Challengers.Clear(); dbData.LastBattleTime = DateTime.Now.ToBinary(); allianceManager.SetFlag(_this.ServerId); PlayerLog.WriteLog((ulong)LogType.AllianceWar, "BattleOver(), ServerId = {0}, occupantId = {1}, old occupantId = {2}", _this.ServerId, occupantId, dbData.Occupant); //如果城主没变就返回 if (dbData.Occupant == occupantId) { return; } dbData.Occupant = occupantId; var alliance = ServerAllianceManager.GetAllianceById(occupantId); if (alliance != null) { //通知全服,城主变了 var data = new AllianceWarOccupantData(); data.OccupantId = occupantId; data.OccupantName = alliance.Name; TeamServer.Instance.TeamAgent.NotifyAllianceWarOccupantData((uint)_this.ServerId, data); //修改玩家的称号 var change0 = new Dict_int_int_Data(); var tbTitle = Table.GetNameTitle(5000); change0.Data.Add(tbTitle.FlagId, 1); var change1 = new Dict_int_int_Data(); tbTitle = Table.GetNameTitle(5001); change1.Data.Add(tbTitle.FlagId, 1); var dad = alliance.Dad; foreach (var id in alliance.mDBData.Members) { var m = dad.GetCharacterData(id); if (m == null) { continue; } if (m.Ladder == (int)eAllianceLadder.Chairman) { ChangeNameTitle(id, change0); } else { ChangeNameTitle(id, change1); } } } //修改玩家的称号 alliance = ServerAllianceManager.GetAllianceById(oldOccupant); if (alliance != null) { var change = new Dict_int_int_Data(); var tbTitle = Table.GetNameTitle(5000); change.Data.Add(tbTitle.FlagId, 0); tbTitle = Table.GetNameTitle(5001); change.Data.Add(tbTitle.FlagId, 0); foreach (var id in alliance.mDBData.Members) { ChangeNameTitle(id, change); } } //通知logic,本服的王城占领者变了 NotifyAllianceWarInfo(_this, occupantId); Init(_this); }
public void Init(AllianceWar _this) { foreach (var trigger in _this.WarTrigger) { if (trigger != null) { TeamServerControl.tm.DeleteTrigger(trigger); } } _this.WarTrigger.Clear(); var tb = Table.GetServerName(_this.ServerId); if (1 != tb.IsClientDisplay) { return; } var am = ServerAllianceManager.GetAllianceByServer(_this.ServerId); if (am == null) { Logger.Error("StartActivity not find GetAllianceByServer!server={0},", _this.ServerId); return; } DBServerAllianceData data; if (!am.mDBData.TryGetValue(_this.ServerId, out data)) { //热更后如果开放新服,这里需要new一个出来 data = new DBServerAllianceData(); data.ServerId = _this.ServerId; data.Occupant = -1; am.mDBData[_this.ServerId] = data; am.SetFlag(_this.ServerId); NotifyAllianceWarInfo(_this, -1); //Logger.Error("In BidOver() can't find data!"); //return; } _this.dbData = data; //特殊处理开服前11天 int AllianceWarType = 200; // Debug.Assert(false); //为攻城战注册一些定时器 var tbFuben = Table.GetFuben(Constants.AllianceWarDungeonId); var now = DateTime.Now; //开服时间 var serverOpenTime = DateTime.Parse(tb.OpenTime); var baseTime = DateTime.Now.Date.AddDays(365); var TimeToday = DateTime.Now > serverOpenTime ? DateTime.Now : serverOpenTime; var KaifuId = (int)(DateTime.Now.Date - serverOpenTime.Date).TotalDays + 1; if (KaifuId < 1) { KaifuId = 1; } var tbKaifu = Table.GetKaiFu(KaifuId); var openWeek = (int)serverOpenTime.DayOfWeek; //开放精确时间 var opentime = tbFuben.OpenTime[0]; var openhour = opentime / 100; var openmin = opentime % 100; //Debug.Assert(false); var nextOpen = DateTime.Now.AddDays(-1); if (_this.dbData.OpenTime > 0) { nextOpen = DateTime.FromBinary(_this.dbData.OpenTime); } if (nextOpen < DateTime.Now) { bool b = false; while (tbKaifu != null) { if (tbKaifu.Week[openWeek] == AllianceWarType && serverOpenTime.AddDays(KaifuId - 1).Date.AddHours(openhour).AddMinutes(openmin) > DateTime.Now) { b = true; break; } tbKaifu = Table.GetKaiFu(++KaifuId); } if (b) { //活动中找到了目标 baseTime = serverOpenTime.AddDays(KaifuId - 1).Date.AddHours(openhour).AddMinutes(openmin); } else { //没有找到目标,按照自己的套路每周二六开放 var strConf0 = Table.GetServerConfig(901).Value; var confs0 = strConf0.Split('|'); var tmp = 7; foreach (var v in confs0) { var n = int.Parse(v); var d = n - (int)DateTime.Now.DayOfWeek; if (d < 0) { d += 7; } if (d < tmp && DateTime.Now.AddDays(d).Date.AddHours(openhour).AddMinutes(openmin) > DateTime.Now) { tmp = d; } } baseTime = DateTime.Now.AddDays(tmp).Date.AddHours(openhour).AddMinutes(openmin); } _this.SetStatus((int)eAllianceWarState.WaitBid); } else { baseTime = nextOpen; } //已经获得了开放的标准时间,下面只需要根据这个时间开放不同的计时器就可以了 //开放竞标计时器 //清楚之前的竞标信息 var bidTime = baseTime.Date.AddDays(-1); // 竞标时间(攻城战开始前一天) var waitEnterTime = baseTime.Date; // 等待进入战场时间(攻城战当天零点开始) var enterTime = baseTime; // 开始进入时间 var startTime = baseTime.AddMinutes(tbFuben.OpenLastMinutes); // 开始战争时间 var timeOverTime = baseTime.AddMinutes(tbFuben.TimeLimitMinutes + tbFuben.OpenLastMinutes); // 超时时间 if ((int)eAllianceWarState.WaitBid == _this.dbData.Status) { if (DateTime.Now >= bidTime) // 已经过了竞标时间了 { StartBid(_this); } else { _this.WarTrigger.Add(TeamServerControl.tm.CreateTrigger(bidTime, () => { StartBid(_this); })); } } //每周二周六0点,竞标结束,算出参战公会 if ((int)eAllianceWarState.Bid == _this.dbData.Status && DateTime.Now >= waitEnterTime) { BidOver(_this); } else { _this.WarTrigger.Add(TeamServerControl.tm.CreateTrigger(waitEnterTime, () => { BidOver(_this); })); } ////每周二周六攻城战开始进入时,进行相关处理 _this.WarTrigger.Add(TeamServerControl.tm.CreateTrigger(enterTime, () => { StartActivity(_this); })); ////每周二周六攻城战开始打时,进行相关处理 _this.WarTrigger.Add(TeamServerControl.tm.CreateTrigger(startTime, () => { StartFight(_this); })); ////每周二周六攻城战结束后,清理相关数据 _this.WarTrigger.Add(TeamServerControl.tm.CreateTrigger(timeOverTime, () => { BattleTimeOver(_this); })); _this.dbData.OpenTime = baseTime.ToBinary(); am.SetFlag(_this.ServerId); }