Move login from configuration to components

This commit is contained in:
James Lyne 2021-07-24 15:19:30 +01:00
parent e46a97df15
commit c202def955
3 changed files with 6 additions and 4 deletions

2
src/dynmap.d.ts vendored
View File

@ -43,7 +43,6 @@ interface DynmapServerConfig {
followMap?: string; followMap?: string;
followZoom: number; followZoom: number;
title: string; title: string;
loginEnabled: boolean;
maxPlayers: number; maxPlayers: number;
grayHiddenPlayers: boolean; grayHiddenPlayers: boolean;
expandUI: boolean; expandUI: boolean;
@ -60,6 +59,7 @@ interface DynmapComponentConfig {
chatBox?: DynmapChatBoxConfig; chatBox?: DynmapChatBoxConfig;
chatSending?: DynmapChatSendingConfig; chatSending?: DynmapChatSendingConfig;
chatBalloons: boolean; chatBalloons: boolean;
login: boolean;
} }
interface DynmapMarkersConfig { interface DynmapMarkersConfig {

View File

@ -63,7 +63,6 @@ export default class DynmapMapProvider extends MapProvider {
followMap: response.followmap || undefined, followMap: response.followmap || undefined,
followZoom: response.followzoom || 0, followZoom: response.followzoom || 0,
title: response.title.replace(titleColoursRegex, '') || 'Dynmap', title: response.title.replace(titleColoursRegex, '') || 'Dynmap',
loginEnabled: response['login-enabled'] || false,
maxPlayers: response.maxcount || 0, maxPlayers: response.maxcount || 0,
expandUI: response.sidebaropened && response.sidebaropened !== 'false', //Sent as a string for some reason 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, linkControl: false,
clockControl: undefined, clockControl: undefined,
logoControls: [], logoControls: [],
login: response['login-enabled'] || false,
}; };
(response.components || []).forEach((component: any) => { (response.components || []).forEach((component: any) => {

View File

@ -94,7 +94,6 @@ export const state: State = {
followMap: '', followMap: '',
followZoom: 0, followZoom: 0,
title: '', title: '',
loginEnabled: false,
maxPlayers: 0, maxPlayers: 0,
grayHiddenPlayers: false, grayHiddenPlayers: false,
expandUI: false, expandUI: false,
@ -193,7 +192,10 @@ export const state: State = {
chatBox: undefined, chatBox: undefined,
//Chat balloons showing messages above player markers //Chat balloons showing messages above player markers
chatBalloons: false chatBalloons: false,
//Login/registering (not currently implemented)
login: false,
}, },
followTarget: undefined, followTarget: undefined,