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

Last change on this file since 398 was 369, checked in by alloc, 3 years ago

Preparations for A20 release
Changes usage of "SteamID" to "UserID" in console commands
Also changes a bunch of the WebAPI stuff to show / use UserIDs

File size: 955 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 ModEvents.CalcChunkColorsDone.RegisterHandler (CalcChunkColorsDone);
12 }
13
[337]14 private void GameStartDone () {
[324]15 // ReSharper disable once ObjectCreationAsStatement
[369]16 if (!ConnectionManager.Instance.IsServer) {
17 return;
18 }
19
[367]20 webInstance = new Web ();
[326]21 LogBuffer.Init ();
[224]22
[325]23 if (ItemIconHandler.Instance != null) {
24 ItemIconHandler.Instance.LoadIcons ();
[291]25 }
26 }
[267]27
[324]28 private void GameShutdown () {
[369]29 webInstance?.Shutdown ();
[351]30 MapRendering.MapRendering.Shutdown ();
[299]31 }
32
[324]33 private void CalcChunkColorsDone (Chunk _chunk) {
[351]34 MapRendering.MapRendering.RenderSingleChunk (_chunk);
[224]35 }
36 }
[325]37}
Note: See TracBrowser for help on using the repository browser.