mirror of
https://github.com/solero/houdini.git
synced 2024-11-21 21:17:21 +00:00
Only allow login packets to be sent once per-connection
This commit is contained in:
parent
ffd70949fc
commit
5a77c09ac7
@ -16,6 +16,7 @@ from datetime import datetime
|
||||
|
||||
|
||||
@Handlers.handler(XMLPacket('login'))
|
||||
@Handlers.allow_once()
|
||||
async def handle_login(p, credentials: CredentialsConverter):
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
|
@ -4,6 +4,7 @@ from Houdini.Converters import VersionChkConverter
|
||||
|
||||
|
||||
@Handlers.handler(XMLPacket('verChk'))
|
||||
@Handlers.allow_once()
|
||||
async def handle_version_check(p, version: VersionChkConverter):
|
||||
if not version == 153:
|
||||
await p.send_xml({'body': {'action': 'apiKO', 'r': '0'}})
|
||||
@ -13,5 +14,6 @@ async def handle_version_check(p, version: VersionChkConverter):
|
||||
|
||||
|
||||
@Handlers.handler(XMLPacket('rndK'))
|
||||
@Handlers.allow_once()
|
||||
async def handle_random_key(p, data):
|
||||
await p.send_xml({'body': {'action': 'rndK', 'r': '-1'}, 'k': 'houdini'})
|
||||
|
Loading…
Reference in New Issue
Block a user