You've already forked KF-MMO-Server
Inventory system improvements,
stats
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { game } from "../game";
|
||||
import { userData } from "../Classes/userData";
|
||||
import { playerData } from "../Classes/playerData";
|
||||
const fs = require('fs');
|
||||
|
||||
@@ -34,13 +33,14 @@ export class players{
|
||||
files.forEach(file => {
|
||||
fs.readFile(`Database/Players/${file}`, (err, data) => {
|
||||
if (err) throw err;
|
||||
let player : playerData = JSON.parse(data);
|
||||
let player : playerData = new playerData(JSON.parse(data));
|
||||
game.playersDB.push(player);
|
||||
player.inventory.items.forEach(i=>{
|
||||
if(i.id > game.itemCount){
|
||||
game.itemCount = i.id
|
||||
}
|
||||
})
|
||||
player.validateEquipment()
|
||||
console.log(`Loaded pl ${player.id}`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user