TShock icon indicating copy to clipboard operation
TShock copied to clipboard

ServerAPI.Hooks.ServerLeave Never fires.

Open Zulvex opened this issue 2 years ago • 4 comments

  • TShock version: 5.2

Issue: I have been making some plugins for TShock, and I noticed there wasn't a leave message, so I tried adding one, and the event: ServerAPI.Hooks.ServerLeave never fires. I decided to look into the TShock plugin code and there is a leave message that also never displays. I have tried just printing a general console message ignoring the args and it still never displays on a player disconnecting. But the world save still happens on player disconnect so I'm not sure if other code is saving the world on disconnect or what because I can never get the event to fire.

Reproduction steps (if applicable)?

Leave the game, and the leave message never displays nor does the event even fire.

My usage: ServerApi.Hooks.ServerLeave.Register(this, OnPlayerLeave); and private void OnPlayerLeave(LeaveEventArgs args) { Console.WriteLine("OnPlayerLeave Activated!"); }

Zulvex avatar May 15 '23 05:05 Zulvex

Is your server running on x32/x86/ARM32?

Arthri avatar May 15 '23 05:05 Arthri

Oh sorry forgot to add that stuff, running it on Linux fedora ARM64

Zulvex avatar May 15 '23 06:05 Zulvex

Is this bug still reproducible? I am unable to reproduce this bug on aarch64 (debian 11 bullseye, rpi) with latest dotnet sdk v6.0.423, TShock v5.2.0 release.

image

pcider avatar Jun 01 '24 19:06 pcider

It's happening to me, TShock v5.2.4-pre2 (and with v5.2.3 and v5.1.3 too) on linux-x64, but it happens too in aarch64.

I put a log just at start of OnJoin and OnLeave events and only the OnJoin is called, I don't get any OnLeave even waiting for user timeout killing client.

When I disconnect the client a call of activelist don't shows it, so the client is successfully disconnected.

I'm using dotnet 9.0.4 on Ubuntu 24.10.

This problem makes my server unusable with SSC, because users can drop items, disconnect without TShock saving its inventory, connect again and duplicate items.

jbiosca78 avatar Apr 16 '25 14:04 jbiosca78