Add TGS_EVENT_INSTANCE_RENAMED to DMAPI

This commit is contained in:
Jordan Brown
2020-04-27 20:39:43 -04:00
parent 2ee6277bfd
commit 8849b1f5ad
2 changed files with 7 additions and 3 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
//tgstation-server DMAPI
#define TGS_DMAPI_VERSION "5.0.0"
#define TGS_DMAPI_VERSION "5.1.0"
//All functions and datums outside this document are subject to change with any version and should not be relied on
@@ -52,8 +52,9 @@
//EVENT CODES
#define TGS_EVENT_PORT_SWAP -2 //before a port change is about to happen, extra parameter is new port
#define TGS_EVENT_REBOOT_MODE_CHANGE -1 //before a reboot mode change, extras parameters are the current and new reboot mode enums
#define TGS_EVENT_REBOOT_MODE_CHANGE -1 //Before a reboot mode change, extras parameters are the current and new reboot mode enums
#define TGS_EVENT_PORT_SWAP -2 //Before a port change is about to happen, extra parameters is new port
#define TGS_EVENT_INSTANCE_RENAMED -3 //Before the instance is renamed, extra prameter is the new name
//See the descriptions for the parameters of these codes here: https://github.com/tgstation/tgstation-server/blob/master/src/Tgstation.Server.Host/Components/EventType.cs
#define TGS_EVENT_REPO_RESET_ORIGIN 0
+3
View File
@@ -178,6 +178,9 @@
if(!istext(new_instance_name))
return TopicResponse("Invalid or missing [DMAPI5_TOPIC_PARAMETER_NEW_INSTANCE_NAME]!")
if(event_handler != null)
event_handler.HandleEvent(TGS_EVENT_INSTANCE_RENAMED, new_instance_name)
instance_name = new_instance_name
return TopicResponse()
if(DMAPI5_TOPIC_COMMAND_CHAT_CHANNELS_UPDATE)