mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Removed some not needed error log messages.
This commit is contained in:
parent
cf90bb4d36
commit
a4afdb8d3f
1 changed files with 5 additions and 10 deletions
|
@ -27,15 +27,14 @@
|
||||||
*/
|
*/
|
||||||
package mage.server;
|
package mage.server;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.*;
|
||||||
import mage.server.User.UserState;
|
import mage.server.User.UserState;
|
||||||
import mage.server.record.UserStats;
|
import mage.server.record.UserStats;
|
||||||
import mage.server.record.UserStatsRepository;
|
import mage.server.record.UserStatsRepository;
|
||||||
import mage.server.util.ThreadExecutor;
|
import mage.server.util.ThreadExecutor;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* manages users - if a user is disconnected and 10 minutes have passed with no
|
* manages users - if a user is disconnected and 10 minutes have passed with no
|
||||||
* activity the user is removed
|
* activity the user is removed
|
||||||
|
@ -68,8 +67,7 @@ public enum UserManager {
|
||||||
|
|
||||||
public Optional<User> getUser(UUID userId) {
|
public Optional<User> getUser(UUID userId) {
|
||||||
if (!users.containsKey(userId)) {
|
if (!users.containsKey(userId)) {
|
||||||
LOGGER.error(String.format("User with id %s could not be found", userId));
|
LOGGER.trace(String.format("User with id %s could not be found", userId));
|
||||||
|
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
} else {
|
} else {
|
||||||
return Optional.of(users.get(userId));
|
return Optional.of(users.get(userId));
|
||||||
|
@ -82,10 +80,7 @@ public enum UserManager {
|
||||||
if (u.isPresent()) {
|
if (u.isPresent()) {
|
||||||
return u;
|
return u;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
LOGGER.error("User with name " + userName + " could not be found");
|
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,8 +118,8 @@ public enum UserManager {
|
||||||
|
|
||||||
public void removeUser(final UUID userId, final DisconnectReason reason) {
|
public void removeUser(final UUID userId, final DisconnectReason reason) {
|
||||||
if (userId != null) {
|
if (userId != null) {
|
||||||
getUser(userId).ifPresent(user ->
|
getUser(userId).ifPresent(user
|
||||||
USER_EXECUTOR.execute(
|
-> USER_EXECUTOR.execute(
|
||||||
() -> {
|
() -> {
|
||||||
try {
|
try {
|
||||||
LOGGER.info("USER REMOVE - " + user.getName() + " (" + reason.toString() + ") userId: " + userId + " [" + user.getGameInfo() + ']');
|
LOGGER.info("USER REMOVE - " + user.getName() + " (" + reason.toString() + ") userId: " + userId + " [" + user.getGameInfo() + ']');
|
||||||
|
|
Loading…
Reference in a new issue