This commit is contained in:
meixiongfeng 2023-11-22 18:41:21 +08:00
parent a311730351
commit c76d8e77e5
13 changed files with 32 additions and 11 deletions

View File

@ -400,7 +400,6 @@ type (
// 查询所有特权 key 对应comm.PrivilegeType1类型
CheckAllPrivilege(session IUserSession) map[int32]*pb.PrivilegeList
// 通过特权类型获取特权对应的增加数量
GetCountByPrivilegeId(uid string, pType int32) (count int32)
}
//武馆

View File

@ -801,7 +801,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
log.Field{Key: "0", Value: datas[0]},
)
} else if len(datas) == 2 && (datas[0] == "create") {
} else if len(datas) == 1 && (datas[0] == "create") {
var (
err error
)
@ -811,9 +811,8 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
req := &pb.UserCreateReq{
NickName: datas[1],
Figure: 16010101,
Gender: 1,
Figure: 16010101,
Gender: 1,
}
if errdata = module1.(comm.IUser).GMCreatePlayer(session, req); errdata != nil {
return

View File

@ -95,5 +95,9 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.MoonfantasyBuyReq) (
// "ticket": info.Ticket,
})
session.SendMsg(string(this.module.GetType()), "buy", &pb.MoonfantasyBuyResp{Issucc: true, BattleNum: req.BuyNum})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "MoonfantasyBuyReq", need)
})
return
}

View File

@ -60,7 +60,9 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.MoonlvAwardReq) (e
list.Lv += 1
update["lv"] = list.Lv
this.module.ModuleUser.ChangeUserMoonLv(session, list.Lv)
if errdata = this.module.ModuleUser.ChangeUserMoonLv(session, list.Lv); errdata != nil {
return
}
// 升级了清空当前任务
list.Tasks = nil
// 重置任务

View File

@ -58,5 +58,8 @@ func (this *apiComp) ClearCD(session comm.IUserSession, req *pb.PassonClearCDReq
return
}
session.SendMsg(string(this.module.GetType()), "clearcd", &pb.PassonClearCDResp{Index: req.Index})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "PassonClearCDReq", conf.Remake)
})
return
}

View File

@ -92,5 +92,8 @@ func (this *apiComp) ActivityBuy(session comm.IUserSession, req *pb.PayActivityB
return
}
session.SendMsg(string(this.module.GetType()), "activitybuy", &pb.PayDailyBuyResp{Isucc: true, Items: items})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "PayDailyBuyReq", conf.Costitem)
})
return
}

View File

@ -67,5 +67,8 @@ func (this *apiComp) DailyBuy(session comm.IUserSession, req *pb.PayDailyBuyReq)
}
session.SendMsg(string(this.module.GetType()), "dailybuy", &pb.PayDailyBuyResp{Isucc: true, Items: items})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "PayDailyBuyReq", conf.Costitem)
})
return
}

View File

@ -85,5 +85,8 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
})
session.SendMsg(string(this.module.GetType()), "gymrefresh", &pb.PracticeGymRefreshResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "PracticeGymRefreshReq", atn)
})
return
}

View File

@ -88,5 +88,8 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.PracticeUpgradeR
"pillarf": room.Pillarf,
})
session.SendMsg(string(this.module.GetType()), "upgrade", &pb.PracticeUpgradeResp{Index: req.Index, Lv: pillar.Lv})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "PracticeUpgradeReq", pillarconfigure.UpLvConsume)
})
return
}

View File

@ -89,6 +89,9 @@ func (this *apiComp) BuyGift(session comm.IUserSession, req *pb.PrivilegeBuyGift
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "PrivilegeBuyGiftReq", atno)
if conf.PriceDiscount.N > 0 {
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "PrivilegeBuyGiftReq", conf.PriceDiscount)
}
})
return
}

View File

@ -41,8 +41,8 @@ func (this *ModelVip) modifyVipData(uid string, data map[string]interface{}) err
return this.Change(uid, data)
}
// 增加vip信息
func (this *ModelVip) addVipData(uId string, vip *pb.DBVip) (err error) {
//创建一条VIP信息
func (this *ModelVip) createVipData(uId string, vip *pb.DBVip) (err error) {
if err = this.Add(uId, vip); err != nil {
this.module.Errorf("err:%v", err)

View File

@ -143,7 +143,7 @@ func (this *Privilege) Delivery(session comm.IUserSession, pId int32) (errdata *
CTime: configure.Now().Unix(),
RewardTime: 0,
}
if err = this.modelVip.addVipData(session.GetUserId(), vip); err != nil {
if err = this.modelVip.createVipData(session.GetUserId(), vip); err != nil {
this.Errorf("err:%v", err)
return
}
@ -372,7 +372,7 @@ func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int3
CTime: configure.Now().Unix(),
RewardTime: configure.Now().Unix(),
}
if err = this.modelVip.addVipData(session.GetUserId(), vip); err != nil {
if err = this.modelVip.createVipData(session.GetUserId(), vip); err != nil {
this.Errorf("err:%v", err)
return
}

View File

@ -73,7 +73,6 @@ func (this *Smithy) CheckActivateAtlasCollect(uid string, id string) {
if this.IsCross() {
atlas := &pb.DBAtlas{}
if model, err := this.GetDBModelByUid(uid, this.modelAtlas.TableName); err == nil {
if err := model.Get(uid, atlas); err != nil { // 防止数据没有初始化情况
if mongo.ErrNoDocuments == err {
atlas.Id = primitive.NewObjectID().Hex()