上传匹配模式日志补充

This commit is contained in:
liwei1dao 2024-02-04 11:54:38 +08:00
parent 522577fc1f
commit e125a49670
2 changed files with 18 additions and 6 deletions

View File

@ -28,12 +28,18 @@ type MPool struct {
func (this *MPool) join(req *pb.JoinMatchPoolReq) { func (this *MPool) join(req *pb.JoinMatchPoolReq) {
this.lock.Lock() this.lock.Lock()
player := &MatchPlayer{ if player, ok := this.Players[req.Uid]; ok {
Uid: req.Uid, player.Dan = req.Dan
Time: 0, player.Data = req.Data
Data: req.Data, } else {
player := &MatchPlayer{
Uid: req.Uid,
Dan: req.Dan,
Time: 0,
Data: req.Data,
}
this.Players[req.Uid] = player
} }
this.Players[req.Uid] = player
this.lock.Unlock() this.lock.Unlock()
} }

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/core/cbase" "go_dreamfactory/lego/core/cbase"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -67,12 +68,17 @@ func (this *SCompMatch) SuccMatchNotice(ctx context.Context, args *pb.SuccMatchN
for k, v := range args.Players { for k, v := range args.Players {
if msg, err = v.UnmarshalNew(); err != nil { if msg, err = v.UnmarshalNew(); err != nil {
log.Errorf("[RPC:SuccMatchNotice] UnmarshalNew err:%s", err.Error())
return return
} }
player[k] = msg player[k] = msg
} }
//执行处理流 //执行处理流
err = msghandle(player) if err = msghandle(player); err != nil {
log.Errorf("[RPC:SuccMatchNotice] msghandle err:%s", err.Error())
}
} else {
log.Errorf("[RPC:SuccMatchNotice] on found args:%s", args.String())
} }
return nil return nil
} }