mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
decode various Ryoudama packets
This commit is contained in:
@@ -1,22 +1,79 @@
|
||||
package channelserver
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/stringsupport"
|
||||
"erupe-ce/network/mhfpacket"
|
||||
)
|
||||
|
||||
type RyoudamaReward struct {
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk3 uint16
|
||||
Unk4 uint16
|
||||
Unk5 uint16
|
||||
}
|
||||
|
||||
type RyoudamaKeyScore struct {
|
||||
Unk0 uint8
|
||||
Unk1 int32
|
||||
}
|
||||
|
||||
type RyoudamaCharInfo struct {
|
||||
CID uint32
|
||||
Unk0 int32
|
||||
Name string
|
||||
}
|
||||
|
||||
type RyoudamaBoostInfo struct {
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
}
|
||||
|
||||
type Ryoudama struct {
|
||||
Reward []RyoudamaReward
|
||||
KeyScore []RyoudamaKeyScore
|
||||
CharInfo []RyoudamaCharInfo
|
||||
BoostInfo []RyoudamaBoostInfo
|
||||
Score []int32
|
||||
}
|
||||
|
||||
func handleMsgMhfGetRyoudama(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgMhfGetRyoudama)
|
||||
// likely guild related
|
||||
// REQ: 00 04 13 53 8F 18 00
|
||||
// RSP: 0A 21 8E AD 00 00 00 00 00 00 00 00 00 00 00 01 00 01 FE 4E
|
||||
// REQ: 00 06 13 53 8F 18 00
|
||||
// RSP: 0A 21 8E AD 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00
|
||||
// REQ: 00 05 13 53 8F 18 00
|
||||
// RSP: 0A 21 8E AD 00 00 00 00 00 00 00 00 00 00 00 0E 2A 15 9E CC 00 00 00 01 82 79 83 4E 83 8A 81 5B 83 69 00 00 00 00 1E 55 B0 2F 00 00 00 01 8D F7 00 00 00 00 00 00 00 00 00 00 00 00 2A 15 9E CC 00 00 00 02 82 79 83 4E 83 8A 81 5B 83 69 00 00 00 00 03 D5 30 56 00 00 00 02 95 BD 91 F2 97 42 00 00 00 00 00 00 00 00 3F 57 76 9F 00 00 00 03 93 56 92 6E 96 B3 97 70 00 00 00 00 00 00 38 D9 0E C4 00 00 00 03 87 64 83 78 83 42 00 00 00 00 00 00 00 00 23 F3 B9 77 00 00 00 04 82 B3 82 CC 82 DC 82 E9 81 99 00 00 00 00 3F 1B 17 9C 00 00 00 04 82 B1 82 A4 82 BD 00 00 00 00 00 00 00 00 00 B9 F9 C0 00 00 00 05 82 CD 82 E9 82 A9 00 00 00 00 00 00 00 00 23 9F 9A EA 00 00 00 05 83 70 83 62 83 4C 83 83 83 49 00 00 00 00 38 D9 0E C4 00 00 00 06 87 64 83 78 83 42 00 00 00 00 00 00 00 00 1E 55 B0 2F 00 00 00 06 8D F7 00 00 00 00 00 00 00 00 00 00 00 00 03 D5 30 56 00 00 00 07 95 BD 91 F2 97 42 00 00 00 00 00 00 00 00 02 D3 B8 77 00 00 00 07 6F 77 6C 32 35 32 35 00 00 00 00 00 00 00
|
||||
data, _ := hex.DecodeString("0A218EAD0000000000000000000000010000000000000000")
|
||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint32(uint32(s.server.erupeConfig.DevModeOptions.EarthIDOverride))
|
||||
bf.WriteUint32(0)
|
||||
bf.WriteUint32(0)
|
||||
|
||||
ryoudama := Ryoudama{
|
||||
Score: []int32{0},
|
||||
}
|
||||
switch pkt.Request2 {
|
||||
case 4:
|
||||
bf.WriteUint32(uint32(len(ryoudama.Score)))
|
||||
for _, score := range ryoudama.Score {
|
||||
bf.WriteInt32(score)
|
||||
}
|
||||
case 5:
|
||||
bf.WriteUint32(uint32(len(ryoudama.CharInfo)))
|
||||
for _, info := range ryoudama.CharInfo {
|
||||
bf.WriteUint32(info.CID)
|
||||
bf.WriteInt32(info.Unk0)
|
||||
bf.WriteBytes(stringsupport.PaddedString(info.Name, 14, true))
|
||||
}
|
||||
case 6:
|
||||
bf.WriteUint32(uint32(len(ryoudama.BoostInfo)))
|
||||
for _, info := range ryoudama.BoostInfo {
|
||||
bf.WriteUint32(info.Unk0)
|
||||
bf.WriteUint32(info.Unk1)
|
||||
}
|
||||
default:
|
||||
bf.WriteUint32(0)
|
||||
}
|
||||
|
||||
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgMhfPostRyoudama(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
Reference in New Issue
Block a user