Package scotlandyard.server

Examples of scotlandyard.server.GameServer


  @Override
  public String[] getPlayerList(String gameName) {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
   
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
    return game.getPlayerNames();
  }
View Full Code Here


  public void readyStartGame() {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
   
    Player player = (Player)session.getAttribute("PlayerInstance");
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
   
    game.readyStartGame(player);
    System.out.println(player.getName() + " pediu para comecar o jogo.");
    //Player asked, try to startGame
   
  }
View Full Code Here

  @Override
  public void stopCometServer() {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
   
    //System.out.println("PreGameService: pedindo para parar MyCometServlet");
    //game.stopServer = true;
  }
View Full Code Here

    //Then wait for reconnection!
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
   
    Player player = (Player)session.getAttribute("PlayerInstance");
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
   
    //Se ele est� ligado a um jogo
    //E se esse jogo j� come�ou
    if (game != null && game.isRunning()){
      System.out.println("Player "+player.getName()+" disconnected/closed the browser while playing!");
      MainServer.getMainServerInstance().playerDisconnected(player, game);
    }
    else{
      System.out.println("Closed browser BUT is not playing");
View Full Code Here

    //Player reconnected
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
   
    Player player = (Player)session.getAttribute("PlayerInstance");
    GameServer game = MainServer.getMainServerInstance().getGameForReconnection(player);
    session.setAttribute("GameServerInstance", game);
   
    game.switchPlayer(player);
   
    return game.getGameName();
  }
View Full Code Here

  @Override
  public BoardState getBoardState() {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
   
    return game.getBoardState();
  }
View Full Code Here

  @Override
  public void move(int destination) {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
    Player player = (Player)session.getAttribute("PlayerInstance");
    System.out.println(player.getName()+" esta tentando se mover para "+destination);
    game.move(player, destination);
  }
View Full Code Here

  @Override
  public void interfaceReady() {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
    Player player = (Player)session.getAttribute("PlayerInstance");
   
    game.checkAllInterfaceLoaded(player);
  }
View Full Code Here

  @Override
  public String getMyGameName() {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
   
    return game.getGameName();
  }
View Full Code Here

TOP

Related Classes of scotlandyard.server.GameServer

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.