Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.43k stars 382 forks source link

[Pre6] Commands.ChatCommands.Add(etc.) Commands not being added #1778

Closed ReDuzed closed 4 years ago

ReDuzed commented 4 years ago

TShock version: 4.4.0.0

Reproduction steps (if applicable)?

As exemplified in the LavaSucks tutorial, I have placed the correct subject snippet in the GameInitialize hook. When logging into the server as a SuperAdmin, the commands don't appear in /help 1-4 and in this case don't appear at all.

The commands in question were tested yesterday using TShock 4.3.x, and were functional.

The basic example of what I am directly referring to:

private void OnInit(EventArgs e)
        {
            Commands.ChatCommands.Add(new Command("permission.admin", PlaceItem, "placeitem")
            {
                HelpText = "Lorem ipsum"
            });
        }

Any stack traces or error messages (if known)?

None that I could find. When trying a command, it simply returns the, as paraphrased: command does not exist, check /help for command available.

Any screenshots?

Plugin that is loaded: image This command doesn't function: command

What plugins and what versions of those plugins are you running?

This is my in-house build of the plugin: PlayerShops. There is a GitHub page of the source if it would be necessary to provide it.

ReDuzed commented 4 years ago

Moving the Commands.ChatCommands.Add(etc.) block to the override void Initialize() method did not succeed, nor putting a reference to the block in a run-once function when using /reload.

The rest of the plugin functions without hitches aside from whatever is locked behind command usage.

ReDuzed commented 4 years ago

Manually calling InitCommands() Found among the code in Command.cs after adding the plugin's custom commands worked for my own commands : Manual usage but duplicated all of the tShock command /help messages along with it.

duplicated

QuiCM commented 4 years ago

What order is your plugin running at?

ReDuzed commented 4 years ago

My ignorance precedes me. Order?

QuiCM commented 4 years ago

Plugins can be assigned a load order - I thought maybe your plugin was loading before TShock, but looking at the first message again shows it's not

QuiCM commented 4 years ago

Hi, I asked in Discord and this was the response. Do you have an extra tshockapi.dll floating around that may be causing issues? DiscordPTB_2020-05-22_11-45-48

ReDuzed commented 4 years ago

Yes, this must be definitely what is going on. There was an excess tshockapi.dll in the root directory of the server instance.