Added loading of properties
This commit is contained in:
@@ -57,6 +57,11 @@ py_players = Py_players()
|
|||||||
|
|
||||||
@async(daemon=True)
|
@async(daemon=True)
|
||||||
def fetch_player(player):
|
def fetch_player(player):
|
||||||
|
properties = (player.uuid, player.name, player.nickname, player.registered,
|
||||||
|
player.password, player.banned,
|
||||||
|
player.banned_reason, player.played_time,
|
||||||
|
player.last_login, player.first_seen)
|
||||||
|
|
||||||
with mysql_connect() as sql:
|
with mysql_connect() as sql:
|
||||||
sql.execute("SELECT * FROM utils_players WHERE uuid = ?", (player.uuid,))
|
sql.execute("SELECT * FROM utils_players WHERE uuid = ?", (player.uuid,))
|
||||||
result = sql.fetchall()
|
result = sql.fetchall()
|
||||||
@@ -68,13 +73,16 @@ def fetch_player(player):
|
|||||||
banned_reason, played_time, last_login, first_seen) \
|
banned_reason, played_time, last_login, first_seen) \
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||||
|
|
||||||
args=(player.uuid, player.name, player.nickname, player.registered,
|
args=properties)
|
||||||
player.password, player.banned,
|
|
||||||
player.banned_reason, player.played_time,
|
elif len(result) is 1:
|
||||||
player.last_login, player.first_seen))
|
props = result[0]
|
||||||
else:
|
print props
|
||||||
pass
|
for prop in properties:
|
||||||
#test
|
prop = props[properties.index(prop)]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@hook.event("player.PlayerJoinEvent","lowest")
|
@hook.event("player.PlayerJoinEvent","lowest")
|
||||||
|
|||||||
Reference in New Issue
Block a user