diff --git a/Assets/MsgTransmitTools/DataClass/BluetoothGateway.cs b/Assets/MsgTransmitTools/DataClass/BluetoothGateway.cs index daf0db6..3852c65 100644 --- a/Assets/MsgTransmitTools/DataClass/BluetoothGateway.cs +++ b/Assets/MsgTransmitTools/DataClass/BluetoothGateway.cs @@ -3,9 +3,10 @@ using System.Collections.Generic; using UnityEngine; using LitJson; using System; +using JXSoft; -namespace JXSoft { - public struct BluetoothGateway:IResponse +namespace DYData { + public struct BluetoothGatewayData:IResponse { /// /// @@ -57,7 +58,7 @@ namespace JXSoft { { try { - BluetoothGateway blg = JsonMapper.ToObject(protocolData); + BluetoothGatewayData blg = JsonMapper.ToObject(protocolData); this.v = blg.v; this.time = blg.time; this.mid = blg.mid; diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerModel.cs b/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerModel.cs index b0ab03b..4c46663 100644 --- a/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerModel.cs +++ b/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerModel.cs @@ -11,7 +11,7 @@ using System.IO; namespace JXSoft { public class HttpServerModel : DataEventModel { - + public ServerState httpServerState = ServerState.Close; protected override void OnInit() { @@ -19,12 +19,12 @@ namespace JXSoft { public override void setLinkState(int linkState) { - + this.httpServerState = (ServerState)linkState; } public override int getLinkState() { - return 0; + return (int)httpServerState; } } public enum ServerState diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerView.cs b/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerView.cs index 828f88a..2c622b8 100644 --- a/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerView.cs +++ b/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerView.cs @@ -24,10 +24,10 @@ namespace JXSoft { void Start() { this.httpServer = this.GetUtility(); - this.RegisterMessageEvent(e => { + this.RegisterMessageEvent(e => { Debug.Log("收到消息:"+e.ip); }).UnRegisterWhenGameObjectDestroyed(gameObject); - this.GetModel().onReceive(); + this.GetModel().onReceive(); } // Update is called once per frame diff --git a/Assets/MsgTransmitTools/src/DataEventModel.cs b/Assets/MsgTransmitTools/src/DataEventModel.cs index 903709d..f11712c 100644 --- a/Assets/MsgTransmitTools/src/DataEventModel.cs +++ b/Assets/MsgTransmitTools/src/DataEventModel.cs @@ -182,7 +182,6 @@ namespace JXSoft { string toProtocolData(); } - public interface ILinkState { //当前链接状态 int getLinkState(); @@ -192,6 +191,8 @@ namespace JXSoft { /// 目标链接状态 /// 是否成功 bool transform(ILinkState invokeState); + + //DataEventModel getEventModel(); } #endregion @@ -352,4 +353,13 @@ namespace BaseLinkState #endregion +} + + +/// +/// this Package improved a base example of server open & close +/// you can also create class implements ILinkState. +/// +namespace BaseServerState { + } \ No newline at end of file