上传代码
This commit is contained in:
parent
8b228a7cd0
commit
8118e59c44
@ -97,25 +97,25 @@ locp:
|
||||
if err == nil {
|
||||
// this.gateway.Debugf("----------2 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType)
|
||||
|
||||
key := msg.MainType + msg.SubType // 加锁
|
||||
if v, ok := this.protoMsg[key]; ok {
|
||||
if v != 0 && configure.Now().Unix()-v < 2 {
|
||||
// 返回错误码
|
||||
this.protoMsg[key] = configure.Now().Unix()
|
||||
data, _ := anypb.New(&pb.NotifyErrorNotifyPush{
|
||||
ReqMainType: msg.MainType,
|
||||
ReqSubType: msg.SubType,
|
||||
Arg: msg.Data,
|
||||
Code: pb.ErrorCode_InsufficientPermissions})
|
||||
err = this.WriteMsg(&pb.UserMessage{
|
||||
MainType: comm.MainTypeNotify,
|
||||
SubType: comm.SubTypeErrorNotify,
|
||||
Data: data,
|
||||
})
|
||||
continue
|
||||
}
|
||||
}
|
||||
this.protoMsg[key] = configure.Now().Unix()
|
||||
// key := msg.MainType + msg.SubType // 加锁
|
||||
// if v, ok := this.protoMsg[key]; ok {
|
||||
// if v != 0 && configure.Now().Unix()-v < 2 {
|
||||
// // 返回错误码
|
||||
// this.protoMsg[key] = configure.Now().Unix()
|
||||
// data, _ := anypb.New(&pb.NotifyErrorNotifyPush{
|
||||
// ReqMainType: msg.MainType,
|
||||
// ReqSubType: msg.SubType,
|
||||
// Arg: msg.Data,
|
||||
// Code: pb.ErrorCode_InsufficientPermissions})
|
||||
// err = this.WriteMsg(&pb.UserMessage{
|
||||
// MainType: comm.MainTypeNotify,
|
||||
// SubType: comm.SubTypeErrorNotify,
|
||||
// Data: data,
|
||||
// })
|
||||
// continue
|
||||
// }
|
||||
// }
|
||||
// this.protoMsg[key] = configure.Now().Unix()
|
||||
|
||||
if err := this.messageDistribution(msg); err != nil {
|
||||
this.gateway.Errorf("messageDistribution err:%v", err)
|
||||
@ -366,10 +366,10 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) {
|
||||
log.Field{Key: "req", Value: fmt.Sprintf("%s:%s %v", req.MainType, req.SubType, req.Message.String())},
|
||||
log.Field{Key: "reply", Value: reply.String()},
|
||||
)
|
||||
key := msg.MainType + msg.SubType
|
||||
if v, ok := this.protoMsg[key]; ok && v != 0 { // 发送消息 协议解锁
|
||||
v = 0
|
||||
}
|
||||
// key := msg.MainType + msg.SubType
|
||||
// if v, ok := this.protoMsg[key]; ok && v != 0 { // 发送消息 协议解锁
|
||||
// v = 0
|
||||
// }
|
||||
if reply.Code != pb.ErrorCode_Success {
|
||||
data, _ := anypb.New(&pb.NotifyErrorNotifyPush{
|
||||
ReqMainType: msg.MainType,
|
||||
|
Loading…
Reference in New Issue
Block a user