source: binary-improvements/MapRendering/API.cs@ 420

Last change on this file since 420 was 420, checked in by alloc, 20 months ago

A21 preparations.
NOT COMPATIBLE WITH A20 ANYMORE!

File size: 727 bytes
RevLine 
[325]1using AllocsFixes.NetConnections.Servers.Web;
2using AllocsFixes.NetConnections.Servers.Web.Handlers;
[224]3
[331]4namespace AllocsFixes {
[324]5 public class API : IModApi {
[367]6 private Web webInstance;
7
[369]8 public void InitMod (Mod _modInstance) {
[325]9 ModEvents.GameStartDone.RegisterHandler (GameStartDone);
10 ModEvents.GameShutdown.RegisterHandler (GameShutdown);
11 }
12
[337]13 private void GameStartDone () {
[324]14 // ReSharper disable once ObjectCreationAsStatement
[369]15 if (!ConnectionManager.Instance.IsServer) {
16 return;
17 }
18
[367]19 webInstance = new Web ();
[326]20 LogBuffer.Init ();
[224]21
[325]22 if (ItemIconHandler.Instance != null) {
23 ItemIconHandler.Instance.LoadIcons ();
[291]24 }
25 }
[267]26
[324]27 private void GameShutdown () {
[369]28 webInstance?.Shutdown ();
[299]29 }
[224]30 }
[325]31}
Note: See TracBrowser for help on using the repository browser.