|
@@ -22,6 +22,7 @@ parser.add_argument("--games", type=str, help="TWGS Games to select")
|
|
|
parser.add_argument("--name", type=str, help="Server Name for Report")
|
|
|
parser.add_argument("--report", type=str, help="Space Reports base filename")
|
|
|
parser.add_argument("--debug", action="store_true")
|
|
|
+parser.add_argument("--telnet", action="store_true")
|
|
|
parser.add_argument(
|
|
|
"--prompt", type=str, help="TWGS Custom Menu Prompt", default="Quit"
|
|
|
)
|
|
@@ -337,11 +338,17 @@ async def receiver(client_stream):
|
|
|
|
|
|
if args.debug:
|
|
|
print("receiver: started")
|
|
|
- # I need to send the rlogin connection information ...
|
|
|
- rlogin = "\x00{0}\x00{1}\x00ansi-bbs\x009600\x00".format(
|
|
|
- args.username, args.password
|
|
|
- )
|
|
|
- await client_stream.send_all(rlogin.encode("utf-8"))
|
|
|
+ if args.telnet:
|
|
|
+ cmd = await client_stream.receive_some(3)
|
|
|
+ await client_stream.send_all("\xff\xfd\xf6".encode("latin-1"))
|
|
|
+ login = "{0}\r".format(args.username)
|
|
|
+ await client_stream.send_all(login.encode("utf-8"))
|
|
|
+ else:
|
|
|
+ # I need to send the rlogin connection information ...
|
|
|
+ rlogin = "\x00{0}\x00{1}\x00ansi-bbs\x009600\x00".format(
|
|
|
+ args.username, args.password
|
|
|
+ )
|
|
|
+ await client_stream.send_all(rlogin.encode("utf-8"))
|
|
|
buffer = ""
|
|
|
async for chunk in client_stream:
|
|
|
buffer += chunk.decode("latin-1", "ignore")
|