forked from External/mage
some more drafting stuff
This commit is contained in:
parent
c67122b605
commit
98d8a428a7
11 changed files with 403 additions and 4 deletions
|
|
@ -44,6 +44,7 @@ import mage.interfaces.callback.ClientCallback;
|
|||
import mage.util.Logging;
|
||||
import mage.view.AbilityPickerView;
|
||||
import mage.view.ChatMessage;
|
||||
import mage.view.DraftClientMessage;
|
||||
import mage.view.GameClientMessage;
|
||||
import mage.view.GameView;
|
||||
import mage.view.TableClientMessage;
|
||||
|
|
@ -164,6 +165,21 @@ public class Client implements CallbackClient {
|
|||
else if (callback.getMethod().equals("sideboard")) {
|
||||
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||
sideboard(message.getDeck(), message.getTableId());
|
||||
}
|
||||
else if (callback.getMethod().equals("draftPick")) {
|
||||
DraftClientMessage message = (DraftClientMessage) callback.getData();
|
||||
|
||||
}
|
||||
else if (callback.getMethod().equals("draftInform")) {
|
||||
if (callback.getMessageId() > messageId) {
|
||||
DraftClientMessage message = (DraftClientMessage) callback.getData();
|
||||
}
|
||||
else {
|
||||
logger.warning("message out of sequence - ignoring");
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("draftInit")) {
|
||||
|
||||
}
|
||||
messageId = callback.getMessageId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ import mage.client.components.MageUI;
|
|||
import mage.client.game.GamePanel;
|
||||
import mage.client.util.Config;
|
||||
import mage.game.GameException;
|
||||
import mage.game.draft.DraftOptions;
|
||||
import mage.interfaces.MageException;
|
||||
import mage.game.match.MatchOptions;
|
||||
import mage.interfaces.Server;
|
||||
|
|
@ -261,6 +262,19 @@ public class Session {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean joinDraftTable(UUID roomId, UUID tableId, String playerName) {
|
||||
try {
|
||||
return server.joinDraftTable(sessionId, roomId, tableId, playerName);
|
||||
} catch (RemoteException ex) {
|
||||
handleRemoteException(ex);
|
||||
} catch (MageException ex) {
|
||||
handleMageException(ex);
|
||||
} catch (GameException ex) {
|
||||
handleGameException(ex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Collection<TableView> getTables(UUID roomId) throws MageRemoteException {
|
||||
try {
|
||||
return server.getTables(roomId);
|
||||
|
|
@ -418,6 +432,17 @@ public class Session {
|
|||
return null;
|
||||
}
|
||||
|
||||
public TableView createDraftTable(UUID roomId, DraftOptions draftOptions) {
|
||||
try {
|
||||
return server.createDraftTable(sessionId, roomId, draftOptions);
|
||||
} catch (RemoteException ex) {
|
||||
handleRemoteException(ex);
|
||||
} catch (MageException ex) {
|
||||
handleMageException(ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isTableOwner(UUID roomId, UUID tableId) {
|
||||
try {
|
||||
return server.isTableOwner(sessionId, roomId, tableId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue