parse TerminalLog correctly

This commit is contained in:
wish
2023-07-30 18:43:28 +10:00
parent 385a672c3d
commit d0db775c11
2 changed files with 19 additions and 8 deletions

View File

@@ -14,7 +14,11 @@ type TerminalLogEntry struct {
Index uint32
Type1 uint8
Type2 uint8
Data []int16
Unk0 int16
Unk1 int32
Unk2 int32
Unk3 int32
Unk4 []int32
}
// MsgSysTerminalLog represents the MSG_SYS_TERMINAL_LOG
@@ -38,17 +42,19 @@ func (m *MsgSysTerminalLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
m.EntryCount = bf.ReadUint16()
m.Unk0 = bf.ReadUint16()
values := 15
if _config.ErupeConfig.RealClientMode <= _config.F5 {
values = 7
}
for i := 0; i < int(m.EntryCount); i++ {
e := &TerminalLogEntry{}
e.Index = bf.ReadUint32()
e.Type1 = bf.ReadUint8()
e.Type2 = bf.ReadUint8()
for j := 0; j < values; j++ {
e.Data = append(e.Data, bf.ReadInt16())
e.Unk0 = bf.ReadInt16()
e.Unk1 = bf.ReadInt32()
e.Unk2 = bf.ReadInt32()
e.Unk3 = bf.ReadInt32()
if _config.ErupeConfig.RealClientMode >= _config.G1 {
for j := 0; j < 4; j++ {
e.Unk4 = append(e.Unk4, bf.ReadInt32())
}
}
m.Entries = append(m.Entries, e)
}