[1.14]Errors are printed twice in single player
jaredlll08 opened this issue ยท 3 comments
When the scripts have errors, the error message is printed twice, this is because we run it on both the client thread and the server thread, we need to only show one.
So some more info on this, and would appreciate ideas from others.
Since the scripts are ran first on the server, then sent to the client, if the script errors it errors twice (once on each side)
The reason it is ran on both is mainly due to some IActions being sided, so a server could send a translation script to the client and have it run, even though running the script on the server would crash the server (Since the server doesn't have translation classes).
So on single player, it runs on both threads (since it is an integrated server).
The issue comes in when there is an issue with the script, since the script fails to compile on both threads.
We can't limit it to only send client specific messages, since then servers wouldn't get messages.
We can't limit it to only send server specific messages, since then clients wouldn't get messages.
If a server only action fails, then the player would get the message once, since the client never ran the IAction.
If a client only action fails, then the player would get the message once, since the server never ran the IAction.
If an IAction that runs on both client and server fails, the message would print twice in single player, but once in multiplayer.
So it really is a bit of a catch 22 on fixing this, way too many edge cases to just say "don't send the message if X"
so if anyone has ideas on solutions, that would be great, or if people don't even think this is an issue (technically it isn't a duplication of messages, each message is a different error message, it just so happens that it reports the same error)
I don't think this is a big issue. What is however an issue, is that previous errors are printed in addition to new ones.
So whenever I reload in SP and get an error, the log will get print that error. When I reload the second time, it'll print the last error message and the new one. If I keep reloading with errors 15-20 times, I have to close the game due to lack of ressources.