Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Latest commit

 

History

History
42 lines (33 loc) · 3.06 KB

README.md

File metadata and controls

42 lines (33 loc) · 3.06 KB

VIGRID Server Monitor

This is a setup to add notifications when VIGRID Battle Royale servers restart.

It is vastly over architected, because that is half the fun.

Design

     ┌────────────┐        ┌──────────────┐
     │            │        │              │
┌────│   Poller   │◀───────│  vigrid.ovh  │
│    │            │        │              │
│    └────────────┘        └──────────────┘
│           │
│           │                     ┌────────────────────────────────────────┐
│           │                     │                Browser                 │
│           ▼                     │                                        │
│  ┌─────────────────┐            │                   ┌──────────────────┐ │
│  │                 │            │                   │                  │ │
│  │      nchan      │───────┐    │                ┌─▶│   Server List    │ │
│  │                 │  Websocket │                │  │                  │ │
│  └─────────────────┘       │    │  ┌───────────┐ │  └──────────────────┘ │
│                            ├────┼─▶│  Monitor  │─┤                       │
│  ┌─────────────────┐       │    │  └───────────┘ │  ┌──────────────────┐ │
│  │                 │    fetch   │                │  │                  │ │
└─▶│  servers.json   │───────┘    │                └─▶│  Notifications   │ │
   │                 │            │                   │                  │ │
   └─────────────────┘            │                   └──────────────────┘ │
                                  │                                        │
                                  └────────────────────────────────────────┘

Poller

Poller fetches the server information from vigrid.ovh every 5 seconds. It does some work to convert to the format we use, then writes it to a file, servers.json. It takes the previous state and diffs it with the new state, generating update messages. These are published to nchan, which sends them out over websocket to browsers.

In the browser we get initial state from servers.json, then begin watching for updates over the websocket connection.

Web

Vanilla web components + events.