40 lines
557 B
Go
40 lines
557 B
Go
package robot
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"github.com/liwei1dao/lego/sys/log"
|
|
)
|
|
|
|
func (r *Robot) handleUserMsg(msg *pb.UserMessage) {
|
|
|
|
switch msg.SubType {
|
|
//创建账号
|
|
case "create":
|
|
case "load":
|
|
|
|
}
|
|
|
|
//加载玩家数据
|
|
if msg.SubType == "load" {
|
|
rsp := &pb.UserLoadRsp{}
|
|
if !comm.ProtoDecode(msg, rsp) {
|
|
log.Fatal("load user err")
|
|
}
|
|
|
|
if rsp.Data.UserData.UserId != 0 {
|
|
r.onUserLoaded()
|
|
} else {
|
|
log.Debugf("%s不存在", r.Opts.Account)
|
|
//创建
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
func (r *Robot) CreateUser() {
|
|
|
|
}
|