Update __init__.py
This commit is contained in:
parent
78d13c17cb
commit
128c7c4c60
1 changed files with 23 additions and 20 deletions
|
@ -18,28 +18,31 @@ async def main(msg: MessageSession):
|
|||
enabled_addon = True
|
||||
gather_list = []
|
||||
matchObj = re.match(r'(.*)[\s:](.*)', msg.parsed_msg["<ServerIP:Port>"], re.M | re.I)
|
||||
server_address = msg.parsed_msg["<ServerIP:Port>"]
|
||||
if matchObj:
|
||||
matchserip = re.match(r'(.*?)\.(.*?)\.(.*?)\.(.*?)', matchObj.group(1))
|
||||
if matchserip:
|
||||
try:
|
||||
is_local_ip = False
|
||||
if matchserip.group(1) == '192':
|
||||
if matchserip.group(2) == '168':
|
||||
server_address = matchObj.group(1)
|
||||
|
||||
matchserip = re.match(r'(.*?)\.(.*?)\.(.*?)\.(.*?)', server_address)
|
||||
if matchserip:
|
||||
try:
|
||||
is_local_ip = False
|
||||
if matchserip.group(1) == '192':
|
||||
if matchserip.group(2) == '168':
|
||||
is_local_ip = True
|
||||
if matchserip.group(1) == '172':
|
||||
if 16 <= int(matchserip.group(2)) <= 31:
|
||||
is_local_ip = True
|
||||
if matchserip.group(1) == '10':
|
||||
if 0 <= int(matchserip.group(2)) <= 255:
|
||||
is_local_ip = True
|
||||
if matchserip.group(1) == '0':
|
||||
if matchserip.group(2) == '0':
|
||||
if matchserip.group(3) == '0':
|
||||
is_local_ip = True
|
||||
if matchserip.group(1) == '172':
|
||||
if 16 <= int(matchserip.group(2)) <= 31:
|
||||
is_local_ip = True
|
||||
if matchserip.group(1) == '10':
|
||||
if 0 <= int(matchserip.group(2)) <= 255:
|
||||
is_local_ip = True
|
||||
if matchserip.group(1) == '0':
|
||||
if matchserip.group(2) == '0':
|
||||
if matchserip.group(3) == '0':
|
||||
is_local_ip = True
|
||||
if is_local_ip:
|
||||
return await msg.sendMessage('你最好有事')
|
||||
except:
|
||||
traceback.print_exc()
|
||||
if is_local_ip:
|
||||
return await msg.sendMessage('你最好有事')
|
||||
except:
|
||||
traceback.print_exc()
|
||||
sm = ['j', 'b']
|
||||
for x in sm:
|
||||
gather_list.append(asyncio.ensure_future(s(
|
||||
|
|
Reference in a new issue