Ejemplo n.º 1
0
  public Server() {

    game.setServer(this);
    game.InitScreenData();
    game.Initghostx(new int[maxghosts]);
    ghostdx = new int[maxghosts];
    game.Initghosty(new int[maxghosts]);
    ghostdy = new int[maxghosts];
    ghostspeed = new int[maxghosts];
    dx = new int[4];
    dy = new int[4];

    numberFinished = 0;
  }
Ejemplo n.º 2
0
 public static void serverInit() {
   String serverAddress = "rmi://" + serverInfo.getIpAddr() + ":1099/I_InfoGame";
   try {
     game = new InfoGame();
     server = new Server();
     game.setServer(server);
     game.setServerAddress(serverInfo.getIpAddr());
     game.setNextAddress(serverInfo.getNext().getIpAddr());
     game.setNbPlayerExpected(numPlayer);
     Naming.rebind(serverAddress, game);
     socketPortClient = serverInfo.getPortClient();
     // System.out.println("End initialisation");
   } catch (RemoteException e) {
     System.out.println("Hubo una excepcion creando la instancia del objeto distribuido");
   } catch (MalformedURLException e) {
     System.out.println("URL mal formada al tratar de publicar el objeto");
   }
 }