Skip to content

Commit

Permalink
fix error caused by guild mission end
Browse files Browse the repository at this point in the history
  • Loading branch information
moonheart committed Jan 15, 2024
1 parent f873e07 commit 5af9809
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
24 changes: 14 additions & 10 deletions MementoMori.Ortega/Share/Master/Table/GuildMissionTable.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
using MementoMori.Ortega.Share.Master.Data;
using MementoMori.Ortega.Share.Utils;

namespace MementoMori.Ortega.Share.Master.Table
{
public class GuildMissionTable : TableBase<GuildMissionMB>
{
public GuildMissionMB GetCurrentGuildMissionMB(OrtegaTimeManager timeManager)
{
// int num = 0;
// bool flag;
// if (!flag)
// {
// num++;
// }
throw new NullReferenceException();
}
public GuildMissionMB GetCurrentGuildMissionMB(DateTime serverNow)
{
foreach (var guildMissionMb in this._datas)
{
var startTime = guildMissionMb.StartTime.ToDateTime();
var endTime = guildMissionMb.EndTime.ToDateTime();
if (startTime <= serverNow && serverNow <= endTime)
{
return guildMissionMb;
}
}
return null;
}
}
}
6 changes: 5 additions & 1 deletion MementoMori/MementoMoriFuncs.Ops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,11 @@ public async Task GetMissionInfo()
var response1 = await GetResponse<GetGuildIdRequest, GetGuildIdResponse>(new GetGuildIdRequest());
if (response1.GuildId > 0)
{
missionGroupTypes.Add(MissionGroupType.Guild);
var currentGuildMissionMb = GuildMissionTable.GetCurrentGuildMissionMB(TimeManager.ServerNow);
if (currentGuildMissionMb != null)
{
missionGroupTypes.Add(MissionGroupType.Guild);
}
}
var panelMission = Mypage.MypageInfo.MypageIconInfos.FirstOrDefault(d => d.TransferDetailInfo.TransferSpotType == TransferSpotType.PanelMission);
if (panelMission != null) missionGroupTypes.Add(MissionGroupType.Panel);
Expand Down

0 comments on commit 5af9809

Please sign in to comment.