From a5b7c9617f908a9cb21544c23d578fb8ab0dcef7 Mon Sep 17 00:00:00 2001 From: kiyote Date: Sat, 29 Mar 2014 09:17:59 -0500 Subject: [PATCH] Added ['time'] attribute to Players POI It's nice that we can see where a player was at logout, but now we can see when that logout was. --- overviewer_core/aux_files/genPOI.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/overviewer_core/aux_files/genPOI.py b/overviewer_core/aux_files/genPOI.py index 5fa4b00..9ca0b92 100755 --- a/overviewer_core/aux_files/genPOI.py +++ b/overviewer_core/aux_files/genPOI.py @@ -15,6 +15,7 @@ markers.js holds a list of which markerSets are attached to each tileSet ''' import os +import time import logging import json import sys @@ -161,6 +162,8 @@ def handlePlayers(rset, render, worldpath): data['x'] = int(data['Pos'][0]) data['y'] = int(data['Pos'][1]) data['z'] = int(data['Pos'][2]) + # Time at last logout, calculated from last time the player's file was modified + data['time'] = time.ctime(os.path.getmtime(os.path.join(playerdir, playerfile)) rset._pois['Players'].append(data) if "SpawnX" in data and dimension == 0: # Spawn position (bed or main spawn)