Move GiveItemsDirectly config item to tshock config

Due to an issue that stops the SSC config persister thing from working,
I moved the config item that's new back to the config file. I tried
applying the patches from
https://github.com/Pryaxis/TShock/pull/2354/commits but these didn't
actually resolve the issue. I'm keeping the commits here but I'm not
sure they help.

The core problem is this: if you add a new config file item to the ssc
config, the ssc config is overwritten with the default config items
instead of being merged automatically with the new items. This is a
critical issue as it means that SSC is disabled on all servers that had
it enabled and results in "data misplacement" which is alarming enough
to cause users to think they had data loss, which is not ideal.

Until the issue with the SSC config is resolved, I'm not willing or
confident to change it.
This commit is contained in:
Lucas Nicodemus 2022-10-31 16:18:39 -07:00
parent 05fe6c905f
commit 61e36d0abd
No known key found for this signature in database
6 changed files with 12 additions and 12 deletions

View file

@ -72,10 +72,6 @@ namespace TShockAPI.Configuration
/// </summary> /// </summary>
[Description("Warns players and the console if a player has the tshock.ignore.ssc permission with data in the SSC table.")] [Description("Warns players and the console if a player has the tshock.ignore.ssc permission with data in the SSC table.")]
public bool WarnPlayersAboutBypassPermission = true; public bool WarnPlayersAboutBypassPermission = true;
/// <summary>If set to true, items given to players will be inserted directly into their inventory. Requires SSC. Otherwise, items given to players will spawn as dropped items.</summary>
[Description("If set to true, items given to players will be inserted directly into their inventory. Requires SSC. Otherwise, items given to players will spawn as dropped items.")]
public bool GiveItemsDirectly = false;
} }
/// <summary> /// <summary>

View file

@ -275,6 +275,10 @@ namespace TShockAPI.Configuration
[Description("Determines the range in tiles that a bomb can affect tiles from detonation point.")] [Description("Determines the range in tiles that a bomb can affect tiles from detonation point.")]
public int BombExplosionRadius = 5; public int BombExplosionRadius = 5;
/// <summary>If set to true, items given to players will be inserted directly into their inventory. Requires SSC. Otherwise, items given to players will spawn as dropped items.</summary>
[Description("If set to true, items given to players will be inserted directly into their inventory. Requires SSC. Otherwise, items given to players will spawn as dropped items. Experimental feature. May not work correctly or result in item loss.")]
public bool GiveItemsDirectly = false;
#endregion #endregion

View file

@ -1509,7 +1509,7 @@ namespace TShockAPI
/// <param name="prefix">The item prefix.</param> /// <param name="prefix">The item prefix.</param>
public virtual void GiveItem(int type, int stack, int prefix = 0) public virtual void GiveItem(int type, int stack, int prefix = 0)
{ {
if (TShock.ServerSideCharacterConfig.Settings.GiveItemsDirectly) if (TShock.Config.Settings.GiveItemsDirectly)
GiveItemDirectly(type, stack, prefix); GiveItemDirectly(type, stack, prefix);
else else
GiveItemByDrop(type, stack, prefix); GiveItemByDrop(type, stack, prefix);

View file

@ -69,7 +69,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
* Check loadout slots for hacked item stacks. (@drunderscore) * Check loadout slots for hacked item stacks. (@drunderscore)
* Fix players being kicked after using the Flamethrower to apply the `OnFire3` debuff for `1200` ticks. (@BashGuy10) * Fix players being kicked after using the Flamethrower to apply the `OnFire3` debuff for `1200` ticks. (@BashGuy10)
* Fix being kicked for using the new sponge types on liquid. (@BashGuy10) * Fix being kicked for using the new sponge types on liquid. (@BashGuy10)
* Fixed SSC not save `ateArtisanBread`, `usedAegisCrystal`, `usedAegisFruit`, `usedArcaneCrystal`, `usedGalaxyPearl`, `usedGummyWorm`, `usedAmbrosia`, `unlockedSuperCart`, `enabledSuperCart` flags, and Server will correct read them. (@hufang360) * Fixed SSC not saving `ateArtisanBread`, `usedAegisCrystal`, `usedAegisFruit`, `usedArcaneCrystal`, `usedGalaxyPearl`, `usedGummyWorm`, `usedAmbrosia`, `unlockedSuperCart`, and `enabledSuperCart` data flags. (@hufang360)
* Allow flask buffs to be applied on town npc due to the Flymeal. Add a permission could skip the buff detection. (@KawaiiYuyu) * Allow flask buffs to be applied on town npc due to the Flymeal. Add a permission could skip the buff detection. (@KawaiiYuyu)
* Dockerize TShock. (@PotatoCider) * Dockerize TShock. (@PotatoCider)
* Log the command itself without arguments if the command is not DoLog. (@sgkoishi, [#2779](https://github.com/Pryaxis/TShock/issues/2779)) * Log the command itself without arguments if the command is not DoLog. (@sgkoishi, [#2779](https://github.com/Pryaxis/TShock/issues/2779))

View file

@ -259,6 +259,11 @@ Forces Christmas-only events to occur all year.
* **Field type**: `Boolean` * **Field type**: `Boolean`
* **Default**: `False` * **Default**: `False`
## GiveItemsDirectly
If set to true, items given to players will be inserted directly into their inventory. Requires SSC. Otherwise, items given to players will spawn as dropped items. Experimental feature. May not work correctly or result in item loss.
* **Field type**: `Boolean`
* **Default**: `False`
## HardcoreBanReason ## HardcoreBanReason
The reason given when banning hardcore players on death. The reason given when banning hardcore players on death.
* **Field type**: `String` * **Field type**: `String`

View file

@ -3,11 +3,6 @@ Enable server side characters, causing client data to be saved on the server ins
* **Field type**: `Boolean` * **Field type**: `Boolean`
* **Default**: `False` * **Default**: `False`
## GiveItemsDirectly
If set to true, items given to players will be inserted directly into their inventory. Requires SSC. Otherwise, items given to players will spawn as dropped items.
* **Field type**: `Boolean`
* **Default**: `False`
## LogonDiscardThreshold ## LogonDiscardThreshold
Time, in milliseconds, to disallow discarding items after logging in when ServerSideCharacters is ON. Time, in milliseconds, to disallow discarding items after logging in when ServerSideCharacters is ON.
* **Field type**: `Int32` * **Field type**: `Int32`
@ -26,7 +21,7 @@ The starting default health for new players when SSC is enabled.
## StartingInventory ## StartingInventory
The starting default inventory for new players when SSC is enabled. The starting default inventory for new players when SSC is enabled.
* **Field type**: `List`1` * **Field type**: `List`1`
* **Default**: `System.Collections.Generic.List\`1[TShockAPI.NetItem]` * **Default**: `System.Collections.Generic.List`1[TShockAPI.NetItem]`
## StartingMana ## StartingMana
The starting default mana for new players when SSC is enabled. The starting default mana for new players when SSC is enabled.