- Timestamp:
- Jul 27, 2022, 7:17:17 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Commands/WebPermissionsCmd.cs
r326 r372 30 30 ExecuteList (); 31 31 } else { 32 SdtdConsole.Instance.Output ( "Invalid sub command \"" + _params [0] + "\".");32 SdtdConsole.Instance.Output ($"Invalid sub command \"{_params [0]}\"."); 33 33 } 34 34 } else { … … 39 39 private void ExecuteAdd (List<string> _params) { 40 40 if (_params.Count != 3) { 41 SdtdConsole.Instance.Output ( "Wrong number of arguments, expected 3, found " + _params.Count + ".");41 SdtdConsole.Instance.Output ($"Wrong number of arguments, expected 3, found {_params.Count}."); 42 42 return; 43 43 } 44 44 45 45 if (!WebPermissions.Instance.IsKnownModule (_params [1])) { 46 SdtdConsole.Instance.Output ( "\"" + _params [1] + "\" is not a valid web function.");46 SdtdConsole.Instance.Output ($"\"{_params [1]}\" is not a valid web function."); 47 47 return; 48 48 } … … 50 50 int level; 51 51 if (!int.TryParse (_params [2], out level)) { 52 SdtdConsole.Instance.Output ( "\"" + _params [2] + "\" is not a valid integer.");52 SdtdConsole.Instance.Output ($"\"{_params [2]}\" is not a valid integer."); 53 53 return; 54 54 } 55 55 56 56 WebPermissions.Instance.AddModulePermission (_params [1], level); 57 SdtdConsole.Instance.Output ( string.Format ("{0} added with permission level of {1}.", _params [1], level));57 SdtdConsole.Instance.Output ($"{_params [1]} added with permission level of {level}."); 58 58 } 59 59 60 60 private void ExecuteRemove (List<string> _params) { 61 61 if (_params.Count != 2) { 62 SdtdConsole.Instance.Output ( "Wrong number of arguments, expected 2, found " + _params.Count + ".");62 SdtdConsole.Instance.Output ($"Wrong number of arguments, expected 2, found {_params.Count}."); 63 63 return; 64 64 } 65 65 66 66 if (!WebPermissions.Instance.IsKnownModule (_params [1])) { 67 SdtdConsole.Instance.Output ( "\"" + _params [1] + "\" is not a valid web function.");67 SdtdConsole.Instance.Output ($"\"{_params [1]}\" is not a valid web function."); 68 68 return; 69 69 } 70 70 71 71 WebPermissions.Instance.RemoveModulePermission (_params [1]); 72 SdtdConsole.Instance.Output ( string.Format ("{0} removed from permissions list.", _params [1]));72 SdtdConsole.Instance.Output ($"{_params [1]} removed from permissions list."); 73 73 } 74 74 … … 77 77 SdtdConsole.Instance.Output (" Level: Web function"); 78 78 foreach (WebPermissions.WebModulePermission wmp in WebPermissions.Instance.GetModules ()) { 79 SdtdConsole.Instance.Output ( string.Format (" {0,5}: {1}", wmp.permissionLevel, wmp.module));79 SdtdConsole.Instance.Output ($" {wmp.permissionLevel,5}: {wmp.module}"); 80 80 } 81 81 }
Note:
See TracChangeset
for help on using the changeset viewer.