mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
partially decode TerminalLog
This commit is contained in:
@@ -3,15 +3,17 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// TerminalLogEntry represents an entry in the MSG_SYS_TERMINAL_LOG packet.
|
||||
type TerminalLogEntry struct {
|
||||
// Unknown fields
|
||||
U0, U1, U2, U3, U4, U5, U6, U7, U8 uint32
|
||||
Index uint32
|
||||
Type1 uint8
|
||||
Type2 uint8
|
||||
Data []int16
|
||||
}
|
||||
|
||||
// MsgSysTerminalLog represents the MSG_SYS_TERMINAL_LOG
|
||||
@@ -37,15 +39,12 @@ func (m *MsgSysTerminalLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
|
||||
|
||||
for i := 0; i < int(m.EntryCount); i++ {
|
||||
e := &TerminalLogEntry{}
|
||||
e.U0 = bf.ReadUint32()
|
||||
e.U1 = bf.ReadUint32()
|
||||
e.U2 = bf.ReadUint32()
|
||||
e.U3 = bf.ReadUint32()
|
||||
e.U4 = bf.ReadUint32()
|
||||
e.U5 = bf.ReadUint32()
|
||||
e.U6 = bf.ReadUint32()
|
||||
e.U7 = bf.ReadUint32()
|
||||
e.U8 = bf.ReadUint32()
|
||||
e.Index = bf.ReadUint32()
|
||||
e.Type1 = bf.ReadUint8()
|
||||
e.Type2 = bf.ReadUint8()
|
||||
for j := 0; j < 15; j++ {
|
||||
e.Data = append(e.Data, bf.ReadInt16())
|
||||
}
|
||||
m.Entries = append(m.Entries, e)
|
||||
}
|
||||
|
||||
|
||||
@@ -118,9 +118,14 @@ func handleMsgSysAck(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysTerminalLog(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgSysTerminalLog)
|
||||
for i := range pkt.Entries {
|
||||
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))
|
||||
}
|
||||
resp := byteframe.NewByteFrame()
|
||||
|
||||
resp.WriteUint32(0x98bd51a9) // LogID to use for requests after this.
|
||||
resp.WriteUint32(pkt.LogID + 1) // LogID to use for requests after this.
|
||||
doAckSimpleSucceed(s, pkt.AckHandle, resp.Data())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user