Skip to content

Commit d040f68

Browse files
authored
V5.4.4
Dev meow
2 parents 7ef8231 + 41264dc commit d040f68

File tree

9 files changed

+27
-14
lines changed

9 files changed

+27
-14
lines changed

HintServiceExample/Plugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class Plugin : LabApi.Loader.Features.Plugins.Plugin
1717
public override string Name => "HintServiceExample";
1818
public override string Author => "MeowServer";
1919
public override string Description => "A example plugin for HSM";
20-
public override Version Version { get; } = new Version(5, 4, 3);
20+
public override Version Version { get; } = new Version(5, 4, 4);
2121
public override Version RequiredApiVersion { get; } = Version.Parse(LabApi.Features.LabApiProperties.CompiledVersion);
2222
public override void Enable()
2323
{

HintServiceMeow.Tests/PeriodicRunnerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ public async Task PauseAndResume_Works()
6868
ShortInterval))
6969
{
7070
await Task.Delay(GetLength(ShortInterval, 3));
71-
int beforePause = count;
7271

7372
runner.Pause();
73+
int before = count;
7474
await Task.Delay(GetLength(ShortInterval, 4));
75-
Assert.AreEqual(beforePause, count);
75+
Assert.AreEqual(before, count);
7676

7777
runner.Resume();
7878
await Task.Delay(GetLength(ShortInterval, 3));
79-
Assert.IsTrue(count > beforePause);
79+
Assert.IsTrue(count > before);
8080
}
8181
}
8282

HintServiceMeow.Tests/TaskSchedulerTests.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,26 @@ public void Pause_And_Resume_Work_AsExpected()
121121
[TestMethod]
122122
public void IsReadyForNextAction_ReturnsFalse_IfElapsedLessThanInterval()
123123
{
124-
_scheduler.Start(TimeSpan.FromMilliseconds(200), () => { });
124+
_scheduler.Start(TimeSpan.FromMilliseconds(200), () =>
125+
{
126+
Console.WriteLine($"Action Executed at {DateTime.Now}");
127+
});
128+
_scheduler.Invoke();
129+
Thread.Sleep(100/6);
125130
Assert.IsFalse(_scheduler.IsReadyForNextAction);
126131
}
127132

128133
[TestMethod]
129134
public void IsReadyForNextAction_ReturnsTrue_IfElapsedGreaterThanInterval()
130135
{
131-
_scheduler.Start(TimeSpan.FromMilliseconds(1), () => { });
136+
_scheduler.Start(TimeSpan.FromMilliseconds(1), () =>
137+
{
138+
Console.WriteLine($"Action Executed at {DateTime.Now}");
139+
});
140+
_scheduler.Invoke();
132141

133-
Thread.Sleep(3);
142+
Thread.Sleep(100/6); // Wait for 1 tick
143+
Thread.Sleep(10); // Wait for interval
134144

135145
Console.WriteLine($"Elapsed for {_scheduler.Elapsed} since last action");
136146
Assert.IsTrue(_scheduler.IsReadyForNextAction);

HintServiceMeow/Core/Utilities/PlayerDisplay.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private IEnumerator<float> CoroutineMethod()
165165
yield return Timing.WaitForOneFrame;
166166

167167
//If player has quit, then stop the coroutine
168-
if (this._playerContext.IsValid())
168+
if (!this._playerContext.IsValid())
169169
break;
170170

171171
//Reset the success flag

HintServiceMeow/Core/Utilities/TaskScheduler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ internal class TaskScheduler : Interface.ITaskScheduler, Interface.IDestructible
1414
private DateTime _scheduledActionTime; // Indicate when the timer will begin trying invoking the action
1515
private TimeSpan _interval; // Minimum time between two actions
1616
private DateTime _startTimeStamp; // Used to calculate elapsed time since last action, = DateTime.MinValue if there's no last action.
17-
private TimeSpan _elapsed; // Time elapsed since last action, does not include the time when the scheduler is paused. If there's not last action, it is DateTime.Now - DateTime.MinValue.
17+
private TimeSpan _elapsed; // Time elapsed since last action, does not include the time when the scheduler is paused.
1818
private bool _paused = false;
1919
private PeriodicRunner runner;
2020
public bool IsPaused => _paused;
2121

2222
/// <summary>
2323
/// Time elapsed since last action. Does not include the time when the scheduler is paused.
24+
/// If there's no last action, it is DateTime.Now - DateTime.MinValue.
2425
/// </summary>
2526
public TimeSpan Elapsed
2627
{

HintServiceMeow/HintServiceMeow.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</PropertyGroup>
3030
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
3131
<OutputPath>bin\x64\Release\</OutputPath>
32-
<DefineConstants>TRACE;EXILED</DefineConstants>
32+
<DefineConstants>TRACE</DefineConstants>
3333
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
3434
<Optimize>true</Optimize>
3535
<DebugType>pdbonly</DebugType>

HintServiceMeow/Plugin/Plugin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ internal class Plugin : LabApi.Loader.Features.Plugins.Plugin
2727
#if EXILED
2828
public override string Name => "HintServiceMeow";
2929
public override string Author => "MeowServer";
30-
public override Version Version => new(5, 4, 3);
30+
public override Version Version => new(5, 4, 4);
3131
public override Version RequiredExiledVersion => new(9, 6, 0);
3232
public override Exiled.API.Enums.PluginPriority Priority => Exiled.API.Enums.PluginPriority.Highest;
3333
#else
3434
public override string Name => "HintServiceMeow";
3535
public override string Author => "MeowServer";
36-
public override Version Version => new(5, 4, 3);
36+
public override Version Version => new(5, 4, 4);
3737
public override Version RequiredApiVersion => new(LabApiProperties.CompiledVersion);
3838
public override string Description => "A hint framework";
3939
public override LoadPriority Priority => LoadPriority.Highest;

HintServiceMeow/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("5.4.3.0")]
35+
[assembly: AssemblyVersion("5.4.4.0")]
3636
[assembly: AssemblyFileVersion("1.0.0.0")]
3737

3838
// Publicize internal types to the test project

HintServiceMeow/UpdateLog.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,6 @@
187187
- V5.4.2
188188
- Fix a bug that cause CA not to clear the hint correctly
189189
- V5.4.3
190-
- Fix a bug that cause CoordinateTool::GetTextWidth to throw exception when handling empty string
190+
- Fix a bug that cause CoordinateTool::GetTextWidth to throw exception when handling empty string
191+
- V5.4.4
192+
- Fix a bug that cause PlayerDisplay::CoroutineMethod not working correctly

0 commit comments

Comments
 (0)