mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
added role , rank tag to spaz node
This commit is contained in:
parent
8d95248166
commit
14007f0b0e
11 changed files with 119 additions and 20 deletions
18
dist/ba_root/mods/stats/mystats.py
vendored
18
dist/ba_root/mods/stats/mystats.py
vendored
|
|
@ -4,7 +4,7 @@ damage_data = {}
|
|||
mystats module for BombSquad version 1.5.29
|
||||
Provides functionality for dumping player stats to disk between rounds.
|
||||
"""
|
||||
|
||||
ranks=[]
|
||||
import threading,json,os,urllib.request,ba,_ba,setting
|
||||
from ba._activity import Activity
|
||||
from ba._music import setmusic, MusicType
|
||||
|
|
@ -56,6 +56,7 @@ def refreshStats():
|
|||
toppers = {}
|
||||
pStats = stats
|
||||
toppersIDs=[]
|
||||
_ranks=[]
|
||||
for entry in entries:
|
||||
if True:
|
||||
rank += 1
|
||||
|
|
@ -85,6 +86,9 @@ def refreshStats():
|
|||
dmg = damage_data[aid]
|
||||
dmg = str(str(dmg).split('.')[0] + '.' + str(dmg).split('.')[1][:3])
|
||||
else: dmg = 0
|
||||
|
||||
_ranks.append(aid)
|
||||
|
||||
pStats[str(aid)]["rank"] = int(rank)
|
||||
pStats[str(aid)]["scores"] = int(scores)
|
||||
pStats[str(aid)]["total_damage"] += float(dmg) #not working properly
|
||||
|
|
@ -110,7 +114,8 @@ def refreshStats():
|
|||
</body>
|
||||
</html>''')
|
||||
f.close()
|
||||
|
||||
global ranks
|
||||
ranks=_ranks
|
||||
f2 = open(statsfile, "w")
|
||||
f2.write(json.dumps(pStats, indent=4))
|
||||
f2.close()
|
||||
|
|
@ -201,4 +206,11 @@ class UpdateThread(threading.Thread):
|
|||
now = datetime.now()
|
||||
update_time = now.strftime("%S:%M:%H - %d %b %y")
|
||||
print(f"Added {str(len(self._account_kills))} account's stats entries. || {str(update_time)}")
|
||||
refreshStats()
|
||||
refreshStats()
|
||||
|
||||
def getRank(acc_id):
|
||||
global ranks
|
||||
if ranks==[]:
|
||||
refreshStats()
|
||||
if acc_id in ranks:
|
||||
return ranks.index(acc_id)
|
||||
Loading…
Add table
Add a link
Reference in a new issue