Minor fix solving a ConcurrentModificationException

This commit is contained in:
Carlos 2021-06-02 22:43:10 +02:00
parent 75a505c63f
commit d593cf379e
5 changed files with 6 additions and 5 deletions

View File

@ -15,7 +15,7 @@ Don't worry about privacy or security: all data is stored in your browser locall
* Real-time connected players, machine CPU and server RAM usage information. * Real-time connected players, machine CPU and server RAM usage information.
* Capable of keeping active connections to more than one server to keep retrieving console log in the background for them all. * Capable of keeping active connections to more than one server to keep retrieving console log in the background for them all.
* English, Spanish, Chinese (thanks to Neubulae and OPhantomO), Czech (thanks to Tada), Deutsch (thanks to NoNamePro0), Dutch (thanks to Twockx), French (thanks to pickatchou999), Italian (thanks to AlexZap), Korean (thanks to XxPKBxX), Portuguese (thanks to AlexandreMuassab and Connect500BR), Russian (thanks to Stashenko) and Turkish (thanks to acarnd03) supported. * English, Spanish, Chinese (thanks to Neubulae and OPhantomO), Czech (thanks to Tada), Deutsch (thanks to NoNamePro0), Dutch (thanks to Twockx), French (thanks to pickatchou999), Italian (thanks to AlexZap), Korean (thanks to XxPKBxX), Portuguese (thanks to AlexandreMuassab and Connect500BR), Russian (thanks to Stashenko) and Turkish (thanks to acarnd03) supported.
* Free, updated regularly, and many more! * Free!
![Screenshot](https://i.imgur.com/sN1sYju.png) ![Screenshot](https://i.imgur.com/sN1sYju.png)

View File

@ -22,8 +22,8 @@ function setLanguage(locale){
"addServerModalSvName": "Server name:", "addServerModalSvName": "Server name:",
"addServerModalSvIp": "Server IP:", "addServerModalSvIp": "Server IP:",
"addServerModalSvPort": "WebConsole port:", "addServerModalSvPort": "WebConsole port:",
"addServerModalSvSsl": "Server is SSL enabled", "addServerModalSvSsl": "SSL is enabled on the server",
"addServerModalSslAdvice": "SSL is required for HTTPS client connections", "addServerModalSslAdvice": "SSL is required for connections made from HTTPS websites",
"addServerModalClose": "Close", "addServerModalClose": "Close",
"saveAndConnectServerButton": "Save and connect", "saveAndConnectServerButton": "Save and connect",
"passwordModalLongTitle": "Password required", "passwordModalLongTitle": "Password required",

View File

@ -52,7 +52,7 @@ public class WebConsole extends JavaPlugin {
try { try {
server.stop(); server.stop();
wsThread = null; wsThread = null;
} catch (IOException | InterruptedException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@ -28,7 +28,7 @@ public class LoginManager {
* @param address User to logout * @param address User to logout
*/ */
public void logOut(InetSocketAddress address) { public void logOut(InetSocketAddress address) {
for(ConnectedUser user : loggedInUsers) for(ConnectedUser user : loggedInUsers.toArray(new ConnectedUser[loggedInUsers.size()]))
if(user.getSocketAddress().equals(address)) if(user.getSocketAddress().equals(address))
loggedInUsers.remove(user); loggedInUsers.remove(user);
} }

View File

@ -105,6 +105,7 @@ public class WSServer extends WebSocketServer {
try { try {
conn.send(content.toJSON()); conn.send(content.toJSON());
}catch(WebsocketNotConnectedException e) { }catch(WebsocketNotConnectedException e) {
LoginManager.getInstance().logOut(conn.getRemoteSocketAddress());
Bukkit.getLogger().warning(Internationalization.getPhrase("error-disconnected-client")); Bukkit.getLogger().warning(Internationalization.getPhrase("error-disconnected-client"));
} }