-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CNREL support #2076
CNREL support #2076
Conversation
// Send response. | ||
ctx.json(responseData); | ||
|
||
// Log to console. | ||
Grasscutter.getLogger().info(translate("messages.dispatch.account.login_attempt", ctx.ip())); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave the new line at the end of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing the messages.status.versionos
key from the languages file. As the message is more of a 'debug message' instead of a critical message for the server administrator, it makes more sense to keep this message hardcoded in existing places. (and to switch the log level for these messages from info
to debug
)
.getSessionKeyAuthenticator() | ||
.authenticate(AuthenticationSystem.fromComboTokenRequest(ctx, bodyData, tokenData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintain spacing.
.getTokenAuthenticator() | ||
.authenticate(AuthenticationSystem.fromTokenRequest(ctx, bodyData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintain spacing.
.getPasswordAuthenticator() | ||
.authenticate(AuthenticationSystem.fromPasswordRequest(ctx, bodyData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintain spacing.
.handleLogin(AuthenticationSystem.fromExternalRequest(ctx))); | ||
javalin.post("/authentication/register", ctx -> Grasscutter.getAuthenticationSystem().getExternalAuthenticator() | ||
.handleAccountCreation(AuthenticationSystem.fromExternalRequest(ctx))); | ||
.handleAccountCreation(AuthenticationSystem.fromExternalRequest(ctx))); | ||
javalin.post("/authentication/change_password", ctx -> Grasscutter.getAuthenticationSystem().getExternalAuthenticator() | ||
.handlePasswordReset(AuthenticationSystem.fromExternalRequest(ctx))); | ||
.handlePasswordReset(AuthenticationSystem.fromExternalRequest(ctx))); | ||
|
||
// External login (from OAuth2). | ||
javalin.post("/hk4e_global/mdk/shield/api/loginByThirdparty", ctx -> Grasscutter.getAuthenticationSystem().getOAuthAuthenticator() | ||
.handleLogin(AuthenticationSystem.fromExternalRequest(ctx))); | ||
.handleLogin(AuthenticationSystem.fromExternalRequest(ctx))); | ||
javalin.get("/authentication/openid/redirect", ctx -> Grasscutter.getAuthenticationSystem().getOAuthAuthenticator() | ||
.handleTokenProcess(AuthenticationSystem.fromExternalRequest(ctx))); | ||
.handleTokenProcess(AuthenticationSystem.fromExternalRequest(ctx))); | ||
javalin.get("/Api/twitter_login", ctx -> Grasscutter.getAuthenticationSystem().getOAuthAuthenticator() | ||
.handleRedirection(AuthenticationSystem.fromExternalRequest(ctx), ClientType.DESKTOP)); | ||
.handleRedirection(AuthenticationSystem.fromExternalRequest(ctx), ClientType.DESKTOP)); | ||
javalin.get("/sdkTwitterLogin.html", ctx -> Grasscutter.getAuthenticationSystem().getOAuthAuthenticator() | ||
.handleRedirection(AuthenticationSystem.fromExternalRequest(ctx), ClientType.MOBILE)); | ||
.handleRedirection(AuthenticationSystem.fromExternalRequest(ctx), ClientType.MOBILE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintain spacing.
// Use the CN region list. | ||
QueryAllRegionsEvent event = new QueryAllRegionsEvent(regionListResponsecn); | ||
event.call(); | ||
logger.info(translate("messages.status.versioncn")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.info(translate("messages.status.versioncn")); | |
logger.debug(translate("messages.status.versioncn")); |
// Use the OS region list. | ||
QueryAllRegionsEvent event = new QueryAllRegionsEvent(regionListResponse); | ||
event.call(); | ||
logger.info(translate("messages.status.versionos")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.info(translate("messages.status.versionos")); | |
logger.debug(translate("messages.status.versionos")); |
// Use the default region list. | ||
QueryAllRegionsEvent event = new QueryAllRegionsEvent(regionListResponse); | ||
event.call(); | ||
logger.info(translate("messages.status.versionos")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.info(translate("messages.status.versionos")); | |
logger.debug(translate("messages.status.versionos")); |
// Use the default region list. | ||
QueryAllRegionsEvent event = new QueryAllRegionsEvent(regionListResponse); | ||
event.call(); | ||
logger.info(translate("messages.status.versionos")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.info(translate("messages.status.versionos")); | |
logger.debug(translate("messages.status.versionos")); |
Already deleted the language keys and hardcoded the debug output |
can you/someone else test it and send a video of it working here? (with debug logs on preferably) |
CNREL.mp4 |
Description
Please carefully read the Contributing note and Code of conduct before making any pull requests.
And, Do not make a pull request to merge into stable unless it is a hotfix. Use the development branch instead.
Issues fixed by this PR
Fix CNREL client can't be played
Special thanks to @xlpmyxhdr
Type of changes
Checklist: