Skip to content

Commit dbf5713

Browse files
committed
Merged from master
1 parent b0c2243 commit dbf5713

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

BotCommands.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private void Awake()
2626
botcmd_path = Cmdpath.Value;
2727

2828
Debug.Log("Created by Rayss and InfernalPlacebo.");
29-
3029
}
3130

3231
[System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members")]
@@ -35,35 +34,23 @@ private void Start()
3534
Reading();
3635
}
3736

38-
/**
39-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members")]
40-
private void Update()
41-
{
42-
43-
}
44-
**/
45-
4637
private async void Reading()
4738
{
4839
using (StreamReader reader = new StreamReader(new FileStream(botcmd_path,
4940
FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
5041
{
5142
//start at the end of the file
5243
long lastMaxOffset = reader.BaseStream.Length;
44+
string line;
5345

5446
while (true)
5547
{
5648
await Task.Delay(1000);
5749

58-
//if the file size has not changed, idle (RAYSS NOTE: MAY NOT BE NEEDED)
59-
if (reader.BaseStream.Length == lastMaxOffset)
60-
continue;
61-
6250
//seek to the last max offset
6351
reader.BaseStream.Seek(lastMaxOffset, SeekOrigin.Begin);
6452

6553
//read out of the file until the EOF
66-
string line = "";
6754
while ((line = reader.ReadLine()) != null)
6855
RoR2.Console.instance.SubmitCmd(null, line);
6956

0 commit comments

Comments
 (0)