mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2026-08-15 13:04:30 +00:00
bug fix : missing rejoincount of new player
This commit is contained in:
parent
ff929c3474
commit
9d9ffe5e42
2 changed files with 14 additions and 4 deletions
|
|
@ -16,21 +16,26 @@ def filter(msg,pb_id,client_id):
|
|||
|
||||
now = time.time()
|
||||
|
||||
if "lastMsg" in serverdata.clients[pb_id]:
|
||||
if "lastMsgTime" in serverdata.clients[pb_id]:
|
||||
count=serverdata.clients[pb_id]["cMsgCount"]
|
||||
if now - serverdata.clients[pb_id]["lastMsg"] < 5:
|
||||
if now - serverdata.clients[pb_id]["lastMsgTime"] < 5:
|
||||
count+=1
|
||||
if count >=2:
|
||||
addWarn(pb_id,client_id)
|
||||
count =0
|
||||
else if now - serverdata.clients[pb_id]["lastMsgTime"] < 30:
|
||||
if serverdata.clients[pb_id]["lastMsg"]==msg:
|
||||
addWarn(pb_id,client_id)
|
||||
else:
|
||||
count =0
|
||||
|
||||
serverdata.clients[pb_id]['cMsgCount']=count
|
||||
serverdata.clients[pb_id]['lastMsg']=now
|
||||
serverdata.clients[pb_id]['lastMsgTime']=now
|
||||
serverdata.clients[pb_id]['lastMsg']=msg
|
||||
else:
|
||||
serverdata.clients[pb_id]['cMsgCount']=0
|
||||
serverdata.clients[pb_id]['lastMsg']=now
|
||||
serverdata.clients[pb_id]['lastMsgTime']=now
|
||||
serverdata.clients[pb_id]['lastMsg']=msg
|
||||
return new_msg
|
||||
|
||||
|
||||
|
|
|
|||
5
dist/ba_root/mods/playersData/pdata.py
vendored
5
dist/ba_root/mods/playersData/pdata.py
vendored
|
|
@ -52,6 +52,11 @@ def add_profile(id,display_string,currentname,age):
|
|||
f=open(data_path+"profiles.json","w")
|
||||
json.dump(profiles,f,indent=4)
|
||||
serverdata.clients[id]=profiles[id]
|
||||
serverdata.clients[id]["warnCount"]=0
|
||||
serverdata.clients[id]["lastWarned"]=time.time()
|
||||
serverdata.clients[id]["verified"]=False
|
||||
serverdata.clients[id]["rejoincount"]=1
|
||||
serverdata.clients[id]["lastJoin"]=time.time()
|
||||
f.close()
|
||||
|
||||
def update_displayString(id,display_string):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue