forked from External/mage
Added context menu to switch between manual and automatic usage of the mana in mana pool. Manual usage is done by clicking on the mana symbol in the player panel. Still some fine tuning to do.
This commit is contained in:
parent
eeead4a8b4
commit
71fb7bf25b
26 changed files with 415 additions and 100 deletions
|
|
@ -65,6 +65,7 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import mage.constants.ManaType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -568,6 +569,21 @@ public class MageServerImpl implements MageServer {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPlayerManaType(final UUID gameId, final String sessionId, final ManaType data) throws MageException {
|
||||
execute("sendPlayerManaType", sessionId, new Action() {
|
||||
@Override
|
||||
public void execute() {
|
||||
User user = SessionManager.getInstance().getUser(sessionId);
|
||||
if (user != null) {
|
||||
user.sendPlayerManaType(gameId, data);
|
||||
} else {
|
||||
logger.warn("Your session expired: gameId=" + gameId + ", sessionId=" + sessionId);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPlayerBoolean(final UUID gameId, final String sessionId, final Boolean data) throws MageException {
|
||||
execute("sendPlayerBoolean", sessionId, new Action() {
|
||||
|
|
@ -609,6 +625,17 @@ public class MageServerImpl implements MageServer {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setManaPoolMode(final UUID gameId, final String sessionId, final boolean autoPayment) throws MageException {
|
||||
execute("setManaPoolMode", sessionId, new Action() {
|
||||
@Override
|
||||
public void execute() {
|
||||
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
|
||||
GameManager.getInstance().setManaPoolMode(gameId, userId, autoPayment);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void concedeGame(final UUID gameId, final String sessionId) throws MageException {
|
||||
execute("concedeGame", sessionId, new Action() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue