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

View File

@@ -43,7 +43,8 @@ shared["load_modules"] = [
"cycle", "cycle",
"motd", "motd",
"abot", "abot",
"forcefield" "forcefield",
"friends"
] ]
shared["modules"] = {} shared["modules"] = {}
for module in shared["load_modules"]: for module in shared["load_modules"]: