Prechádzať zdrojové kódy

远程协助文件模块修改 原机房信息4个接口替换

DGJ 1 rok pred
rodič
commit
ef0248d5c2

+ 8 - 5
Assets/Game/Blue/Controller/Item/DeviceInfo_Item.cs

@@ -4,6 +4,7 @@ using Newtonsoft.Json.Linq;
 using UnityEngine;
 using UnityEngine.UI;
 using TMPro;
+using Agora.Rtc.LitJson;
 
 namespace GHZLangChao
 {
@@ -52,13 +53,15 @@ namespace GHZLangChao
 
             // 从后台获取UI详情
 
-            JObject data = new JObject();
+            JsonData data = new JsonData();
             data["cabinetNumber"] = DeviceParameter.cabinetNumber;
             data["u"] = DeviceParameter.u;
 
-            string jsondata = JsonConvert.SerializeObject(data);
+            // string jsondata = JsonConvert.SerializeObject(data);
 
-            StartCoroutine(HttpTool.Instance.SendHttp(HttpActionLang.bladeServer, jsondata, BladeServerCallBack));
+            Debug.Log(data.ToJson());
+
+            StartCoroutine(HttpTool.Instance.SendHttp(HttpActionLang.bladeServer, data.ToJson(), BladeServerCallBack));
            // HttpLangChaoTool.Instance.Post(HttpLangChaoAction.bladeServer, jsondata, BladeServerCallBack);
 
            
@@ -84,8 +87,8 @@ namespace GHZLangChao
 
             if (json["code"].ToString() == "200")
             {
-                string data = json["data"][0].ToString();
-                //Debug.Log(data);
+                string data = json["data"]["list"][0].ToString();
+                Debug.Log(data);
                this.DeviceParameter = JsonConvert.DeserializeObject<DeviceParameters>(data);
 
                 Debug.Log(JsonConvert.SerializeObject(this.DeviceParameter));

+ 17 - 1
Assets/Game/Blue/Controller/LangChaoRommMinIo.cs

@@ -62,6 +62,22 @@ public class LangChaoRommMinIo : MonoSingleton<LangChaoRommMinIo>
     // File uploader task.
     private async Task Run()
     {
+        StatObjectArgs statObjectArgs = new StatObjectArgs()
+                                          .WithBucket(Nowfd.bucket)
+                                          .WithObject(Nowfd.objectName);
+        await minio.StatObjectAsync(statObjectArgs);
+        PresignedGetObjectArgs args = new PresignedGetObjectArgs()
+                                        .WithBucket(Nowfd.bucket)
+                                        .WithObject(Nowfd.objectName)
+                                        .WithExpiry(60 * 60 * 24);
+        string url = await minio.PresignedGetObjectAsync(args);
+        RoomFileData rfd = new RoomFileData();
+        rfd.url = url;
+        RoomFileDataBack rfdb = new RoomFileDataBack();
+        rfdb.rfd = rfd;
+        rfdb.Nowfd = Nowfd;
+        backQueue.Enqueue(rfdb);
+        /*
             StatObjectArgs statObjectArgs = new StatObjectArgs()
                                               .WithBucket(Nowfd.bucket)
                                               .WithObject(Nowfd.objectName);
@@ -87,7 +103,7 @@ public class LangChaoRommMinIo : MonoSingleton<LangChaoRommMinIo>
                                                   backQueue.Enqueue(rfdb);
 
                                               });
-            await minio.GetObjectAsync(getObjectArgs);
+            await minio.GetObjectAsync(getObjectArgs);*/
     }
     void initMinIo(Action<bool> callBack)
     {

+ 3 - 1
Assets/Game/ShowLogin/LangChaoLogin.cs

@@ -89,7 +89,9 @@ namespace GHZLangChao
                    
                     GameStart.Instance.StartCoroutine(HttpTool.Instance.SendHttp(HttpActionLang.userinfo, "", UserInfoCallBack));
 
-                    HttpTool.Instance.Post(HttpActionLang.sceneInit, "",MachineRoomManager.Instance.SceneInitCallBack);
+                    JsonData data = new JsonData();
+                    data["roomName"] = "4A-23";
+                    HttpTool.Instance.Post(HttpActionLang.sceneInit, data.ToJson(), MachineRoomManager.Instance.SceneInitCallBack);
                 }
                 else
                     StartCoroutine(PopUp());

+ 4 - 4
Assets/HttpActionLang.cs

@@ -27,19 +27,19 @@ public class HttpActionLang : Singleton<HttpActionLang>
     /// <summary>
     /// 获取刀片机详细信息
     /// </summary>
-    public const string bladeServer = "/mr-navigator/v1/inspection/item";
+    public const string bladeServer = "/cmcc-endustry/v1/navigation/device";
     /// <summary>
     /// 获取机房信息
     /// </summary>
-    public const string sceneInit = "/mr-navigator/v1/inspection/cabinet";
+    public const string sceneInit = "/cmcc-endustry/v1/navigation/cabinet";
     /// <summary>
     /// 修改机柜信息
     /// </summary>
-    public const string updateCabinet = "/mr-navigator/v1/inspection/updateCabinet";
+    public const string updateCabinet = "/cmcc-endustry/v1/navigation/updateCabinet";
     /// <summary>
     /// 修改场景TagData
     /// </summary>
-    public const string updateTag = "/mr-navigator/v1/inspection/updateScene";
+    public const string updateTag = "/cmcc-endustry/v1/navigation/updateRoomTagData";
 
     public string mqttSocket ="";
 }

+ 1 - 1
Assets/LangChaoRTC/Remote/ShowRoom/RoomInvite/Prefab/Mp4Item.prefab

@@ -392,7 +392,7 @@ Transform:
   m_GameObject: {fileID: 2283116017620586622}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0.6, y: 0, z: 0.8}
-  m_LocalScale: {x: 2.7922, y: 2.7922, z: 2.7922}
+  m_LocalScale: {x: 10, y: 10, z: 10}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 6499191176663535467}

+ 2 - 4
Assets/LangChaoRTC/Remote/ShowRoom/RoomInvite/Prefab/PngJpgItem.prefab

@@ -262,7 +262,7 @@ Transform:
   m_GameObject: {fileID: 2283116017620586622}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0.4, y: 0, z: 0.8}
-  m_LocalScale: {x: 2.7922, y: 2.7922, z: 2.7922}
+  m_LocalScale: {x: 10, y: 10, z: 10}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 7501303589197907794}
@@ -307,13 +307,10 @@ MonoBehaviour:
   scaleMinimum: 0.2
   activeScaleMaxRestrict: 0
   scaleMaximum: 2
-  scaleHandleSize: 0.016
   BoundBoxCollider: {fileID: 0}
-  rotationHandleSize: 0.016
   showRotationHandleForX: 0
   showRotationHandleForY: 1
   showRotationHandleForZ: 0
-  axisScaleHandleSize: 0.016
   activeAxis: 36
   RotateStartAudio: 4
   RotateStopAudio: 3
@@ -390,6 +387,7 @@ MonoBehaviour:
   canTwoHandScale: 0
   minScaleRatio: 0.8
   maxScaleRatio: 3
+  isParentDrag: 0
 --- !u!114 &-4693312241201425186
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 3 - 3
Assets/LangChaoRTC/Remote/ShowRoom/RoomInvite/Scripts/BaseFilePrefabItem.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using LitJson;
@@ -21,8 +21,8 @@ public class BaseFilePrefabItem : MonoBehaviour,IPointerHandler
         //RoomFile.OnFilePrefabListAction += DeletFilePrefab;
         deleteBtn.onClick.AddListener(ClickOnDeleteBtn);
         hideBtn.onClick.AddListener(ClickOnHideBtn);
-        WSHandler.Rtc.OnDeleteFileSucess += DeleteFileSucess;
-        WSHandler.Rtc.OnDeleteFile += NotifyDeleteFile;
+        //WSHandler.Rtc.OnDeleteFileSucess += DeleteFileSucess;
+        //WSHandler.Rtc.OnDeleteFile += NotifyDeleteFile;
     }
 
     private void ClickOnHideBtn()

+ 9 - 1
Assets/LangChaoRTC/Remote/ShowRoom/RoomInvite/Scripts/ModelList.cs

