Skip to content
This repository was archived by the owner on Dec 21, 2019. It is now read-only.

Commit 29a007e

Browse files
authored
Remove RocketMod's console input handling
It conflicts with Unturned's recently added own input handling.
1 parent ab9f3c9 commit 29a007e

File tree

1 file changed

+1
-64
lines changed

1 file changed

+1
-64
lines changed

Rocket.Unturned/UnturnedConsole.cs

+1-64
Original file line numberDiff line numberDiff line change
@@ -9,69 +9,6 @@ namespace Rocket.Unturned
99
{
1010
public class UnturnedConsole : MonoBehaviour
1111
{
12-
FileStream fileStream = null;
13-
StreamWriter streamWriter = null;
14-
UnturnedConsoleWriter writer = null;
15-
private void Awake()
16-
{
17-
try
18-
{
19-
fileStream = new FileStream(String.Format(Environment.ConsoleFile, Dedicator.serverID), FileMode.Create,FileAccess.Write,FileShare.ReadWrite);
20-
21-
streamWriter = new StreamWriter(fileStream, System.Text.Encoding.UTF8)
22-
{
23-
AutoFlush = true
24-
};
25-
writer = new UnturnedConsoleWriter(streamWriter);
26-
27-
readingThread = new Thread(new ThreadStart(DoRead));
28-
readingThread.Start();
29-
}
30-
catch (Exception ex)
31-
{
32-
Core.Logging.Logger.Log("Error: " + ex.ToString());
33-
}
34-
}
35-
36-
private void Destroy()
37-
{
38-
if (fileStream != null)
39-
{
40-
fileStream.Close();
41-
fileStream.Dispose();
42-
}
43-
if (streamWriter != null)
44-
{
45-
streamWriter.Close();
46-
streamWriter.Dispose();
47-
}
48-
if (writer != null)
49-
{
50-
writer.Close();
51-
writer.Dispose();
52-
}
53-
}
54-
55-
private static Thread readingThread;
56-
57-
private static void DoRead()
58-
{
59-
string x;
60-
do
61-
{
62-
try
63-
{
64-
x = System.Console.ReadLine();
65-
66-
if (x != null && CommandWindow.input != null && CommandWindow.input.onInputText != null && x.Trim().Length != 0) CommandWindow.input.onInputText(x);
67-
68-
}
69-
catch (Exception ex)
70-
{
71-
Core.Logging.Logger.LogException(ex);
72-
}
73-
}
74-
while (true);
75-
}
12+
7613
}
7714
}

0 commit comments

Comments
 (0)