Commit a72dc603 authored by Chunchi Che's avatar Chunchi Che Committed by GitHub

Merge pull request #13 from DarkNeos/dev

Dev
parents ea1eeebb 3a928f85
......@@ -31,6 +31,7 @@ const (
StocChat = 25
StocHsPlayerEnter = 32
StocHsPlayerChange = 33
StocHsWatchChange = 34
)
type YgoPacket struct {
......@@ -137,6 +138,8 @@ func Transform(src []byte, tranformType int, ctx *util.Context) ([]byte, error)
pb = pStocTypeChage{}.Packet2Pb(packet)
case StocHsPlayerChange:
pb = pStocHsPlayerChange{}.Packet2Pb(packet)
case StocHsWatchChange:
pb = pStocHsWatchChange{}.Packet2Pb(packet)
default:
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 {
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,
}
}
This diff is collapsed.
Subproject commit b76a7b646366e85d3a1d7652525790e08c1be39d
Subproject commit 7b87e8a035a016c44d551f85c1ce0a719b507b8f
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