Skip to content
Snippets Groups Projects
Unverified Commit 29a007e1 authored by Enes Sadık Özbek's avatar Enes Sadık Özbek Committed by GitHub
Browse files

Remove RocketMod's console input handling

It conflicts with Unturned's recently added own input handling.
parent ab9f3c92
Branches
Tags 4.9.3.0
No related merge requests found
......@@ -9,69 +9,6 @@ namespace Rocket.Unturned
{
public class UnturnedConsole : MonoBehaviour
{
FileStream fileStream = null;
StreamWriter streamWriter = null;
UnturnedConsoleWriter writer = null;
private void Awake()
{
try
{
fileStream = new FileStream(String.Format(Environment.ConsoleFile, Dedicator.serverID), FileMode.Create,FileAccess.Write,FileShare.ReadWrite);
streamWriter = new StreamWriter(fileStream, System.Text.Encoding.UTF8)
{
AutoFlush = true
};
writer = new UnturnedConsoleWriter(streamWriter);
readingThread = new Thread(new ThreadStart(DoRead));
readingThread.Start();
}
catch (Exception ex)
{
Core.Logging.Logger.Log("Error: " + ex.ToString());
}
}
private void Destroy()
{
if (fileStream != null)
{
fileStream.Close();
fileStream.Dispose();
}
if (streamWriter != null)
{
streamWriter.Close();
streamWriter.Dispose();
}
if (writer != null)
{
writer.Close();
writer.Dispose();
}
}
private static Thread readingThread;
private static void DoRead()
{
string x;
do
{
try
{
x = System.Console.ReadLine();
if (x != null && CommandWindow.input != null && CommandWindow.input.onInputText != null && x.Trim().Length != 0) CommandWindow.input.onInputText(x);
}
catch (Exception ex)
{
Core.Logging.Logger.LogException(ex);
}
}
while (true);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment