Changeset 420 for binary-improvements/MapRendering/Web
- Timestamp:
- Mar 28, 2023, 5:11:02 PM (20 months ago)
- Location:
- binary-improvements/MapRendering/Web
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/API/ExecuteConsoleCommand.cs
r360 r420 31 31 } 32 32 33 int commandPermissionLevel = GameManager.Instance.adminTools. GetCommandPermissionLevel (command.GetCommands ());33 int commandPermissionLevel = GameManager.Instance.adminTools.Commands.GetCommandPermissionLevel (command.GetCommands ()); 34 34 35 35 if (_permissionLevel > commandPermissionLevel) { -
binary-improvements/MapRendering/Web/API/GetAllowedCommands.cs
r360 r420 9 9 JSONArray entries = new JSONArray (); 10 10 foreach (IConsoleCommand cc in SdtdConsole.Instance.GetCommands ()) { 11 int commandPermissionLevel = GameManager.Instance.adminTools. GetCommandPermissionLevel (cc.GetCommands ());11 int commandPermissionLevel = GameManager.Instance.adminTools.Commands.GetCommandPermissionLevel (cc.GetCommands ()); 12 12 if (_permissionLevel <= commandPermissionLevel) { 13 13 string cmd = string.Empty; -
binary-improvements/MapRendering/Web/API/GetLandClaims.cs
r369 r420 23 23 24 24 JSONObject result = new JSONObject (); 25 result.Add ("claimsize", new JSONNumber (GamePrefs.GetInt (EnumUtils.Parse<EnumGamePrefs> ( "LandClaimSize"))));25 result.Add ("claimsize", new JSONNumber (GamePrefs.GetInt (EnumUtils.Parse<EnumGamePrefs> (nameof(EnumGamePrefs.LandClaimSize))))); 26 26 27 27 JSONArray claimOwners = new JSONArray (); -
binary-improvements/MapRendering/Web/API/GetPlayerList.cs
r369 r420 68 68 pJson.Add ("ping", new JSONNumber (p.IsOnline ? p.ClientInfo.ping : -1)); 69 69 70 JSONBoolean banned = admTools != null ? new JSONBoolean (admTools. IsBanned (kvp.Key, out _, out _)) : new JSONBoolean (false);70 JSONBoolean banned = admTools != null ? new JSONBoolean (admTools.Blacklist.IsBanned (kvp.Key, out _, out _)) : new JSONBoolean (false); 71 71 72 72 pJson.Add ("banned", banned); -
binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs
r369 r420 24 24 foreach (KeyValuePair<PlatformUserIdentifierAbs, Player> kvp in playersList.Dict) { 25 25 if (admTools != null) { 26 if (admTools. IsBanned (kvp.Key, out _, out _)) {26 if (admTools.Blacklist.IsBanned (kvp.Key, out _, out _)) { 27 27 continue; 28 28 } -
binary-improvements/MapRendering/Web/Handlers/ItemIconHandler.cs
r369 r420 89 89 loadIconsFromFolder (modIconsPath, tintedIcons); 90 90 } catch (Exception e) { 91 Log.Error ("Failed loading icons from mod " + mod. ModInfo.Name.Value);91 Log.Error ("Failed loading icons from mod " + mod.Name); 92 92 Log.Exception (e); 93 93 } -
binary-improvements/MapRendering/Web/Handlers/StaticHandler.cs
r367 r420 1 1 using System.IO; 2 2 using System.Net; 3 using AllocsFixes.FileCache;3 using Webserver.FileCache; 4 4 5 5 namespace AllocsFixes.NetConnections.Servers.Web.Handlers { -
binary-improvements/MapRendering/Web/OpenID.cs
r351 r420 26 26 27 27 private const bool verboseSsl = false; 28 p ublic static booldebugOpenId;28 private static bool debugOpenId => Webserver.OpenID.debugOpenId; 29 29 30 30 static OpenID () { 31 for (int i = 0; i < Environment.GetCommandLineArgs ().Length; i++) {32 if (Environment.GetCommandLineArgs () [i].EqualsCaseInsensitive ("-debugopenid")) {33 debugOpenId = true;34 }35 }36 37 31 ServicePointManager.ServerCertificateValidationCallback = (_srvPoint, _certificate, _chain, _errors) => { 38 32 if (_errors == SslPolicyErrors.None) { -
binary-improvements/MapRendering/Web/Web.cs
r369 r420 7 7 using System.Text; 8 8 using System.Threading; 9 using AllocsFixes.FileCache;10 9 using AllocsFixes.NetConnections.Servers.Web.Handlers; 11 10 using AllocsFixes.NetConnections.Servers.Web.SSE; 12 11 using UnityEngine; 12 using Webserver.FileCache; 13 13 14 14 namespace AllocsFixes.NetConnections.Servers.Web { … … 25 25 public Web () { 26 26 try { 27 int webPort = GamePrefs.GetInt (EnumUtils.Parse<EnumGamePrefs> ( "ControlPanelPort"));27 int webPort = GamePrefs.GetInt (EnumUtils.Parse<EnumGamePrefs> (nameof(EnumGamePrefs.WebDashboardPort))); 28 28 if (webPort < 1 || webPort > 65533) { 29 Log.Out ("Webserver not started ( ControlPanelPort not within 1-65533)");29 Log.Out ("Webserver not started (WebDashboardPort not within 1-65533)"); 30 30 return; 31 31 } 32 32 33 33 if (!Directory.Exists (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + 34 "/webserver ")) {35 Log.Out ("Webserver not started (folder \"webserver \" not found in WebInterface mod folder)");34 "/webserver_legacy")) { 35 Log.Out ("Webserver not started (folder \"webserver_legacy\" not found in WebInterface mod folder)"); 36 36 return; 37 37 } … … 40 40 bool useStaticCache = false; 41 41 42 string dataFolder = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + "/webserver ";42 string dataFolder = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + "/webserver_legacy"; 43 43 44 44 if (!HttpListener.IsSupported) { … … 60 60 RegisterPathHandler ("/map/", new StaticHandler ( 61 61 GameIO.GetSaveGameDir () + "/map", 62 MapRendering.MapRender ing.GetTileCache (),62 MapRendering.MapRenderer.GetTileCache (), 63 63 false, 64 64 "web.map") … … 248 248 if (con != null) { 249 249 _con = con; 250 return GameManager.Instance.adminTools. GetUserPermissionLevel (_con.UserId);250 return GameManager.Instance.adminTools.Users.GetUserPermissionLevel (_con.UserId); 251 251 } 252 252 } … … 270 270 WebConnection con = connectionHandler.LogIn (id, _req.RemoteEndPoint.Address); 271 271 _con = con; 272 int level = GameManager.Instance.adminTools. GetUserPermissionLevel (con.UserId);272 int level = GameManager.Instance.adminTools.Users.GetUserPermissionLevel (con.UserId); 273 273 Log.Out ("Steam OpenID login from {0} with ID {1}, permission level {2}", 274 274 remoteEndpointString, con.UserId, level); -
binary-improvements/MapRendering/Web/WebPermissions.cs
r372 r420 171 171 172 172 private string GetFilePath () { 173 return GamePrefs.GetString (EnumUtils.Parse<EnumGamePrefs> ( "SaveGameFolder"));173 return GamePrefs.GetString (EnumUtils.Parse<EnumGamePrefs> (nameof(EnumGamePrefs.SaveGameFolder))); 174 174 } 175 175
Note:
See TracChangeset
for help on using the changeset viewer.