|
|
@ -5,6 +5,7 @@ import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/golang/protobuf/proto"
|
|
|
|
"github.com/jordanorelli/hyperstone/dota"
|
|
|
|
"github.com/jordanorelli/hyperstone/dota"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -49,6 +50,16 @@ func (p *parser) run() error {
|
|
|
|
if err := msg.check(p.dumpPackets); err != nil {
|
|
|
|
if err := msg.check(p.dumpPackets); err != nil {
|
|
|
|
fmt.Printf("error: %v\n", err)
|
|
|
|
fmt.Printf("error: %v\n", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
m := cmdFactory.BuildMessage(int(msg.cmd))
|
|
|
|
|
|
|
|
if m != nil {
|
|
|
|
|
|
|
|
err := proto.Unmarshal(msg.body, m)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("cmd unmarshal error: %v\n", err)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fmt.Println(m)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|