Skip to content

Commit e222a8b

Browse files
committed
Reverted back to thread.sleep, improved responsiveness by decreasing time to 4ms
1 parent d0358ea commit e222a8b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

BotCommands.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using BepInEx;
22
using BepInEx.Configuration;
33
using System.IO;
4-
using System.Threading.Tasks;
54
using UnityEngine;
65

76
namespace BotCMDs
@@ -16,7 +15,7 @@ public class BotCommands : BaseUnityPlugin
1615
private string botcmd_path;
1716

1817
[System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members")]
19-
public void Awake()
18+
private void Awake()
2019
{
2120
Cmdpath = Config.Bind<string>(
2221
"Config",
@@ -30,14 +29,14 @@ public void Awake()
3029
}
3130

3231
[System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members")]
33-
private async void Update()
32+
private void Update()
3433
{
3534
using (StreamReader reader = new StreamReader(new FileStream(botcmd_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
3635
{
3736
//start at the end of the file
3837
long lastMaxOffset = reader.BaseStream.Length;
3938

40-
await Task.Delay(5000);
39+
System.Threading.Thread.Sleep(4);
4140

4241
//seek to the last max offset
4342
reader.BaseStream.Seek(lastMaxOffset, SeekOrigin.Begin);

0 commit comments

Comments
 (0)