mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
parse TerminalLog correctly
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -111,7 +111,12 @@ func handleMsgSysTerminalLog(s *Session, p mhfpacket.MHFPacket) {
|
||||
s.server.logger.Info("SysTerminalLog",
|
||||
zap.Uint8("Type1", pkt.Entries[i].Type1),
|
||||
zap.Uint8("Type2", pkt.Entries[i].Type2),
|
||||
zap.Int16s("Data", pkt.Entries[i].Data))
|
||||
zap.Int16("Unk0", pkt.Entries[i].Unk0),
|
||||
zap.Int32("Unk1", pkt.Entries[i].Unk1),
|
||||
zap.Int32("Unk2", pkt.Entries[i].Unk2),
|
||||
zap.Int32("Unk3", pkt.Entries[i].Unk3),
|
||||
zap.Int32s("Unk4", pkt.Entries[i].Unk4),
|
||||
)
|
||||
}
|
||||
resp := byteframe.NewByteFrame()
|
||||
resp.WriteUint32(pkt.LogID + 1) // LogID to use for requests after this.
|
||||
|
||||
Reference in New Issue
Block a user