mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-25 06:05:52 +02:00
Archive update 0.53.1
This commit is contained in:
@@ -631,7 +631,7 @@ export class ServerActions implements IServerActions, SocketServer {
|
||||
}
|
||||
@Method({ binary: [Bin.Obj] })
|
||||
editorAction(action: EditorAction) {
|
||||
if (this.server.flags.objects && this.client.isMod) {
|
||||
if (this.server.flags.editor && this.client.isMod) {
|
||||
const added = editorAdded.get(this.client.accountId) || [];
|
||||
editorAdded.set(this.client.accountId, added);
|
||||
|
||||
|
||||
@@ -14,8 +14,12 @@ const settingsPath = paths.pathTo('settings', `settings.json`);
|
||||
|
||||
/* istanbul ignore next */
|
||||
export async function loadSettings() {
|
||||
const json = await readFileAsync(settingsPath, 'utf8');
|
||||
return JSON.parse(json) as Settings;
|
||||
try {
|
||||
const json = await readFileAsync(settingsPath, 'utf8');
|
||||
return JSON.parse(json) as Settings;
|
||||
} catch {
|
||||
return {} as Settings;
|
||||
}
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
|
||||
@@ -57,6 +57,8 @@ interface ReservedID {
|
||||
time: number;
|
||||
}
|
||||
|
||||
const MAP_SOFT_LIMIT = 10000;
|
||||
|
||||
export class World {
|
||||
season = Season.Summer;
|
||||
holiday = Holiday.None;
|
||||
@@ -488,7 +490,8 @@ export class World {
|
||||
timingEnd();
|
||||
|
||||
timingStart('cleanup unused maps');
|
||||
const mapDiscardThreshold = now - MAP_DISCARD_TIMEOUT;
|
||||
const discardTimeout = this.maps.length > MAP_SOFT_LIMIT ? 5 * MINUTE : MAP_DISCARD_TIMEOUT;
|
||||
const mapDiscardThreshold = now - discardTimeout;
|
||||
|
||||
for (const map of this.maps) {
|
||||
if (map.instance && (hasAnyClients(map) || this.mapSwitchQueue.some(q => q.map === map))) {
|
||||
|
||||
Reference in New Issue
Block a user