Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix announcement start time #1567

Merged
merged 5 commits into from
Apr 23, 2024
Merged

Conversation

Natrium0521
Copy link
Contributor

@Natrium0521 Natrium0521 commented Apr 22, 2024

Description

修复了在版本更新维护预告发布后,版本更新说明发布前,活动公告显示的开始时间错误的问题:

image

修改了部分语言提取公告时间的正则表达式。

Related Issue

Checklist

  • The target PR branch is develop branch

@Natrium0521 Natrium0521 changed the title 修复了公告显示时间错误 fix announcement start time Apr 22, 2024
@@ -2922,13 +2922,19 @@
<value>Weapon WIKI</value>
</data>
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
<value>(?:〓Event Duration〓|〓Quest Start Time〓).*?\d\.\dthe Version update(?:after|)Permanently available</value>
<value>(?:〓Event Duration〓|〓Quest Start Time〓).*?Permanently.*?Version.*?(\d\.\d).*?update</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

正则表达的本地化能不能拆分到不同的文件

@qhy040404 qhy040404 requested a review from Lightczx April 23, 2024 03:34
Comment on lines 116 to 130
WebAnnouncement? versionUpdate = announcementListWrappers
.Single(wrapper => wrapper.TypeId == 2)
.List
.Single(ann => AnnouncementRegex.VersionUpdateTitleRegex.IsMatch(ann.Title));
.SingleOrDefault(ann => AnnouncementRegex.VersionUpdateTitleRegex.IsMatch(ann.Title));

if (AnnouncementRegex.VersionUpdateTimeRegex.Match(versionUpdate.Content) is not { Success: true } versionUpdateMatch)
if (versionUpdate is not null)
{
return;
}
if (AnnouncementRegex.VersionUpdateTimeRegex.Match(versionUpdate.Content) is not { Success: true } versionUpdateMatch)
{
return;
}

DateTimeOffset versionUpdateTime = UnsafeDateTimeOffset.ParseDateTime(versionUpdateMatch.Groups[1].ValueSpan, offset);
versionStartTimeDict.Add(VersionRegex().Match(versionUpdate.Title).Groups[1].Value, versionUpdateTime);
DateTimeOffset versionUpdateTime = UnsafeDateTimeOffset.ParseDateTime(versionUpdateMatch.Groups[1].ValueSpan, offset);
versionStartTimeDict.Add(VersionRegex().Match(versionUpdate.Title).Groups[1].Value, versionUpdateTime);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

更新公告是一定存在的,不存在不匹配的情况

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

正则式本地化好像有问题,韩语的公告就显示不出来

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没人提供肯定显示不出来啊(
image

Copy link
Member

@qhy040404 qhy040404 Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个通过修改正则来修复,不然出来的时间也是错的,不显示在这里是intended

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所以判断一下,这样最多只是显示的时间错了,不会出现没有公告的情况

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对于活动公告的准确性来说,我个人认为不太能接受
看其他reviewer吧

@Lightczx
Copy link
Member

Hi @Natrium0521 感谢你对本项目的贡献,为了方便后续的交流你可以加入我们的开发交流群
点击链接加入群聊【Snap 开发交流】:https://qm.qq.com/q/hCLQymGhPM

@Lightczx Lightczx merged commit 09a8805 into DGP-Studio:develop Apr 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants