Ignore:
Timestamp:
Jul 29, 2024, 4:48:56 PM (4 months ago)
Author:
alloc
Message:

Fixed NRE when using APIs while server is shutting down

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TFP-WebServer/WebServer/src/ModApi.cs

    r404 r500  
    1212                public void InitMod (Mod _modInstance) {
    1313                        ModEvents.GameStartDone.RegisterHandler (GameStartDone);
    14                         ModEvents.GameShutdown.RegisterHandler (GameShutdown);
     14                        ModEvents.WorldShuttingDown.RegisterHandler (WorldShuttingDown);
    1515                        modInstance = _modInstance;
    1616
     
    3131                }
    3232
    33                 private void GameShutdown () {
    34                         webInstance?.Shutdown ();
     33                private void WorldShuttingDown () {
     34                        webInstance?.Disconnect ();
    3535                }
    3636        }
Note: See TracChangeset for help on using the changeset viewer.