mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-16 17:05:03 +01:00
Implement MsgSysCreateStage
This commit is contained in:
@@ -6,7 +6,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// MsgSysCreateStage represents the MSG_SYS_CREATE_STAGE
|
// MsgSysCreateStage represents the MSG_SYS_CREATE_STAGE
|
||||||
type MsgSysCreateStage struct{}
|
type MsgSysCreateStage struct {
|
||||||
|
AckHandle uint32
|
||||||
|
Unk0 uint8
|
||||||
|
Unk1 uint8
|
||||||
|
StageIDLength uint8
|
||||||
|
StageID string // NULL terminated string.
|
||||||
|
}
|
||||||
|
|
||||||
// Opcode returns the ID associated with this packet type.
|
// Opcode returns the ID associated with this packet type.
|
||||||
func (m *MsgSysCreateStage) Opcode() network.PacketID {
|
func (m *MsgSysCreateStage) Opcode() network.PacketID {
|
||||||
@@ -15,7 +21,12 @@ func (m *MsgSysCreateStage) Opcode() network.PacketID {
|
|||||||
|
|
||||||
// Parse parses the packet from binary
|
// Parse parses the packet from binary
|
||||||
func (m *MsgSysCreateStage) Parse(bf *byteframe.ByteFrame) error {
|
func (m *MsgSysCreateStage) Parse(bf *byteframe.ByteFrame) error {
|
||||||
panic("Not implemented")
|
m.AckHandle = bf.ReadUint32()
|
||||||
|
m.Unk0 = bf.ReadUint8()
|
||||||
|
m.Unk1 = bf.ReadUint8()
|
||||||
|
m.StageIDLength = bf.ReadUint8()
|
||||||
|
m.StageID = string(bf.ReadBytes(uint(m.StageIDLength)))
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build builds a binary packet from the current data.
|
// Build builds a binary packet from the current data.
|
||||||
|
|||||||
@@ -252,7 +252,16 @@ func handleMsgSysRecordLog(s *Session, p mhfpacket.MHFPacket) {}
|
|||||||
|
|
||||||
func handleMsgSysEcho(s *Session, p mhfpacket.MHFPacket) {}
|
func handleMsgSysEcho(s *Session, p mhfpacket.MHFPacket) {}
|
||||||
|
|
||||||
func handleMsgSysCreateStage(s *Session, p mhfpacket.MHFPacket) {}
|
func handleMsgSysCreateStage(s *Session, p mhfpacket.MHFPacket) {
|
||||||
|
pkt := p.(*mhfpacket.MsgSysCreateStage)
|
||||||
|
|
||||||
|
s.server.stagesLock.Lock()
|
||||||
|
s.server.stages[stripNullTerminator(s.stageID)] = &Stage{}
|
||||||
|
s.server.stagesLock.Lock()
|
||||||
|
|
||||||
|
resp := make([]byte, 8) // Unk resp.
|
||||||
|
s.QueueAck(pkt.AckHandle, resp)
|
||||||
|
}
|
||||||
|
|
||||||
func handleMsgSysStageDestruct(s *Session, p mhfpacket.MHFPacket) {}
|
func handleMsgSysStageDestruct(s *Session, p mhfpacket.MHFPacket) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user