Skip to content

Commit be092ac

Browse files
committed
Remove unused config, correct a few things, add docs
1 parent 0573590 commit be092ac

File tree

10 files changed

+396
-27
lines changed

10 files changed

+396
-27
lines changed

Documentation/Server Configuration.md

+385
Large diffs are not rendered by default.

Documentation/media/maintenance.png

59.4 KB
Loading

TSOClient/FSO.Server.Api.Core/Api.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public Api()
3434
public void Init(NameValueCollection appSettings)
3535
{
3636
Config = new ApiConfig();
37-
Config.Maintainance = bool.Parse(appSettings["maintainance"]);
37+
Config.Maintenance = bool.Parse(appSettings["maintenance"]);
3838
Config.AuthTicketDuration = int.Parse(appSettings["authTicketDuration"]);
3939
Config.Regkey = appSettings["regkey"];
4040
Config.Secret = appSettings["secret"];

TSOClient/FSO.Server.Api.Core/ApiConfig.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class ApiConfig
1717
/// <summary>
1818
/// If true, only authentication from moderators and admins will be accepted
1919
/// </summary>
20-
public bool Maintainance { get; set; }
20+
public bool Maintenance { get; set; }
2121

2222
public string Secret { get; set; }
2323

TSOClient/FSO.Server.Api.Core/Controllers/AuthLoginController.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class AuthLoginController : ControllerBase
1515
private static Func<IActionResult> ERROR_020 = printError("INV-020", "Please enter your member name and password.");
1616
private static Func<IActionResult> ERROR_110 = printError("INV-110", "The member name or password you have entered is incorrect. Please try again.");
1717
private static Func<IActionResult> ERROR_302 = printError("INV-302", "The game has experienced an internal error. Please try again.");
18-
private static Func<IActionResult> ERROR_160 = printError("INV-160", "The server is currently down for maintainance. Please try again later.");
18+
private static Func<IActionResult> ERROR_160 = printError("INV-160", "The server is currently down for maintenance. Please try again later.");
1919
private static Func<IActionResult> ERROR_150 = printError("INV-150", "We're sorry, but your account has been suspended or cancelled.");
2020
private static string LOCK_MESSAGE = "Your account has been locked due to too many incorrect login attempts. " +
2121
"If you cannot remember your password, it can be reset at https://beta.freeso.org/forgot. Locked for: ";
@@ -58,7 +58,7 @@ public IActionResult Get(string username, string password, string version, strin
5858
return ERROR_150();
5959
}
6060

61-
if (api.Config.Maintainance && !(user.is_admin || user.is_moderator))
61+
if (api.Config.Maintenance && !(user.is_admin || user.is_moderator))
6262
{
6363
return ERROR_160();
6464
}

TSOClient/FSO.Server.Api.Core/Controllers/ShardSelectorController.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ShardSelectorController : ControllerBase
1616
private static Func<IActionResult> ERROR_AVATAR_NOT_FOUND = ApiResponse.XmlFuture(HttpStatusCode.OK, new XMLErrorMessage("504", "Avatar not found"));
1717
private static Func<IActionResult> ERROR_AVATAR_NOT_YOURS = ApiResponse.XmlFuture(HttpStatusCode.OK, new XMLErrorMessage("505", "You do not own this avatar!"));
1818
private static Func<IActionResult> ERROR_BANNED = ApiResponse.XmlFuture(HttpStatusCode.OK, new XMLErrorMessage("506", "Your account has been banned."));
19-
private static Func<IActionResult> ERROR_MAINTAINANCE = ApiResponse.XmlFuture(HttpStatusCode.OK, new XMLErrorMessage("507", "The server is currently undergoing maintainance. Please try again later."));
19+
private static Func<IActionResult> ERROR_MAINTENANCE = ApiResponse.XmlFuture(HttpStatusCode.OK, new XMLErrorMessage("507", "The server is currently undergoing maintainance. Please try again later."));
2020

2121
public IActionResult Get(string shardName, string avatarId)
2222
{
@@ -58,9 +58,9 @@ public IActionResult Get(string shardName, string avatarId)
5858
return ERROR_BANNED();
5959
}
6060

61-
if (api.Config.Maintainance && !(dbuser.is_admin || dbuser.is_moderator))
61+
if (api.Config.Maintenance && !(dbuser.is_admin || dbuser.is_moderator))
6262
{
63-
return ERROR_MAINTAINANCE();
63+
return ERROR_MAINTENANCE();
6464
}
6565

6666
/** Make an auth ticket **/

TSOClient/FSO.Server.Core/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static IAPILifetime StartWebApi(UserApi api, string url)
2424
var config = api.Config;
2525
var userApiConfig = config.Services.UserApi;
2626
var settings = new NameValueCollection();
27-
settings.Add("maintainance", userApiConfig.Maintainance.ToString());
27+
settings.Add("maintenance", userApiConfig.Maintenance.ToString());
2828
settings.Add("authTicketDuration", userApiConfig.AuthTicketDuration.ToString());
2929
settings.Add("regkey", userApiConfig.Regkey);
3030
settings.Add("secret", config.Secret);

TSOClient/FSO.Server/Servers/UserApi/ApiServerConfiguration.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ public class ApiServerConfiguration
1414
/// Hostname bindings
1515
/// </summary>
1616
public List<string> Bindings { get; set; }
17-
18-
/// <summary>
19-
/// Indicates which routes to register on the api
20-
/// </summary>
21-
public List<ApiServerControllers> Controllers { get; set; }
2217

2318
/// <summary>
2419
/// How long an auth ticket is valid for
@@ -33,15 +28,14 @@ public class ApiServerConfiguration
3328
/// <summary>
3429
/// If true, only authentication from moderators and admins will be accepted
3530
/// </summary>
36-
public bool Maintainance { get; set; }
31+
public bool Maintenance { get; set; }
3732
public string UpdateUrl { get; set; }
3833
public string CDNUrl { get; set; }
3934

4035
public string SmtpHost { get; set; }
4136
public int SmtpPort { get; set; }
4237
public string SmtpPassword { get; set; }
4338
public string SmtpUser { get; set; }
44-
public bool ForceEmailConfirmation { get; set; }
4539
public bool UseProxy { get; set; } = true;
4640

4741
public AWSConfig AwsConfig { get; set; }

TSOClient/FSO.Server/config.sample.json

+1-11
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,8 @@
8888
"bindings": [
8989
"http://+:9000/"
9090
],
91-
"controllers": [
92-
"auth",
93-
"citySelector"
94-
],
9591
// "cdnUrl": "http://0.0.0.0:9000",
96-
"maintainance": false
92+
"maintenance": false
9793
},
9894
"cities": [
9995
{
@@ -109,12 +105,6 @@
109105
"min_nominations": 2,
110106
"election_week_align": true,
111107
"election_move_penalty": 14
112-
},
113-
"maintenance": {
114-
"cron": "0 4 * * *",
115-
"timeout": 3600,
116-
"visits_retention_period": 7,
117-
"top100_average_period": 4
118108
}
119109
}
120110
],

TSOClient/tso.content/Upgrades/Model/UpgradeIff.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class UpgradeIff
1818
/// <summary>
1919
/// A list of tuning groups for this file. Groups allow the developer to group together tuning values with the same target effect, but
2020
/// used by different objects, eg. "Cheap Max Fun", "Expensive Max Fun". With these groups set up, tuning values can be easily copied
21-
/// between objects (as they point to the groups instead of object specific entries) for easier maintainance and rebalancing.
21+
/// between objects (as they point to the groups instead of object specific entries) for easier maintenance and rebalancing.
2222
/// </summary>
2323
public List<UpgradeGroup> Groups = new List<UpgradeGroup>();
2424

0 commit comments

Comments
 (0)