Package mage.view

Examples of mage.view.DraftClientMessage


        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                if (futureTimeout != null && !futureTimeout.isDone()) {
                    int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS);
                    user.fireCallback(new ClientCallback("draftInit", draft.getId(), new DraftClientMessage(getDraftPickView(remaining))));
                }
                return true;
            }
        }
        return false;
View Full Code Here


    //
    public void inform(final String message) {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("draftInform", draft.getId(), new DraftClientMessage(getDraftView(), message)));
            }
        }
    }
View Full Code Here

    public void pickCard(int timeout) {
        if (!killed) {
            setupTimeout(timeout);
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("draftPick", draft.getId(), new DraftClientMessage(getDraftPickView(timeout))));
            }
        }
    }
View Full Code Here

                        case "draftOver":
                            MageFrame.removeDraft(callback.getObjectId());
                            break;
                        case "draftPick":
                            {
                                DraftClientMessage message = (DraftClientMessage) callback.getData();
                                DraftPanel panel = MageFrame.getDraft(callback.getObjectId());
                                if (panel != null) {
                                    panel.loadBooster(message.getDraftPickView());
                                }       break;
                            }
                        case "draftUpdate":
                            {
                                DraftPanel panel = MageFrame.getDraft(callback.getObjectId());
                                if (panel != null) {
                                    panel.updateDraft((DraftView) callback.getData());
                                }
                                break;
                            }
                        case "draftInform":
//                            if (callback.getMessageId() > messageId) {
                            {
                                DraftClientMessage message = (DraftClientMessage) callback.getData();
                            }
//                            } else {
//                                logger.warn("message out of sequence - ignoring");
//                            }
//                            break;
                        case "draftInit":
                            {
                                DraftClientMessage message = (DraftClientMessage) callback.getData();
                                DraftPanel panel = MageFrame.getDraft(callback.getObjectId());
                                if (panel != null) {
                                    panel.loadBooster(message.getDraftPickView());
                                }       break;
                            }
                        case "tournamentInit":
                            break;
                    }
View Full Code Here

TOP

Related Classes of mage.view.DraftClientMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.