Commit 3a928f85 authored by Chunchi Che's avatar Chunchi Che

handle StocHsWatchChange

parent c43fb60e
...@@ -31,6 +31,7 @@ const ( ...@@ -31,6 +31,7 @@ const (
StocChat = 25 StocChat = 25
StocHsPlayerEnter = 32 StocHsPlayerEnter = 32
StocHsPlayerChange = 33 StocHsPlayerChange = 33
StocHsWatchChange = 34
) )
type YgoPacket struct { type YgoPacket struct {
...@@ -137,6 +138,8 @@ func Transform(src []byte, tranformType int, ctx *util.Context) ([]byte, error) ...@@ -137,6 +138,8 @@ func Transform(src []byte, tranformType int, ctx *util.Context) ([]byte, error)
pb = pStocTypeChage{}.Packet2Pb(packet) pb = pStocTypeChage{}.Packet2Pb(packet)
case StocHsPlayerChange: case StocHsPlayerChange:
pb = pStocHsPlayerChange{}.Packet2Pb(packet) pb = pStocHsPlayerChange{}.Packet2Pb(packet)
case StocHsWatchChange:
pb = pStocHsWatchChange{}.Packet2Pb(packet)
default: default:
return nil, errors.New(fmt.Sprintf(COMPONENT+"Unhandled YgoStocMsg type, proto=%d", packet.Proto)) return nil, errors.New(fmt.Sprintf(COMPONENT+"Unhandled YgoStocMsg type, proto=%d", packet.Proto))
} }
...@@ -359,3 +362,19 @@ func (_ pStocHsPlayerChange) Packet2Pb(pkt YgoPacket) ygopropb.YgoStocMsg { ...@@ -359,3 +362,19 @@ func (_ pStocHsPlayerChange) Packet2Pb(pkt YgoPacket) ygopropb.YgoStocMsg {
Msg: &msg, Msg: &msg,
} }
} }
type pStocHsWatchChange struct{}
func (_ pStocHsWatchChange) Packet2Pb(pkt YgoPacket) ygopropb.YgoStocMsg {
count := binary.LittleEndian.Uint16(pkt.Exdata)
msg := ygopropb.YgoStocMsg_StocHsWatchChange{
StocHsWatchChange: &ygopropb.StocHsWatchChange{
Count: int32(count),
},
}
return ygopropb.YgoStocMsg{
Msg: &msg,
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment