This commit is contained in:
liwei1dao 2023-05-30 21:25:38 +08:00
commit 85d861c4f1
48 changed files with 198 additions and 63 deletions

View File

@ -22,7 +22,10 @@ func (this *apiComp) Activate(session comm.IUserSession, req *pb.AtlasActivateRe
atlasConf, err := this.module.configure.GetPandoAtlasConf(req.Id) atlasConf, err := this.module.configure.GetPandoAtlasConf(req.Id)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound // 返回错误码 code = pb.ErrorCode_ConfigNoFound // 返回错误码
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
list, _ := this.module.modelPandaAtlas.getPandaAtlasList(session.GetUserId()) list, _ := this.module.modelPandaAtlas.getPandaAtlasList(session.GetUserId())

View File

@ -21,6 +21,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
cityInfo *pb.CityInfo cityInfo *pb.CityInfo
ok bool ok bool
upperLimit int32 // 单个物品堆叠上限 upperLimit int32 // 单个物品堆叠上限
) )
update = make(map[string]interface{}) update = make(map[string]interface{})
if code = this.BuyOrSellCheck(session, req); code != pb.ErrorCode_Success { if code = this.BuyOrSellCheck(session, req); code != pb.ErrorCode_Success {
@ -37,7 +38,10 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
if err == nil { if err == nil {
upperLimit = c.Bagtagnum // 获取单个格子堆叠数 upperLimit = c.Bagtagnum // 获取单个格子堆叠数
} else { } else {
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
@ -62,7 +66,10 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
price = cityConf.Specialnum * price / 1000 price = cityConf.Specialnum * price / 1000
bFound = true bFound = true
} else { } else {
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
@ -99,7 +106,10 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
update["lv"] = curLv update["lv"] = curLv
update["baglimit"] = c.Bagtop update["baglimit"] = c.Bagtop
} else { } else {
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
@ -149,7 +159,10 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
update["city"] = caravan.City update["city"] = caravan.City
addScore -= price * v addScore -= price * v
} else { } else {
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }

View File

@ -27,7 +27,10 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.CaravanGetListRe
if conf, err := this.module.configure.GetCaravanLv(list.Lv); err == nil { if conf, err := this.module.configure.GetCaravanLv(list.Lv); err == nil {
this.module.ModuleItems.CleanItemById(session, conf.Tickettop.T) // 清理之前的门票数据 this.module.ModuleItems.CleanItemById(session, conf.Tickettop.T) // 清理之前的门票数据
} else { } else {
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }

View File

@ -29,7 +29,10 @@ func (this *apiComp) GetStory(session comm.IUserSession, req *pb.CaravanGetStory
conf, err := this.module.configure.GetCaravanEventById(req.Cid) conf, err := this.module.configure.GetCaravanEventById(req.Cid)
if err != nil { if err != nil {
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }

View File

@ -42,7 +42,10 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity
bNewTask = false bNewTask = false
} }
} else { } else {
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
@ -73,7 +76,10 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity
N: req.Ticket, N: req.Ticket,
} }
} else { } else {
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }

View File

@ -22,7 +22,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.EnchantChallen
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回 return // 参数校验失败直接返回
} }
enchant, err := this.module.modelEnchant.getEnchantList(session.GetUserId()) enchant, err := this.module.modelEnchant.getEnchantList(session.GetUserId())
if err != nil { if err != nil {
code = pb.ErrorCode_PagodaNotFound code = pb.ErrorCode_PagodaNotFound
@ -32,7 +31,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.EnchantChallen
cfgData, err := this.module.configure.GetEnchantBossConfigData(req.BossType) cfgData, err := this.module.configure.GetEnchantBossConfigData(req.BossType)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
if len(cfgData) <= 0 { if len(cfgData) <= 0 {

View File

@ -37,7 +37,10 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha
cfgEnchant, err := this.module.configure.GetEnchantBossConfigData(req.BossType) cfgEnchant, err := this.module.configure.GetEnchantBossConfigData(req.BossType)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }

View File

@ -24,7 +24,10 @@ func (this *apiComp) ActivateAtlas(session comm.IUserSession, req *pb.GourmetAct
conf, err := this.configure.GetGrormetCookBookConf(req.Cid) conf, err := this.configure.GetGrormetCookBookConf(req.Cid)
if err != nil { // 配置校验 if err != nil { // 配置校验
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
_gourmet, err := this.module.modelAtlas.getGourmetAtlasList(session.GetUserId()) _gourmet, err := this.module.modelAtlas.getGourmetAtlasList(session.GetUserId())

View File

@ -28,7 +28,10 @@ func (this *apiComp) CreateFood(session comm.IUserSession, req *pb.GourmetCreate
conf, err := this.configure.GetGrormetCookBookConf(req.Cid) conf, err := this.configure.GetGrormetCookBookConf(req.Cid)
if err != nil { // 配置校验 if err != nil { // 配置校验
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }

View File

@ -41,9 +41,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
awakenData, err = this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1) awakenData, err = this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)
if err != nil { if err != nil {
data = &pb.ErrorData{}
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
if len(awakenData.Phasebonus) < 2 { // 配置校验 if len(awakenData.Phasebonus) < 2 { // 配置校验
@ -141,7 +143,10 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
} else { } else {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), szTask...) go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), szTask...)

View File

@ -42,7 +42,10 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HeroBuyReq) (code pb
if conf, err = this.module.configure.GetShopItemsConfigureByGroups(req.BuyType, udata); err != nil { // 找配置 if conf, err = this.module.configure.GetShopItemsConfigureByGroups(req.BuyType, udata); err != nil { // 找配置
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }

View File

@ -269,7 +269,10 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
_data, err := this.module.configure.GetPollByType(strPool[index]) _data, err := this.module.configure.GetPollByType(strPool[index])
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
sz := make([]int32, 0) sz := make([]int32, 0)

View File

@ -31,7 +31,10 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c
conf, err := this.module.configure.GetHeroFucionConfig(req.HeroId) conf, err := this.module.configure.GetHeroFucionConfig(req.HeroId)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound // 配置没找到 code = pb.ErrorCode_ConfigNoFound // 配置没找到
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
for _, v := range req.Heros { for _, v := range req.Heros {

View File

@ -25,7 +25,6 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
cost []*cfg.Gameatn // 技能升级消耗 cost []*cfg.Gameatn // 技能升级消耗
lvUpCount int32 // 技能升级的次数 lvUpCount int32 // 技能升级的次数
) )
code = this.StrengthenUpSkillCheck(session, req) // check code = this.StrengthenUpSkillCheck(session, req) // check
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
return return
@ -38,7 +37,10 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
heroCfg, err := this.module.configure.GetHeroConfig(_hero.HeroID) heroCfg, err := this.module.configure.GetHeroConfig(_hero.HeroID)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
for _, v1 := range req.Item { for _, v1 := range req.Item {
@ -80,7 +82,10 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
skillData, err := this.module.configure.GetHeroSkillUpConfig(skill.SkillID) skillData, err := this.module.configure.GetHeroSkillUpConfig(skill.SkillID)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
sz = append(sz, skillData.Probability[skill.SkillLv]) sz = append(sz, skillData.Probability[skill.SkillLv])

View File

@ -23,7 +23,6 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
_hero *pb.DBHero // 目标英雄 _hero *pb.DBHero // 目标英雄
err error err error
) )
code = this.StrengthenUpStarCheck(session, req) // check code = this.StrengthenUpStarCheck(session, req) // check
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
return return
@ -37,13 +36,19 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
starConf, err = this.module.configure.GetHeroStarupConfig(_hero.HeroID, _hero.Star) starConf, err = this.module.configure.GetHeroStarupConfig(_hero.HeroID, _hero.Star)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
heroConf, err := this.module.configure.GetHeroConfig(_hero.HeroID) heroConf, err := this.module.configure.GetHeroConfig(_hero.HeroID)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
nextHeroConfig, _ := this.module.configure.GetHeroStarupConfig(_hero.HeroID, _hero.Star+1) nextHeroConfig, _ := this.module.configure.GetHeroStarupConfig(_hero.HeroID, _hero.Star+1)

View File

@ -49,7 +49,10 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren
costGold += expConf.Needgold * v costGold += expConf.Needgold * v
} else { } else {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
} }

View File

@ -23,6 +23,7 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe
chanegCard []*pb.DBHero // 推送属性变化 chanegCard []*pb.DBHero // 推送属性变化
res []*cfg.Gameatn // 学习天赋需要消耗的道具 res []*cfg.Gameatn // 学习天赋需要消耗的道具
) )
chanegCard = make([]*pb.DBHero, 0) chanegCard = make([]*pb.DBHero, 0)
if code = this.TalentLearnCheck(session, req); code != pb.ErrorCode_Success { if code = this.TalentLearnCheck(session, req); code != pb.ErrorCode_Success {
return return
@ -61,7 +62,10 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe
talentConf, err := this.module.configure.GetHeroTalent(req.TalentID) talentConf, err := this.module.configure.GetHeroTalent(req.TalentID)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
// 校验 // 校验

View File

@ -46,7 +46,10 @@ func (this *apiComp) TalentReset(session comm.IUserSession, req *pb.HeroTalentRe
talentPoint += conf.Point // 获取当前英雄的天赋点数 talentPoint += conf.Point // 获取当前英雄的天赋点数
} else { } else {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
} }

View File

@ -36,7 +36,10 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
favorConf, err := this.module.configure.GetFavorability(_heroFetter.Heroid, 1) // 取1级的就可以 favorConf, err := this.module.configure.GetFavorability(_heroFetter.Heroid, 1) // 取1级的就可以
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
// 领取传记往事id // 领取传记往事id

View File

@ -41,7 +41,10 @@ func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvReward
confData, err := this.module.configure.GetFavorability(_heroFetter.Heroid, req.Lv) confData, err := this.module.configure.GetFavorability(_heroFetter.Heroid, req.Lv)
if err != nil { if err != nil {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }

View File

@ -42,7 +42,10 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
_exp, err := this.module.configure.GetFavorabilityExp(_heroObj.Heroid) _exp, err := this.module.configure.GetFavorabilityExp(_heroObj.Heroid)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
maxLv = int32(len(_exp)) // 获取当前星级羁绊最大等级 maxLv = int32(len(_exp)) // 获取当前星级羁绊最大等级
@ -74,7 +77,10 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
_c, err := this.module.configure.GetFavorability(_heroObj.Heroid, _heroObj.Favorlv) _c, err := this.module.configure.GetFavorability(_heroObj.Heroid, _heroObj.Favorlv)
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
for _, v := range _c.LikesFood { // 喜欢的食物 for _, v := range _c.LikesFood { // 喜欢的食物
@ -157,7 +163,10 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
}) })
} else { } else {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
} }

View File

@ -52,7 +52,10 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.MlineGetListReq)
} }
} else { } else {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Message = err.Error() data = &pb.ErrorData{
Title: pb.GetErrorCodeMsg(code),
Message: err.Error(),
}
return return
} }
} }

View File

@ -61,24 +61,16 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.PracticeUpgradeR
} }
switch pillar.Lv { switch pillar.Lv {
case 2: case 2:
if err := this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100002"); err != nil { this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100002")
data.Message = err.Error()
}
break break
case 3: case 3:
if this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100003"); err != nil { this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100003")
data.Message = err.Error()
}
break break
case 4: case 4:
if this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100004"); err != nil { this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100004")
data.Message = err.Error()
}
break break
case 5: case 5:
if this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100005"); err != nil { this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100005")
data.Message = err.Error()
}
break break
} }
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{ this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{

View File

@ -15,7 +15,7 @@ func (this *apiComp) Formation(session comm.IUserSession, req *pb.SociatyBFormat
if code = this.FormationCheck(session, req); code != pb.ErrorCode_Success { if code = this.FormationCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
user := this.module.ModuleUser.GetUser(uid) user := this.module.ModuleUser.GetUser(uid)
if user == nil { if user == nil {
@ -29,6 +29,7 @@ func (this *apiComp) Formation(session comm.IUserSession, req *pb.SociatyBFormat
ggd := this.module.ModuleTools.GetGlobalConf() ggd := this.module.ModuleTools.GetGlobalConf()
if ggd == nil { if ggd == nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
data.Title = code.ToString()
return return
} }
@ -36,6 +37,7 @@ func (this *apiComp) Formation(session comm.IUserSession, req *pb.SociatyBFormat
if _, ok := req.Teams[2]; ok { if _, ok := req.Teams[2]; ok {
if user.Lv < ggd.GuildBossTroop2 { if user.Lv < ggd.GuildBossTroop2 {
code = pb.ErrorCode_SociatyTeamUnlock code = pb.ErrorCode_SociatyTeamUnlock
data.Title = code.ToString()
return return
} }
} }

View File

@ -26,7 +26,9 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid}) data.Title = code.ToString()
data.Datastring = uid
data.Message = SociatyNoFound
return return
} }
@ -36,6 +38,8 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
pb.SociatyJob_VICEPRESIDENT, pb.SociatyJob_VICEPRESIDENT,
pb.SociatyJob_ADMIN) { pb.SociatyJob_ADMIN) {
code = pb.ErrorCode_SociatyNoRight code = pb.ErrorCode_SociatyNoRight
data.Title = code.ToString()
data.Message = SociatyNoRight
return return
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"errors" "errors"
"fmt"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
@ -23,11 +24,14 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getSociaty(req.SociatyId) sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
data.Title = code.ToString()
data.Datastring = req.SociatyId
this.module.Error("公会未找到", log.Field{Key: "uid", Value: uid}, log.Field{Key: "sociatyId", Value: req.SociatyId}) this.module.Error("公会未找到", log.Field{Key: "uid", Value: uid}, log.Field{Key: "sociatyId", Value: req.SociatyId})
return return
} }
@ -37,17 +41,21 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
if err != nil { if err != nil {
this.module.Error("GetRemoteUserExpand", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()}) this.module.Error("GetRemoteUserExpand", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()})
code = pb.ErrorCode_UserSessionNobeing code = pb.ErrorCode_UserSessionNobeing
data.Title = code.ToString()
return return
} }
if utils.IsInCDHour(userEx.SociatyCd) { if utils.IsInCDHour(userEx.SociatyCd) {
code = pb.ErrorCode_SociatyCDLimit code = pb.ErrorCode_SociatyCDLimit
data.Title = code.ToString()
data.Message = fmt.Sprintf("CD内")
return return
} }
// 是否公会成员 // 是否公会成员
if this.module.modelSociaty.isMember(uid, sociaty) { if this.module.modelSociaty.isMember(uid, sociaty) {
code = pb.ErrorCode_SociatyBelongTo code = pb.ErrorCode_SociatyBelongTo
data.Title = code.ToString()
return return
} }

View File

@ -20,11 +20,13 @@ func (this *apiComp) ApplyCancel(session comm.IUserSession, req *pb.SociatyApply
if code = this.ApplyCancelCheck(session, req); code != pb.ErrorCode_Success { if code = this.ApplyCancelCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getSociaty(req.SociatyId) sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
if sociaty != nil && sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
data.Title = code.ToString()
this.module.Error("公会未找到", log.Field{Key: "uid", Value: uid}, log.Field{Key: "sociatyId", Value: req.SociatyId}) this.module.Error("公会未找到", log.Field{Key: "uid", Value: uid}, log.Field{Key: "sociatyId", Value: req.SociatyId})
return return
} }

View File

@ -20,6 +20,7 @@ func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.SociatyApplyLi
if code = this.ApplyListCheck(session, req); code != pb.ErrorCode_Success { if code = this.ApplyListCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getSociaty(req.SociatyId) sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
if sociaty == nil { if sociaty == nil {

View File

@ -20,7 +20,7 @@ func (this *apiComp) Assign(session comm.IUserSession, req *pb.SociatyAssignReq)
if code = this.AssignCheck(session, req); code != pb.ErrorCode_Success { if code = this.AssignCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
if uid == req.TargetId { if uid == req.TargetId {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError

View File

@ -15,7 +15,7 @@ func (this *apiComp) BossmainCheck(session comm.IUserSession, req *pb.SociatyBMa
func (this *apiComp) Bossmain(session comm.IUserSession, req *pb.SociatyBMainReq) (code pb.ErrorCode, data *pb.ErrorData) { func (this *apiComp) Bossmain(session comm.IUserSession, req *pb.SociatyBMainReq) (code pb.ErrorCode, data *pb.ErrorData) {
uid := session.GetUserId() uid := session.GetUserId()
data = &pb.ErrorData{}
ggd := this.module.ModuleTools.GetGlobalConf() ggd := this.module.ModuleTools.GetGlobalConf()
if ggd == nil { if ggd == nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
@ -51,6 +51,7 @@ func (this *apiComp) Bossmain(session comm.IUserSession, req *pb.SociatyBMainReq
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
data.Title = code.ToString()
this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid}) this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid})
return return
} }

View File

@ -19,10 +19,12 @@ func (this *apiComp) Brank(session comm.IUserSession, req *pb.SociatyBRankReq) (
if code = this.BrankCheck(session, req); code != pb.ErrorCode_Success { if code = this.BrankCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
data.Title = code.ToString()
this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid}) this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid})
return return
} }

View File

@ -19,10 +19,12 @@ func (this *apiComp) Breceive(session comm.IUserSession, req *pb.SociatyBReceive
if code = this.BreceiveCheck(session, req); code != pb.ErrorCode_Success { if code = this.BreceiveCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
data.Title = code.ToString()
this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid}) this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid})
return return
} }

View File

@ -18,7 +18,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.SociatyBuyReq) (code
if code = this.BuyCheck(session, req); code != pb.ErrorCode_Success { if code = this.BuyCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
ggd := this.module.ModuleTools.GetGlobalConf() ggd := this.module.ModuleTools.GetGlobalConf()
if ggd == nil { if ggd == nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
@ -28,6 +28,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.SociatyBuyReq) (code
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
data.Title = code.ToString()
this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid}) this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid})
return return
} }
@ -57,6 +58,8 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.SociatyBuyReq) (code
ex, err := iuser.GetUserExpand(uid) ex, err := iuser.GetUserExpand(uid)
if err != nil { if err != nil {
code = pb.ErrorCode_UserSessionNobeing code = pb.ErrorCode_UserSessionNobeing
data.Title = code.ToString()
data.Message = err.Error()
return return
} }
@ -74,6 +77,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.SociatyBuyReq) (code
//扣除资源 //扣除资源
if code = this.module.DispenseRes(session, atn, true); code != pb.ErrorCode_Success { if code = this.module.DispenseRes(session, atn, true); code != pb.ErrorCode_Success {
data.Title =code.ToString()
return return
} }

View File

@ -15,6 +15,7 @@ func (this *apiComp) Challengefinish(session comm.IUserSession, req *pb.SociatyB
if code = this.ChallengefinishCheck(session, req); code != pb.ErrorCode_Success { if code = this.ChallengefinishCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {

View File

@ -16,7 +16,7 @@ func (this *apiComp) Challengestart(session comm.IUserSession, req *pb.SociatyBC
if code = this.ChallengestartCheck(session, req); code != pb.ErrorCode_Success { if code = this.ChallengestartCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
@ -32,6 +32,8 @@ func (this *apiComp) Challengestart(session comm.IUserSession, req *pb.SociatyBC
log.Field{Key: "err", Value: err.Error()}, log.Field{Key: "err", Value: err.Error()},
) )
code = pb.ErrorCode_UserSessionNobeing code = pb.ErrorCode_UserSessionNobeing
data.Title = code.ToString()
data.Message = err.Error()
return return
} }
if userEx.SociatyTicket <= 0 { if userEx.SociatyTicket <= 0 {

View File

@ -26,7 +26,7 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
if code = this.CreateCheck(session, req); code != pb.ErrorCode_Success { if code = this.CreateCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
user := this.module.ModuleUser.GetUser(uid) user := this.module.ModuleUser.GetUser(uid)
if user == nil { if user == nil {
@ -38,12 +38,14 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
userExpand, err := this.module.ModuleUser.GetUserExpand(uid) userExpand, err := this.module.ModuleUser.GetUserExpand(uid)
if err != nil { if err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
data.Title = code.ToString()
return return
} }
// CD校验 // CD校验
if utils.IsInCDHour(userExpand.SociatyCd) { if utils.IsInCDHour(userExpand.SociatyCd) {
code = pb.ErrorCode_SociatyCDLimit code = pb.ErrorCode_SociatyCDLimit
data.Title = code.ToString()
return return
} }

View File

@ -21,6 +21,7 @@ func (this *apiComp) Discharge(session comm.IUserSession, req *pb.SociatyDischar
if code = this.DischargeCheck(session, req); code != pb.ErrorCode_Success { if code = this.DischargeCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
@ -45,6 +46,8 @@ func (this *apiComp) Discharge(session comm.IUserSession, req *pb.SociatyDischar
} else { } else {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
} }
data.Title = code.ToString()
data.Message = err.Error()
this.module.Error("踢出公会", this.module.Error("踢出公会",
log.Field{Key: "uid", Value: uid}, log.Field{Key: "uid", Value: uid},
log.Field{Key: "sociatyId", Value: sociaty.Id}, log.Field{Key: "sociatyId", Value: sociaty.Id},

View File

@ -21,6 +21,8 @@ func (this *apiComp) Dismiss(session comm.IUserSession, req *pb.SociatyDismissRe
if code = this.DismissCheck(session, req); code != pb.ErrorCode_Success { if code = this.DismissCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {

View File

@ -16,9 +16,6 @@ func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.SociatyListReq
} }
func (this *apiComp) List(session comm.IUserSession, req *pb.SociatyListReq) (code pb.ErrorCode, data *pb.ErrorData) { func (this *apiComp) List(session comm.IUserSession, req *pb.SociatyListReq) (code pb.ErrorCode, data *pb.ErrorData) {
if code = this.module.ModuleSys.IsAccess(comm.Guild, session.GetUserId()); code != pb.ErrorCode_Success {
return
}
if code = this.ListCheck(session, req); code != pb.ErrorCode_Success { if code = this.ListCheck(session, req); code != pb.ErrorCode_Success {
return return
} }

View File

@ -14,7 +14,7 @@ func (this *apiComp) MineCheck(session comm.IUserSession, req *pb.SociatyMineReq
} }
func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (code pb.ErrorCode, data *pb.ErrorData) { func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (code pb.ErrorCode, data *pb.ErrorData) {
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
userEx, err := this.module.ModuleUser.GetUserExpand(uid) userEx, err := this.module.ModuleUser.GetUserExpand(uid)
if err != nil { if err != nil {
@ -45,6 +45,7 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (co
//判断公会是否解散(公会解散非立即执行) //判断公会是否解散(公会解散非立即执行)
if this.module.modelSociaty.isDismiss(sociaty) { if this.module.modelSociaty.isDismiss(sociaty) {
code = pb.ErrorCode_SociatyDismissed code = pb.ErrorCode_SociatyDismissed
data.Title = code.ToString()
return return
} }
@ -78,6 +79,8 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (co
master = this.module.modelSociaty.getMasterInfo(sociaty) master = this.module.modelSociaty.getMasterInfo(sociaty)
} else { } else {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
data.Title = code.ToString()
data.Message = err.Error()
this.module.Error("会长弹劾", this.module.Error("会长弹劾",
log.Field{Key: "uid", Value: uid}, log.Field{Key: "uid", Value: uid},
log.Field{Key: "sociatyId", Value: sociaty.Id}, log.Field{Key: "sociatyId", Value: sociaty.Id},

View File

@ -14,6 +14,7 @@ func (this *apiComp) QuitCheck(session comm.IUserSession, req *pb.SociatyQuitReq
} }
func (this *apiComp) Quit(session comm.IUserSession, req *pb.SociatyQuitReq) (code pb.ErrorCode, data *pb.ErrorData) { func (this *apiComp) Quit(session comm.IUserSession, req *pb.SociatyQuitReq) (code pb.ErrorCode, data *pb.ErrorData) {
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
@ -44,6 +45,8 @@ func (this *apiComp) Quit(session comm.IUserSession, req *pb.SociatyQuitReq) (co
if err := this.module.ModuleUser.ChangeUserExpand(uid, update); err != nil { if err := this.module.ModuleUser.ChangeUserExpand(uid, update); err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
data.Title = code.ToString()
data.Message = err.Error()
this.module.Error("退出公会,更新玩家公会ID", this.module.Error("退出公会,更新玩家公会ID",
log.Field{Key: "uid", Value: uid}, log.Field{Key: "uid", Value: uid},
log.Field{Key: "sociatyId", Value: sociaty.Id}, log.Field{Key: "sociatyId", Value: sociaty.Id},

View File

@ -20,6 +20,8 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.SociatyRefuseReq)
if code = this.RefuseCheck(session, req); code != pb.ErrorCode_Success { if code = this.RefuseCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
@ -40,12 +42,15 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.SociatyRefuseReq)
// 已是公会成员 // 已是公会成员
if this.module.modelSociaty.isMember(uid, sociaty) { if this.module.modelSociaty.isMember(uid, sociaty) {
code = pb.ErrorCode_SociatyAdded code = pb.ErrorCode_SociatyAdded
data.Title = code.ToString()
return return
} }
// 拒绝公会申请 // 拒绝公会申请
if err := this.module.modelSociaty.refuse(req.Uid, sociaty); err != nil { if err := this.module.modelSociaty.refuse(req.Uid, sociaty); err != nil {
code = pb.ErrorCode_SociatyRefuse code = pb.ErrorCode_SociatyRefuse
data.Title = code.ToString()
data.Message = err.Error()
this.module.Error("申请拒绝", this.module.Error("申请拒绝",
log.Field{Key: "uid", Value: uid}, log.Field{Key: "uid", Value: uid},
log.Field{Key: "拒绝目标人", Value: req.Uid}, log.Field{Key: "拒绝目标人", Value: req.Uid},

View File

@ -19,7 +19,7 @@ func (this *apiComp) Search(session comm.IUserSession, req *pb.SociatySearchReq)
if code = this.SearchCheck(session, req); code != pb.ErrorCode_Success { if code = this.SearchCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
rsp := &pb.SociatySearchResp{} rsp := &pb.SociatySearchResp{}
sociaty := this.module.modelSociaty.findByName(req.Name) sociaty := this.module.modelSociaty.findByName(req.Name)
if sociaty != nil && sociaty.Id != "" { if sociaty != nil && sociaty.Id != "" {

View File

@ -20,7 +20,7 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe
if code = this.SettingCheck(session, req); code != pb.ErrorCode_Success { if code = this.SettingCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
@ -44,6 +44,8 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe
// 更新设置 // 更新设置
if err := this.module.modelSociaty.setting(sociaty); err != nil { if err := this.module.modelSociaty.setting(sociaty); err != nil {
code = pb.ErrorCode_SociatySetting code = pb.ErrorCode_SociatySetting
data.Title = code.ToString()
data.Message = err.Error()
this.module.Error("公会修改", this.module.Error("公会修改",
log.Field{Key: "uid", Value: uid}, log.Field{Key: "uid", Value: uid},
log.Field{Key: "sociatyId", Value: sociaty.Id}, log.Field{Key: "sociatyId", Value: sociaty.Id},

View File

@ -19,7 +19,7 @@ func (this *apiComp) SettingJob(session comm.IUserSession, req *pb.SociatySettin
if code = this.SettingJobCheck(session, req); code != pb.ErrorCode_Success { if code = this.SettingJobCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
data = &pb.ErrorData{}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {

View File

@ -16,7 +16,7 @@ func (this *apiComp) Sign(session comm.IUserSession, req *pb.SociatySignReq) (co
return return
} }
uid := session.GetUserId() uid := session.GetUserId()
data = &pb.ErrorData{}
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
@ -39,6 +39,8 @@ func (this *apiComp) Sign(session comm.IUserSession, req *pb.SociatySignReq) (co
// 签到 // 签到
if err := this.module.modelSociaty.sign(uid, sociaty); err != nil { if err := this.module.modelSociaty.sign(uid, sociaty); err != nil {
code = pb.ErrorCode_SociatySign code = pb.ErrorCode_SociatySign
data.Title = code.ToString()
data.Message = err.Error()
this.module.Error("签到失败", log.Field{Key: "uid", Value: uid}, log.Field{Key: "sociatyId", Value: sociaty.Id}, log.Field{Key: "err", Value: err.Error()}) this.module.Error("签到失败", log.Field{Key: "uid", Value: uid}, log.Field{Key: "sociatyId", Value: sociaty.Id}, log.Field{Key: "err", Value: err.Error()})
return return
} }

View File

@ -14,6 +14,7 @@ func (this *apiComp) TaskListCheck(session comm.IUserSession, req *pb.SociatyTas
func (this *apiComp) TaskList(session comm.IUserSession, req *pb.SociatyTaskListReq) (code pb.ErrorCode, data *pb.ErrorData) { func (this *apiComp) TaskList(session comm.IUserSession, req *pb.SociatyTaskListReq) (code pb.ErrorCode, data *pb.ErrorData) {
uid := session.GetUserId() uid := session.GetUserId()
data = &pb.ErrorData{}
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
@ -41,6 +42,9 @@ func (this *apiComp) TaskList(session comm.IUserSession, req *pb.SociatyTaskList
rsp.List = taskList rsp.List = taskList
if err := this.module.modelSociatyTask.updateTaskList(sociaty.Id, uid, taskList); err != nil { if err := this.module.modelSociatyTask.updateTaskList(sociaty.Id, uid, taskList); err != nil {
code = pb.ErrorCode_DBError
data.Title = code.ToString()
data.Message = err.Error()
this.module.Error("更新公会任务列表失败", this.module.Error("更新公会任务列表失败",
log.Field{Key: "uid", Value: uid}, log.Field{Key: "uid", Value: uid},
log.Field{Key: "sociatyId", Value: sociaty.Id}, log.Field{Key: "sociatyId", Value: sociaty.Id},

View File

@ -172,7 +172,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
var szTask []*pb.BuriedParam var szTask []*pb.BuriedParam
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype73, 1, req.BossId, req.Difficulty)) szTask = append(szTask, comm.GetBuriedParam(comm.Rtype73, 1, req.BossId, req.Difficulty))
//szTask = append(szTask, comm.GetBuriedParam(comm.Rtype74, req.BossId, req.Difficulty)) //szTask = append(szTask, comm.GetBuriedParam(comm.Rtype74, req.BossId, req.Difficulty))
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype78, req.BossId, req.Difficulty, req.Report.Costtime)) szTask = append(szTask, comm.GetBuriedParam(comm.Rtype78, req.BossId, req.Report.Costtime/1000, req.Difficulty))
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {