diff --git a/Debugging.md b/Debugging.md new file mode 100644 index 0000000..1ed9311 --- /dev/null +++ b/Debugging.md @@ -0,0 +1,51 @@ +### Give yourself 'moderator' priviledges +1. Make sure that the game server is closed +2. Execute this command: + +Replace "someUser" by your username. +``` +db.user.update({username: {$eq: "someUser"}}, {$set: {moderator: true}}) +``` +3. Start the game server + +### Enabling debug console output +Execute this command in your browser's console +```javascript +DEBUG = true +``` + +## Debug API +These commands can be ran from your browser's console + +### User commands +```javascript +//Navigate to the specified world +Debug.goTo(worldX, worldY, dimension) + +//Navigate to the specified world (hex) +Debug.goTo(worldX, worldY, dimension) +``` + +### Moderator commands +```javascript +Debug.setTileAt(x, y, newTile) + +Debug.createWorld(x, y, dimension) +Debug.createWorldHex(x, y, dimension) +Debug.killAll(x, y) +Debug.objInfo(x, y) +Debug.userInfo(username) +Debug.moveObj(objectId, x, y) +Debug.tpObj(objectId, x, y, worldX, worldY, dimension) +Debug.tpObjHex(objectId, x, y, worldX, worldY, dimension) +Debug.spawnObj(data) +Debug.comPortMsg(objectId, message) +Debug.healObj(objectId, amount) +Debug.damageObj(objectId, amount) +Debug.chargeShield(objectId, amount) +Debug.setEnergy(objectId, amount) +Debug.saveGame() +Debug.popItem(objectId) +Debug.putItem(objectId, item) +Debug.setInventoryPosition(objectId, position) +``` \ No newline at end of file