From 5896d728b1104d22acde9b5347d5e3b77231c127 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 5 Jul 2019 14:19:10 +0100 Subject: [PATCH] add `lowerpong` criteria --- README.md | 1 + start.py | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4ba94b4..0c848d2 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Currently (2019-07-04) detects: aicia, androirc, bitchx, burd, hexchat, icechat, - `PING :123` -> `PONG :123` OR `PONG 123` (`pong_colon`) - `PONG`ing an invalidly long `PING` (`long_pong`) - `PING` tokens being cut at space (`spacepong`) +- not recognising `ping` as `PING` (`lowerpong`) - `NICK` before `USER` (`nick_first`) - `USER` disused params (`user_hostname` and `user_servername`) - ERR_NICKNAMEINUSE `` param being echoed (`nick_echo`) diff --git a/start.py b/start.py index f94108b..c3a1b9f 100755 --- a/start.py +++ b/start.py @@ -70,6 +70,7 @@ class Client(object): "pong_colon": False, "long_pong": False, "spacepong": False, + "lowerpong": False, "user_hostname": "", "user_servername": "", @@ -225,6 +226,7 @@ def _end(client): _result(client, "pong_colon", False) _result(client, "long_pong", False) _result(client, "spacepong", True) + _result(client, "lowerpong", True) _result(client, "cap") if client.criteria["cap"]: @@ -282,11 +284,13 @@ def listen(port: int, verbose: bool): new_client.snotice("\x0303%s" % line) new_client.snotice("detectin yr client lmao") - new_client.send("PING :%s" % LONG_PING) - new_client.send("PING :spacepong a") - new_client.send( ":ircfuz 005 * NAMESX :are supported by this server") + + new_client.send("PING :%s" % LONG_PING) + new_client.send("ping :lower") + new_client.send("PING :spacepong a") + else: lines = rsock.recv() if not lines: @@ -321,12 +325,20 @@ def listen(port: int, verbose: bool): client.pong_count += 1 if not " " in line.args[0] and " :" in raw_line: client.criteria["pong_colon"] = True + + if line.args[0] == "lower": + client.criteria["lowerpong"] = True + if "spacepong" in line.args[0]: client.criteria["spacepong"] = " " in line.args[0] + + if not client.criteria["lowerpong"]: + client.pong_count += 1 + if line.args[0] == LONG_PING: client.criteria["long_pong"] = True - if client.terminal_pong and client.pong_count == 2: + if client.terminal_pong and client.pong_count == 3: _end(client) break