Update README.md, colors.txt, config.sh, and 10 more files for alpha v0.3
This commit is contained in:
parent
a08a86dc40
commit
6d9651b4ff
13 changed files with 449 additions and 109 deletions
|
|
@ -103,7 +103,8 @@ function fetchWorldStatus_%%current_world_key%%() {
|
|||
|
||||
function fetchDataForElement(elementId, filePath, isRawText, prefixText, suffixText, isJsonPlayerList) {
|
||||
const el = document.getElementById(elementId);
|
||||
if (!el && !isJsonPlayerList) return;
|
||||
if (!el && !isJsonPlayerList) return;
|
||||
|
||||
fetch('/' + filePath + '?v=%%CACHE_BUSTER%%&t=' + new Date().getTime())
|
||||
.then(r => { if (!r.ok) throw new Error('Datei ' + filePath + ' nicht erreichbar (' + r.status + ')'); return r.text(); })
|
||||
.then(t => {
|
||||
|
|
@ -111,9 +112,10 @@ function fetchDataForElement(elementId, filePath, isRawText, prefixText, suffixT
|
|||
if (t.trim() === "") {
|
||||
content = (elementId.startsWith("map-last-update") ? "<em>unbekannt</em>" : "<em>Keine Daten verfügbar.</em>");
|
||||
if (isJsonPlayerList && window.playerListLogic_%%current_world_key%%) {
|
||||
window.playerListLogic_%%current_world_key%%.masterPlayerData = {};
|
||||
window.playerListLogic_%%current_world_key%%.updatePlayerMarkers({});
|
||||
window.playerListLogic_%%current_world_key%%.applyPlayerFiltersAndRender();
|
||||
const logic = window.playerListLogic_%%current_world_key%%;
|
||||
logic.masterPlayerData = {};
|
||||
logic.updatePlayerMarkers({});
|
||||
logic.applyPlayerFiltersAndRender();
|
||||
}
|
||||
} else {
|
||||
if (isJsonPlayerList && window.playerListLogic_%%current_world_key%%) {
|
||||
|
|
@ -125,7 +127,11 @@ function fetchDataForElement(elementId, filePath, isRawText, prefixText, suffixT
|
|||
logic.applyPlayerFiltersAndRender();
|
||||
} catch (e) { console.error("Fehler beim Parsen der Spielerdaten:", e); }
|
||||
return;
|
||||
} else { content = isRawText ? t.replace(/\n/g, '<br>') : t; }
|
||||
} else {
|
||||
const dv = document.createElement('div');
|
||||
dv.textContent = t;
|
||||
content = dv.innerHTML.replace(/\n/g, '<br>');
|
||||
}
|
||||
}
|
||||
if(el) { el.innerHTML = (prefixText || '') + content + (suffixText || ''); }
|
||||
}).catch(e => {
|
||||
|
|
@ -168,6 +174,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
// Periodische Updates
|
||||
setInterval(fetchWorldStatus_%%current_world_key%%, 60000);
|
||||
setInterval(() => fetchDataForElement('map-last-update-text-%%current_world_key%%', '%%web_last_update_rel_path%%', true, '', ''), 60000);
|
||||
setInterval(() => fetchDataForElement('player-info-%%current_world_key%%', '%%web_players_txt_rel_path%%', false, '', '', true), 70000);
|
||||
// KORREKTUR: Intervall von 70000ms auf 30000ms (30 Sekunden) geändert
|
||||
setInterval(() => fetchDataForElement('player-info-%%current_world_key%%', '%%web_players_txt_rel_path%%', false, '', '', true), 30000);
|
||||
setInterval(() => fetchDataForElement('weather-info-%%current_world_key%%', '%%web_weather_txt_rel_path%%', true, '<p><strong>Wetter:</strong> ', '</p>'), 300000);
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue