mirror of
https://github.com/array-in-a-matrix/brainwine.git
synced 2025-04-02 11:11:58 -04:00
Console commands are now handled on main thread
This commit is contained in:
parent
dd3a4ebcf1
commit
d8099a9643
1 changed files with 10 additions and 2 deletions
|
@ -26,11 +26,19 @@ public class ConsoleThread extends Thread {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while((line = reader.readLine()) != null) {
|
while((line = reader.readLine()) != null) {
|
||||||
// TODO run these on main thread lol
|
queueConsoleCommand(line);
|
||||||
CommandManager.executeCommand(server, line);
|
|
||||||
}
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
logger.info("Could not read console input", e);
|
logger.info("Could not read console input", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void queueConsoleCommand(String commandLine) {
|
||||||
|
server.queueSynchronousTask(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
CommandManager.executeCommand(server, commandLine);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue