Skip to content

Update TSAPI for Terraria 1.4.6.0 (OTAPI 3.3.15) - #286

Open
KRWCLASSIC wants to merge 1 commit into
Pryaxis:general-develfrom
KRWCLASSIC:terraria-1.4.6
Open

KRWCLASSIC wants to merge 1 commit into
Pryaxis:general-develfrom
KRWCLASSIC:terraria-1.4.6

Conversation

@KRWCLASSIC

Copy link
Copy Markdown

Updates TSAPI for Terraria 1.4.6.0 (depends on the OTAPI PR): bumps OTAPI to 3.3.15, adds packet 165, and fixes the RemoteClient / connection acceptance changes.

@magaflaca

magaflaca commented Nov 25, 2026 •

Copy link
Copy Markdown

Found two issues while testing this on Windows and Linux:

ServerLeave never fires on 1.4.6

In 1.4.6 IsActive is Status == ConnStatus.Active, but Reset() only runs once the client is already Terminated. So ServerLeave is never invoked and TShock doesn't clean up the player or save SSC data on leave.

 // TerrariaServerAPI/TerrariaApi.Server/Hooking/ServerHooks.cs
-if (client.IsActive)
+if (client.Status != RemoteClient.ConnStatus.Free)
 {
     _hookManager.InvokeServerLeave(client.Id);
 }

Server crashes if GNS_Wrapper can't load

If the native or one of its deps is missing (e.g. an old OpenSSL on the host), GNS_API.Startup() throws DllNotFoundException and the server dies. Probing the library at startup and setting Netplay.UseGNS = false with a warning keeps the server up on TCP only. Fix: magaflaca@0299712


Btw, I think dont need #284 in 1.4.6 cause PendingTermination was removed in this PR.


Update on the ServerLeave fix above: checking Status != Free in Reset makes it fire, but too late. 1.4.6 calls ApproveTermination() before Reset(), and that sets State = 0, so TShock's InsertPlayerData returns early (State < Complete) and SSC inventories are never saved on leave. Firing ServerLeave from ApproveTermination instead keeps the state intact, like 1.4.5.8: magaflaca@ddd66f2

Tested (SSC inventory saved and restored on relog) and confirmed working on another server running SSC.

Thanks kobo_pace for testing in this too.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants