Skip to content

Commit

Permalink
structure & change config for MezFes
Browse files Browse the repository at this point in the history
  • Loading branch information
sekaiwish committed Nov 26, 2023
1 parent a0fbfc2 commit dfc359f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 33 deletions.
3 changes: 1 addition & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"DivaEvent": 0,
"FestaEvent": -1,
"TournamentEvent": 0,
"MezFesEvent": true,
"MezFesAlt": false,
"DisableTokenCheck": false,
"QuestDebugTools": false,
"EarthStatusOverride": 0,
Expand Down Expand Up @@ -66,6 +64,7 @@
"ExtraCarves": 0,
"DisableHunterNavi": false,
"MezFesDuration": 172800,
"MezFesSwitchMinigame": false,
"EnableKaijiEvent": false,
"EnableHiganjimaEvent": false,
"EnableNierEvent": false,
Expand Down
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ type DevModeOptions struct {
DivaEvent int // Diva Defense event status
FestaEvent int // Hunter's Festa event status
TournamentEvent int // VS Tournament event status
MezFesEvent bool // MezFes status
MezFesAlt bool // Swaps out Volpakkun for Tokotoko
DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!)
QuestDebugTools bool // Enable various quest debug logs
EarthStatusOverride int32
Expand Down Expand Up @@ -152,6 +150,7 @@ type GameplayOptions struct {
ExtraCarves uint16 // Grant n extra chances to carve ALL carcasses
DisableHunterNavi bool // Disables the Hunter Navi
MezFesDuration int // Seconds that MezFes will last for weekly (from 12AM Mon backwards)
MezFesSwitchMinigame bool // Swaps out Volpakkun Together for Tokotoko Partnya
EnableKaijiEvent bool // Enables the Kaiji event in the Rasta Bar
EnableHiganjimaEvent bool // Enables the Higanjima event in the Rasta Bar
EnableNierEvent bool // Enables the Nier event in the Rasta Bar
Expand Down
53 changes: 24 additions & 29 deletions server/signserver/dsgn_resp.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,35 +155,30 @@ func (s *Session) makeSignResponse(uid uint32) []byte {
bf.WriteUint32(uint32(s.server.getReturnExpiry(uid).Unix()))
bf.WriteUint32(0)

mezfes := s.server.erupeConfig.DevModeOptions.MezFesEvent
alt := s.server.erupeConfig.DevModeOptions.MezFesAlt
if mezfes {
// We can just use the start timestamp as the event ID
bf.WriteUint32(uint32(channelserver.TimeWeekStart().Unix()))
// Start time
bf.WriteUint32(uint32(channelserver.TimeWeekNext().Add(-time.Duration(s.server.erupeConfig.GameplayOptions.MezFesDuration) * time.Second).Unix()))
// End time
bf.WriteUint32(uint32(channelserver.TimeWeekNext().Unix()))
bf.WriteUint8(2) // Unk
bf.WriteUint32(s.server.erupeConfig.GameplayOptions.MezfesSoloTickets)
bf.WriteUint32(s.server.erupeConfig.GameplayOptions.MezfesGroupTickets)
bf.WriteUint8(8) // Stalls open
bf.WriteUint8(10) // Stall Map
bf.WriteUint8(3) // Pachinko
bf.WriteUint8(6) // Nyanrendo
bf.WriteUint8(9) // Point stall
if alt {
bf.WriteUint8(2) // Tokotoko Partnya
} else {
bf.WriteUint8(4) // Volpakkun Together
}
bf.WriteUint8(8) // Dokkan Battle Cats
bf.WriteUint8(5) // Goocoo Scoop
bf.WriteUint8(7) // Honey Panic
} else {
bf.WriteUint32(0)
bf.WriteUint32(0)
bf.WriteUint32(0)
tickets := []uint32{
s.server.erupeConfig.GameplayOptions.MezfesSoloTickets,
s.server.erupeConfig.GameplayOptions.MezfesGroupTickets,
}
stalls := []uint8{
10, 3, 6, 9, 4, 8, 5, 7,
}
if s.server.erupeConfig.GameplayOptions.MezFesSwitchMinigame {
stalls[4] = 2
}

// We can just use the start timestamp as the event ID
bf.WriteUint32(uint32(channelserver.TimeWeekStart().Unix()))
// Start time
bf.WriteUint32(uint32(channelserver.TimeWeekNext().Add(-time.Duration(s.server.erupeConfig.GameplayOptions.MezFesDuration) * time.Second).Unix()))
// End time
bf.WriteUint32(uint32(channelserver.TimeWeekNext().Unix()))
bf.WriteUint8(uint8(len(tickets)))
for i := range tickets {
bf.WriteUint32(tickets[i])
}
bf.WriteUint8(uint8(len(stalls)))
for i := range stalls {
bf.WriteUint8(stalls[i])
}
return bf.Data()
}

0 comments on commit dfc359f

Please sign in to comment.