mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 15:04:38 +01:00
convert Guild Missions to struct
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
@@ -1723,16 +1722,51 @@ func handleMsgMhfReadGuildcard(s *Session, p mhfpacket.MHFPacket) {
|
||||
doAckBufSucceed(s, pkt.AckHandle, resp.Data())
|
||||
}
|
||||
|
||||
type GuildMission struct {
|
||||
ID uint32
|
||||
Unk uint32
|
||||
Type uint16
|
||||
Goal uint16
|
||||
Quantity uint16
|
||||
SkipTickets uint16
|
||||
GR bool
|
||||
RewardType uint16
|
||||
RewardLevel uint16
|
||||
}
|
||||
|
||||
func handleMsgMhfGetGuildMissionList(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgMhfGetGuildMissionList)
|
||||
|
||||
decoded, err := hex.DecodeString("000694610000023E000112990023000100000200015DDD232100069462000002F30000005F000C000200000300025DDD232100069463000002EA0000005F0006000100000100015DDD23210006946400000245000000530010000200000400025DDD232100069465000002B60001129B0019000100000200015DDD232100069466000003DC0000001B0010000100000600015DDD232100069467000002DA000112A00019000100000400015DDD232100069468000002A800010DEF0032000200000200025DDD2321000694690000045500000022003C000200000600025DDD23210006946A00000080000122D90046000200000300025DDD23210006946B000001960000003B000A000100000100015DDD23210006946C0000049200000046005A000300000600035DDD23210006946D000000A4000000260018000200000600025DDD23210006946E0000017A00010DE40096000300000100035DDD23210006946F000001BE0000005E0014000200000400025DDD2355000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
bf := byteframe.NewByteFrame()
|
||||
missions := []GuildMission{
|
||||
{431201, 574, 1, 4761, 35, 1, false, 2, 1},
|
||||
{431202, 755, 0, 95, 12, 2, false, 3, 2},
|
||||
{431203, 746, 0, 95, 6, 1, false, 1, 1},
|
||||
{431204, 581, 0, 83, 16, 2, false, 4, 2},
|
||||
{431205, 694, 1, 4763, 25, 1, false, 2, 1},
|
||||
{431206, 988, 0, 27, 16, 1, false, 6, 1},
|
||||
{431207, 730, 1, 4768, 25, 1, false, 4, 1},
|
||||
{431208, 680, 1, 3567, 50, 2, false, 2, 2},
|
||||
{431209, 1109, 0, 34, 60, 2, false, 6, 2},
|
||||
{431210, 128, 1, 8921, 70, 2, false, 3, 2},
|
||||
{431211, 406, 0, 59, 10, 1, false, 1, 1},
|
||||
{431212, 1170, 0, 70, 90, 3, false, 6, 3},
|
||||
{431213, 164, 0, 38, 24, 2, false, 6, 2},
|
||||
{431214, 378, 1, 3556, 150, 3, false, 1, 3},
|
||||
{431215, 446, 0, 94, 20, 2, false, 4, 2},
|
||||
}
|
||||
|
||||
doAckBufSucceed(s, pkt.AckHandle, decoded)
|
||||
for _, mission := range missions {
|
||||
bf.WriteUint32(mission.ID)
|
||||
bf.WriteUint32(mission.Unk)
|
||||
bf.WriteUint16(mission.Type)
|
||||
bf.WriteUint16(mission.Goal)
|
||||
bf.WriteUint16(mission.Quantity)
|
||||
bf.WriteUint16(mission.SkipTickets)
|
||||
bf.WriteBool(mission.GR)
|
||||
bf.WriteUint16(mission.RewardType)
|
||||
bf.WriteUint16(mission.RewardLevel)
|
||||
bf.WriteUint32(uint32(TimeAdjusted().Unix()))
|
||||
}
|
||||
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgMhfGetGuildMissionRecord(s *Session, p mhfpacket.MHFPacket) {
|
||||
|
||||
Reference in New Issue
Block a user