|
|
|
@ -8,14 +8,28 @@ using UnityEngine;
@@ -8,14 +8,28 @@ using UnityEngine;
|
|
|
|
|
using QFrameworkCP; |
|
|
|
|
|
|
|
|
|
namespace JXSoft { |
|
|
|
|
public class HttpServerView : MonoBehaviour |
|
|
|
|
public class HttpServerArchitecture : Architecture<HttpServerArchitecture> |
|
|
|
|
{ |
|
|
|
|
protected override void Init() |
|
|
|
|
{ |
|
|
|
|
this.RegisterUtility(new HttpServerUtility()); |
|
|
|
|
this.RegisterModel(new HttpServerModel()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public class HttpServerView : MonoBehaviour,IController |
|
|
|
|
{ |
|
|
|
|
public string[] prefixes; |
|
|
|
|
public HttpServerUtility httpServer = new HttpServerUtility(); |
|
|
|
|
public HttpServerUtility httpServer; |
|
|
|
|
// Start is called before the first frame update |
|
|
|
|
void Start() |
|
|
|
|
{ |
|
|
|
|
//httpServer.startServer(prefixes); |
|
|
|
|
this.httpServer = this.GetUtility<HttpServerUtility>(); |
|
|
|
|
this.RegisterEvent<ResponseMsgEvent>(e => { |
|
|
|
|
if (e.res.GetType() == typeof(BluetoothGateway)) { |
|
|
|
|
// |
|
|
|
|
} |
|
|
|
|
}).UnRegisterWhenGameObjectDestroyed(gameObject); |
|
|
|
|
this.GetModel<HttpServerModel>().onReceive<BluetoothGateway>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Update is called once per frame |
|
|
|
@ -27,7 +41,7 @@ namespace JXSoft {
@@ -27,7 +41,7 @@ namespace JXSoft {
|
|
|
|
|
item.GetComponentInChildren<Text>().text = tcpUtil.receivedData; |
|
|
|
|
this.GetModel<TCPClientModel>().onDataRecived.Invoke(tcpUtil.receivedData); |
|
|
|
|
*/ |
|
|
|
|
Debug.Log(httpServer.receivedData); |
|
|
|
|
this.GetModel<HttpServerModel>().onDataRecived.Invoke(httpServer.receivedData); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public void startServer() { |
|
|
|
@ -38,6 +52,11 @@ namespace JXSoft {
@@ -38,6 +52,11 @@ namespace JXSoft {
|
|
|
|
|
{ |
|
|
|
|
httpServer.closeServer(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IArchitecture GetArchitecture() |
|
|
|
|
{ |
|
|
|
|
return HttpServerArchitecture.Interface; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|