mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
Fixed weird errors with server lost of player priority on lagged games (see #4448)
This commit is contained in:
parent
1b191a5f93
commit
ba4fee11f6
2 changed files with 80 additions and 7 deletions
|
|
@ -11,7 +11,7 @@ import org.apache.log4j.Logger;
|
|||
/**
|
||||
* For tests only
|
||||
*
|
||||
* @author noxx
|
||||
* @author noxx, JayDi85
|
||||
*/
|
||||
public class SimpleMageClient implements MageClient {
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ public class SimpleMageClient implements MageClient {
|
|||
|
||||
private static final Logger log = Logger.getLogger(SimpleMageClient.class);
|
||||
|
||||
private final CallbackClient callbackClient;
|
||||
private final LoadCallbackClient callbackClient;
|
||||
|
||||
public SimpleMageClient() {
|
||||
clientId = UUID.randomUUID();
|
||||
|
|
@ -54,7 +54,11 @@ public class SimpleMageClient implements MageClient {
|
|||
|
||||
@Override
|
||||
public void processCallback(ClientCallback callback) {
|
||||
callbackClient.processCallback(callback);
|
||||
try {
|
||||
callbackClient.processCallback(callback);
|
||||
} catch (Throwable e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSession(Session session) {
|
||||
|
|
@ -64,4 +68,12 @@ public class SimpleMageClient implements MageClient {
|
|||
public boolean isGameOver() {
|
||||
return ((LoadCallbackClient)callbackClient).isGameOver();
|
||||
}
|
||||
|
||||
public void setConcede(boolean needToConcede) {
|
||||
this.callbackClient.setConcede(needToConcede);
|
||||
}
|
||||
|
||||
public String getLastGameResult() {
|
||||
return this.callbackClient.getLastGameResult();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue