This commit is contained in:
liwei1dao 2023-08-23 18:34:21 +08:00
commit 7835ad53a1
4 changed files with 51 additions and 51 deletions

View File

@ -28,10 +28,10 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt
portal int32 // 生成传送门 构造房间数据 portal int32 // 生成传送门 构造房间数据
confStage *cfg.GameStoneStageData confStage *cfg.GameStoneStageData
curRoomConf *cfg.GameStoneRoomData // 当前房间 curRoomConf *cfg.GameStoneRoomData // 当前房间
szBuff []int32 //szBuff []int32
err error err error
szEvent []int32 szEvent []int32
roles []*pb.BattleRole roles []*pb.BattleRole
) )
update = make(map[string]interface{}) update = make(map[string]interface{})
if errdata = this.EnterLevelCheck(session, req); errdata != nil { if errdata = this.EnterLevelCheck(session, req); errdata != nil {
@ -135,11 +135,11 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt
} }
if len(szEvent) > 0 { if len(szEvent) > 0 {
szBuff = this.module.configure.GetEventGroupDataByLottery(szEvent...) event := this.module.configure.GetEventGroupDataByLottery(szEvent...)
for _, v := range szBuff { for _, v := range event {
stone.Rooms.Eventid[v] = false stone.Rooms.Eventid[v] = false
} }
this.module.modelStonehenge.AddNewEvent(szEvent, stone) this.module.modelStonehenge.AddNewEvent(event, stone)
} }
// 特权校验 // 特权校验
for _, v := range stone.Privilege { for _, v := range stone.Privilege {

View File

@ -115,11 +115,11 @@ func (this *apiComp) GotoRoom(session comm.IUserSession, req *pb.StonehengeGotoR
stone.Rooms.Eventid[curRoomConf.BossEvent] = false stone.Rooms.Eventid[curRoomConf.BossEvent] = false
} }
if len(szEvent) > 0 { if len(szEvent) > 0 {
szEvent = this.module.configure.GetEventGroupDataByLottery(szEvent...) event := this.module.configure.GetEventGroupDataByLottery(szEvent...)
for _, v := range szEvent { for _, v := range event {
stone.Rooms.Eventid[v] = false stone.Rooms.Eventid[v] = false
} }
this.module.modelStonehenge.AddNewEvent(szEvent, stone) this.module.modelStonehenge.AddNewEvent(event, stone)
} }
//stone.Rooms.Portal = this.module.configure.GetRoomGroupDataByLottery(req.Portal) //stone.Rooms.Portal = this.module.configure.GetRoomGroupDataByLottery(req.Portal)

View File

@ -40,48 +40,48 @@ func (this *apiComp) Modifyname(session comm.IUserSession, req *pb.UserModifynam
return return
} }
expand, err := this.module.modelExpand.GetUserExpand(uid) // expand, err := this.module.modelExpand.GetUserExpand(uid)
if err != nil { // if err != nil {
errdata = &pb.ErrorData{ // errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError, // Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(), // Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(), // Message: err.Error(),
} // }
return // return
} // }
//校验名称修改次数 //校验名称修改次数
if expand.ModifynameCount <= 0 { // if expand.ModifynameCount <= 0 {
errdata = this.module.ConsumeRes(session, this.module.globalConf.HeroName, true) // errdata = this.module.ConsumeRes(session, this.module.globalConf.HeroName, true)
if errdata != nil { // if errdata != nil {
return // return
} // }
} // }
//修改名称次数 // //修改名称次数
left := expand.ModifynameCount - 1 // left := expand.ModifynameCount - 1
if left < 0 { // if left < 0 {
left = 0 // left = 0
} // }
mc := map[string]interface{}{ // mc := map[string]interface{}{
"modifynameCount": left, // "modifynameCount": left,
} // }
if err := this.module.modelExpand.ChangeUserExpand(uid, mc); err != nil { // if err := this.module.modelExpand.ChangeUserExpand(uid, mc); err != nil {
errdata = &pb.ErrorData{ // errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError, // Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(), // Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(), // Message: err.Error(),
} // }
this.module.Errorf("更新昵称失败 uid:%v name:%v err:%v", uid, req.Name, err) // this.module.Errorf("更新昵称失败 uid:%v name:%v err:%v", uid, req.Name, err)
return // return
} // }
// 修改名称 // 修改名称
if errdata = this.module.modelUser.modifyName(uid, name); errdata != nil { if errdata = this.module.modelUser.modifyName(uid, name); errdata != nil {
return return
} }
resp.Count = uint32(left) //resp.Count = uint32(left)
this.sendMsg(session, UserSubTypeModifyName, resp) this.sendMsg(session, UserSubTypeModifyName, resp)
return return

View File

@ -47,14 +47,14 @@ func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err
if err = this.Get(uid, result); err != nil && mongo.ErrNoDocuments == err { if err = this.Get(uid, result); err != nil && mongo.ErrNoDocuments == err {
globalConf := this.module.ModuleTools.GetGlobalConf() globalConf := this.module.ModuleTools.GetGlobalConf()
initUpdate := map[string]interface{}{ initUpdate := map[string]interface{}{
"uid": uid, "uid": uid,
"modifynameCount": 1, //修改名称1次 //"modifynameCount": 1, //修改名称1次
"sociatyTicket": globalConf.GuildBossInitialNum, //公会BOSS挑战券 "sociatyTicket": globalConf.GuildBossInitialNum, //公会BOSS挑战券
"expitem": make(map[string]int32, 0), // 初始化 "expitem": make(map[string]int32, 0), // 初始化
"mline": make(map[string]int32, 0), "mline": make(map[string]int32, 0),
"race": make(map[string]int32, 0), "race": make(map[string]int32, 0),
"givetime": configure.Now().Unix(), "givetime": configure.Now().Unix(),
"herofrag": make(map[string]int32, 0), // 初始化 "herofrag": make(map[string]int32, 0), // 初始化
} }
result.SociatyTicket = globalConf.GuildBossInitialNum result.SociatyTicket = globalConf.GuildBossInitialNum
if err = this.module.modelExpand.ChangeUserExpand(uid, initUpdate); err != nil { if err = this.module.modelExpand.ChangeUserExpand(uid, initUpdate); err != nil {