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;
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 {

View File

@ -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) => {

View File

@ -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,