@@ -1,8 +1,9 @@
-using ShadowStudio.Model;
+using ShadowStudio.Model;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using XRTool.Util;
+using static LangChaoRommMinIo;
 
 public class ModelList : UnitySingleton<ModelList>
 {
@@ -16,6 +17,13 @@ public class ModelList : UnitySingleton<ModelList>
         {
             RoomFile.Instance.FilePrefabConfigList.Add(fileConfig);
             string url = fileConfig.Url;
+            LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
+
+                Debug.Log("rfd==>" + rfd.url);
+                Debug.Log("rfd==>" + rfd.bytes.Length);
+                url = rfd.url;
+
+            });
             if (!url.Contains("http"))
             {
                 url = "https://" + fileConfig.Url;

+ 10 - 0
Assets/LangChaoRTC/Remote/ShowRoom/RoomInvite/Scripts/Mp4Item.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 using UnityEngine.Video;
+using static LangChaoRommMinIo;
 
 public class Mp4Item : BaseFilePrefabItem
 {
@@ -17,6 +18,15 @@ public class Mp4Item : BaseFilePrefabItem
         if (!string.IsNullOrEmpty(fileConfig.Url))
         {
             string url = fileConfig.Url;
+
+            LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
+
+                Debug.Log("rfd==>" + rfd.url);
+                Debug.Log("rfd==>" + rfd.bytes.Length);
+                url = rfd.url;
+
+            });
+
             if (!fileConfig.Url.Contains("http"))
             {
                 url = "https://" + fileConfig.Url;

+ 35 - 25
Assets/LangChaoRTC/Remote/ShowRoom/RoomInvite/Scripts/PngJpgItem.cs

@@ -13,39 +13,49 @@ public class PngJpgItem : BaseFilePrefabItem
     {
         base.Init(fileConfig);
 
-        LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
+        //LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
 
-            Debug.Log("rfd==>" + rfd.url);
-            Debug.Log("rfd==>" + rfd.bytes.Length);
+        //    Debug.Log("rfd==>" + rfd.url);
+        //    Debug.Log("rfd==>" + rfd.bytes.Length);
 
-            Texture2D texture = new Texture2D(10, 10);
-            texture.LoadImage(rfd.bytes);//流数据转换成Texture2D
+        //    Texture2D texture = new Texture2D(10, 10);
+        //    texture.LoadImage(rfd.bytes);//流数据转换成Texture2D
 
-            texture.Apply();
+        //    texture.Apply();
 
-            Adaption(texture);
-            mainImage.texture = texture;
-        });
+        //    Adaption(texture);
+        //    mainImage.texture = texture;
+        //});
 
 
-        //if (!string.IsNullOrEmpty(fileConfig.Url))
-        //{
-        //    string url = fileConfig.Url;
-        //    if (!fileConfig.Url.Contains("http"))
-        //    {
-        //        url = "https://" + fileConfig.Url;
-        //    }
-        //    NetWorkHeaders.Instance.getNetTexture(url, null, (Texture tex) => {
-        //        if (tex)
-        //        {
-        //            Adaption(tex);
-        //            mainImage.texture = tex;
-        //        }
-        //    });
+        if (!string.IsNullOrEmpty(fileConfig.Url))
+        {
+            string url = fileConfig.Url;
 
+            LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
 
-        //}
-    }
+                Debug.Log("rfd==>" + rfd.url);
+                Debug.Log("rfd==>" + rfd.bytes.Length);
+                url = rfd.url;
+
+            });
+
+            if (!fileConfig.Url.Contains("http"))
+            {
+                url = "https://" + fileConfig.Url;
+            }
+            NetWorkHeaders.Instance.getNetTexture(url, null, (Texture tex) =>
+            {
+                if (tex)
+                {
+                    Adaption(tex);
+                    mainImage.texture = tex;
+                }
+            });
+
+
+         }
+     }
 
     public void Adaption(Texture tex)
     {

+ 9 - 1
Assets/LangChaoRTC/Remote/Z_Blend/PdfManager.cs

@@ -1,8 +1,9 @@
-using Paroxe.PdfRenderer;
+using Paroxe.PdfRenderer;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
+using static LangChaoRommMinIo;
 
 public class PdfManager : BaseFilePrefabItem
 {
@@ -14,6 +15,13 @@ public class PdfManager : BaseFilePrefabItem
         if (!string.IsNullOrEmpty(fileConfig.Url))
         {
             string url = fileConfig.Url;
+            LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
+
+                Debug.Log("rfd==>" + rfd.url);
+                Debug.Log("rfd==>" + rfd.bytes.Length);
+                url = rfd.url;
+
+            });
             if (!fileConfig.Url.Contains("http"))
             {
                 url = "https://" + fileConfig.Url;

+ 1 - 1
Assets/Materials/PlayButtonGreen.mat

@@ -173,7 +173,7 @@ Material:
     - _ZWrite: 1
     m_Colors:
     - _ClippingBorderColor: {r: 1, g: 0.2, b: 0, a: 1}
-    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _Color: {r: 0, g: 1, b: 0.13350749, a: 1}
     - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
     - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
     - _EnvironmentColorX: {r: 1, g: 0, b: 0, a: 1}

+ 1 - 1
Assets/Scripts/Managers/MachineRoomManager.cs

@@ -250,7 +250,7 @@ public class MachineRoomManager : MonoSingleton<MachineRoomManager>
         UILogManager.Instance.text1.text = msg;
         if (json["code"].ToString() == "200")
         {
-            string data = json["data"].ToString();
+            string data = json["data"]["room"].ToString();
 
             this.data = JsonConvert.DeserializeObject<MachineRoomData>(data);
 

+ 1 - 1
Assets/Scripts/RTC/RTCRoomManager.cs

@@ -236,7 +236,7 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
                 break;
         }
 
-        if(rtcState != RTCEnum.OFF&& ScenesManager.Instance.getWindow() != ScenesManager.SceneType.ShowRTC)
+        if(rtcState != RTCEnum.OFF&& ScenesManager.Instance.getWindow() != ScenesManager.SceneType.ShowRoom)
         {
             Debug.Log(" GETWindow Scenes   " + ScenesManager.Instance.getWindow());
             // 退出房间