Added friends module. Thanks piggly for testing! :D

This commit is contained in:
Dico
2014-07-23 00:53:24 +02:00
parent fa68622d2d
commit a962e0b6a8
2 changed files with 9 additions and 2 deletions

View File

@@ -113,6 +113,12 @@ def retrieve_player(uuid):
return server.getOfflinePlayer(juuid(uuid))
def played_before(player):
if player.getFirstPlayed() == 0:
return False
return True
def open_json_file(filename):
"""
opens the given json file and returns an object or returns None on error
@@ -131,7 +137,7 @@ def save_json_file(filename, obj):
filename is the path + name of the file.
"""
try:
with open(filename) as f:
with open(filename, "w") as f:
f.write(json_dumps(obj))
except Exception, e:
error("Failed to write to %s: %s" % (filename, e))