mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 23:44:52 +01:00
add account creation toggle
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
"FeaturedWeapons": 2,
|
"FeaturedWeapons": 2,
|
||||||
"DevMode": true,
|
"DevMode": true,
|
||||||
"DevModeOptions": {
|
"DevModeOptions": {
|
||||||
|
"AutoCreateAccount": true,
|
||||||
"EnableLauncherServer": false,
|
"EnableLauncherServer": false,
|
||||||
"HideLoginNotice": false,
|
"HideLoginNotice": false,
|
||||||
"LoginNotice": "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9.1 Beta!<BR><BODY><LEFT><SIZE_2><C_5>Erupe is experimental software<C_7>, we are not liable for any<BR><BODY>issues caused by installing the software!<BR><BODY><BR><BODY><C_4>■Report bugs on Discord!<C_7><BR><BODY><BR><BODY><C_4>■Test everything!<C_7><BR><BODY><BR><BODY><C_4>■Don't talk to softlocking NPCs!<C_7><BR><BODY><BR><BODY><C_4>■Fork the code on GitHub!<C_7><BR><BODY><BR><BODY>Thank you to all of the contributors,<BR><BODY><BR><BODY>this wouldn't exist without you.",
|
"LoginNotice": "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9.1 Beta!<BR><BODY><LEFT><SIZE_2><C_5>Erupe is experimental software<C_7>, we are not liable for any<BR><BODY>issues caused by installing the software!<BR><BODY><BR><BODY><C_4>■Report bugs on Discord!<C_7><BR><BODY><BR><BODY><C_4>■Test everything!<C_7><BR><BODY><BR><BODY><C_4>■Don't talk to softlocking NPCs!<C_7><BR><BODY><BR><BODY><C_4>■Fork the code on GitHub!<C_7><BR><BODY><BR><BODY>Thank you to all of the contributors,<BR><BODY><BR><BODY>this wouldn't exist without you.",
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ type Config struct {
|
|||||||
|
|
||||||
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
||||||
type DevModeOptions struct {
|
type DevModeOptions struct {
|
||||||
|
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
||||||
HideLoginNotice bool // Hide the Erupe notice on login
|
HideLoginNotice bool // Hide the Erupe notice on login
|
||||||
LoginNotice string // MHFML string of the login notice displayed
|
LoginNotice string // MHFML string of the login notice displayed
|
||||||
CleanDB bool // Automatically wipes the DB on server reset.
|
CleanDB bool // Automatically wipes the DB on server reset.
|
||||||
|
|||||||
@@ -93,12 +93,15 @@ func (s *Session) handleDSGNRequest(bf *byteframe.ByteFrame) error {
|
|||||||
s.logger.Info("Account not found", zap.String("reqUsername", reqUsername))
|
s.logger.Info("Account not found", zap.String("reqUsername", reqUsername))
|
||||||
serverRespBytes = makeSignInFailureResp(SIGN_EAUTH)
|
serverRespBytes = makeSignInFailureResp(SIGN_EAUTH)
|
||||||
|
|
||||||
// HACK(Andoryuuta): Create a new account if it doesn't exit.
|
if s.server.erupeConfig.DevMode && s.server.erupeConfig.DevModeOptions.AutoCreateAccount {
|
||||||
s.logger.Info("Creating account", zap.String("reqUsername", reqUsername), zap.String("reqPassword", reqPassword))
|
s.logger.Info("Creating account", zap.String("reqUsername", reqUsername), zap.String("reqPassword", reqPassword))
|
||||||
err = s.server.registerDBAccount(reqUsername, reqPassword)
|
err = s.server.registerDBAccount(reqUsername, reqPassword)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.logger.Info("Error on creating new account", zap.Error(err))
|
s.logger.Info("Error on creating new account", zap.Error(err))
|
||||||
serverRespBytes = makeSignInFailureResp(SIGN_EABORT)
|
serverRespBytes = makeSignInFailureResp(SIGN_EABORT)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user