LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
289 stars 576 forks source link

🐛 possible to crash server with an area print inside a trusts onMobDeath script #4583

Open TeoTwawki opened 11 months ago

TeoTwawki commented 11 months ago

I affirm:

OS / platform the server is running (if known)

Windows Server 2022

Branch affected by issue

base

Steps to reproduce

  1. Be ina party of yoruself +1 single trust.
  2. Place a PrintToArea() call in that trusts onMobdeath
  3. dismiss the trust or let it die

Whats happening is after somewhat recent changes the party/alliance is wiped but the print binding still was using it.

During retail accurate trust use this would never happen, so we may opt to simply gracefully fail out instead and then custom death prints just become something you just cannot do.

Expected behavior

Either print the message, or gracefully fail.

TeoTwawki commented 11 months ago

in my attempt to fix this by adjusting the print function I realized this has further reaching issues than just the one I reported here - the party and alliance are being killed before onMobDeath is finished. That's pretty serious. Previously when alliance didn't exist we'd auto fallback to the party which was why checking alliance ID was safe even when there wasn't one, and checking the party was safe when you were solo because you'd count as a "party of one" but that seems to no longer be the case. My WIP sidesteps the crash, but then I saw tons of other stuff is still broken - better to fix the underlying cause.