上传pvp代码修复
This commit is contained in:
parent
7bcccce0f5
commit
ce0b0423f4
@ -97,10 +97,22 @@ func (this *Pvp) CreateRoom(sessions []comm.IUserSession, rulesStr string) (room
|
||||
battle *BattleItem
|
||||
red, blue *pb.DBUser
|
||||
)
|
||||
|
||||
if err = json.Unmarshal([]byte(rulesStr), rules); err != nil {
|
||||
this.Error("解析规则json", log.Field{Key: "err", Value: err.Error()})
|
||||
return
|
||||
}
|
||||
//发起者 red
|
||||
red, err = this.ModuleUser.GetUser(sessions[0].GetUserId())
|
||||
if err != nil {
|
||||
this.Error("未找到红方信息", log.Field{Key: "uid", Value: sessions[0].GetUserId()})
|
||||
return
|
||||
}
|
||||
blue, err = this.ModuleUser.GetUser(sessions[1].GetUserId())
|
||||
if err != nil {
|
||||
this.Error("未找到蓝方信息", log.Field{Key: "uid", Value: sessions[1].GetUserId()})
|
||||
return
|
||||
}
|
||||
roomid = primitive.NewObjectID().Hex()
|
||||
battle = &BattleItem{
|
||||
Id: roomid,
|
||||
|
Loading…
Reference in New Issue
Block a user