@zardoy/flying-squid 0.0.79 → 0.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ export interface PlayerStatsStore {
7
7
  meta?: {
8
8
  firstLoginMs?: number;
9
9
  lastLoginMs?: number;
10
+ username?: string;
10
11
  };
11
12
  }
12
13
  export declare const server: (serv: Server, options: Options) => void;
@@ -98,11 +98,9 @@ const server = function (serv, options) {
98
98
  const uuids = Array.from(dirtyStores.values());
99
99
  await Promise.all(uuids.map((uuid) => serv.savePlayerDataToDisk(uuid)));
100
100
  };
101
- // Flush periodically and on shutdown
102
- const interval = serv.setInterval(async () => {
103
- await serv.saveAllPlayerDataToDisk();
104
- }, 30_000);
105
- serv.cleanupFunctions.push(() => clearInterval(interval));
101
+ serv.cleanupFunctions.push(() => {
102
+ serv.saveAllPlayerDataToDisk();
103
+ });
106
104
  };
107
105
  exports.server = server;
108
106
  const player = function (player, serv, options) {
@@ -120,6 +118,7 @@ const player = function (player, serv, options) {
120
118
  if (!player.db.meta.firstLoginMs)
121
119
  player.db.meta.firstLoginMs = now;
122
120
  player.db.meta.lastLoginMs = now;
121
+ player.db.meta.username = player.username;
123
122
  await serv.savePlayerDataToDisk(player.uuid);
124
123
  });
125
124
  // Count placed blocks attempts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zardoy/flying-squid",
3
3
  "description": "A minecraft server written in TS",
4
- "version": "0.0.79",
4
+ "version": "0.0.80",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "bin": "dist/app.js",