Need a lock on the list as we update it between threads
This commit is contained in:
parent
e589001985
commit
016fb611af
@ -394,7 +394,8 @@ class Server
|
||||
@Override
|
||||
public void run() {
|
||||
while (true){
|
||||
for (String command:commandQueue){
|
||||
synchronized (commandQueue){
|
||||
commandQueue.forEach((command)->{
|
||||
switch (command){
|
||||
case "FOLLOW":{
|
||||
PressKeyWithModifier(KeyEvent.VK_CONTROL,KeyEvent.VK_7);
|
||||
@ -453,8 +454,9 @@ class Server
|
||||
System.out.println("Unknown command: "+command);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
commandQueue.clear();
|
||||
}
|
||||
|
||||
if (queueUpSprint&&nextActionTimer==0){
|
||||
PressKey(KeyEvent.VK_N);
|
||||
|
Loading…
x
Reference in New Issue
Block a user