This commit is contained in:
aozhiwei 2024-10-12 14:49:35 +08:00
parent 829f535c8f
commit a9cac80248
2 changed files with 23 additions and 16 deletions

View File

@ -10,11 +10,6 @@ import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
) )
type BattleItem struct {
ItemId int32 `json:"item_id"`
ItemNum int32 `json:"item_num"`
}
type UserInfo struct { type UserInfo struct {
//Activated string `json:"activated"` //Activated string `json:"activated"`
//RenameCount string `json:"rename_count"` //RenameCount string `json:"rename_count"`

View File

@ -567,19 +567,31 @@ func (this *player) CMChooseBattleItem(hdr *f5.MsgHdr, msg *cs.CMChooseBattleIte
return return
} }
} }
rspObj := common.MapInfoRsp{} rspObj := struct {
{ Errcode int `json:"errcode"`
f5.GetSysLog().Info("updateMap:%s", rsp.GetRawData()) Errmsg string `json:"errmsg"`
ItemId interface{} `json:"item_id"`
ItemNum interface{} `json:"item_num"`
ItemType interface{} `json:"item_type"`
ItemSubType interface{} `json:"item_sub_type"`
}{}
err := json.Unmarshal([]byte(rsp.GetRawData()), &rspObj) err := json.Unmarshal([]byte(rsp.GetRawData()), &rspObj)
if err != nil { if err != nil || rspObj.Errcode != 0 {
//cb(500, "server internal error") rspMsg.Errcode = proto.Int32(500)
rspMsg.Errmsg = proto.String("server internal error")
this.SendMsg(rspMsg)
return return
} }
{ var itemId int32
} var itemNum int32
} var itemType int32
}) var itemSubType int32
q5.DuckToSimple(rspObj.ItemId, &itemId)
q5.DuckToSimple(rspObj.ItemNum, &itemNum)
q5.DuckToSimple(rspObj.ItemType, &itemType)
q5.DuckToSimple(rspObj.ItemSubType, &itemSubType)
this.GetTeam().SendUpdateNotify() this.GetTeam().SendUpdateNotify()
})
} }
func (this *player) IsBattling() bool { func (this *player) IsBattling() bool {