|
|
|
@ -28,6 +28,7 @@ namespace JXSoft {
@@ -28,6 +28,7 @@ namespace JXSoft {
|
|
|
|
|
} |
|
|
|
|
//找到命令后添加命令 |
|
|
|
|
mCommandContainer.Get<ExcuteResponseCommand<T>>().setProtocolData(protocolData); |
|
|
|
|
mCommandContainer.Get<ExcuteResponseCommand<T>>().setSender(getSender()); |
|
|
|
|
this.SendCommand(mCommandContainer.Get<ExcuteResponseCommand<T>>()); |
|
|
|
|
} |
|
|
|
|
/// <summary> |
|
|
|
@ -81,6 +82,10 @@ namespace JXSoft {
@@ -81,6 +82,10 @@ namespace JXSoft {
|
|
|
|
|
setLinkState((int)LinkStateDefault.Close); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public virtual string getSender() { |
|
|
|
|
return "default"; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -98,6 +103,7 @@ namespace JXSoft {
@@ -98,6 +103,7 @@ namespace JXSoft {
|
|
|
|
|
public class ExcuteResponseCommand<TResponse> : AbstractCommand where TResponse : IResponse |
|
|
|
|
{ |
|
|
|
|
public string protocolData; |
|
|
|
|
public string sender; |
|
|
|
|
private TResponse response; |
|
|
|
|
private Color printColor = Color.white; |
|
|
|
|
public ExcuteResponseCommand(TResponse response) |
|
|
|
@ -115,13 +121,16 @@ namespace JXSoft {
@@ -115,13 +121,16 @@ namespace JXSoft {
|
|
|
|
|
if (response.toProtocolData() != "") { |
|
|
|
|
Debug.Log("Received:" + response.toProtocolData() + response.GetType()); |
|
|
|
|
} |
|
|
|
|
this.SendEvent(new ResponseMsgEvent(response)); |
|
|
|
|
this.SendEvent(new ResponseMsgEvent(response, sender)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public void setProtocolData(string protocolData) |
|
|
|
|
{ |
|
|
|
|
this.protocolData = protocolData; |
|
|
|
|
} |
|
|
|
|
public void setSender(string sender) { |
|
|
|
|
this.sender = sender; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
@ -282,9 +291,11 @@ namespace JXSoft {
@@ -282,9 +291,11 @@ namespace JXSoft {
|
|
|
|
|
public struct ResponseMsgEvent |
|
|
|
|
{ |
|
|
|
|
public IResponse res; |
|
|
|
|
public ResponseMsgEvent(IResponse res_) |
|
|
|
|
public string sender; |
|
|
|
|
public ResponseMsgEvent(IResponse res_,string sender_) |
|
|
|
|
{ |
|
|
|
|
res = res_; |
|
|
|
|
sender = sender_; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
public struct RequestMsgEvent |
|
|
|
|