Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
3e3b6c9d39
@ -32,13 +32,47 @@ func (this *apiComp) LatticeGrid(session comm.IUserSession, req *pb.UiGameLattic
|
|||||||
update := make(map[string]interface{}, 0)
|
update := make(map[string]interface{}, 0)
|
||||||
list, _ := this.module.modelLattice.getLatticeList(session.GetUserId(), req.Hdid)
|
list, _ := this.module.modelLattice.getLatticeList(session.GetUserId(), req.Hdid)
|
||||||
|
|
||||||
if _, ok := list.Gotarr[req.Grid]; ok {
|
if latticeConf, err = this.module.configure.GetLatticeConf(list.Floor); err != nil {
|
||||||
session.SendMsg(string(this.module.GetType()), "latticegrid", &pb.UiGameLatticeGridResp{Data: list})
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
|
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if list.Floor > 1 { // 移动到出生点 直接去上一层
|
||||||
|
if latticeConf.Bornpos == req.Grid {
|
||||||
|
list.Floor -= 1
|
||||||
|
update["floor"] = list.Floor
|
||||||
|
list.Curpos = 0
|
||||||
|
update["curpos"] = list.Curpos
|
||||||
|
this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update)
|
||||||
|
session.SendMsg(string(this.module.GetType()), "latticegrid", &pb.UiGameLatticeGridResp{
|
||||||
|
Data: list,
|
||||||
|
Atno: atno,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
if v1, ok := list.Lattice[list.Floor]; ok {
|
if v1, ok := list.Lattice[list.Floor]; ok {
|
||||||
if _, ok := v1.Data[req.Grid]; ok {
|
if _, ok := v1.Data[req.Grid]; ok {
|
||||||
list.Curpos = req.Grid
|
list.Curpos = req.Grid
|
||||||
|
if req.Grid == latticeConf.Outpos { // 宝箱关
|
||||||
|
list.Floor += 1
|
||||||
|
// 校验是不是达到最大层数
|
||||||
|
if _, e := this.module.configure.GetLatticeConf(list.Floor); e != nil {
|
||||||
|
list.Floor -= 1
|
||||||
|
} else {
|
||||||
|
list.Curpos = 0
|
||||||
|
}
|
||||||
|
update["floor"] = list.Floor
|
||||||
|
if list.Total < list.Floor {
|
||||||
|
list.Total = list.Floor
|
||||||
|
update["total"] = list.Total
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
update["curpos"] = list.Curpos
|
update["curpos"] = list.Curpos
|
||||||
this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update)
|
this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update)
|
||||||
session.SendMsg(string(this.module.GetType()), "latticegrid", &pb.UiGameLatticeGridResp{
|
session.SendMsg(string(this.module.GetType()), "latticegrid", &pb.UiGameLatticeGridResp{
|
||||||
@ -49,7 +83,6 @@ func (this *apiComp) LatticeGrid(session comm.IUserSession, req *pb.UiGameLattic
|
|||||||
}
|
}
|
||||||
list.Lattice[list.Floor].Data[req.Grid] = 1
|
list.Lattice[list.Floor].Data[req.Grid] = 1
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
list.Lattice[list.Floor] = &pb.LatticeData{
|
list.Lattice[list.Floor] = &pb.LatticeData{
|
||||||
Data: map[int32]int32{req.Grid: 1},
|
Data: map[int32]int32{req.Grid: 1},
|
||||||
}
|
}
|
||||||
@ -63,11 +96,6 @@ func (this *apiComp) LatticeGrid(session comm.IUserSession, req *pb.UiGameLattic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 校验 是否是宝箱
|
|
||||||
latticeConf, err = this.module.configure.GetLatticeConf(list.Floor)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for _, v := range latticeConf.Chestspos {
|
for _, v := range latticeConf.Chestspos {
|
||||||
if v == req.Grid { // 发现是宝箱
|
if v == req.Grid { // 发现是宝箱
|
||||||
if errdata, atno = this.module.DispenseAtno(session, latticeConf.Chestsward, true); errdata != nil {
|
if errdata, atno = this.module.DispenseAtno(session, latticeConf.Chestsward, true); errdata != nil {
|
||||||
@ -93,8 +121,10 @@ func (this *apiComp) LatticeGrid(session comm.IUserSession, req *pb.UiGameLattic
|
|||||||
// 校验是不是达到最大层数
|
// 校验是不是达到最大层数
|
||||||
if _, e := this.module.configure.GetLatticeConf(list.Floor); e != nil {
|
if _, e := this.module.configure.GetLatticeConf(list.Floor); e != nil {
|
||||||
list.Floor -= 1
|
list.Floor -= 1
|
||||||
|
} else {
|
||||||
|
req.Grid = 0 // 重置出生点
|
||||||
}
|
}
|
||||||
update["Floor"] = list.Floor
|
update["floor"] = list.Floor
|
||||||
if list.Total < list.Floor {
|
if list.Total < list.Floor {
|
||||||
list.Total = list.Floor
|
list.Total = list.Floor
|
||||||
update["total"] = list.Total
|
update["total"] = list.Total
|
||||||
|
Loading…
Reference in New Issue
Block a user