Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
7924cc979a
@ -48,5 +48,15 @@
|
||||
"n": 20000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"index": "unified_reward",
|
||||
"var": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 20000
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
@ -25,8 +25,8 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
list, _ = this.module.modelPagoda.getPagodaList(session.GetUserId())
|
||||
if !expand.CompletePagoda { // 普通塔
|
||||
list, _ = this.module.modelPagoda.getPagodaList(session.GetUserId())
|
||||
if list == nil { // redis没有数据
|
||||
list = &pb.DBPagoda{}
|
||||
list.Id = primitive.NewObjectID().Hex()
|
||||
@ -40,6 +40,8 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq
|
||||
season, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
|
||||
if season.Id == "" {
|
||||
list.Complete = true
|
||||
} else {
|
||||
list = season
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,9 +87,12 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.TrollGetListReq)
|
||||
update["circle"] = trolltrain.Circle
|
||||
}
|
||||
leftTime = (int32(t) % circletime)
|
||||
// 循环次数
|
||||
|
||||
index += circleCount * trainNum // 计算火车的位置信息
|
||||
for _, v := range sz {
|
||||
for pos, v := range sz {
|
||||
if pos < int(trolltrain.TarinPos-1) { // 起始位置
|
||||
continue
|
||||
}
|
||||
if leftTime <= v {
|
||||
trolltrain.RefreshTime = time.Now().Unix()
|
||||
trolltrain.TarinPos += index
|
||||
|
@ -87,7 +87,9 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain) (c
|
||||
}
|
||||
iCount := this.configure.GetTrollRule(comm.TrollAIBuyCount)
|
||||
for index = 0; ; index++ {
|
||||
|
||||
if index < troll.TarinPos-1 { // 起始位置
|
||||
continue
|
||||
}
|
||||
index := int32(index) % trainNum
|
||||
troll.RefreshTime += int64(sz[index])
|
||||
|
||||
|
@ -145,6 +145,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
|
||||
// 每日签到检测
|
||||
this.module.modelSign.checkResetSignData(session)
|
||||
|
||||
this.Sign(session, &pb.UserSignReq{})
|
||||
//推送登录公告
|
||||
this.chat.SendSysChatToUser(session, comm.UserLoginNotice, 0)
|
||||
mail := &pb.DBMailData{
|
||||
|
@ -15,6 +15,7 @@ func (this *apiComp) SignCheck(session comm.IUserSession, req *pb.UserSignReq) (
|
||||
|
||||
//登录
|
||||
func (this *apiComp) Sign(session comm.IUserSession, req *pb.UserSignReq) (code pb.ErrorCode, data proto.Message) {
|
||||
this.module.modelSign.checkResetSignData(session)
|
||||
|
||||
code = this.module.modelSign.checkResetSignData(session)
|
||||
return
|
||||
}
|
||||
|
@ -78,11 +78,12 @@ func (this *ModelSign) updateSignData(uid string, sign *pb.DBSign) (err error) {
|
||||
}
|
||||
|
||||
// 检测是否达到重置日期
|
||||
func (this *ModelSign) checkResetSignData(session comm.IUserSession) {
|
||||
func (this *ModelSign) checkResetSignData(session comm.IUserSession) (code pb.ErrorCode) {
|
||||
var (
|
||||
update map[string]interface{}
|
||||
bReward bool
|
||||
)
|
||||
|
||||
update = make(map[string]interface{}, 0)
|
||||
if sign, err := this.module.modelSign.GetUserSign(session.GetUserId()); err == nil {
|
||||
start, _ := utils.GetMonthStartEnd()
|
||||
@ -114,8 +115,19 @@ func (this *ModelSign) checkResetSignData(session comm.IUserSession) {
|
||||
}
|
||||
}
|
||||
_data := this.module.configure.GetSignConf(sign.Cid, sign.Group)
|
||||
if bReward && _data != nil { // 发奖
|
||||
this.module.DispenseRes(session, _data.Loopgift, true)
|
||||
if _data != nil { // 发奖
|
||||
if bReward {
|
||||
this.module.DispenseRes(session, _data.Loopgift, true)
|
||||
}
|
||||
} else {
|
||||
globalCnf := this.module.configure.GetGlobalAtnConf("unified_reward") // 获取重置消耗
|
||||
if globalCnf == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if bReward {
|
||||
this.module.DispenseRes(session, globalCnf.Var, true) // 发放通用奖励
|
||||
}
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "sign", &pb.UserSignResp{
|
||||
Data: sign,
|
||||
|
Loading…
Reference in New Issue
Block a user