File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
GameFrameX.StartUp/ServiceClient Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,11 @@ private void SendHeartBeat()
212212 /// <param name="messageObject">要发送的消息对象</param>
213213 public void Send ( MessageObject messageObject )
214214 {
215+ if ( messageObject . MessageId >= 0 )
216+ {
217+ throw new ArgumentOutOfRangeException ( nameof ( messageObject ) , "messageObject.MessageId must be less than 0" ) ;
218+ }
219+
215220 _rpcSession . Send ( messageObject as IRequestMessage ) ;
216221 }
217222
@@ -239,6 +244,11 @@ private void MessageSendHandle(INetworkMessage messageObject)
239244 /// <returns>表示异步操作的任务,任务结果为IRpcResult对象</returns>
240245 public Task < IRpcResult > Call < T > ( MessageObject messageObject , int timeOut = 10000 ) where T : IResponseMessage , new ( )
241246 {
247+ if ( messageObject . MessageId >= 0 )
248+ {
249+ throw new ArgumentOutOfRangeException ( nameof ( messageObject ) , "messageObject.MessageId must be less than 0" ) ;
250+ }
251+
242252 var result = _rpcSession . Call < T > ( messageObject as IRequestMessage , timeOut ) ;
243253 return result ;
244254 }
You can’t perform that action at this time.
0 commit comments