You've already forked KF-MMO-Server
changed how props are identified
updated save frequency
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { physicsObject } from "./physicsObject"
|
||||
|
||||
export class propData{
|
||||
name : string
|
||||
id : number
|
||||
templateId : number
|
||||
rigidbody : physicsObject
|
||||
components : any
|
||||
|
||||
static copyPropStart(o: propData) {
|
||||
let pObject = Object.assign({}, o)
|
||||
@@ -13,10 +14,13 @@ export class propData{
|
||||
|
||||
static copyPropUpdate(o: propData) {
|
||||
let pObject : any = {}
|
||||
pObject.name = o.name
|
||||
pObject.id = o.id
|
||||
if(!physicsObject.isKinematic(o.rigidbody)){
|
||||
pObject.rigidbody = physicsObject.copyUpdate(o.rigidbody)
|
||||
}
|
||||
if(o.components != null){
|
||||
pObject.components = o.components
|
||||
}
|
||||
return pObject
|
||||
}
|
||||
}
|
||||
7
index.ts
7
index.ts
@@ -78,7 +78,7 @@ setInterval(() => {
|
||||
for(let i = 0; i < lobbyState.rooms.length; i++){
|
||||
console.log(lobbyState.rooms[i].id + " " + lobbyState.rooms[i].hostId)
|
||||
lobbyState.rooms[i].objects.forEach(object => {
|
||||
console.log("\t" + object.name + ": " + JSON.stringify(object.rigidbody))
|
||||
console.log("\t" + object.id + ": " + JSON.stringify(object.rigidbody))
|
||||
});
|
||||
}
|
||||
console.log("Dungeon:")
|
||||
@@ -87,6 +87,11 @@ setInterval(() => {
|
||||
}
|
||||
}, 1000)
|
||||
|
||||
setInterval(() => {
|
||||
users.saveUsers();
|
||||
players.savePlayers();
|
||||
}, 1000 * 60 * 60 * 12) //twice a day
|
||||
|
||||
process.on('SIGINT', function () {
|
||||
console.log('Ctrl-C...');
|
||||
process.exit(2);
|
||||
|
||||
Reference in New Issue
Block a user