map 初始化
This commit is contained in:
parent
b1b6df83a8
commit
d8ca98f2e2
@ -52,6 +52,12 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
|||||||
if heroRecord.Count == nil {
|
if heroRecord.Count == nil {
|
||||||
heroRecord.Count = make(map[int32]int32)
|
heroRecord.Count = make(map[int32]int32)
|
||||||
}
|
}
|
||||||
|
if heroRecord.Wish == nil {
|
||||||
|
heroRecord.Wish = make(map[string]int64)
|
||||||
|
}
|
||||||
|
if heroRecord.Limit == nil {
|
||||||
|
heroRecord.Limit = make(map[string]int64)
|
||||||
|
}
|
||||||
rsp := &pb.HeroDrawCardResp{
|
rsp := &pb.HeroDrawCardResp{
|
||||||
Data: []*pb.AtnoData{},
|
Data: []*pb.AtnoData{},
|
||||||
Wish: &pb.UserAtno{},
|
Wish: &pb.UserAtno{},
|
||||||
|
@ -40,6 +40,8 @@ func (this *ModelRecord) GetHeroRecord(uid string) (result *pb.DBHeroRecord, err
|
|||||||
result.Baodi5 = map[int32]int32{}
|
result.Baodi5 = map[int32]int32{}
|
||||||
result.Count = map[int32]int32{}
|
result.Count = map[int32]int32{}
|
||||||
result.Peach = map[int32]bool{}
|
result.Peach = map[int32]bool{}
|
||||||
|
result.Wish = map[string]int64{}
|
||||||
|
result.Limit = map[string]int64{}
|
||||||
result.Mtime = configure.Now().Unix()
|
result.Mtime = configure.Now().Unix()
|
||||||
this.Add(uid, result)
|
this.Add(uid, result)
|
||||||
err = nil
|
err = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user