消息返回bug
This commit is contained in:
parent
b2881f5f68
commit
d03ff89421
@ -30,6 +30,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralCh
|
|||||||
atno []*pb.UserAtno // atno 类型
|
atno []*pb.UserAtno // atno 类型
|
||||||
curAddExp []int32
|
curAddExp []int32
|
||||||
)
|
)
|
||||||
|
changExp = make(map[string]int32)
|
||||||
harm = req.Report.Harm
|
harm = req.Report.Harm
|
||||||
update = make(map[string]interface{}, 0)
|
update = make(map[string]interface{}, 0)
|
||||||
if errdata = this.ChallengeOverCheck(session, req); errdata != nil {
|
if errdata = this.ChallengeOverCheck(session, req); errdata != nil {
|
||||||
@ -153,6 +154,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralCh
|
|||||||
|
|
||||||
err = this.module.modelIntegral.modifyIntegralData(session.GetUserId(), update)
|
err = this.module.modelIntegral.modifyIntegralData(session.GetUserId(), update)
|
||||||
|
|
||||||
|
this.module.modelRank.updateRank(harm, session.GetUserId(), int(req.Nandu))
|
||||||
session.SendMsg(string(this.module.GetType()), "challengeover", &pb.IntegralChallengeOverResp{
|
session.SendMsg(string(this.module.GetType()), "challengeover", &pb.IntegralChallengeOverResp{
|
||||||
Data: list,
|
Data: list,
|
||||||
Atno: atno,
|
Atno: atno,
|
||||||
|
@ -73,7 +73,7 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.IntegralRankLis
|
|||||||
Line: v.Line[req.Nandu],
|
Line: v.Line[req.Nandu],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), "rank", &pb.IntegralRankListResp{
|
session.SendMsg(string(this.module.GetType()), "ranklist", &pb.IntegralRankListResp{
|
||||||
Ranks: players,
|
Ranks: players,
|
||||||
Friends: friends,
|
Friends: friends,
|
||||||
})
|
})
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/lego/sys/redis/pipe"
|
"go_dreamfactory/lego/sys/redis/pipe"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
@ -27,14 +26,14 @@ func (this *modelRank) Init(service core.IService, module core.IModule, comp cor
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新排名
|
// 更新排名
|
||||||
func (this *modelRank) updateRank(data *pb.DBIntegralRank, nandu int) (err error) {
|
func (this *modelRank) updateRank(Score int32, uid string, nandu int) (err error) {
|
||||||
var (
|
var (
|
||||||
pipe *pipe.RedisPipe = this.DBModel.Redis.RedisPipe(context.TODO())
|
pipe *pipe.RedisPipe = this.DBModel.Redis.RedisPipe(context.TODO())
|
||||||
menbers *redis.Z
|
menbers *redis.Z
|
||||||
cmd *redis.IntCmd
|
cmd *redis.IntCmd
|
||||||
)
|
)
|
||||||
|
|
||||||
menbers = &redis.Z{Score: float64(data.Score), Member: data.Uinfo.Uid}
|
menbers = &redis.Z{Score: float64(Score), Member: uid}
|
||||||
|
|
||||||
if cmd = pipe.ZAdd(this.TableName+strconv.Itoa(nandu), menbers); err != nil {
|
if cmd = pipe.ZAdd(this.TableName+strconv.Itoa(nandu), menbers); err != nil {
|
||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user