Package plar.ClientServer

Examples of plar.ClientServer.Server


        ArrayList <String> guns=Common.getJavas(Common.gunsFolder);
        ArrayList <String> players=Common.getJavas(Common.playersFolder);
   
    IniProperties inis = Common.getConfig();
        Server s = new Server();
    s.resolution.x=Integer.parseInt(inis.getProperty("resolutionx") );
    s.resolution.y=Integer.parseInt(inis.getProperty("resolutiony") );
        String response = new String();
        for (int i = 0; i < args.length; i++) {
            if (args[i].equals("--noGui"))
                silent = true;
            else if(response.equals(""))
                response = args[i];
        }
    String topic="";
    String lasd=new String(topic);
        if(!silent)
        {


            ArrayList <String> ll = Common.getJavas(Common.levelFolder);
            String lista = Common.joinAL(Common.getDescriptions(ll,Common.levelPackage));

   
     
            response = inis.getProperty("level");
      topic="Welcome to "
                                  + Common.serverName + "\n\n"
                                  + "The following players were found:\n"+Common.joinAL(players)+"\n"
                                  + "The following guns were found:\n"+Common.joinAL(guns)+"\n"
                                  + "Here the aviable levels:\n"+lista+"\n"
                                  + "\n"
                                  + "According to "+Common.configFile+"\n"
                                  + "The Level to load is "+inis.getProperty("level")+"\n"
                                  + "Screen resolution "+inis.getProperty("resolutionx")+"x"+inis.getProperty("resolutiony")+" px\n"
                                  + "Game resolution "+inis.getProperty("screenx")+"x"+inis.getProperty("screeny")+" m\n"
                                  + "Match lasts "+inis.getProperty("time")+" min\n"
                                  + "\n"
                                  + "\n"
                                  + "Press OK to start\n";
                 
      Common.message(topic,false,false);

            if (response.equals(""))
                response = ll.get(0);
            if(response.contains(".")) response = "LevelLoader " + response;
            response = Common.levelPackage + response;
        }
        Level l = loadLevel(response);


        if (l == null)

            Common.message("Failed loading the class "+ response, true,silent);



        s.newGame(l);
        s.loadGame();

        s.g.gunList = guns;
        s.g.playerList = players;
    s.g.setResolution(new Float(inis.getProperty("screenx") ),new Float(inis.getProperty("screeny") ));



        // s.g.resolution = new Point(800,600);
        for (int i = 0; i < args.length; i++) {
            if (args[i].equals("--noGui"))
                silent = true;
            // Common.info("["+args[i]+"]");
        }
        if (s.listen(Common.port)) {
            if (!silent) {
                java.awt.EventQueue.invokeLater(new Runnable() {
       
       
                    public void run() {
                        new server().setVisible(true);
           
                    }
                });
            }
        } else {
            s.close();
            System.exit(0);
        }

    }
View Full Code Here

TOP

Related Classes of plar.ClientServer.Server

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.