Skip to content

Commit

Permalink
bug修正
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Jun 15, 2022
1 parent 39cd2a8 commit 7362c12
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ASFEnhance/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Reflection;

[assembly: System.CLSCompliant(false)]
[assembly: AssemblyVersion("1.6.5.536")]
[assembly: AssemblyFileVersion("1.6.5.536")]
[assembly: AssemblyVersion("1.6.5.537")]
[assembly: AssemblyFileVersion("1.6.5.537")]

[assembly: AssemblyCopyright("Copyright © 2022 Chr_")]
[assembly: AssemblyProduct("ASFEnhance")]
Expand Down
23 changes: 11 additions & 12 deletions ASFEnhance/Event/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ internal static class Command
try
{
List<uint> demos = new();
List<uint> tmp = new();

HashSet<uint> failedDemos = new();
HashSet<uint> addedDemos = new();
Expand All @@ -96,7 +95,6 @@ internal static class Command
while (index < DemosDB.Demos.Count)
{
demos.Clear();
tmp.Clear();

int error = 5;
while (!bot.IsConnectedAndLoggedOn)
Expand All @@ -108,7 +106,9 @@ internal static class Command
}
}

while (demos.Count < 45 && index < DemosDB.Demos.Count)

int count = 0;
while (count++ < 45 && index < DemosDB.Demos.Count)
{
if (!Paused)
{
Expand All @@ -133,16 +133,16 @@ internal static class Command
failedDemos.Add(appid);
}

tmp.Add(appid);
demos.Add(appid);

//游玩Demo
if (tmp.Count >= 20)
if (demos.Count >= 20)
{
string arg = string.Join(',', tmp);
string arg = string.Join(',', demos);
await bot.Commands.Response(EAccess.Owner, $"PLAY {botName} {arg}").ConfigureAwait(false);
await Task.Delay(5000).ConfigureAwait(false);

foreach (var i in tmp)
foreach (var i in demos)
{
addedDemos.Add(i);
}
Expand All @@ -152,21 +152,21 @@ internal static class Command
await bot.Commands.Response(EAccess.Master, $"RESUME {botName}").ConfigureAwait(false);
}

tmp.Clear();
demos.Clear();
}
}

await Task.Delay(TimeSpan.FromMinutes(65)).ConfigureAwait(false);

}

if (tmp.Count > 0)
if (demos.Count > 0)
{
string arg = string.Join(',', tmp);
string arg = string.Join(',', demos);
await bot.Commands.Response(EAccess.Owner, $"PLAY {botName} {arg}").ConfigureAwait(false);
await Task.Delay(5000).ConfigureAwait(false);

foreach (var i in tmp)
foreach (var i in demos)
{
addedDemos.Add(i);
}
Expand All @@ -175,7 +175,6 @@ internal static class Command
{
await bot.Commands.Response(EAccess.Master, $"RESUME {botName}").ConfigureAwait(false);
}
tmp.Clear();
}
}
finally
Expand Down
2 changes: 1 addition & 1 deletion ASFEnhance/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ internal static Dictionary<string, SteamGameID> FetchGameIDs(string query, Steam
/// <summary>
/// 获取版本号
/// </summary>
internal static Version MyVersion => typeof(ASFEnhance).Assembly.GetName().Version;
internal static Version MyVersion => typeof(ASFEnhance).Assembly.GetName().Version ?? new Version("0");

/// <summary>
/// 获取插件所在路径
Expand Down

0 comments on commit 7362c12

Please sign in to comment.