mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-25 05:56:58 +01:00
IRC nickname defaults to instance name. Constified NEEDS INITIALIZING
This commit is contained in:
@@ -30,7 +30,7 @@ namespace TGServerService
|
||||
public string CommitterName { get; set; } = "tgstation-server";
|
||||
public string CommitterEmail { get; set; } = "tgstation-server@tgstation13.org";
|
||||
|
||||
public string ChatProviderData { get; set; } = "NEEDS INITIALIZING";
|
||||
public string ChatProviderData { get; set; } = ServerInstance.UninitializedString;
|
||||
public string ChatProviderEntropy { get; set; }
|
||||
|
||||
public bool ReattachRequired { get; set; } = false;
|
||||
|
||||
@@ -10,6 +10,11 @@ namespace TGServerService
|
||||
{
|
||||
sealed partial class ServerInstance : ITGChat
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for indicating unintialized encrypted data
|
||||
/// </summary>
|
||||
public const string UninitializedString = "NEEDS INITIALIZING";
|
||||
|
||||
/// <summary>
|
||||
/// List of <see cref="IChatProvider"/>s for the <see cref="ServerInstance"/>
|
||||
/// </summary>
|
||||
@@ -130,8 +135,8 @@ namespace TGServerService
|
||||
lock (ChatLock)
|
||||
{
|
||||
var rawdata = Config.ChatProviderData;
|
||||
if (rawdata == "NEEDS INITIALIZING")
|
||||
return new List<ChatSetupInfo>() { new IRCSetupInfo(), new DiscordSetupInfo() };
|
||||
if (rawdata == UninitializedString)
|
||||
return new List<ChatSetupInfo>() { new IRCSetupInfo() { Nickname = Config.Name }, new DiscordSetupInfo() };
|
||||
|
||||
string plaintext;
|
||||
try
|
||||
@@ -159,7 +164,7 @@ namespace TGServerService
|
||||
}
|
||||
catch
|
||||
{
|
||||
Config.ChatProviderData = "NEEDS INITIALIZING";
|
||||
Config.ChatProviderData = UninitializedString;
|
||||
}
|
||||
}
|
||||
//if we get here we want to retry
|
||||
|
||||
Reference in New Issue
Block a user