Files
Erupe/network/mhfpacket/msg_sys_position_object.go
stratic-dev 62fe5cf277 moved bin 8 out and removed clientctx
moved crypto bin8 out of entrance server

removed unused clientctx

missed import

fix accidental commit and rename ack_helpers
2024-10-09 18:36:34 +01:00

36 lines
827 B
Go

package mhfpacket
import (
"erupe-ce/network"
"erupe-ce/utils/byteframe"
)
// MsgSysPositionObject represents the MSG_SYS_POSITION_OBJECT
type MsgSysPositionObject struct {
ObjID uint32
X, Y, Z float32
}
// Opcode returns the ID associated with this packet type.
func (m *MsgSysPositionObject) Opcode() network.PacketID {
return network.MSG_SYS_POSITION_OBJECT
}
// Parse parses the packet from binary
func (m *MsgSysPositionObject) Parse(bf *byteframe.ByteFrame) error {
m.ObjID = bf.ReadUint32()
m.X = bf.ReadFloat32()
m.Y = bf.ReadFloat32()
m.Z = bf.ReadFloat32()
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgSysPositionObject) Build(bf *byteframe.ByteFrame) error {
bf.WriteUint32(m.ObjID)
bf.WriteFloat32(m.X)
bf.WriteFloat32(m.Y)
bf.WriteFloat32(m.Z)
return nil
}