- Timestamp:
- Sep 9, 2014, 8:04:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs
r172 r182 16 16 private string realm = "7dtd Admin Panel"; 17 17 18 public Web ( int port)18 public Web () 19 19 { 20 20 try { 21 int webPort = GamePrefs.GetInt (EnumGamePrefs.ControlPanelPort); 22 if (!GamePrefs.GetBool (EnumGamePrefs.ControlPanelEnabled) || webPort < 1 || webPort > 65533) { 23 Log.Out ("Webserver not started (ControlPanel not enabled or ControlPanelPort not within 1-65534)"); 24 return; 25 } 26 if (!Directory.Exists (Application.dataPath + "/../webserver")) { 27 Log.Out ("Webserver not started (folder \"webserver\" not found in game folder)"); 28 return; 29 } 30 21 31 if (!HttpListener.IsSupported) 22 32 throw new NotSupportedException ("Needs Windows XP SP2, Server 2003 or later."); … … 27 37 handlers.Add ("/api/", new ApiHandler ("/api/")); 28 38 29 _listener.Prefixes.Add (String.Format ("http://*:{0}/", port));39 _listener.Prefixes.Add (String.Format ("http://*:{0}/", webPort + 2)); 30 40 authEnabled = File.Exists (Application.dataPath + "/../webserver/protect"); 31 41 if (authEnabled) … … 49 59 ); 50 60 51 Log.Out ("Started Webserver on " + port + " (authentication " + (authEnabled ? "enabled" : "disabled") + ")"); 61 NetTelnetServer.RegisterServer(this); 62 63 64 Log.Out ("Started Webserver on " + (webPort + 2) + " (authentication " + (authEnabled ? "enabled" : "disabled") + ")"); 52 65 } catch (Exception e) { 53 66 Log.Out ("Error in Web.ctor: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.