cfa1ef3592dd038ce7ff05212570aa52de8bfb62
[fw/altos] / map-server / altos-mapd / AltosMapd.java
1 /*
2  * Copyright © 2018 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  */
14
15 package altosmapd;
16
17 import java.net.*;
18 import java.io.*;
19
20 import org.altusmetrum.altoslib_13.*;
21
22 public class AltosMapd {
23
24         public final static int port = 16717;
25
26         public final static int maptype = AltosMap.maptype_hybrid;
27
28         public final static int px_size = 512;
29
30         public final static int scale = 1;
31
32         public static void main(final String[] args) {
33
34                 AltosMapdServer server = new AltosMapdServer(port);
35
36                 AltosPreferences.init(new AltosMapdPreferences());
37
38                 AltosPreferences.mapdir = new File("/home/keithp/misc/rockets/flights/maps");
39
40                 for (;;) {
41                         Socket client = server.accept();
42                         if (client == null) {
43                                 System.out.printf("accept failed\n");
44                                 continue;
45                         }
46                         System.out.printf("got client\n");
47                         new AltosMapdClient(client);
48                 }
49         }
50 }