|
|
@ -22,27 +22,27 @@ read()
|
|
|
|
|
|
|
|
|
|
|
|
needsleep = 0
|
|
|
|
needsleep = 0
|
|
|
|
while True:
|
|
|
|
while True:
|
|
|
|
if needsleep == 30:
|
|
|
|
if needsleep == 30:
|
|
|
|
needsleep = 0
|
|
|
|
needsleep = 0
|
|
|
|
sleep(30)
|
|
|
|
sleep(30)
|
|
|
|
db[i[0]] = db[i[0]] + 29
|
|
|
|
db[i[0]] = db[i[0]] + 29
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
sleep(1)
|
|
|
|
sleep(1)
|
|
|
|
needsleep += 1
|
|
|
|
needsleep += 1
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# if True:
|
|
|
|
#if True:
|
|
|
|
stats = ping.get_stats()
|
|
|
|
stats = ping.get_stats()
|
|
|
|
if stats['players']['online'] != 0:
|
|
|
|
if stats['players']['online'] != 0:
|
|
|
|
for i in stats['players']['sample']:
|
|
|
|
for i in stats['players']['sample']:
|
|
|
|
#Add in db if not in db
|
|
|
|
#Add in db if not in db
|
|
|
|
if i[0] not in db:
|
|
|
|
if i[0] not in db:
|
|
|
|
db[i[0]] = 1
|
|
|
|
db[i[0]] = 1
|
|
|
|
write()
|
|
|
|
write()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
db[i[0]] = db[i[0]] + 1
|
|
|
|
db[i[0]] = db[i[0]] + 1
|
|
|
|
write()
|
|
|
|
write()
|
|
|
|
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
print(e)
|
|
|
|
print(e)
|
|
|
|
|
|
|
|
|
|
|
|