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 // 生成传送门 构造房间数据
confStage *cfg.GameStoneStageData
curRoomConf *cfg.GameStoneRoomData // 当前房间
szBuff []int32
err error
szEvent []int32
roles []*pb.BattleRole
//szBuff []int32
err error
szEvent []int32
roles []*pb.BattleRole
)
update = make(map[string]interface{})
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 {
szBuff = this.module.configure.GetEventGroupDataByLottery(szEvent...)
for _, v := range szBuff {
event := this.module.configure.GetEventGroupDataByLottery(szEvent...)
for _, v := range event {
stone.Rooms.Eventid[v] = false
}
this.module.modelStonehenge.AddNewEvent(szEvent, stone)
this.module.modelStonehenge.AddNewEvent(event, stone)
}
// 特权校验
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
}
if len(szEvent) > 0 {
szEvent = this.module.configure.GetEventGroupDataByLottery(szEvent...)
for _, v := range szEvent {
event := this.module.configure.GetEventGroupDataByLottery(szEvent...)
for _, v := range event {
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)

View File

@ -40,48 +40,48 @@ func (this *apiComp) Modifyname(session comm.IUserSession, req *pb.UserModifynam
return
}
expand, err := this.module.modelExpand.GetUserExpand(uid)
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
// expand, err := this.module.modelExpand.GetUserExpand(uid)
// if err != nil {
// errdata = &pb.ErrorData{
// Code: pb.ErrorCode_DBError,
// Title: pb.ErrorCode_DBError.ToString(),
// Message: err.Error(),
// }
// return
// }
//校验名称修改次数
if expand.ModifynameCount <= 0 {
errdata = this.module.ConsumeRes(session, this.module.globalConf.HeroName, true)
if errdata != nil {
return
}
}
// if expand.ModifynameCount <= 0 {
// errdata = this.module.ConsumeRes(session, this.module.globalConf.HeroName, true)
// if errdata != nil {
// return
// }
// }
//修改名称次数
left := expand.ModifynameCount - 1
if left < 0 {
left = 0
}
mc := map[string]interface{}{
"modifynameCount": left,
}
if err := this.module.modelExpand.ChangeUserExpand(uid, mc); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
this.module.Errorf("更新昵称失败 uid:%v name:%v err:%v", uid, req.Name, err)
return
}
// //修改名称次数
// left := expand.ModifynameCount - 1
// if left < 0 {
// left = 0
// }
// mc := map[string]interface{}{
// "modifynameCount": left,
// }
// if err := this.module.modelExpand.ChangeUserExpand(uid, mc); err != nil {
// errdata = &pb.ErrorData{
// Code: pb.ErrorCode_DBError,
// Title: pb.ErrorCode_DBError.ToString(),
// Message: err.Error(),
// }
// this.module.Errorf("更新昵称失败 uid:%v name:%v err:%v", uid, req.Name, err)
// return
// }
// 修改名称
if errdata = this.module.modelUser.modifyName(uid, name); errdata != nil {
return
}
resp.Count = uint32(left)
//resp.Count = uint32(left)
this.sendMsg(session, UserSubTypeModifyName, resp)
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 {
globalConf := this.module.ModuleTools.GetGlobalConf()
initUpdate := map[string]interface{}{
"uid": uid,
"modifynameCount": 1, //修改名称1次
"sociatyTicket": globalConf.GuildBossInitialNum, //公会BOSS挑战券
"expitem": make(map[string]int32, 0), // 初始化
"mline": make(map[string]int32, 0),
"race": make(map[string]int32, 0),
"givetime": configure.Now().Unix(),
"herofrag": make(map[string]int32, 0), // 初始化
"uid": uid,
//"modifynameCount": 1, //修改名称1次
"sociatyTicket": globalConf.GuildBossInitialNum, //公会BOSS挑战券
"expitem": make(map[string]int32, 0), // 初始化
"mline": make(map[string]int32, 0),
"race": make(map[string]int32, 0),
"givetime": configure.Now().Unix(),
"herofrag": make(map[string]int32, 0), // 初始化
}
result.SociatyTicket = globalConf.GuildBossInitialNum
if err = this.module.modelExpand.ChangeUserExpand(uid, initUpdate); err != nil {