update for now. technically speaking could some kind of fingerprinting be very usefull here
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#!/home/nonroot/import_bans/venv/bin/python3
|
||||
from settings import (get_connection)
|
||||
|
||||
def create_tables():
|
||||
with get_connection() as conn:
|
||||
with conn.cursor() as cur:
|
||||
sql_statement = """
|
||||
CREATE TABLE IF NOT EXISTS
|
||||
`unloze_anti-spoofing`.kicklist
|
||||
(
|
||||
steam_id varchar(64) not null,
|
||||
ipv4 varchar(64) not null,
|
||||
kick boolean default FALSE,
|
||||
inserted_on datetime default now(),
|
||||
primary key (steam_id, ipv4)
|
||||
)
|
||||
"""
|
||||
cur.execute(sql_statement)
|
||||
|
||||
def select_into_recent_bans():
|
||||
with get_connection() as conn:
|
||||
with conn.cursor() as cur:
|
||||
sql_statement = """
|
||||
insert IGNORE
|
||||
`unloze_anti-spoofing`.kicklist(steam_id, ipv4)
|
||||
select
|
||||
cr.steam_id, cr.ipv4
|
||||
from `unloze_anti-spoofing`.connect_restriction cr
|
||||
where cr.cooldown > NOW()
|
||||
"""
|
||||
cur.execute(sql_statement)
|
||||
|
||||
def update_kick_flag():
|
||||
with get_connection() as conn:
|
||||
with conn.cursor() as cur:
|
||||
sql_statement = """
|
||||
update `unloze_anti-spoofing`.kicklist set kick = true
|
||||
"""
|
||||
cur.execute(sql_statement)
|
||||
|
||||
def main():
|
||||
create_tables()
|
||||
print("new iteration")
|
||||
select_into_recent_bans()
|
||||
#TODO generate some fingerprints to base the kick flag being set by
|
||||
update_kick_flag()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user