mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Chat Refactor (#79) [TGSDeploy]
* Chat refactor: Service changes * Settings migration * First pass at implementing the commandline * WIP irc modes * Wip * Fix it * Working * Fix dickscord * Some readme updates * Fixes * PMs are admin etc * Compiling * Final touches * Version bump to 3.0.86.0
This commit is contained in:
@@ -40,7 +40,7 @@ namespace TGServerService
|
||||
DDWatchdogStarted = 2500,
|
||||
ChatSend = 2600,
|
||||
ChatBroadcast = 2700,
|
||||
ChatAdminBroadcast = 2800,
|
||||
//ChatAdminBroadcast = 2800,
|
||||
ChatDisconnectFail = 2900,
|
||||
TopicSent = 3000,
|
||||
TopicFailed = 3100,
|
||||
@@ -73,6 +73,8 @@ namespace TGServerService
|
||||
ServiceShutdownFail = 6100,
|
||||
WorldReboot = 6200,
|
||||
ServerUpdateApplied = 6300,
|
||||
ChatBroadcastFail = 6400,
|
||||
IRCLogModes = 6500,
|
||||
}
|
||||
|
||||
static TGServerService ActiveService; //So everyone else can write to our eventlog
|
||||
@@ -92,7 +94,13 @@ namespace TGServerService
|
||||
ActiveService.EventLog.WriteEntry(message, EventLogEntryType.Warning, (int)id);
|
||||
}
|
||||
|
||||
ServiceHost host; //the WCF host
|
||||
ServiceHost host; //the WCF host
|
||||
|
||||
void MigrateSettings(int oldVersion, int newVersion)
|
||||
{
|
||||
if (oldVersion == newVersion && newVersion == 0) //chat refactor
|
||||
Properties.Settings.Default.ChatProviderData = "NEEDS INITIALIZING"; //reset chat settings to be safe
|
||||
}
|
||||
|
||||
//you should seriously not add anything here
|
||||
//Use OnStart instead
|
||||
@@ -102,7 +110,12 @@ namespace TGServerService
|
||||
{
|
||||
if (Properties.Settings.Default.UpgradeRequired)
|
||||
{
|
||||
var newVersion = Properties.Settings.Default.SettingsVersion;
|
||||
Properties.Settings.Default.Upgrade();
|
||||
var oldVersion = Properties.Settings.Default.SettingsVersion;
|
||||
|
||||
MigrateSettings(oldVersion, newVersion);
|
||||
|
||||
Properties.Settings.Default.UpgradeRequired = false;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user