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

Last change on this file since 394 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
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 ModEvents.CalcChunkColorsDone.RegisterHandler (CalcChunkColorsDone);
12 }
13
14 private void GameStartDone () {
15 // ReSharper disable once ObjectCreationAsStatement
16 if (!ConnectionManager.Instance.IsServer) {
17 return;
18 }
19
20 webInstance = new Web ();
21 LogBuffer.Init ();
22
23 if (ItemIconHandler.Instance != null) {
24 ItemIconHandler.Instance.LoadIcons ();
25 }
26 }
27
28 private void GameShutdown () {
29 webInstance?.Shutdown ();
30 MapRendering.MapRendering.Shutdown ();
31 }
32
33 private void CalcChunkColorsDone (Chunk _chunk) {
34 MapRendering.MapRendering.RenderSingleChunk (_chunk);
35 }
36 }
37}
Note: See TracBrowser for help on using the repository browser.