|
Last change
on this file since 368 was 367, checked in by alloc, 5 years ago |
|
Web:
- Added SSE (ServerSentEvents) subsystem
- Added log endpoint to SSE. Less heavy weight and more responsive way of watching the server log
- Bunch of refactoring
|
|
File size:
870 bytes
|
| Rev | Line | |
|---|
| [325] | 1 | using AllocsFixes.NetConnections.Servers.Web;
|
|---|
| 2 | using AllocsFixes.NetConnections.Servers.Web.Handlers;
|
|---|
| [224] | 3 |
|
|---|
| [331] | 4 | namespace AllocsFixes {
|
|---|
| [324] | 5 | public class API : IModApi {
|
|---|
| [367] | 6 | private Web webInstance;
|
|---|
| 7 |
|
|---|
| [325] | 8 | public void InitMod () {
|
|---|
| 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
|
|---|
| [367] | 16 | webInstance = new Web ();
|
|---|
| [326] | 17 | LogBuffer.Init ();
|
|---|
| [224] | 18 |
|
|---|
| [325] | 19 | if (ItemIconHandler.Instance != null) {
|
|---|
| 20 | ItemIconHandler.Instance.LoadIcons ();
|
|---|
| [291] | 21 | }
|
|---|
| 22 | }
|
|---|
| [267] | 23 |
|
|---|
| [324] | 24 | private void GameShutdown () {
|
|---|
| [367] | 25 | webInstance.Shutdown ();
|
|---|
| [351] | 26 | MapRendering.MapRendering.Shutdown ();
|
|---|
| [299] | 27 | }
|
|---|
| 28 |
|
|---|
| [324] | 29 | private void CalcChunkColorsDone (Chunk _chunk) {
|
|---|
| [351] | 30 | MapRendering.MapRendering.RenderSingleChunk (_chunk);
|
|---|
| [224] | 31 | }
|
|---|
| 32 | }
|
|---|
| [325] | 33 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.