From 73532ce154d8b45e94ac43e22feb7f77c7f9d1b7 Mon Sep 17 00:00:00 2001 From: boyce Date: Wed, 9 Dec 2020 17:59:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96gc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- network/processor/pbrawprocessor.go | 6 ++++-- network/processor/processor.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/network/processor/pbrawprocessor.go b/network/processor/pbrawprocessor.go index 46a1e1b..10414a1 100644 --- a/network/processor/pbrawprocessor.go +++ b/network/processor/pbrawprocessor.go @@ -75,8 +75,10 @@ func (pbRawProcessor *PBRawProcessor) SetRawMsgHandler(handle RawMessageHandler) pbRawProcessor.msgHandler = handle } -func (pbRawProcessor *PBRawProcessor) MakeRawMsg(msgType uint16,msg []byte) *PBRawPackInfo { - return &PBRawPackInfo{typ:msgType,rawMsg:msg} +func (pbRawProcessor *PBRawProcessor) MakeRawMsg(msgType uint16,msg []byte,pbRawPackInfo *PBRawPackInfo) { + pbRawPackInfo.typ = msgType + pbRawPackInfo.rawMsg = msg + //return &PBRawPackInfo{typ:msgType,rawMsg:msg} } func (pbRawProcessor *PBRawProcessor) UnknownMsgRoute(msg interface{}, userData interface{}){ diff --git a/network/processor/processor.go b/network/processor/processor.go index f28877b..e72ad14 100644 --- a/network/processor/processor.go +++ b/network/processor/processor.go @@ -23,7 +23,7 @@ type IRawProcessor interface { Marshal(msg interface{}) ([]byte, error) SetRawMsgHandler(handle RawMessageHandler) - MakeRawMsg(msgType uint16,msg []byte) *PBRawPackInfo + MakeRawMsg(msgType uint16,msg []byte,pbRawPackInfo *PBRawPackInfo) UnknownMsgRoute(msg interface{}, userData interface{}) ConnectedRoute(userData interface{}) DisConnectedRoute(userData interface{})