mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
stub InfoTournament
This commit is contained in:
@@ -1,15 +1,19 @@
|
|||||||
package mhfpacket
|
package mhfpacket
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"erupe-ce/network/clientctx"
|
|
||||||
"erupe-ce/network"
|
|
||||||
"erupe-ce/common/byteframe"
|
"erupe-ce/common/byteframe"
|
||||||
|
"erupe-ce/network"
|
||||||
|
"erupe-ce/network/clientctx"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MsgMhfInfoTournament represents the MSG_MHF_INFO_TOURNAMENT
|
// MsgMhfInfoTournament represents the MSG_MHF_INFO_TOURNAMENT
|
||||||
type MsgMhfInfoTournament struct{}
|
type MsgMhfInfoTournament struct {
|
||||||
|
AckHandle uint32
|
||||||
|
Unk0 uint8
|
||||||
|
Unk1 uint32
|
||||||
|
}
|
||||||
|
|
||||||
// Opcode returns the ID associated with this packet type.
|
// Opcode returns the ID associated with this packet type.
|
||||||
func (m *MsgMhfInfoTournament) Opcode() network.PacketID {
|
func (m *MsgMhfInfoTournament) Opcode() network.PacketID {
|
||||||
@@ -18,7 +22,10 @@ func (m *MsgMhfInfoTournament) Opcode() network.PacketID {
|
|||||||
|
|
||||||
// Parse parses the packet from binary
|
// Parse parses the packet from binary
|
||||||
func (m *MsgMhfInfoTournament) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
func (m *MsgMhfInfoTournament) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||||
return errors.New("NOT IMPLEMENTED")
|
m.AckHandle = bf.ReadUint32()
|
||||||
|
m.Unk0 = bf.ReadUint8()
|
||||||
|
m.Unk1 = bf.ReadUint32()
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build builds a binary packet from the current data.
|
// Build builds a binary packet from the current data.
|
||||||
|
|||||||
@@ -1,8 +1,59 @@
|
|||||||
package channelserver
|
package channelserver
|
||||||
|
|
||||||
import "erupe-ce/network/mhfpacket"
|
import (
|
||||||
|
"erupe-ce/common/byteframe"
|
||||||
|
ps "erupe-ce/common/pascalstring"
|
||||||
|
"erupe-ce/network/mhfpacket"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
func handleMsgMhfInfoTournament(s *Session, p mhfpacket.MHFPacket) {}
|
func handleMsgMhfInfoTournament(s *Session, p mhfpacket.MHFPacket) {
|
||||||
|
pkt := p.(*mhfpacket.MsgMhfInfoTournament)
|
||||||
|
bf := byteframe.NewByteFrame()
|
||||||
|
|
||||||
|
switch pkt.Unk0 {
|
||||||
|
case 0:
|
||||||
|
bf.WriteUint32(uint32(Time_Current_Adjusted().Unix()))
|
||||||
|
bf.WriteUint32(0) // Tied to schedule ID?
|
||||||
|
case 1:
|
||||||
|
|
||||||
|
bf.WriteBytes(make([]byte, 15))
|
||||||
|
ps.Uint8(bf, "", false)
|
||||||
|
break
|
||||||
|
|
||||||
|
bf.WriteUint32(0xACEDCAFE)
|
||||||
|
|
||||||
|
bf.WriteUint32(5) // Active schedule?
|
||||||
|
|
||||||
|
bf.WriteUint32(1) // Schedule ID?
|
||||||
|
|
||||||
|
bf.WriteUint32(32) // Max players
|
||||||
|
bf.WriteUint32(0) // Registered players
|
||||||
|
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
bf.WriteUint16(2) // Color code for schedule item
|
||||||
|
bf.WriteUint32(0)
|
||||||
|
|
||||||
|
bf.WriteUint32(uint32(time.Now().Add(time.Hour * -10).Unix()))
|
||||||
|
bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix()))
|
||||||
|
bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix()))
|
||||||
|
bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix()))
|
||||||
|
bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix()))
|
||||||
|
bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix()))
|
||||||
|
|
||||||
|
bf.WriteBool(true) // Unk
|
||||||
|
bf.WriteBool(false) // Cafe-only
|
||||||
|
|
||||||
|
bf.WriteUint32(0) // Min HR
|
||||||
|
bf.WriteUint32(0) // Max HR
|
||||||
|
|
||||||
|
ps.Uint8(bf, "Test", false)
|
||||||
|
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
|
||||||
|
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||||
|
}
|
||||||
|
|
||||||
func handleMsgMhfEntryTournament(s *Session, p mhfpacket.MHFPacket) {}
|
func handleMsgMhfEntryTournament(s *Session, p mhfpacket.MHFPacket) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user