Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
16c820858f
@ -290,6 +290,9 @@ const ( //Rpc
|
||||
Rpc_ModuleSociatyTask core.Rpc_Key = "Rpc_ModuleSociatyTask"
|
||||
Rpc_ModuleSociatyGetTask core.Rpc_Key = "Rpc_ModuleSociatyGetTask"
|
||||
|
||||
//武馆解锁柱子
|
||||
RPC_ModulePracticeUnLockPillar core.Rpc_Key = "RPC_ModulePracticeUnLockPillar"
|
||||
|
||||
// RPC 通知来了邮件
|
||||
Rpc_Mail core.Rpc_Key = "Rpc_Mail"
|
||||
)
|
||||
|
@ -92,7 +92,7 @@ func (this *modelArena) queryUserHeros(uid string, heroids []string) (results []
|
||||
var (
|
||||
model *db.DBModel
|
||||
)
|
||||
if model, err = this.module.GetDBModuleByUid(uid, comm.TableHero, time.Hour); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uid, comm.TableHero, time.Hour); err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
|
@ -208,11 +208,11 @@ func (this *Battle) CreateRtPvpBattle(req *pb.BattleRTPVPReq) (code pb.ErrorCode
|
||||
code = pb.ErrorCode_Exception
|
||||
return
|
||||
}
|
||||
if redmodel, err = this.GetDBModuleByUid(req.RedCompId, comm.TableHero, time.Hour); err != nil {
|
||||
if redmodel, err = this.GetDBModelByUid(req.RedCompId, comm.TableHero, time.Hour); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if bluemodel, err = this.GetDBModuleByUid(req.BlueCompId, comm.TableHero, time.Hour); err != nil {
|
||||
if bluemodel, err = this.GetDBModelByUid(req.BlueCompId, comm.TableHero, time.Hour); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ func (this *modelEquipmentComp) QueryUserEquipments(uId string) (equipments []*p
|
||||
)
|
||||
equipments = make([]*pb.DB_Equipment, 0)
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.GetList(uId, &equipments); err != nil {
|
||||
@ -143,7 +143,7 @@ func (this *modelEquipmentComp) AddEquipments(session comm.IUserSession, cIds ma
|
||||
model *db.DBModel
|
||||
)
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.AddLists(uId, add); err != nil {
|
||||
@ -166,7 +166,7 @@ func (this *modelEquipmentComp) addEquipment(equip *pb.DB_Equipment) (err error)
|
||||
model *db.DBModel
|
||||
)
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(equip.UId, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(equip.UId, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.AddList(equip.UId, equip.Id, equip); err != nil {
|
||||
@ -190,7 +190,7 @@ func (this *modelEquipmentComp) DelEquipments(uId string, eIds []string) (change
|
||||
)
|
||||
change = make([]*pb.DB_Equipment, 0)
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.DelListlds(uId, eIds); err != nil {
|
||||
@ -220,7 +220,7 @@ func (this *modelEquipmentComp) UpdateByHeroId(uid string, equipments ...*pb.DB_
|
||||
model *db.DBModel
|
||||
)
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
for _, v := range equipments {
|
||||
|
@ -139,7 +139,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int
|
||||
if hero != nil {
|
||||
hero.SameCount = 1 // 新需求 不需要判断叠加
|
||||
if this.moduleHero.IsCross() {
|
||||
if model, err = this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.moduleHero.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
this.moduleHero.Errorln(err)
|
||||
} else {
|
||||
if err = model.AddList(uid, hero.Id, hero); err != nil {
|
||||
@ -831,7 +831,7 @@ func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, c
|
||||
return
|
||||
}
|
||||
if this.moduleHero.IsCross() {
|
||||
if dbModel, err1 := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err1 == nil {
|
||||
if dbModel, err1 := this.moduleHero.GetDBModelByUid(uid, this.TableName, this.Expired); err1 == nil {
|
||||
if err = dbModel.GetList(uid, &heros); err != nil {
|
||||
this.moduleHero.Errorf("err:%v", err)
|
||||
return
|
||||
|
@ -310,7 +310,7 @@ func (this *Hero) AddHeroExp(session comm.IUserSession, heroObjID string, exp in
|
||||
}
|
||||
if this.IsCross() {
|
||||
_hero = &pb.DBHero{}
|
||||
if model, err := this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil {
|
||||
if model, err := this.GetDBModelByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil {
|
||||
if err := model.GetListObj(session.GetUserId(), heroObjID, _hero); err != nil {
|
||||
this.Errorf("err:%v", err)
|
||||
return
|
||||
@ -348,7 +348,7 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf
|
||||
|
||||
if this.IsCross() {
|
||||
_hero = &pb.DBHero{}
|
||||
if model, err = this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil {
|
||||
if model, err = this.GetDBModelByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil {
|
||||
if err := model.GetListObj(session.GetUserId(), heroObjID, _hero); err != nil {
|
||||
this.Errorf("err:%v", err)
|
||||
return
|
||||
@ -851,8 +851,7 @@ func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid []string
|
||||
)
|
||||
|
||||
if this.IsCross() {
|
||||
|
||||
if model, err = this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil {
|
||||
if model, err = this.GetDBModelByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil {
|
||||
for _, v := range heroOid {
|
||||
_hero := &pb.DBHero{}
|
||||
if err := model.GetListObj(session.GetUserId(), v, _hero); err != nil {
|
||||
|
@ -51,7 +51,7 @@ func (this *modelHoroscope) updateInfo(session comm.IUserSession, info *pb.DBHor
|
||||
"nodes": info.Nodes,
|
||||
"lastrest": info.Lastrest,
|
||||
})
|
||||
if model, err = this.module.GetDBModuleByUid(info.Uid, this.TableName, time.Hour); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(info.Uid, this.TableName, time.Hour); err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ func (this *ModelItemsComp) QueryUserPack(uId string) (itmes []*pb.DB_UserItemDa
|
||||
)
|
||||
itmes = make([]*pb.DB_UserItemData, 0)
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.GetList(uId, &itmes); err != nil {
|
||||
@ -66,7 +66,7 @@ func (this *ModelItemsComp) QueryUserPackByGridId(uId string, grid string) (itme
|
||||
|
||||
itme = &pb.DB_UserItemData{}
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.GetListObj(uId, grid, itme); err != nil {
|
||||
@ -90,7 +90,7 @@ func (this *ModelItemsComp) QueryUserPackByGridIds(uId string, grids []string) (
|
||||
|
||||
itme = make([]*pb.DB_UserItemData, len(grids))
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.GetListObjs(uId, grids, &itme); err != nil {
|
||||
@ -116,7 +116,7 @@ func (this *ModelItemsComp) AddUserPack(uId string, itmes ...*pb.DB_UserItemData
|
||||
model *db.DBModel
|
||||
)
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uId, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.AddLists(uId, data); err != nil {
|
||||
@ -138,7 +138,7 @@ func (this *ModelItemsComp) UpdateUserPack(uid string, itmes ...*pb.DB_UserItemD
|
||||
model *db.DBModel
|
||||
)
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
for _, v := range itmes {
|
||||
@ -172,7 +172,7 @@ func (this *ModelItemsComp) DeleteUserPack(uid string, itmes ...*pb.DB_UserItemD
|
||||
gridIds[i] = v.GridId
|
||||
}
|
||||
if this.module.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
if model, err = this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.DelListlds(uid, gridIds); err != nil {
|
||||
|
@ -477,7 +477,25 @@ func (this *ModuleBase) GetDBNodule(session comm.IUserSession, tableName string,
|
||||
}
|
||||
|
||||
//跨服对象获取数据操作对象
|
||||
func (this *ModuleBase) GetDBModuleByUid(uid, tableName string, expired time.Duration) (model *db.DBModel, err error) {
|
||||
func (this *ModuleBase) GetCrossDBModel(tableName string, expired time.Duration) (model *db.DBModel, err error) {
|
||||
var (
|
||||
conn *db.DBConn
|
||||
)
|
||||
if this.IsCross() {
|
||||
if conn, err = db.Local(); err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if conn, err = db.Cross(); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
model = db.NewDBModel(tableName, expired, conn)
|
||||
return
|
||||
}
|
||||
|
||||
//跨服对象获取数据操作对象
|
||||
func (this *ModuleBase) GetDBModelByUid(uid, tableName string, expired time.Duration) (model *db.DBModel, err error) {
|
||||
var (
|
||||
stag string
|
||||
conn *db.DBConn
|
||||
|
@ -56,6 +56,6 @@ func (this *apiComp) UnLock(session comm.IUserSession, req *pb.PracticeUnLockReq
|
||||
filed: pillar,
|
||||
"pillarf": room.Pillarf,
|
||||
})
|
||||
session.SendMsg(string(this.module.GetType()), "unLock", &pb.PracticeUnLockResp{Info: room})
|
||||
session.SendMsg(string(this.module.GetType()), "unlock", &pb.PracticeUnLockResp{Info: room})
|
||||
return
|
||||
}
|
||||
|
@ -45,10 +45,10 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
|
||||
Knapsack: make(map[string]int32),
|
||||
Gymaction: 0,
|
||||
Gymrefresh: 0,
|
||||
Pillar1: &pb.DBPracticePillar{Index: 1, Isunlock: 2, Lv: 1},
|
||||
Pillar1: &pb.DBPracticePillar{Index: 1, Lv: 1},
|
||||
Pillar2: &pb.DBPracticePillar{Index: 2, Lv: 1},
|
||||
Pillar3: &pb.DBPracticePillar{Index: 3, Lv: 1},
|
||||
Pillarf: &pb.DBPracticePillar{Index: 4, Isunlock: 2, Lv: 1},
|
||||
Pillarf: &pb.DBPracticePillar{Index: 4, Lv: 1},
|
||||
Statuers: make([]*pb.DBPracticeStatuer, 0),
|
||||
}
|
||||
if err = this.refreshnpc(result); err != nil {
|
||||
@ -64,6 +64,8 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
//刷新npc
|
||||
func (this *modelPandata) refreshnpc(room *pb.DBPracticeRoom) (err error) {
|
||||
var (
|
||||
|
@ -1,6 +1,8 @@
|
||||
package practice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
@ -11,6 +13,7 @@ import (
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/sys/db"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
@ -74,6 +77,7 @@ func (this *Practice) Start() (err error) {
|
||||
return
|
||||
}
|
||||
this.battle = module.(comm.IBattle)
|
||||
this.service.RegisterFunctionName(string(comm.RPC_ModulePracticeUnLockPillar), this.RPC_ModulePracticeUnLockPillar)
|
||||
return
|
||||
}
|
||||
|
||||
@ -156,51 +160,20 @@ func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32
|
||||
|
||||
//完成世界任务
|
||||
func (this *Practice) TaskComplete(session comm.IUserSession, taskid int32) {
|
||||
var (
|
||||
configure []*cfg.GamePandamasJsData
|
||||
room *pb.DBPracticeRoom
|
||||
err error
|
||||
this.Debug("TaskComplete",
|
||||
log.Field{Key: "session", Value: session.GetUserId()},
|
||||
log.Field{Key: "taskid", Value: taskid},
|
||||
)
|
||||
if configure, err = this.configure.getGamePandamasJs(); err != nil {
|
||||
this.Errorln(err)
|
||||
return
|
||||
}
|
||||
if room, err = this.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil {
|
||||
this.Errorln(err)
|
||||
return
|
||||
}
|
||||
for _, v := range configure {
|
||||
if v.UnlockCondition == taskid {
|
||||
switch v.Id {
|
||||
case 1:
|
||||
if room.Pillar1.Isunlock == 0 {
|
||||
room.Pillar1.Isunlock = 1
|
||||
}
|
||||
this.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||
"pillar1": room.Pillar1,
|
||||
})
|
||||
this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1001")
|
||||
break
|
||||
case 2:
|
||||
if room.Pillar2.Isunlock == 0 {
|
||||
room.Pillar2.Isunlock = 1
|
||||
}
|
||||
this.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||
"pillar2": room.Pillar2,
|
||||
})
|
||||
this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1001")
|
||||
break
|
||||
case 3:
|
||||
if room.Pillar3.Isunlock == 0 {
|
||||
room.Pillar3.Isunlock = 1
|
||||
}
|
||||
this.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||
"pillar3": room.Pillar3,
|
||||
})
|
||||
this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1001")
|
||||
break
|
||||
}
|
||||
if !this.IsCross() {
|
||||
err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(),
|
||||
comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar),
|
||||
&pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: fmt.Sprintf("%d", taskid)}, &pb.EmptyResp{})
|
||||
if err != nil {
|
||||
this.Errorln(err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
this.RPC_ModulePracticeUnLockPillar(context.Background(), &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: fmt.Sprintf("%d", taskid)}, &pb.EmptyResp{})
|
||||
}
|
||||
}
|
||||
|
||||
@ -291,3 +264,62 @@ func (this *Practice) ChallengeResults(bid, red, bule string, winSide int32) {
|
||||
"statuers": buleroom.Statuers,
|
||||
})
|
||||
}
|
||||
|
||||
//解锁武馆柱子
|
||||
func (this *Practice) RPC_ModulePracticeUnLockPillar(ctx context.Context, args *pb.RPCGeneralReqA2, reply *pb.EmptyResp) (err error) {
|
||||
this.Debug("RPC_ModulePracticeUnLockPillar",
|
||||
log.Field{Key: "uid", Value: args.Param1},
|
||||
log.Field{Key: "taskid", Value: args.Param2},
|
||||
)
|
||||
var (
|
||||
configure []*cfg.GamePandamasJsData
|
||||
room *pb.DBPracticeRoom
|
||||
taskid int64
|
||||
)
|
||||
if taskid, err = strconv.ParseInt(args.Param2, 10, 64); err != nil {
|
||||
this.Errorln(err)
|
||||
return
|
||||
}
|
||||
if configure, err = this.configure.getGamePandamasJs(); err != nil {
|
||||
this.Errorln(err)
|
||||
return
|
||||
}
|
||||
if room, err = this.modelPandata.queryUserMartialhall(args.Param1); err != nil {
|
||||
this.Errorln(err)
|
||||
return
|
||||
}
|
||||
for _, v := range configure {
|
||||
if v.UnlockCondition == int32(taskid) {
|
||||
switch v.Id {
|
||||
case 1:
|
||||
if room.Pillar1.Isunlock == 0 {
|
||||
room.Pillar1.Isunlock = 1
|
||||
}
|
||||
this.modelPandata.Change(args.Param1, map[string]interface{}{
|
||||
"pillar1": room.Pillar1,
|
||||
})
|
||||
this.atlas.CheckActivatePandaAtlasCollect(args.Param1, "1001")
|
||||
break
|
||||
case 2:
|
||||
if room.Pillar2.Isunlock == 0 {
|
||||
room.Pillar2.Isunlock = 1
|
||||
}
|
||||
this.modelPandata.Change(args.Param1, map[string]interface{}{
|
||||
"pillar2": room.Pillar2,
|
||||
})
|
||||
this.atlas.CheckActivatePandaAtlasCollect(args.Param1, "1001")
|
||||
break
|
||||
case 3:
|
||||
if room.Pillar3.Isunlock == 0 {
|
||||
room.Pillar3.Isunlock = 1
|
||||
}
|
||||
this.modelPandata.Change(args.Param1, map[string]interface{}{
|
||||
"pillar3": room.Pillar3,
|
||||
})
|
||||
this.atlas.CheckActivatePandaAtlasCollect(args.Param1, "1001")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ func (this *Privilege) SendDailyPrivilegeMail(session comm.IUserSession, cId []i
|
||||
}
|
||||
func (this *Privilege) GetCountByPrivilegeId(uid string, pType int32) (count int32) {
|
||||
if this.IsCross() { // 跨服情况
|
||||
if model, err := this.GetDBModuleByUid(uid, comm.TableVip, time.Hour); err == nil {
|
||||
if model, err := this.GetDBModelByUid(uid, comm.TableVip, time.Hour); err == nil {
|
||||
vip := &pb.DBVip{}
|
||||
if err = model.Get(uid, vip); err == nil {
|
||||
if v, ok := vip.Privilege[pType]; ok {
|
||||
|
@ -33,7 +33,7 @@ func (this *ModelExpand) Init(service core.IService, module core.IModule, comp c
|
||||
func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) {
|
||||
result = &pb.DBUserExpand{}
|
||||
if db.IsCross() {
|
||||
if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
if model, err := this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
this.module.Error("Cross GetDBModuleByUid", log.Field{Key: "uid", Value: uid})
|
||||
return result, err
|
||||
} else {
|
||||
@ -78,7 +78,7 @@ func (this *ModelExpand) ChangeUserExpand(uid string, value map[string]interface
|
||||
model *db.DBModel
|
||||
)
|
||||
if db.IsCross() {
|
||||
if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err == nil {
|
||||
if model, err = this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err == nil {
|
||||
return model.Change(uid, value)
|
||||
} else {
|
||||
this.module.Errorln(err)
|
||||
|
@ -93,7 +93,7 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser) {
|
||||
// return
|
||||
// }
|
||||
if this.module.IsCross() {
|
||||
if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
if model, err := this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.Get(uid, user); err != nil {
|
||||
@ -111,7 +111,7 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser) {
|
||||
//设置属性
|
||||
func (this *ModelUser) updateUserAttr(uid string, data map[string]interface{}) error {
|
||||
if this.module.IsCross() {
|
||||
if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
if model, err := this.module.GetDBModelByUid(uid, this.TableName, this.Expired); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
if err = model.Change(uid, data); err != nil {
|
||||
|
@ -858,8 +858,8 @@ type PracticeEnrolledReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
|
||||
Hero string `protobuf:"bytes,2,opt,name=hero,proto3" json:"hero"`
|
||||
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
|
||||
Hero []string `protobuf:"bytes,2,rep,name=hero,proto3" json:"hero"`
|
||||
}
|
||||
|
||||
func (x *PracticeEnrolledReq) Reset() {
|
||||
@ -901,11 +901,11 @@ func (x *PracticeEnrolledReq) GetGroup() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PracticeEnrolledReq) GetHero() string {
|
||||
func (x *PracticeEnrolledReq) GetHero() []string {
|
||||
if x != nil {
|
||||
return x.Hero
|
||||
}
|
||||
return ""
|
||||
return nil
|
||||
}
|
||||
|
||||
///登记满级英雄 回应
|
||||
@ -914,8 +914,8 @@ type PracticeEnrolledResp struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
|
||||
Hero string `protobuf:"bytes,2,opt,name=hero,proto3" json:"hero"`
|
||||
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
|
||||
Hero []string `protobuf:"bytes,2,rep,name=hero,proto3" json:"hero"`
|
||||
}
|
||||
|
||||
func (x *PracticeEnrolledResp) Reset() {
|
||||
@ -957,11 +957,11 @@ func (x *PracticeEnrolledResp) GetGroup() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PracticeEnrolledResp) GetHero() string {
|
||||
func (x *PracticeEnrolledResp) GetHero() []string {
|
||||
if x != nil {
|
||||
return x.Hero
|
||||
}
|
||||
return ""
|
||||
return nil
|
||||
}
|
||||
|
||||
///练功道具和教习推送
|
||||
@ -2110,11 +2110,11 @@ var file_practice_practice_msg_proto_rawDesc = []byte{
|
||||
0x22, 0x3f, 0x0a, 0x13, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x72, 0x6f,
|
||||
0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x72,
|
||||
0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x72,
|
||||
0x6f, 0x22, 0x40, 0x0a, 0x14, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x72,
|
||||
0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f,
|
||||
0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68,
|
||||
0x12, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x68,
|
||||
0x65, 0x72, 0x6f, 0x22, 0x24, 0x0a, 0x12, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x4a,
|
||||
0x58, 0x49, 0x74, 0x65, 0x6d, 0x50, 0x75, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
|
||||
0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x50, 0x72, 0x61,
|
||||
|
Loading…
Reference in New Issue
Block a user