removed potential ConcurrentModificationException chance, part one for 304
This commit is contained in:
1 parent
59be8b3fb4
commit
01a2d9ea6e
1 file changed
+7
-1
@@ -126,7 +126,13 @@ public class CarpetEventServer
|
|||||||
List<LazyValue> argv = argumentSupplier.get(); // empty for onTickDone
|
List<LazyValue> argv = argumentSupplier.get(); // empty for onTickDone
|
||||||
ServerCommandSource source = cmdSourceSupplier.get();
|
ServerCommandSource source = cmdSourceSupplier.get();
|
||||||
assert argv.size() == reqArgs;
|
assert argv.size() == reqArgs;
|
||||||
callList.removeIf(call -> !CarpetServer.scriptServer.runas(source, call.host, call.function, argv)); // this actually does the calls
|
List<Callback> fails = new ArrayList<>();
|
||||||
|
for (Callback call: callList)
|
||||||
|
{
|
||||||
|
if (!CarpetServer.scriptServer.runas(source, call.host, call.function, argv))
|
||||||
|
fails.add(call);
|
||||||
|
}
|
||||||
|
for (Callback call : fails) callList.remove(call);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean addEventCall(ServerCommandSource source, String hostName, String funName, Function<ScriptHost, Boolean> verifier)
|
public boolean addEventCall(ServerCommandSource source, String hostName, String funName, Function<ScriptHost, Boolean> verifier)
|
||||||
|
|||||||
Reference in new issue
Block a user