mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-02-06 01:57:38 +01:00
add some gameplay options
This commit is contained in:
@@ -31,6 +31,10 @@
|
|||||||
"OutputDir": "savedata"
|
"OutputDir": "savedata"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"GameplayOptions": {
|
||||||
|
"DisableLoginBoost": false,
|
||||||
|
"GuildMealDuration": 60
|
||||||
|
},
|
||||||
"Discord": {
|
"Discord": {
|
||||||
"Enabled": false,
|
"Enabled": false,
|
||||||
"BotToken": "",
|
"BotToken": "",
|
||||||
|
|||||||
@@ -25,15 +25,16 @@ type Config struct {
|
|||||||
DeleteOnSaveCorruption bool // Attempts to save corrupted data will flag the save for deletion
|
DeleteOnSaveCorruption bool // Attempts to save corrupted data will flag the save for deletion
|
||||||
DevMode bool
|
DevMode bool
|
||||||
|
|
||||||
DevModeOptions DevModeOptions
|
DevModeOptions DevModeOptions
|
||||||
Discord Discord
|
GameplayOptions GameplayOptions
|
||||||
Commands []Command
|
Discord Discord
|
||||||
Courses []Course
|
Commands []Command
|
||||||
Database Database
|
Courses []Course
|
||||||
Sign Sign
|
Database Database
|
||||||
SignV2 SignV2
|
Sign Sign
|
||||||
Channel Channel
|
SignV2 SignV2
|
||||||
Entrance Entrance
|
Channel Channel
|
||||||
|
Entrance Entrance
|
||||||
}
|
}
|
||||||
|
|
||||||
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
||||||
@@ -60,6 +61,12 @@ type SaveDumpOptions struct {
|
|||||||
OutputDir string
|
OutputDir string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GameplayOptions has various gameplay modifiers
|
||||||
|
type GameplayOptions struct {
|
||||||
|
DisableLoginBoost bool // Disables the Login Boost system
|
||||||
|
GuildMealDuration int // The number of minutes a Guild Meal can be activated for after cooking
|
||||||
|
}
|
||||||
|
|
||||||
// Discord holds the discord integration config.
|
// Discord holds the discord integration config.
|
||||||
type Discord struct {
|
type Discord struct {
|
||||||
Enabled bool
|
Enabled bool
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ func handleMsgMhfGetKeepLoginBoostStatus(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
|
|
||||||
var loginBoosts []loginBoost
|
var loginBoosts []loginBoost
|
||||||
rows, err := s.server.db.Queryx("SELECT week_req, expiration, reset FROM login_boost WHERE char_id=$1 ORDER BY week_req", s.charID)
|
rows, err := s.server.db.Queryx("SELECT week_req, expiration, reset FROM login_boost WHERE char_id=$1 ORDER BY week_req", s.charID)
|
||||||
if err != nil {
|
if err != nil || s.server.erupeConfig.GameplayOptions.DisableLoginBoost {
|
||||||
doAckBufSucceed(s, pkt.AckHandle, make([]byte, 35))
|
doAckBufSucceed(s, pkt.AckHandle, make([]byte, 35))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1772,7 +1772,7 @@ func handleMsgMhfLoadGuildCooking(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
func handleMsgMhfRegistGuildCooking(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgMhfRegistGuildCooking(s *Session, p mhfpacket.MHFPacket) {
|
||||||
pkt := p.(*mhfpacket.MsgMhfRegistGuildCooking)
|
pkt := p.(*mhfpacket.MsgMhfRegistGuildCooking)
|
||||||
guild, _ := GetGuildInfoByCharacterId(s, s.charID)
|
guild, _ := GetGuildInfoByCharacterId(s, s.charID)
|
||||||
currentTime := TimeAdjusted()
|
currentTime := TimeAdjusted().Add(time.Duration(s.server.erupeConfig.GameplayOptions.GuildMealDuration-60) * time.Minute)
|
||||||
if pkt.OverwriteID != 0 {
|
if pkt.OverwriteID != 0 {
|
||||||
s.server.db.Exec("UPDATE guild_meals SET meal_id = $1, level = $2, created_at = $3 WHERE id = $4", pkt.MealID, pkt.Success, currentTime, pkt.OverwriteID)
|
s.server.db.Exec("UPDATE guild_meals SET meal_id = $1, level = $2, created_at = $3 WHERE id = $4", pkt.MealID, pkt.Success, currentTime, pkt.OverwriteID)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user