|
|
@ -202,11 +202,13 @@ def main(): |
|
|
|
if isinstance(exception, YggdrasilError): |
|
|
|
if isinstance(exception, YggdrasilError): |
|
|
|
if (exception.yggdrasil_error == "ForbiddenOperationException" and |
|
|
|
if (exception.yggdrasil_error == "ForbiddenOperationException" and |
|
|
|
exception.yggdrasil_error == "Invalid token"): |
|
|
|
exception.yggdrasil_error == "Invalid token"): |
|
|
|
|
|
|
|
log.info("Authentication token expired. Re-authenticating with Mojang.") |
|
|
|
new_auth_token = authentication.AuthenticationToken() |
|
|
|
new_auth_token = authentication.AuthenticationToken() |
|
|
|
try: |
|
|
|
try: |
|
|
|
new_auth_token.authenticate(*credentials) |
|
|
|
new_auth_token.authenticate(*credentials) |
|
|
|
connection.auth_token = new_auth_token |
|
|
|
connection.auth_token = new_auth_token |
|
|
|
except YggdrasilError as ye: |
|
|
|
except YggdrasilError as ye: |
|
|
|
|
|
|
|
log.error("Error while re-authenticating with Mojang.") |
|
|
|
log.error(ye) |
|
|
|
log.error(ye) |
|
|
|
log.info('Reconnecting.') |
|
|
|
log.info('Reconnecting.') |
|
|
|
connection.connect() |
|
|
|
connection.connect() |
|
|
|