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

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

A21 preparations.
NOT COMPATIBLE WITH A20 ANYMORE!

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