Skip to content

Commit

Permalink
fix accidental commit and rename ack_helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
stratic-dev committed Oct 9, 2024
1 parent fb09fa3 commit b4288c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
File renamed without changes.
36 changes: 18 additions & 18 deletions server/channelserver/handlers_festa.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ func generateFestaTimestamps(s *Session, start uint32, debug bool) []uint32 {
}

type FestaTrial struct {
ID uint32 `db:"id"`
Objective uint16 `db:"objective"`
GoalID uint32 `db:"goal_id"`
TimesReq uint16 `db:"times_req"`
Locale uint16 `db:"locale_req"`
Reward uint16 `db:"reward"`
Monopoly guild.FestivalColor `db:"monopoly"`
ID uint32 `db:"id"`
Objective uint16 `db:"objective"`
GoalID uint32 `db:"goal_id"`
TimesReq uint16 `db:"times_req"`
Locale uint16 `db:"locale_req"`
Reward uint16 `db:"reward"`
Monopoly FestivalColor `db:"monopoly"`
Unk uint16
}

Expand Down Expand Up @@ -235,7 +235,7 @@ func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) {
bf.WriteUint16(trial.TimesReq)
bf.WriteUint16(trial.Locale)
bf.WriteUint16(trial.Reward)
bf.WriteInt16(guild.FestivalColorCodes[trial.Monopoly])
bf.WriteInt16(FestivalColorCodes[trial.Monopoly])
if _config.ErupeConfig.ClientID >= _config.F4 { // Not in S6.0
bf.WriteUint16(trial.Unk)
}
Expand Down Expand Up @@ -300,7 +300,7 @@ func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) {
for i := uint16(0); i < 4; i++ {
var guildID uint32
var guildName string
var guildTeam = guild.FestivalColorNone
var guildTeam = FestivalColorNone
s.server.db.QueryRow(`
SELECT fs.guild_id, g.name, fr.team, SUM(fs.souls) as _
FROM festa_submissions fs
Expand All @@ -312,14 +312,14 @@ func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) {
`, i+1).Scan(&guildID, &guildName, &guildTeam, &temp)
bf.WriteUint32(guildID)
bf.WriteUint16(i + 1)
bf.WriteInt16(guild.FestivalColorCodes[guildTeam])
bf.WriteInt16(FestivalColorCodes[guildTeam])
ps.Uint8(bf, guildName, true)
}
bf.WriteUint16(7)
for i := uint16(0); i < 7; i++ {
var guildID uint32
var guildName string
var guildTeam = guild.FestivalColorNone
var guildTeam = FestivalColorNone
offset := 86400 * uint32(i)
s.server.db.QueryRow(`
SELECT fs.guild_id, g.name, fr.team, SUM(fs.souls) as _
Expand All @@ -332,7 +332,7 @@ func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) {
`, timestamps[1]+offset, timestamps[1]+offset+86400).Scan(&guildID, &guildName, &guildTeam, &temp)
bf.WriteUint32(guildID)
bf.WriteUint16(i + 1)
bf.WriteInt16(guild.FestivalColorCodes[guildTeam])
bf.WriteInt16(FestivalColorCodes[guildTeam])
ps.Uint8(bf, guildName, true)
}

Expand All @@ -357,7 +357,7 @@ func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) {
// state festa (U)ser
func handleMsgMhfStateFestaU(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfStateFestaU)
guild, err := guild.GetGuildInfoByCharacterId(s, s.charID)
guild, err := GetGuildInfoByCharacterId(s, s.charID)
applicant := false
if guild != nil {
applicant, _ = guild.HasApplicationForCharID(s, s.charID)
Expand All @@ -384,7 +384,7 @@ func handleMsgMhfStateFestaU(s *Session, p mhfpacket.MHFPacket) {
// state festa (G)uild
func handleMsgMhfStateFestaG(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfStateFestaG)
guild, err := guild.GetGuildInfoByCharacterId(s, s.charID)
guild, err := GetGuildInfoByCharacterId(s, s.charID)
applicant := false
if guild != nil {
applicant, _ = guild.HasApplicationForCharID(s, s.charID)
Expand All @@ -409,20 +409,20 @@ func handleMsgMhfStateFestaG(s *Session, p mhfpacket.MHFPacket) {

func handleMsgMhfEnumerateFestaMember(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfEnumerateFestaMember)
guild, err := guild.GetGuildInfoByCharacterId(s, s.charID)
guild, err := GetGuildInfoByCharacterId(s, s.charID)
if err != nil || guild == nil {
doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4))
return
}
members, err := guild.GetGuildMembers(s, guild.ID, false)
members, err := GetGuildMembers(s, guild.ID, false)
if err != nil {
doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4))
return
}
sort.Slice(members, func(i, j int) bool {
return members[i].Souls > members[j].Souls
})
var validMembers []*guild.GuildMember
var validMembers []*GuildMember
for _, member := range members {
if member.Souls > 0 {
validMembers = append(validMembers, member)
Expand Down Expand Up @@ -451,7 +451,7 @@ func handleMsgMhfVoteFesta(s *Session, p mhfpacket.MHFPacket) {

func handleMsgMhfEntryFesta(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfEntryFesta)
guild, err := guild.GetGuildInfoByCharacterId(s, s.charID)
guild, err := GetGuildInfoByCharacterId(s, s.charID)
if err != nil || guild == nil {
doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4))
return
Expand Down

0 comments on commit b4288c1

Please sign in to comment.