Examples of GameServer


Examples of scotlandyard.server.GameServer

  @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

Examples of scotlandyard.server.GameServer

    //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

Examples of scotlandyard.server.GameServer

    //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

Examples of scotlandyard.server.GameServer

  public String getCaseDescription (){
    initDB();
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
     
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
    return dbman.findCaseDescriptionByNumber(game.getCaso());
  }
View Full Code Here

Examples of scotlandyard.server.GameServer

  public String getDica(int porta) {
    initDB();
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
     
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
    try{
      return dbman.getDica(game.getCaso(), dbman.getLocalOf(porta));
    } catch (DoorNotFoundException dnfe){
      dnfe.printStackTrace();
      return "Dica nao encontrada";
    }
  }
View Full Code Here

Examples of scotlandyard.server.GameServer

  public String getDica(String local) {
    initDB();
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
     
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
    System.out.println("DATABASESERVICE:");
    System.out.println("\tTentando pegar caso: "+ game.getCaso() + " local: "+local);
    return dbman.getDica(game.getCaso(), local);
  }
View Full Code Here

Examples of scotlandyard.server.GameServer

    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
    Player playerName = (Player)session.getAttribute("PlayerInstance");
   
    System.out.println(playerName);
    GameServer game = MainServer.getMainServerInstance().getGameServerByGameName(gameName);
   
    session.setAttribute("GameServerInstance",game );
    //session.setAttribute("PlayerName", playerName);
    // see MainServerManagementTest
    game.joinGame(playerName);
  }
View Full Code Here

Examples of scotlandyard.server.GameServer

  @Override
  public void quitGame(String gameName) {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
    Player playerName = (Player)session.getAttribute("PlayerInstance");
    GameServer game = (GameServer)session.getAttribute("GameServerInstance");
   
    game.quitGame(playerName);
    session.removeAttribute("GameServerInstance");
  }
View Full Code Here

Examples of scotlandyard.server.GameServer

    HttpSession session = request.getSession();
    Player playerName = (Player)session.getAttribute("PlayerInstance");
   
    // see MainServerManagementTest
    MainServer.getMainServerInstance().openGame(gameName);
    GameServer game = MainServer.getMainServerInstance().getGameServerByGameName(gameName);
   
    session.setAttribute("GameServerInstance", game);
    game.joinGame(playerName);
  }
View Full Code Here

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
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.