mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
Added a quit match option. FFA game gets no more killed if host left mage or quitted match.
This commit is contained in:
parent
ec9bb538ed
commit
7b260c960b
15 changed files with 178 additions and 54 deletions
|
|
@ -100,6 +100,7 @@ public interface MageServer {
|
|||
void sendPlayerBoolean(UUID gameId, String sessionId, Boolean data) throws MageException;
|
||||
void sendPlayerInteger(UUID gameId, String sessionId, Integer data) throws MageException;
|
||||
void concedeGame(UUID gameId, String sessionId) throws MageException;
|
||||
void quitMatch(UUID gameId, String sessionId) throws MageException;
|
||||
void undo(UUID gameId, String sessionId) throws MageException;
|
||||
GameView getGameView(UUID gameId, String sessionId, UUID playerId) throws MageException;
|
||||
|
||||
|
|
|
|||
|
|
@ -929,6 +929,21 @@ public class SessionImpl implements Session {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean quitMatch(UUID gameId) {
|
||||
try {
|
||||
if (isConnected()) {
|
||||
server.quitMatch(gameId, sessionId);
|
||||
return true;
|
||||
}
|
||||
} catch (MageException ex) {
|
||||
handleMageException(ex);
|
||||
} catch (Throwable t) {
|
||||
handleThrowable(t);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean undo(UUID gameId) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ public interface GamePlay {
|
|||
|
||||
boolean concedeGame(UUID gameId);
|
||||
|
||||
boolean quitMatch(UUID gameId);
|
||||
|
||||
boolean submitDeck(UUID tableId, DeckCardLists deck);
|
||||
|
||||
boolean updateDeck(UUID tableId, DeckCardLists deck);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue