上传匹配模式日志补充
This commit is contained in:
parent
522577fc1f
commit
e125a49670
@ -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()
|
||||||
|
if player, ok := this.Players[req.Uid]; ok {
|
||||||
|
player.Dan = req.Dan
|
||||||
|
player.Data = req.Data
|
||||||
|
} else {
|
||||||
player := &MatchPlayer{
|
player := &MatchPlayer{
|
||||||
Uid: req.Uid,
|
Uid: req.Uid,
|
||||||
|
Dan: req.Dan,
|
||||||
Time: 0,
|
Time: 0,
|
||||||
Data: req.Data,
|
Data: req.Data,
|
||||||
}
|
}
|
||||||
this.Players[req.Uid] = player
|
this.Players[req.Uid] = player
|
||||||
|
}
|
||||||
this.lock.Unlock()
|
this.lock.Unlock()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user