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 {
|
||||
while((line = reader.readLine()) != null) {
|
||||
// TODO run these on main thread lol
|
||||
CommandManager.executeCommand(server, line);
|
||||
queueConsoleCommand(line);
|
||||
}
|
||||
} catch(IOException 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