From 11c5a972c5522aae1ff72837870f46b3e1ac9195 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 1 Dec 2020 20:45:38 -0500 Subject: [PATCH 1/6] Fix the possibility of watchdog starting twice. This can happen if the initial Status check in Launch passes and blocks on the lock before Status is set to Restoring. It needs to be checked again. --- src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs index e9843b2294..83ed8294c1 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs @@ -360,6 +360,8 @@ namespace Tgstation.Server.Host.Components.Watchdog CancellationToken cancellationToken) { Logger.LogTrace("Begin LaunchImplNoLock"); + if (startMonitor && Status != WatchdogStatus.Offline) + throw new JobException(ErrorCode.WatchdogRunning); if (reattachInfo == null && !DmbFactory.DmbAvailable) throw new JobException(ErrorCode.WatchdogCompileJobCorrupted); From 8dfc5feb056e102fc3e2d5669ca98a2e4a5602c4 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 1 Dec 2020 21:08:19 -0500 Subject: [PATCH 2/6] Fix DMAPI doc comment indentation Fuck everything about this --- build/Version.props | 2 +- src/DMAPI/tgs.dm | 104 ++++++++++++++++++++++---------------------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/build/Version.props b/build/Version.props index 220cd98461..bb2c35a17a 100644 --- a/build/Version.props +++ b/build/Version.props @@ -7,7 +7,7 @@ 2.1.1 7.4.0 8.4.0 - 5.2.8 + 5.2.9 1.1.0 1.1.1 diff --git a/src/DMAPI/tgs.dm b/src/DMAPI/tgs.dm index e70955845c..2562bfe4d3 100644 --- a/src/DMAPI/tgs.dm +++ b/src/DMAPI/tgs.dm @@ -1,6 +1,6 @@ // tgstation-server DMAPI -#define TGS_DMAPI_VERSION "5.2.8" +#define TGS_DMAPI_VERSION "5.2.9" // All functions and datums outside this document are subject to change with any version and should not be relied on. @@ -117,22 +117,22 @@ //REQUIRED HOOKS /** - * Call this somewhere in [/world/proc/New] that is always run. This function may sleep! - * - * * event_handler - Optional user defined [/datum/tgs_event_handler]. - * * minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated. Can be one of [TGS_SECURITY_ULTRASAFE], [TGS_SECURITY_SAFE], or [TGS_SECURITY_TRUSTED]. - */ + * Call this somewhere in [/world/proc/New] that is always run. This function may sleep! + * + * * event_handler - Optional user defined [/datum/tgs_event_handler]. + * * minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated. Can be one of [TGS_SECURITY_ULTRASAFE], [TGS_SECURITY_SAFE], or [TGS_SECURITY_TRUSTED]. + */ /world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE) return /** - * Call this when your initializations are complete and your game is ready to play before any player interactions happen. - * - * This may use [/world/var/sleep_offline] to make this happen so ensure no changes are made to it while this call is running. - * Afterwards, consider explicitly setting it to what you want to avoid this BYOND bug: http://www.byond.com/forum/post/2575184 - * Before this point, note that any static files or directories may be in use by another server. Your code should account for this. - * This function should not be called before ..() in [/world/proc/New]. - */ + * Call this when your initializations are complete and your game is ready to play before any player interactions happen. + * + * This may use [/world/var/sleep_offline] to make this happen so ensure no changes are made to it while this call is running. + * Afterwards, consider explicitly setting it to what you want to avoid this BYOND bug: http://www.byond.com/forum/post/2575184 + * Before this point, note that any static files or directories may be in use by another server. Your code should account for this. + * This function should not be called before ..() in [/world/proc/New]. + */ /world/proc/TgsInitializationComplete() return @@ -140,8 +140,8 @@ #define TGS_TOPIC var/tgs_topic_return = TgsTopic(args[1]); if(tgs_topic_return) return tgs_topic_return /** - * Call this at the beginning of [world/proc/Reboot]. - */ + * Call this at the beginning of [world/proc/Reboot]. + */ /world/proc/TgsReboot() return @@ -175,16 +175,16 @@ var/deprefixed_parameter /** - * Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards. - */ + * Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards. + */ /datum/tgs_version/proc/Wildcard() return /** - * Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] equals some other version. - * - * other_version - The [/datum/tgs_version] to compare against. - */ + * Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] equals some other version. + * + * other_version - The [/datum/tgs_version] to compare against. + */ /datum/tgs_version/proc/Equals(datum/tgs_version/other_version) return @@ -234,10 +234,10 @@ var/datum/tgs_chat_channel/channel /** - * User definable callback for handling TGS events. - * - * event_code - One of the TGS_EVENT_ defines. Extra parameters will be documented in each - */ + * User definable callback for handling TGS events. + * + * event_code - One of the TGS_EVENT_ defines. Extra parameters will be documented in each + */ /datum/tgs_event_handler/proc/HandleEvent(event_code, ...) set waitfor = FALSE return @@ -252,11 +252,11 @@ var/admin_only = FALSE /** - * Process command activation. Should return a string to respond to the issuer with. - * - * sender - The [/datum/tgs_chat_user] who issued the command. - * params - The trimmed string following the command `/datum/tgs_chat_command/var/name]. - */ + * Process command activation. Should return a string to respond to the issuer with. + * + * sender - The [/datum/tgs_chat_user] who issued the command. + * params - The trimmed string following the command `/datum/tgs_chat_command/var/name]. + */ /datum/tgs_chat_command/proc/Run(datum/tgs_chat_user/sender, params) CRASH("[type] has no implementation for Run()") @@ -271,48 +271,48 @@ return /** - * Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise. - */ + * Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise. + */ /world/proc/TgsAvailable() return // No function below this succeeds if it TgsAvailable() returns FALSE or if TgsNew() has yet to be called. /** - * Forces a hard reboot of DreamDaemon by ending the process. - * - * Unlike del(world) clients will try to reconnect. - * If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again - */ + * Forces a hard reboot of DreamDaemon by ending the process. + * + * Unlike del(world) clients will try to reconnect. + * If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again + */ /world/proc/TgsEndProcess() return /** - * Send a message to connected chats. - * - * message - The string to send. - * admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies. - */ + * Send a message to connected chats. + * + * message - The string to send. + * admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies. + */ /world/proc/TgsTargetedChatBroadcast(message, admin_only = FALSE) return /** - * Send a private message to a specific user. - * - * message - The string to send. - * user: The [/datum/tgs_chat_user] to PM. - */ + * Send a private message to a specific user. + * + * message - The string to send. + * user: The [/datum/tgs_chat_user] to PM. + */ /world/proc/TgsChatPrivateMessage(message, datum/tgs_chat_user/user) return // The following functions will sleep if a call to TgsNew() is sleeping /** - * Send a message to connected chats that are flagged as game-related in TGS. - * - * message - The string to send. - * channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to. - */ + * Send a message to connected chats that are flagged as game-related in TGS. + * + * message - The string to send. + * channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to. + */ /world/proc/TgsChatBroadcast(message, list/channels = null) return From 3c3a9bf6e49b00f9e0f8a35a7b43d05bdc3f9e67 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 1 Dec 2020 21:43:33 -0500 Subject: [PATCH 3/6] Bump the timeout of a test --- tests/Tgstation.Server.Tests/Instance/RepositoryTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tgstation.Server.Tests/Instance/RepositoryTest.cs b/tests/Tgstation.Server.Tests/Instance/RepositoryTest.cs index efd3e9a21e..def6f1385d 100644 --- a/tests/Tgstation.Server.Tests/Instance/RepositoryTest.cs +++ b/tests/Tgstation.Server.Tests/Instance/RepositoryTest.cs @@ -209,7 +209,7 @@ namespace Tgstation.Server.Tests.Instance var mergingAgain = await repositoryClient.Update(withMerge, cancellationToken); Assert.IsNotNull(mergingAgain.ActiveJob); - await WaitForJob(mergingAgain.ActiveJob, 30, false, null, cancellationToken); + await WaitForJob(mergingAgain.ActiveJob, 60, false, null, cancellationToken); var final = await repositoryClient.Read(cancellationToken); Assert.AreEqual("asdffdsa", final.RevisionInformation.PrimaryTestMerge.Comment); From f78d1716d9da85ce4fdd3fc5acb4ce82601537b4 Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Tue, 1 Dec 2020 23:47:51 -0800 Subject: [PATCH 4/6] Don't tell people to use the port configured during the setup wizard during a step that happens before the setup wizard is ran. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39da29f3a4..512c58e203 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ docker run \ --name="tgs" \ # Name for the container --cap-add=sys_nice \ # Recommended, allows tgs to schedule DreamDaemon as a higher priority process --init \ #Highly recommended, reaps potential zombie processes - -p : \ # Port bridge for accessing TGS + -p 5000:5000 \ # Port bridge for accessing TGS, you can change this if you need -p 0.0.0.0:: \ # Port bridge for accessing DreamDaemon -v /path/to/your/configfile/directory:/config_data \ # Recommended, create a volume mapping for server configuration -v /path/to/store/instances:/tgs4_instances \ # Recommended, create a volume mapping for server instances From adf5d0c0c4f9b759ea4e161f14488aca6b05e0b1 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Wed, 2 Dec 2020 20:04:41 -0500 Subject: [PATCH 5/6] Forward container arguments to dotnet --- build/tgs.docker.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/tgs.docker.sh b/build/tgs.docker.sh index 1ca8007756..490f318a42 100755 --- a/build/tgs.docker.sh +++ b/build/tgs.docker.sh @@ -1,6 +1,6 @@ #!/bin/sh -SCRIPT_VERSION="1.1.1" +SCRIPT_VERSION="1.2.0" echo "tgstation-server 4 container startup script v$SCRIPT_VERSION" echo "PWD: $PWD" @@ -23,4 +23,4 @@ if [ ! -f "$HOST_CONFIG" ]; then fi echo "Executing console runner..." -exec dotnet Tgstation.Server.Host.Console.dll +exec dotnet Tgstation.Server.Host.Console.dll $@ From 4516c6bd887549258f0ce08d748a9a588403279e Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Wed, 2 Dec 2020 20:11:19 -0500 Subject: [PATCH 6/6] Update TgsContainerScriptVersion in Version.props --- build/Version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Version.props b/build/Version.props index bb2c35a17a..3b64b3ff67 100644 --- a/build/Version.props +++ b/build/Version.props @@ -9,7 +9,7 @@ 8.4.0 5.2.9 1.1.0 - 1.1.1 + 1.2.0