图鉴数据参数优化
This commit is contained in:
parent
090dbe1521
commit
f1409ff23a
@ -295,7 +295,7 @@ type (
|
||||
ModifyHeroFetterData(uid string, obj string, data map[string]interface{}) (code pb.ErrorCode) // 修改羁绊信息
|
||||
QueryHeroFetter(uid string) (data []*pb.DBHeroFetter) // 查询所有的羁绊信息
|
||||
AddHeroFetterData(uid string, heroConfId string) (code pb.ErrorCode) // 创建一条羁绊信息
|
||||
SendRpcAddHero(session IUserSession, heroConfId string) (err error)
|
||||
SendRpcAddHero(uid string, heroConfId string, serverTag string) (err error)
|
||||
}
|
||||
//月子秘境
|
||||
IMoonFantasy interface {
|
||||
|
@ -83,13 +83,13 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string,
|
||||
)
|
||||
hero, bFirst, atno, err = this.modelHero.createHero(session, heroCfgId, num)
|
||||
if err == nil && bFirst {
|
||||
//go func(uid string, heroCfgId string) { // 携程处理 图鉴数据
|
||||
if db.IsCross() {
|
||||
this.moduleFetter.SendRpcAddHero(session, heroCfgId)
|
||||
} else {
|
||||
this.moduleFetter.AddHeroFetterData(session.GetUserId(), heroCfgId)
|
||||
}
|
||||
//}(session.GetUserId(), heroCfgId)
|
||||
go func() { // 携程处理 图鉴数据
|
||||
if db.IsCross() {
|
||||
this.moduleFetter.SendRpcAddHero(session.GetUserId(), heroCfgId, session.GetServiecTag())
|
||||
} else {
|
||||
this.moduleFetter.AddHeroFetterData(session.GetUserId(), heroCfgId)
|
||||
}
|
||||
}()
|
||||
// 统计任务
|
||||
|
||||
// 查品质
|
||||
|
@ -3,7 +3,6 @@ package library
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
@ -155,14 +154,15 @@ func (this *Library) QueryOneHeroFetter(uid string, cid string) *pb.DBHeroFetter
|
||||
}
|
||||
|
||||
// 发送prc消息到区服处理
|
||||
func (this *Library) SendRpcAddHero(session comm.IUserSession, heroConfId string) (err error) {
|
||||
func (this *Library) SendRpcAddHero(uid string, heroConfId string, serverTag string) (err error) {
|
||||
if this.IsCross() {
|
||||
|
||||
if _, err = this.service.AcrossClusterRpcGo( // 给区服发送rpc消息
|
||||
context.Background(),
|
||||
session.GetServiecTag(),
|
||||
serverTag,
|
||||
comm.Service_Worker,
|
||||
string(comm.Rpc_ModuleFetter),
|
||||
pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: heroConfId},
|
||||
pb.RPCGeneralReqA2{Param1: uid, Param2: heroConfId},
|
||||
nil); err != nil {
|
||||
this.Errorln(err)
|
||||
}
|
||||
@ -253,15 +253,14 @@ func (this *Library) Rpc_ModuleFetter(ctx context.Context, args *pb.RPCGeneralRe
|
||||
session comm.IUserSession
|
||||
ok bool
|
||||
)
|
||||
defer func() {
|
||||
this.PutUserSession(session)
|
||||
}()
|
||||
if session, ok = this.GetUserSession(args.Param1); !ok {
|
||||
err = fmt.Errorf("目标用户:%s 不在线", args.Param1)
|
||||
} else {
|
||||
|
||||
if session, ok = this.GetUserSession(args.Param1); ok {
|
||||
this.AddHeroFetterData(session.GetUserId(), args.Param2)
|
||||
session.Push()
|
||||
} else {
|
||||
this.Debugf("Rpc_ModuleFetter 目标用户:%s 不在线", args.Param1)
|
||||
}
|
||||
this.PutUserSession(session)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user