mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
Adds the full campaign/event-tent feature: Packet layer: - MsgMhfApplyCampaign: Unk0/Unk1/Unk2 → CampaignID/Code (null-terminated 16-byte string) - MsgMhfAcquireItem: Unk0/Length/Unk1 → RewardIDs []uint32 - MsgMhfEnumerateItem: remove Unk0/Unk1 (RE'd: zeroed + always-2, ignored) - MsgMhfStateCampaign: Unk1 → NullPadding (RE'd: always zero) - MsgMhfTransferItem: Unk0/Unk1/Unk2 → QuestID/ItemType/Quantity (RE'd) Handler layer (handlers_campaign.go): - handleMsgMhfEnumerateCampaign: reads campaigns, categories, links from DB; prefix moved into pascal string slot 3 of each event entry (RE confirmed 3-section response format — removes spurious intermediate section) - handleMsgMhfStateCampaign: returns stamp count and redeemable flag - handleMsgMhfApplyCampaign: validates and records code redemption - handleMsgMhfEnumerateItem: lists rewards gated by stamp count - handleMsgMhfAcquireItem: marks rewards as claimed - handleMsgMhfTransferItem: records campaign quest completion (item_type=9) Quest gating (handlers_quest.go): - makeEventQuest: for QuestTypeSpecialTool, check campaign stamp count and deadline before allowing the quest (WriteBool true/false) Database: - 0010_campaign.sql: 8-table schema (campaigns, categories, links, rewards, claimed, state, codes, quest) - CampaignDemo.sql: community-researched live game campaign data
35 lines
882 B
Go
35 lines
882 B
Go
package mhfpacket
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"erupe-ce/common/byteframe"
|
|
"erupe-ce/network"
|
|
"erupe-ce/network/clientctx"
|
|
)
|
|
|
|
// MsgMhfEnumerateItem represents the MSG_MHF_ENUMERATE_ITEM
|
|
type MsgMhfEnumerateItem struct {
|
|
AckHandle uint32
|
|
CampaignID uint32
|
|
}
|
|
|
|
// Opcode returns the ID associated with this packet type.
|
|
func (m *MsgMhfEnumerateItem) Opcode() network.PacketID {
|
|
return network.MSG_MHF_ENUMERATE_ITEM
|
|
}
|
|
|
|
// Parse parses the packet from binary
|
|
func (m *MsgMhfEnumerateItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
|
m.AckHandle = bf.ReadUint32()
|
|
bf.ReadUint16() // Zeroed
|
|
bf.ReadUint16() // Always 2
|
|
m.CampaignID = bf.ReadUint32()
|
|
return nil
|
|
}
|
|
|
|
// Build builds a binary packet from the current data.
|
|
func (m *MsgMhfEnumerateItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
|
return errors.New("NOT IMPLEMENTED")
|
|
}
|