2020-11-24 01:56:03 +00:00
|
|
|
import {LatLng} from "leaflet";
|
2020-11-23 12:13:28 +00:00
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface Window {
|
|
|
|
config: DynmapConfig
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type DynmapConfig = {
|
|
|
|
url: DynmapUrlConfig;
|
|
|
|
};
|
|
|
|
|
|
|
|
type DynmapUrlConfig = {
|
|
|
|
configuration: string;
|
|
|
|
update: string;
|
|
|
|
sendmessage: string;
|
|
|
|
login: string;
|
|
|
|
register: string;
|
|
|
|
tiles: string;
|
|
|
|
markers: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DynmapServerConfig {
|
|
|
|
version: string;
|
|
|
|
allowChat: boolean;
|
|
|
|
chatRequiresLogin: boolean;
|
|
|
|
chatInterval: number;
|
|
|
|
defaultMap?: string;
|
|
|
|
defaultWorld?: string;
|
|
|
|
defaultZoom?: number;
|
|
|
|
followMap?: string;
|
|
|
|
followZoom?: number;
|
|
|
|
updateInterval: number;
|
|
|
|
showLayerControl: boolean;
|
|
|
|
title: string;
|
|
|
|
loginEnabled: boolean;
|
|
|
|
loginRequired: boolean;
|
|
|
|
maxPlayers: number;
|
|
|
|
hash: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DynmapMessageConfig {
|
|
|
|
chatNotAllowed: string;
|
|
|
|
chatRequiresLogin: string;
|
|
|
|
chatCooldown: string;
|
|
|
|
mapTypes: string;
|
|
|
|
players: string;
|
|
|
|
playerJoin: string;
|
|
|
|
playerQuit: string;
|
|
|
|
anonymousJoin: string;
|
|
|
|
anonymousQuit: string;
|
|
|
|
}
|
|
|
|
|
2020-11-24 01:56:03 +00:00
|
|
|
interface DynmapComponentConfig {
|
|
|
|
playerMarkers?: DynmapPlayerMarkersConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DynmapPlayerMarkersConfig {
|
|
|
|
hideByDefault: boolean;
|
|
|
|
layerName: string;
|
|
|
|
layerPriority: number;
|
|
|
|
showBodies: boolean;
|
|
|
|
showSkinFaces: boolean;
|
|
|
|
showHealth: boolean;
|
|
|
|
smallFaces: boolean;
|
|
|
|
}
|
|
|
|
|
2020-11-23 12:13:28 +00:00
|
|
|
interface DynmapWorld {
|
|
|
|
seaLevel: number;
|
|
|
|
name: string;
|
|
|
|
protected: boolean;
|
|
|
|
title: string;
|
|
|
|
height: number;
|
|
|
|
center: Coordinate;
|
|
|
|
maps: Array<DynmapMap>;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DynmapMap {
|
2020-11-24 01:56:03 +00:00
|
|
|
world: DynmapWorld;
|
2020-11-23 12:13:28 +00:00
|
|
|
background: string;
|
|
|
|
backgroundDay: string;
|
|
|
|
backgroundNight: string;
|
|
|
|
compassView: string;
|
|
|
|
icon: string;
|
|
|
|
imageFormat: string;
|
|
|
|
name: string;
|
|
|
|
nightAndDay: boolean;
|
|
|
|
prefix: string;
|
|
|
|
protected: boolean;
|
|
|
|
title: string;
|
|
|
|
type: string;
|
|
|
|
mapToWorld: [number, number, number, number, number, number, number, number, number];
|
|
|
|
worldToMap: [number, number, number, number, number, number, number, number, number];
|
|
|
|
nativeZoomLevels: number;
|
|
|
|
extraZoomLevels: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Coordinate {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DynmapLocation {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
world?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DynmapConfigurationResponse {
|
|
|
|
config: DynmapServerConfig,
|
|
|
|
messages: DynmapMessageConfig,
|
|
|
|
worlds: Array<DynmapWorld>,
|
2020-11-24 01:56:03 +00:00
|
|
|
components: DynmapComponentConfig,
|
2020-11-23 12:13:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface DynmapUpdateResponse {
|
|
|
|
configHash: number;
|
|
|
|
playerCount: number;
|
|
|
|
raining: boolean;
|
|
|
|
thundering: boolean;
|
|
|
|
timeOfDay: number;
|
|
|
|
players: Array<DynmapPlayer>;
|
|
|
|
timestamp: number;
|
|
|
|
//TODO: Tiles etc
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DynmapPlayer {
|
|
|
|
account: string
|
|
|
|
armor: number
|
|
|
|
health: number
|
|
|
|
name: string
|
|
|
|
sort: number
|
|
|
|
location: DynmapLocation;
|
|
|
|
}
|
|
|
|
|
|
|
|
|