Need a lock on the list as we update it between threads

master
sigonasr2 2 years ago
parent e589001985
commit 016fb611af
  1. 6
      sig/App.java

@ -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…
Cancel
Save