mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Merge pull request #4682 from delftswa2018/hotfix/resolving-unaccepted-changes
Hotfix - resolving unaccepted changes
This commit is contained in:
commit
8563c6d865
3 changed files with 5 additions and 3 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
package org.mage.card.arcane;
|
package org.mage.card.arcane;
|
||||||
|
|
||||||
|
import mage.util.StreamUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.DatagramPacket;
|
import java.net.DatagramPacket;
|
||||||
import java.net.DatagramSocket;
|
import java.net.DatagramSocket;
|
||||||
|
|
@ -42,7 +44,7 @@ public final class Util {
|
||||||
socket = new DatagramSocket();
|
socket = new DatagramSocket();
|
||||||
broadcast(socket, data, port, NetworkInterface.getNetworkInterfaces());
|
broadcast(socket, data, port, NetworkInterface.getNetworkInterfaces());
|
||||||
} finally {
|
} finally {
|
||||||
socket.close();
|
StreamUtils.closeQuietly(socket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@ public class ChatSession {
|
||||||
String userName = clients.get(userId);
|
String userName = clients.get(userId);
|
||||||
if (reason != DisconnectReason.LostConnection) { // for lost connection the user will be reconnected or session expire so no removeUserFromAllTablesAndChat of chat yet
|
if (reason != DisconnectReason.LostConnection) { // for lost connection the user will be reconnected or session expire so no removeUserFromAllTablesAndChat of chat yet
|
||||||
final Lock w = lock.writeLock();
|
final Lock w = lock.writeLock();
|
||||||
try {
|
|
||||||
w.lock();
|
w.lock();
|
||||||
|
try {
|
||||||
clients.remove(userId);
|
clients.remove(userId);
|
||||||
} finally {
|
} finally {
|
||||||
w.unlock();
|
w.unlock();
|
||||||
|
|
|
||||||
|
|
@ -231,8 +231,8 @@ public enum UserManager {
|
||||||
}
|
}
|
||||||
logger.debug("Users to remove " + toRemove.size());
|
logger.debug("Users to remove " + toRemove.size());
|
||||||
final Lock w = lock.readLock();
|
final Lock w = lock.readLock();
|
||||||
try {
|
|
||||||
w.lock();
|
w.lock();
|
||||||
|
try {
|
||||||
for (User user : toRemove) {
|
for (User user : toRemove) {
|
||||||
users.remove(user.getId());
|
users.remove(user.getId());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue