Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
3f40324d22
@ -306,10 +306,10 @@ const (
|
||||
type ReddotType int32
|
||||
|
||||
const (
|
||||
Reddot1 ReddotType = 10001 //任务----日常活跃宝箱红点
|
||||
Reddot2 ReddotType = 10002 //任务----周活跃宝箱红点
|
||||
Reddot1 ReddotType = 10001 //任务----日常任务奖励红点
|
||||
Reddot2 ReddotType = 10002 //任务----周常任务奖励红点
|
||||
Reddot3 ReddotType = 10003 //公会----签到红点
|
||||
Reddot4 ReddotType = 10004 //任务----成就奖励红点
|
||||
Reddot4 ReddotType = 10004 //任务----成就任务奖励红点
|
||||
Reddot5 ReddotType = 10005 //主线关卡----可挑战红点
|
||||
Reddot6 ReddotType = 10006 //爬塔----可挑战红点
|
||||
Reddot7 ReddotType = 10007 //爬塔----奖励红点
|
||||
@ -332,9 +332,9 @@ const (
|
||||
Reddot24 ReddotType = 10024 //熊猫武馆----可升级红点
|
||||
Reddot25 ReddotType = 10025 //熊猫武馆----可领取奖励红点
|
||||
Reddot26 ReddotType = 10026 //邮件-----附件红点
|
||||
Reddot27 ReddotType = 10027 //公会----任务完成红点
|
||||
Reddot28 ReddotType = 10028 //公会----进度奖励红点
|
||||
Reddot29 ReddotType = 10029 //任务----周常任务完成红点
|
||||
Reddot27 ReddotType = 10027 //任务----日常活跃奖励红点
|
||||
Reddot28 ReddotType = 10028 //任务----周常活跃奖励红点
|
||||
Reddot29 ReddotType = 10029 //公会----申请红点
|
||||
Reddot30 ReddotType = 10030 //邮件-----未读邮件红点
|
||||
)
|
||||
|
||||
@ -497,7 +497,7 @@ const (
|
||||
Rtype137 TaskType = 137 //累计铁匠铺锻造X小时(历史)(从创号开始记录,满1小时进度+1)
|
||||
Rtype138 TaskType = 138 //在线N分钟(从接到任务开始,记录玩家在线时间并记入进度)
|
||||
Rtype139 TaskType = 139 //通过融合获得指定英雄(从接到任务开始记录,通过融合获得指定英雄则任务完成)
|
||||
|
||||
Rtype140 TaskType = 140 //关卡编辑器完成条件
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -11,6 +11,7 @@ import (
|
||||
"go_dreamfactory/lego/utils/codec/json"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
"time"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
@ -82,7 +83,7 @@ func (this *Chat) OnInstallComp() {
|
||||
//Event------------------------------------------------------------------------------------------------------------
|
||||
func (this *Chat) EventUserOffline(session comm.IUserSession) {
|
||||
if err := this.modelChat.removeCrossChannelMember(session); err != nil {
|
||||
this.Debug("EventUserOffline:", log.Fields{ "uid": session.GetUserId(),"err":err.Error()})
|
||||
this.Debug("EventUserOffline:", log.Fields{"uid": session.GetUserId(), "err": err.Error()})
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,7 +227,7 @@ func (this *Chat) SendSysChatToWorld(ctype comm.ChatSystemType, appenddata inter
|
||||
Channel: pb.ChatChannel_System,
|
||||
Ctype: pb.ChatType_Text,
|
||||
Stag: this.service.GetTag(),
|
||||
Ctime: time.Now().Unix(),
|
||||
Ctime: configure.Now().Unix(),
|
||||
Content: fmt.Sprintf(st.Text, agrs...),
|
||||
Display: st.Display,
|
||||
}
|
||||
|
@ -67,6 +67,10 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
|
||||
_hero.SameCount = 1
|
||||
_hero.IsOverlying = false
|
||||
// 加属性 awakenData
|
||||
if len(awakenData.Phasebonus) != 2 {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
_value, ok := strconv.Atoi(awakenData.Phasebonus[0])
|
||||
if ok == nil { // 升级技能
|
||||
for pos, v := range _hero.NormalSkill {
|
||||
@ -81,10 +85,12 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
|
||||
} else { // 加属性
|
||||
value, err := strconv.Atoi(awakenData.Phasebonus[1])
|
||||
if err == nil {
|
||||
if value > 0 {
|
||||
this.module.modelHero.setJuexingProperty(_hero, awakenData.Phasebonus[0], int32(value))
|
||||
_heroMap["juexProperty"] = _hero.JuexProperty
|
||||
}
|
||||
}
|
||||
}
|
||||
_hero.JuexingLv += 1
|
||||
_heroMap["juexingLv"] = _hero.JuexingLv
|
||||
// 保存数据
|
||||
|
@ -264,7 +264,7 @@ func (this *ModelHero) setJuexingProperty(hero *pb.DBHero, key string, value int
|
||||
case comm.ResonanceAtkPro:
|
||||
hero.JuexProperty[comm.Atk] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Atk])))
|
||||
case comm.ResonanceDefPro:
|
||||
hero.JuexProperty[comm.Def] += int32(math.Floor((float64(value) / 1000)) * float64(hero.Property[comm.Def]))
|
||||
hero.JuexProperty[comm.Def] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Def])))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq)
|
||||
N: v.N * int32(req.Amount),
|
||||
})
|
||||
}
|
||||
if code = this.module.ConsumeRes(session, itemcf.SynthetizeDeplete, true); code != pb.ErrorCode_Success {
|
||||
if code = this.module.ConsumeRes(session, sale, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattle
|
||||
Buleflist: record.Buleflist,
|
||||
},
|
||||
})
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype88, 1)
|
||||
} else {
|
||||
session.SendMsg(string(this.module.GetType()), "battle", &pb.MoonfantasyBattleResp{Code: cd})
|
||||
}
|
||||
|
@ -127,12 +127,14 @@ func (this *modelDreamComp) trigger(session comm.IUserSession) {
|
||||
Avatar: user.Avatar,
|
||||
Uname: user.Name,
|
||||
Slv: user.Lv,
|
||||
Ctime: configure.Now().Unix(),
|
||||
Stag: session.GetServiecTag(),
|
||||
Content: mdata.Monster,
|
||||
AppendStr: mdata.Id,
|
||||
}
|
||||
this.module.modelDream.noticeuserfriend(session, mdata.Id, chat)
|
||||
session.SendMsg(string(this.module.GetType()), "trigger", &pb.MoonfantasyTriggerPush{Issucc: true, Mid: mdata.Id, Monster: mdata.Monster})
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype87, 1)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,19 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
|
||||
reddot = make(map[comm.ReddotType]bool)
|
||||
sociaty := this.modelSociaty.getUserSociaty(session.GetUserId())
|
||||
if sociaty == nil || sociaty.Id == "" {
|
||||
reddot[comm.Reddot3] = false
|
||||
log.Warn("公会红点未获得公会信息", log.Fields{"uid": session.GetUserId()})
|
||||
return
|
||||
}
|
||||
|
||||
var applyReddot bool
|
||||
if this.modelSociaty.isRight(session.GetUserId(), sociaty,
|
||||
pb.SociatyJob_PRESIDENT,
|
||||
pb.SociatyJob_VICEPRESIDENT,
|
||||
pb.SociatyJob_ADMIN) {
|
||||
|
||||
if len(sociaty.ApplyRecord) > 0 {
|
||||
applyReddot = true
|
||||
}
|
||||
return
|
||||
}
|
||||
for _, v := range rid {
|
||||
@ -132,6 +144,8 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
|
||||
if ok := this.modelSociaty.IsSign(session.GetUserId(), sociaty); !ok {
|
||||
reddot[comm.Reddot3] = true
|
||||
}
|
||||
case comm.Reddot29:
|
||||
reddot[comm.Reddot29] = applyReddot
|
||||
}
|
||||
}
|
||||
return
|
||||
|
@ -57,6 +57,21 @@ func (this *ModelTaskActive) getActiveListByTag(uid string, taskTag comm.TaskTag
|
||||
return list
|
||||
}
|
||||
|
||||
// 查询完成的且未领取的任务 发现未领取返回true
|
||||
func (this *ModelTaskActive) noReceiveTaskActive(uid string, taskTag comm.TaskTag) (bool, error) {
|
||||
list := []*pb.DBTaskActive{}
|
||||
if err := this.GetList(uid, &list); err != nil {
|
||||
this.moduleTask.Errorf("getUserActiveList err:%v", err)
|
||||
return false,err
|
||||
}
|
||||
for _, v := range list {
|
||||
if v.Tag == int32(taskTag) && v.Received == 0 {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
//获取玩家活跃记录 id 唯一ID
|
||||
func (this *ModelTaskActive) getUserActive(uid, id string, taskTag comm.TaskTag) *pb.DBTaskActive {
|
||||
record := this.getActiveListByTag(uid, taskTag)
|
||||
|
@ -23,14 +23,10 @@ type ModuleTask struct {
|
||||
modelTaskActive *ModelTaskActive
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
|
||||
// taskHandleMap map[int32]taskHandle //任务处理器
|
||||
}
|
||||
|
||||
func NewModule() core.IModule {
|
||||
return &ModuleTask{
|
||||
// taskHandleMap: make(map[int32]taskHandle),
|
||||
}
|
||||
return &ModuleTask{}
|
||||
}
|
||||
|
||||
func (this *ModuleTask) GetType() core.M_Modules {
|
||||
@ -43,7 +39,6 @@ func (this *ModuleTask) GetEventApp() *event_v2.App {
|
||||
|
||||
func (this *ModuleTask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
// this.initTaskHandle()
|
||||
return
|
||||
}
|
||||
|
||||
@ -163,6 +158,14 @@ func (this *ModuleTask) Reddot(session comm.IUserSession, rid ...comm.ReddotType
|
||||
reddot[comm.Reddot4] = ok
|
||||
break
|
||||
}
|
||||
case comm.Reddot27:
|
||||
if ok,_:= this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_DAILY);ok{
|
||||
reddot[comm.Reddot27] = ok
|
||||
}
|
||||
case comm.Reddot28:
|
||||
if ok,_:= this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_WEEKLY);ok{
|
||||
reddot[comm.Reddot28] = ok
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user