View Javadoc

1   /*
2    * AI Soccer Project - network gaming environment for AI warriors.
3    * Copyright (C) 2001-2004  Marcin Werla, Pawel Widera
4    *
5    * This program is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU General Public License
7    * as published by the Free Software Foundation; either version 2
8    * of the License, or (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, you can find it here:
17   * http://www.gnu.org/licenses/gpl.html
18   */
19  
20  package snifos;
21  
22  import org.apache.log4j.BasicConfigurator;
23  import org.apache.log4j.Level;
24  import org.apache.log4j.Logger;
25  
26  import snifos.server.SnifosServer;
27  
28  import java.io.FileInputStream;
29  import java.io.InputStream;
30  
31  
32  /***
33   * Simple runner class to start SNIFOS application server.
34   * @version $Id: Main.java,v 1.3 2004/05/08 21:55:31 mwerla Exp $
35   */
36  public class Main {
37      /***
38       * Main method which starts server.
39       * @param args Commandline parameters.
40       */
41      public static void main(String[] args) {
42          BasicConfigurator.configure();
43          Logger.getRootLogger().setLevel(Level.INFO);
44  
45          try {
46              InputStream stream = new FileInputStream(args[0]);
47              new SnifosServer(stream).run();
48          } catch (Exception e) {
49              Logger.getRootLogger().error(e.getMessage(), e);
50          }
51      }
52  }