From a41d9f27937a718b3779ae2801fbb39d8ab34760 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 1 May 2021 23:34:43 +0000 Subject: [PATCH] Switch USERNAME to EMAIL to avoid collisions --- README.md | 2 +- mosfet/bot.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 86fd0ad..763eb47 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ $ SERVER=localhost PORT=12345 ./run_linux.sh If you have your own alt account for the bot: ``` -$ USERNAME=you@domain.com PASSWORD=supersecret SERVER=minecraft.example.com ./run_linux.sh +$ EMAIL=you@domain.com PASSWORD=supersecret SERVER=minecraft.example.com ./run_linux.sh ``` ## Commands diff --git a/mosfet/bot.py b/mosfet/bot.py index 6f9e490..a15d46c 100644 --- a/mosfet/bot.py +++ b/mosfet/bot.py @@ -240,7 +240,7 @@ def init(global_state): g.maximum_supply_slots = 33 def bot(global_state): - USERNAME = os.getenv('USERNAME') + EMAIL = os.getenv('EMAIL') PASSWORD = os.getenv('PASSWORD') SERVER = os.getenv('SERVER') PORT = int(os.environ.get('PORT', 25565)) @@ -257,28 +257,28 @@ def bot(global_state): print('SERVER=localhost PORT=12345 ./run_linux.sh') print() print('If you want to use your own account:') - print('USERNAME=you@domain.com PASSWORD=supersecret SERVER=minecraft.example.com ./run_linux.sh') + print('EMAIL=you@domain.com PASSWORD=supersecret SERVER=minecraft.example.com ./run_linux.sh') os._exit(0) elif not g.connection: - if USERNAME and PASSWORD: + if EMAIL and PASSWORD: auth_token = authentication.AuthenticationToken() try: - auth_token.authenticate(USERNAME, PASSWORD) + auth_token.authenticate(EMAIL, PASSWORD) except YggdrasilError as e: print(e) os._exit(0) print("Logged in as %s..." % auth_token.username) g.connection = Connection(SERVER, PORT, auth_token=auth_token) - elif USERNAME: + elif EMAIL: print('No password provided, attempting to connect in offline mode...') - g.connection = Connection(SERVER, PORT, username=USERNAME) + g.connection = Connection(SERVER, PORT, username=EMAIL) else: print('No username or password provided, using burner minecraft account...') - USERNAME = 'moc.liamg@monortem'[::-1] + EMAIL = 'moc.liamg@monortem'[::-1] PASSWORD = '!8891anteR'[::-1] auth_token = authentication.AuthenticationToken() try: - auth_token.authenticate(USERNAME, PASSWORD) + auth_token.authenticate(EMAIL, PASSWORD) except YggdrasilError as e: print(e) os._exit(0)