Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
e75f8cf4b3
@ -275,6 +275,17 @@ func (this *MCompConfigure) GetItemConfigureByType(useType int32) (item []*cfg.G
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *MCompConfigure) GetItemConfigureByBagType(bagType int32) (item []*cfg.GameItemData) {
|
||||||
|
if v, err := this.GetConfigure(game_item); err == nil {
|
||||||
|
for _, v1 := range v.(*cfg.GameItem).GetDataMap() {
|
||||||
|
if v1.Bagtype == bagType {
|
||||||
|
item = append(item, v1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
func (this *MCompConfigure) GetEquipmentConfigureById(equipmentId string) (configure *cfg.GameEquipData) {
|
func (this *MCompConfigure) GetEquipmentConfigureById(equipmentId string) (configure *cfg.GameEquipData) {
|
||||||
|
|
||||||
if v, err := this.GetConfigure(game_equip); err == nil {
|
if v, err := this.GetConfigure(game_equip); err == nil {
|
||||||
|
@ -477,15 +477,53 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_data := this.configure.GetItemConfigureByType(int32(num1))
|
_data := this.configure.GetItemConfigureByType(int32(num1))
|
||||||
|
var res []*cfg.Gameatn
|
||||||
for _, v := range _data {
|
for _, v := range _data {
|
||||||
res := &cfg.Gameatn{
|
res = append(res, &cfg.Gameatn{
|
||||||
A: "item",
|
A: "item",
|
||||||
T: v.Id,
|
T: v.Id,
|
||||||
N: int32(num2),
|
N: int32(num2),
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
if errdata = this.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil {
|
if errdata = this.DispenseRes(session, res, true); errdata != nil {
|
||||||
this.Debugf("DispenseRes err :uid = %s,code = %d", datas[0], errdata)
|
this.Debugf("DispenseRes err :uid = %s,code = %d", datas[0], errdata)
|
||||||
}
|
}
|
||||||
|
this.Debug("使用bingo命令:uid = %s ",
|
||||||
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
|
log.Field{Key: "0", Value: datas[0]},
|
||||||
|
log.Field{Key: "1", Value: datas[1]},
|
||||||
|
log.Field{Key: "2", Value: datas[2]},
|
||||||
|
)
|
||||||
|
} else if len(datas) == 3 && (datas[0] == "bagtype") {
|
||||||
|
num1, err := strconv.Atoi(datas[1])
|
||||||
|
if err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
num2, err := strconv.Atoi(datas[2])
|
||||||
|
if err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_data := this.configure.GetItemConfigureByBagType(int32(num1))
|
||||||
|
var res []*cfg.Gameatn
|
||||||
|
for _, v := range _data {
|
||||||
|
res = append(res, &cfg.Gameatn{
|
||||||
|
A: "item",
|
||||||
|
T: v.Id,
|
||||||
|
N: int32(num2),
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
if errdata = this.DispenseRes(session, res, true); errdata != nil {
|
||||||
|
this.Debugf("DispenseRes err :uid = %s,code = %d", datas[0], errdata)
|
||||||
}
|
}
|
||||||
this.Debug("使用bingo命令:uid = %s ",
|
this.Debug("使用bingo命令:uid = %s ",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
|
@ -41,6 +41,14 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe
|
|||||||
this.module.modelPlunder.changePlunderData(session.GetUserId(), map[string]interface{}{
|
this.module.modelPlunder.changePlunderData(session.GetUserId(), map[string]interface{}{
|
||||||
"landid": list.Landid,
|
"landid": list.Landid,
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
if land, err = this.module.modelLand.getPlunderLandData(list.Landid); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), "getlist", &pb.PlunderGetListResp{
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.PlunderGetListResp{
|
||||||
List: list,
|
List: list,
|
||||||
|
Loading…
Reference in New Issue
Block a user