From c202def9558cb1e92dcbb50f1a094fedb84e47cf Mon Sep 17 00:00:00 2001 From: James Lyne Date: Sat, 24 Jul 2021 15:19:30 +0100 Subject: [PATCH] Move login from configuration to components --- src/dynmap.d.ts | 2 +- src/providers/DynmapMapProvider.ts | 2 +- src/store/state.ts | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dynmap.d.ts b/src/dynmap.d.ts index b5b4099..ce92915 100644 --- a/src/dynmap.d.ts +++ b/src/dynmap.d.ts @@ -43,7 +43,6 @@ interface DynmapServerConfig { followMap?: string; followZoom: number; title: string; - loginEnabled: boolean; maxPlayers: number; grayHiddenPlayers: boolean; expandUI: boolean; @@ -60,6 +59,7 @@ interface DynmapComponentConfig { chatBox?: DynmapChatBoxConfig; chatSending?: DynmapChatSendingConfig; chatBalloons: boolean; + login: boolean; } interface DynmapMarkersConfig { diff --git a/src/providers/DynmapMapProvider.ts b/src/providers/DynmapMapProvider.ts index e7cd8d4..c5b8772 100644 --- a/src/providers/DynmapMapProvider.ts +++ b/src/providers/DynmapMapProvider.ts @@ -63,7 +63,6 @@ export default class DynmapMapProvider extends MapProvider { followMap: response.followmap || undefined, followZoom: response.followzoom || 0, title: response.title.replace(titleColoursRegex, '') || 'Dynmap', - loginEnabled: response['login-enabled'] || false, maxPlayers: response.maxcount || 0, expandUI: response.sidebaropened && response.sidebaropened !== 'false', //Sent as a string for some reason }; @@ -158,6 +157,7 @@ export default class DynmapMapProvider extends MapProvider { linkControl: false, clockControl: undefined, logoControls: [], + login: response['login-enabled'] || false, }; (response.components || []).forEach((component: any) => { diff --git a/src/store/state.ts b/src/store/state.ts index 00ca907..9e139dd 100644 --- a/src/store/state.ts +++ b/src/store/state.ts @@ -94,7 +94,6 @@ export const state: State = { followMap: '', followZoom: 0, title: '', - loginEnabled: false, maxPlayers: 0, grayHiddenPlayers: false, expandUI: false, @@ -193,7 +192,10 @@ export const state: State = { chatBox: undefined, //Chat balloons showing messages above player markers - chatBalloons: false + chatBalloons: false, + + //Login/registering (not currently implemented) + login: false, }, followTarget: undefined,