Examples of GameCommand


Examples of bluffinmuffin.protocol.commands.lobby.GameCommand

        m_isConnected = false;
    }
   
    protected void sendMessage(String p_msg)
    {
        m_comm.send(new GameCommand(m_tableID, p_msg));
    }
View Full Code Here

Examples of bluffinmuffin.protocol.commands.lobby.GameCommand

        {
            joinTables(new JoinTableCommand(token));
        }
        else if (commandName.equals(GameCommand.COMMAND_NAME))
        {
            game(new GameCommand(token));
        }
        else if (commandName.equals(CreateUserCommand.COMMAND_NAME))
        {
            createUser(new CreateUserCommand(token));
        }
View Full Code Here

Examples of bluffinmuffin.protocol.commands.lobby.GameCommand

        m_toClient = toClient;
    }
   
    protected void send(String p_msg)
    {
        m_toClient.send(new GameCommand(m_tableID, p_msg));
    }
View Full Code Here

Examples of bluffinmuffin.protocol.commands.lobby.GameCommand

        System.out.println(m_playerName + " RECV [" + line + "]");
        final StringTokenizer token = new StringTokenizer(line, AbstractLobbyCommand.Delimitter + "");
        final String commandName = token.nextToken();
        if (commandName.equals(GameCommand.COMMAND_NAME))
        {
            final GameCommand c = new GameCommand(token);
            while (!m_clients.containsKey(c.getTableId()))
            {
                Thread.sleep(100);
            }
           
            m_clients.get(c.getTableId()).incoming(c.getCommand());
        }
        else
        {
            m_incoming.put(line);
        }
View Full Code Here

Examples of ch.fusun.baron.core.command.GameCommand

        }
      }

      private void tryExecuteCommand(Object object) {
        try {
          GameCommand command = (GameCommand) object;
          ReInjector.getInstance().reInject(command);
          if (command.isAllowed()) {
            command.execute();
            updateUsers();
          } else {
            System.err.println(command + " not allowed"); //$NON-NLS-1$
          }
        } catch (Exception e) {
View Full Code Here

Examples of com.barrybecker4.game.common.online.GameCommand

            throw new RuntimeException(e);
        }

        try {
            // initial update to the game tables for someone entering the room.
            GameCommand cmd = new GameCommand(GameCommand.Name.UPDATE_TABLES, cmdProcessor.getTables());
            update(cmd);

            while (!stopped) {
                // receive the serialized commands that are sent and process them.
                cmd = (GameCommand) iStream.readObject();
View Full Code Here

Examples of com.barrybecker4.game.common.online.GameCommand

            default:
                assert false : "Unhandled command: "+ cmd;
        }

        if (useUpdateTable) {
            GameCommand response = new GameCommand(GameCommand.Name.UPDATE_TABLES, getTables());
            responses.add(0, response)// add as first command in response.
        }

        return responses;
    }
View Full Code Here

Examples of com.barrybecker4.game.common.online.GameCommand

        // get all robot player actions until the next human player
        List<PlayerAction> robotActions = ((MultiGameController)controller_).getRecentRobotActions();

        for (PlayerAction act : robotActions) {
            GameCommand robotCmd = new GameCommand(GameCommand.Name.DO_ACTION, act);
            GameContext.log(0, "adding response command for robot action on server :" + robotCmd);
            responses.add(robotCmd);
        }
    }
View Full Code Here

Examples of com.barrybecker4.game.common.online.GameCommand

        GameContext.log(0, "UpdateWorker terminated.");
    }

    private void processNextCommand() throws IOException, ClassNotFoundException {

        GameCommand cmd = (GameCommand) inputStream.readObject();
        GameContext.log(0, "Client Connection: got an update from the server:" + cmd);

        boolean processed = false;
        int count = 0;
View Full Code Here

Examples of com.barrybecker4.game.common.online.GameCommand

        if (e.getKeyChar() == '\n') {
            String txt = messageField_.getText();
            txt = txt.trim();
            if (txt.length() > 0) {
                messageField_.setText("");
                connection_.sendCommand(new GameCommand(GameCommand.Name.CHAT_MESSAGE, txt));
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.