Package bluffinmuffin.protocol

Examples of bluffinmuffin.protocol.GameTCPServer


            }
           
            @Override
            public void joinTableCommandReceived(JoinTableCommand command)
            {
                GameTCPServer client = null;
                final PokerGame game = m_lobby.getGame(command.getTableID());
                if (game.getClass().equals(PokerGameTraining.class))
                {
                    final PokerGameTraining tgame = (PokerGameTraining) game;
                    client = new GameTCPServer(game, m_playerName, tgame.getTrainingTable().getStartingMoney());
                }
                else
                {
                    client = new GameTCPServer(game, DataManager.Persistance.get(command.getPlayerName()));
                }
                final TableInfo table = game.getTable();
                if (!game.isRunning())
                {
                    sendMessage(command.encodeErrorResponse());
                    return;
                }
               
                // Verify the player does not already playing on that table.
                if (!table.containsPlayer(command.getPlayerName()))
                {
                    final boolean ok = client.joinGame();
                    if (!ok)
                    {
                        sendMessage(command.encodeErrorResponse());
                    }
                    else
                    {
                        m_tables.put(command.getTableID(), client);
                        client.start();
                        sendMessage(command.encodeResponse(client.getPlayer().getNoSeat()));
                        client.sitIn();
                        new ServerClientSender(command.getTableID(), client, ServerClientLobby.this).start();
                    }
                }
                else
                {
View Full Code Here

TOP

Related Classes of bluffinmuffin.protocol.GameTCPServer

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.