mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
fix EnumerateQuest parsing and limit tuneValue slice length
This commit is contained in:
@@ -30,10 +30,12 @@ func (m *MsgMhfEnumerateQuest) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.World = bf.ReadUint8()
|
||||
m.Counter = bf.ReadUint16()
|
||||
m.Offset = bf.ReadUint16()
|
||||
if _config.ErupeConfig.RealClientMode > _config.Z1 {
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
if _config.ErupeConfig.RealClientMode <= _config.Z1 {
|
||||
m.Offset = uint16(bf.ReadUint8())
|
||||
} else {
|
||||
m.Offset = bf.ReadUint16()
|
||||
}
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -632,6 +632,27 @@ func handleMsgMhfEnumerateQuest(s *Session, p mhfpacket.MHFPacket) {
|
||||
|
||||
offset := uint16(time.Now().Unix())
|
||||
bf.WriteUint16(offset)
|
||||
|
||||
if _config.ErupeConfig.RealClientMode <= _config.F5 {
|
||||
tuneValues = tuneValues[:256]
|
||||
} else if _config.ErupeConfig.RealClientMode <= _config.G3 {
|
||||
tuneValues = tuneValues[:283]
|
||||
} else if _config.ErupeConfig.RealClientMode <= _config.GG {
|
||||
tuneValues = tuneValues[:315]
|
||||
} else if _config.ErupeConfig.RealClientMode <= _config.G61 {
|
||||
tuneValues = tuneValues[:332]
|
||||
} else if _config.ErupeConfig.RealClientMode <= _config.G7 {
|
||||
tuneValues = tuneValues[:339]
|
||||
} else if _config.ErupeConfig.RealClientMode <= _config.G81 {
|
||||
tuneValues = tuneValues[:396]
|
||||
} else if _config.ErupeConfig.RealClientMode <= _config.G91 {
|
||||
tuneValues = tuneValues[:694]
|
||||
} else if _config.ErupeConfig.RealClientMode <= _config.G101 {
|
||||
tuneValues = tuneValues[:704]
|
||||
} else if _config.ErupeConfig.RealClientMode <= _config.Z2 {
|
||||
tuneValues = tuneValues[:750]
|
||||
}
|
||||
|
||||
bf.WriteUint16(uint16(len(tuneValues)))
|
||||
for i := range tuneValues {
|
||||
bf.WriteUint16(tuneValues[i].ID ^ offset)
|
||||
|
||||
Reference in New Issue
Block a user