Adventure-Terraria-Server-Project / Protector-Plugin

Protector plugin for Terraria Server API and TShock.
GNU General Public License v3.0
10 stars 19 forks source link

Update to Terraria 1.4 #63

Closed dark22 closed 1 year ago

dark22 commented 4 years ago

Would it be possible to upgrade to the new version?

Apparently the items are not being saved when placed in the chest...

Cheers!

Stealownz commented 4 years ago

Hi @dark22, we're still trying to currently fully update the plugin. There's been some changes to the handling of plugins, and the order of the hooks being triggered. I've found that modifying the TShock Bouncer code somewhat resolves the items not being saved issue.

https://github.com/Pryaxis/TShock/blob/general-devel/TShockAPI/Bouncer.cs#L932

            if (args.Player.TPlayer.chest != id)
            {
                TShock.Log.ConsoleDebug("Bouncer / OnChestItemChange rejected from chest mismatch from {0}", args.Player.Name);
                args.Handled = true;
                return;
            }

to

            if (args.Player.TPlayer.chest != id)
            {
                TShock.Log.ConsoleDebug("Bouncer / OnChestItemChange rejected from chest mismatch from {0}", args.Player.Name);
                //args.Handled = true;
                //return;
            }

This change is not ideal, but I'm still trying to figure out the underlying changes that caused this.

dark22 commented 4 years ago

Thank you for the temporary solution and quick response.

I had forgotten to activate Debug in the TShock settings and I didn't think it would be the problem. In addition to the referred line, testing here, apparently "RangeChecks", are also preventing communication from the client to the server. Keeping this option off, or commenting out the line, works normally.

https://github.com/Pryaxis/TShock/blob/general-devel/TShockAPI/Bouncer.cs#L951

Now that the chest limit has been increased to 8,000, would it be possible to disable Protector chests completely, if the user wishes? I know that it is currently possible with as 'MaxProtectorChests = 0' and not create the additional chests, but still animation of the chests when opening and closing are lost.