mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
implement normal gacha functionality
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfPlayNormalGacha represents the MSG_MHF_PLAY_NORMAL_GACHA
|
||||
type MsgMhfPlayNormalGacha struct{
|
||||
AckHandle uint32
|
||||
GachaHash uint32
|
||||
RollType uint8
|
||||
type MsgMhfPlayNormalGacha struct {
|
||||
AckHandle uint32
|
||||
GachaID uint32
|
||||
RollType uint8
|
||||
CurrencyMode uint8
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ func (m *MsgMhfPlayNormalGacha) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPlayNormalGacha) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GachaHash = bf.ReadUint32()
|
||||
m.GachaID = bf.ReadUint32()
|
||||
m.RollType = bf.ReadUint8()
|
||||
m.CurrencyMode = bf.ReadUint8()
|
||||
return nil
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfReceiveGachaItem represents the MSG_MHF_RECEIVE_GACHA_ITEM
|
||||
type MsgMhfReceiveGachaItem struct{
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
type MsgMhfReceiveGachaItem struct {
|
||||
AckHandle uint32
|
||||
Max uint8
|
||||
Freeze bool
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,7 +23,8 @@ func (m *MsgMhfReceiveGachaItem) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfReceiveGachaItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Max = bf.ReadUint8()
|
||||
m.Freeze = bf.ReadBool()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user