Browse Source

外部插件引用整理

master
DESKTOP-B25GA9E\W35 2 years ago
parent
commit
45ed233d79
  1. 8
      Assets/MsgTransmitTools/DataClass.meta
  2. 49
      Assets/MsgTransmitTools/DataClass/BluetoothGateway.cs
  3. 11
      Assets/MsgTransmitTools/DataClass/BluetoothGateway.cs.meta
  4. 17
      Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerModel.cs
  5. 1
      Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerView.cs
  6. 8
      Assets/Plugin.meta
  7. 0
      Assets/Plugin/LitJson.dll
  8. 0
      Assets/Plugin/LitJson.dll.meta

8
Assets/MsgTransmitTools/DataClass.meta

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cdc27ec2fd28d2c43ba1eeb65b7e16b1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

49
Assets/MsgTransmitTools/DataClass/BluetoothGateway.cs

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LitJson;
namespace JXSoft {
public class BluetoothGateway:IResponse
{
/// <summary>
///
/// </summary>
public int v { get; set; }
/// <summary>
///
/// </summary>
public int mid { get; set; }
/// <summary>
///
/// </summary>
public int time { get; set; }
/// <summary>
/// 用时
/// </summary>
public string ip { get; set; }
/// <summary>
/// 地址
/// </summary>
public string mac { get; set; }
/// <summary>
/// 设备信息
/// </summary>
public List<List<int>> devices { get; set; }
public string toProtocolData()
{
return "";
}
public bool trySetData(string protocolData)
{
throw new System.NotImplementedException();
}
public string getException()
{
throw new System.NotImplementedException();
}
}
}

11
Assets/MsgTransmitTools/DataClass/BluetoothGateway.cs.meta

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 13a2cca89eba62b4190e83ab540a781f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

17
Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerModel.cs

@ -27,6 +27,11 @@ namespace JXSoft { @@ -27,6 +27,11 @@ namespace JXSoft {
return 0;
}
}
public enum ServerState
{
Close = 0,
Open = 1
}
public class HttpServerUtility:IUtility
{
@ -40,6 +45,7 @@ namespace JXSoft { @@ -40,6 +45,7 @@ namespace JXSoft {
public Thread reciveT;
#region OpenServer
public bool startServer(string[] prefixes) {
if (httpServer == null || !httpServer.IsListening) {
if (!HttpListener.IsSupported)
@ -68,25 +74,27 @@ namespace JXSoft { @@ -68,25 +74,27 @@ namespace JXSoft {
}
return false;
}
public void startServer(string prefix) {
string[] prefixes = {prefix};
startServer(prefixes);
}
public void startServer()
{
string[] prefixes = { address };
startServer(prefixes);
}
#endregion
#region CloseServer
public void closeServer() {
if (httpServer.IsListening) {
reciveT.Abort();
httpServer.Close();
}
}
#endregion
#region MessageReceive
public void RecciveMsg()
{
string msg = "";
@ -120,7 +128,7 @@ namespace JXSoft { @@ -120,7 +128,7 @@ namespace JXSoft {
}
#endregion
#region 返回消息
#region 返回应答
HttpListenerResponse response = context.Response;
// Construct a response.
byte[] buffer = Encoding.UTF8.GetBytes("<HTML><BODY> " + "success" + "</BODY></HTML>");
@ -144,7 +152,7 @@ namespace JXSoft { @@ -144,7 +152,7 @@ namespace JXSoft {
}
/// <summary>
/// 线程接收到消息后
/// Update调用,主线程信息提取
/// </summary>
/// <returns>接收到的消息</returns>
public string getReceivedValue()
@ -159,5 +167,6 @@ namespace JXSoft { @@ -159,5 +167,6 @@ namespace JXSoft {
return "";
}
}
#endregion
}
}

1
Assets/MsgTransmitTools/ExtendLinkModel/HttpServer/HttpServerView.cs

@ -5,6 +5,7 @@ using System.IO; @@ -5,6 +5,7 @@ using System.IO;
using System.Net;
using System.Text;
using UnityEngine;
using QFrameworkCP;
namespace JXSoft {
public class HttpServerView : MonoBehaviour

8
Assets/Plugin.meta

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c29f7b7272f37b648a299662bc951a33
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

0
Assets/JsonIOTools/LitJson.dll → Assets/Plugin/LitJson.dll

0
Assets/JsonIOTools/LitJson.dll.meta → Assets/Plugin/LitJson.dll.meta

Loading…
Cancel
Save