move active features to gameplay options

This commit is contained in:
wish
2023-03-09 18:54:53 +11:00
parent 1f349a342e
commit a3b1b2841f
3 changed files with 3 additions and 3 deletions

View File

@@ -3,7 +3,6 @@
"BinPath": "bin",
"Language": "en",
"DisableSoftCrash": false,
"FeaturedWeapons": 1,
"HideLoginNotice": true,
"LoginNotice": "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9.1!<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.",
"PatchServerManifest": "",
@@ -32,6 +31,7 @@
}
},
"GameplayOptions": {
"FeaturedWeapons": 1,
"DisableLoginBoost": false,
"GuildMealDuration": 60
},

View File

@@ -16,7 +16,6 @@ type Config struct {
BinPath string `mapstructure:"BinPath"`
Language string
DisableSoftCrash bool // Disables the 'Press Return to exit' dialog allowing scripts to reboot the server automatically
FeaturedWeapons int // Number of Active Feature weapons to generate daily
HideLoginNotice bool // Hide the Erupe notice on login
LoginNotice string // MHFML string of the login notice displayed
PatchServerManifest string // Manifest patch server override
@@ -63,6 +62,7 @@ type SaveDumpOptions struct {
// GameplayOptions has various gameplay modifiers
type GameplayOptions struct {
FeaturedWeapons int // Number of Active Feature weapons to generate daily
DisableLoginBoost bool // Disables the Login Boost system
GuildMealDuration int // The number of minutes a Guild Meal can be activated for after cooking
}

View File

@@ -71,7 +71,7 @@ func handleMsgMhfGetWeeklySchedule(s *Session, p mhfpacket.MHFPacket) {
var temp activeFeature
err := s.server.db.QueryRowx(`SELECT start_time, featured FROM feature_weapon WHERE start_time=$1`, t).StructScan(&temp)
if err != nil || temp.StartTime.IsZero() {
temp = generateFeatureWeapons(s.server.erupeConfig.FeaturedWeapons)
temp = generateFeatureWeapons(s.server.erupeConfig.GameplayOptions.FeaturedWeapons)
temp.StartTime = t
s.server.db.Exec(`INSERT INTO feature_weapon VALUES ($1, $2)`, temp.StartTime, temp.ActiveFeatures)
}