Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Oct 10, 2023
1 parent f6c862a commit 20be24d
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 12 deletions.
14 changes: 8 additions & 6 deletions ASFEnhance/Account/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ private static string NotificationTargetToString(NotificationTarget target)
}
}

return bot.FormatBotResponse("收到礼物 {0} 个, 接收成功 {1} 个", giftCount, successCount);
return bot.FormatBotResponse(Langs.ReceiveGiftResult, giftCount, successCount);
}

/// <summary>
Expand Down Expand Up @@ -928,6 +928,7 @@ private static string NotificationTargetToString(NotificationTarget target)
/// 获取游玩时间
/// </summary>
/// <param name="bot"></param>
/// <param name="query"></param>
/// <returns></returns>
internal static async Task<string?> ResponseGetPlayTime(Bot bot, string? query)
{
Expand Down Expand Up @@ -964,7 +965,7 @@ private static string NotificationTargetToString(NotificationTarget target)
}
else
{
sb.AppendFormat("{0}: 无效的AppId", entry);
sb.AppendFormat(Langs.InvalidAppId, entry);
}
}
}
Expand All @@ -983,27 +984,27 @@ private static string NotificationTargetToString(NotificationTarget target)
{
if (result.TryGetValue(appId, out var game))
{
sb.AppendLineFormat("{0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}]", appId, game.Name, game.PlayTimeForever / 60.0, game.PlayTime2Weeks / 60.0);
sb.AppendLineFormat(Langs.PlayTimeItem, appId, game.Name, game.PlayTimeForever / 60.0, game.PlayTime2Weeks / 60.0);
totalHours += game.PlayTimeForever;
twoWeekHours += game.PlayTime2Weeks;
}
else
{
sb.AppendLineFormat("{0}: 无游玩时长数据", appId);
sb.AppendLineFormat(Langs.NoPlayTimeInfo, appId);
}
}
}
else
{
sb.AppendLine("未指定游戏, 统计所有游戏");
sb.AppendLine(Langs.AllPlayTimeInfo);
foreach (var game in result.Values)
{
totalHours += game.PlayTimeForever;
twoWeekHours += game.PlayTime2Weeks;
}
}

sb.AppendLineFormat("累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h", totalHours / 60.0, twoWeekHours / 60.0);
sb.AppendLineFormat(Langs.TotalPlayTimeItem, totalHours / 60.0, twoWeekHours / 60.0);

return bot.FormatBotResponse(sb.ToString());
}
Expand All @@ -1012,6 +1013,7 @@ private static string NotificationTargetToString(NotificationTarget target)
/// 获取游玩时间 (多个Bot)
/// </summary>
/// <param name="botNames"></param>
/// <param name="query"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
internal static async Task<string?> ResponseGetPlayTime(string botNames, string? query)
Expand Down
5 changes: 0 additions & 5 deletions ASFEnhance/Data/GetOwnedGamesResponse.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ASFEnhance.Data;
internal sealed record GetOwnedGamesResponse
Expand Down
54 changes: 54 additions & 0 deletions ASFEnhance/Localization/Langs.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions ASFEnhance/Localization/Langs.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1074,4 +1074,22 @@
<data name="SendRequestSuccess" xml:space="preserve">
<value>Send {0} requests successful</value>
</data>
<data name="AllPlayTimeInfo" xml:space="preserve">
<value>No appId proivded, sum all playtime</value>
</data>
<data name="InvalidAppId" xml:space="preserve">
<value>{0}: Invalid appId</value>
</data>
<data name="NoPlayTimeInfo" xml:space="preserve">
<value>{0}: No playtime info</value>
</data>
<data name="PlayTimeItem" xml:space="preserve">
<value>{0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}]</value>
</data>
<data name="ReceiveGiftResult" xml:space="preserve">
<value>收到礼物 {0} 个, 接收成功 {1} 个</value>
</data>
<data name="TotalPlayTimeItem" xml:space="preserve">
<value>累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h</value>
</data>
</root>
18 changes: 18 additions & 0 deletions ASFEnhance/Localization/Langs.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1074,4 +1074,22 @@
<data name="BanGameCount" xml:space="preserve">
<value> {0} 个封禁</value>
</data>
<data name="ReceiveGiftResult" xml:space="preserve">
<value>收到礼物 {0} 个, 接收成功 {1} 个</value>
</data>
<data name="InvalidAppId" xml:space="preserve">
<value>{0}: 无效的AppId</value>
</data>
<data name="PlayTimeItem" xml:space="preserve">
<value>{0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}]</value>
</data>
<data name="NoPlayTimeInfo" xml:space="preserve">
<value>{0}: 无游玩时长数据</value>
</data>
<data name="AllPlayTimeInfo" xml:space="preserve">
<value>未指定游戏, 统计所有游戏</value>
</data>
<data name="TotalPlayTimeItem" xml:space="preserve">
<value>累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h</value>
</data>
</root>
18 changes: 18 additions & 0 deletions ASFEnhance/Localization/Langs.ru-RU.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1074,4 +1074,22 @@
<data name="SendRequestSuccess" xml:space="preserve">
<value>Отправлено {0} запросов успешно</value>
</data>
<data name="AllPlayTimeInfo" xml:space="preserve">
<value>未指定游戏, 统计所有游戏</value>
</data>
<data name="InvalidAppId" xml:space="preserve">
<value>{0}: 无效的AppId</value>
</data>
<data name="NoPlayTimeInfo" xml:space="preserve">
<value>{0}: 无游玩时长数据</value>
</data>
<data name="PlayTimeItem" xml:space="preserve">
<value>{0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}]</value>
</data>
<data name="ReceiveGiftResult" xml:space="preserve">
<value>收到礼物 {0} 个, 接收成功 {1} 个</value>
</data>
<data name="TotalPlayTimeItem" xml:space="preserve">
<value>累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h</value>
</data>
</root>
18 changes: 18 additions & 0 deletions ASFEnhance/Localization/Langs.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1074,4 +1074,22 @@
<data name="SendRequestSuccess" xml:space="preserve">
<value>成功发送 {0} 个请求</value>
</data>
<data name="AllPlayTimeInfo" xml:space="preserve">
<value>未指定游戏, 统计所有游戏</value>
</data>
<data name="InvalidAppId" xml:space="preserve">
<value>{0}: 无效的AppId</value>
</data>
<data name="NoPlayTimeInfo" xml:space="preserve">
<value>{0}: 无游玩时长数据</value>
</data>
<data name="PlayTimeItem" xml:space="preserve">
<value>{0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}]</value>
</data>
<data name="ReceiveGiftResult" xml:space="preserve">
<value>收到礼物 {0} 个, 接收成功 {1} 个</value>
</data>
<data name="TotalPlayTimeItem" xml:space="preserve">
<value>累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h</value>
</data>
</root>
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>1.8.13.1</Version>
<Version>1.8.14.0</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 20be24d

Please sign in to comment.