上传匹配模式日志补充
This commit is contained in:
parent
522577fc1f
commit
e125a49670
@ -28,12 +28,18 @@ type MPool struct {
|
||||
|
||||
func (this *MPool) join(req *pb.JoinMatchPoolReq) {
|
||||
this.lock.Lock()
|
||||
player := &MatchPlayer{
|
||||
Uid: req.Uid,
|
||||
Time: 0,
|
||||
Data: req.Data,
|
||||
if player, ok := this.Players[req.Uid]; ok {
|
||||
player.Dan = req.Dan
|
||||
player.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()
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/core/cbase"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"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 {
|
||||
if msg, err = v.UnmarshalNew(); err != nil {
|
||||
log.Errorf("[RPC:SuccMatchNotice] UnmarshalNew err:%s", err.Error())
|
||||
return
|
||||
}
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user