diff --git a/dist/ba_root/mods/chatHandle/chatFilter/ChatFilter.py b/dist/ba_root/mods/chatHandle/chatFilter/ChatFilter.py index 15708b0..5b9a130 100644 --- a/dist/ba_root/mods/chatHandle/chatFilter/ChatFilter.py +++ b/dist/ba_root/mods/chatHandle/chatFilter/ChatFilter.py @@ -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 diff --git a/dist/ba_root/mods/playersData/pdata.py b/dist/ba_root/mods/playersData/pdata.py index 462cf32..cece0de 100644 --- a/dist/ba_root/mods/playersData/pdata.py +++ b/dist/ba_root/mods/playersData/pdata.py @@ -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):