From 7167334c0e89dd84827d59e726123d14776e3a09 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 16 六月 2020 11:14:13 +0800
Subject: [PATCH] 2020-06-16-1

---
 HDL_ON/UI/Music/SendMethod.cs |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/UI/Music/SendMethod.cs b/HDL_ON/UI/Music/SendMethod.cs
index 16c3a95..60ec371 100644
--- a/HDL_ON/UI/Music/SendMethod.cs
+++ b/HDL_ON/UI/Music/SendMethod.cs
@@ -153,22 +153,17 @@
             try
             {
 
-                if (a31MusicModel.ServerClientType == -1)
+                if (a31MusicModel.ServerClientType == 1)
                 {
-                    var result = OpenWeb("http://" + a31MusicModel.ServerIP + "/httpapi.asp?command=multiroom:getSlaveList");
-                    if (result != null)
+                    var result = OpenWeb("http://" + a31MusicModel.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
+                    if (result != null && result != "Failed")
                     {
                         var slaves = Newtonsoft.Json.JsonConvert.DeserializeObject<Slaves>(result);
-                        if (slaves != null && slaves.slave_list != null)
+                        if (slaves != null && slaves.slave_list != null && slaves.slave_list.Count != 0)
                         {
-                            var slave = slaves.slave_list.Find((obj) => obj.uuid.Replace("uuid:", "") == a31MusicModel.UniqueDeviceName);
-                            if (slave != null)
-                            {
-                                a31MusicModel.A31PlayStatus.vol = slave.volume;
-                            }
+                            a31MusicModel.Slave = slaves;
                         }
                     }
-                    return;
                 }
 
                 WebClient webClient = new WebClient();
@@ -176,7 +171,7 @@
                 webClient.Headers.Add("CONTENT-TYPE", "text/xml; charset=\"utf-8\"");
 
                 var recevieBytes = webClient.UploadData(new Uri("http://" + a31MusicModel.IPAddress + ":" + a31MusicModel.Port + "/upnp/control/rendertransport1"), "POST", System.Text.Encoding.UTF8.GetBytes("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:GetInfoEx xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\"><InstanceID>0</InstanceID></u:GetInfoEx></s:Body></s:Envelope>"));
-                a31MusicModel.LastDateTime = DateTime.Now;
+                a31MusicModel.LastDateTime = DateTime.Now;//璁板綍鏁版嵁鍙嶉鐨勬椂闂�(鍥犱负鏈夋椂闂寸綉缁滃樊鏁版嵁涓嶅洖澶嶏紝瀵艰嚧褰撳墠鎾斁闊充箰鏃堕棿鏄剧ず涓嶆纭�)
 
                 var se = System.Security.SecurityElement.FromString(System.Text.Encoding.UTF8.GetString(recevieBytes)).SearchForChildByTag("s:Body").SearchForChildByTag("u:GetInfoExResponse");
 
@@ -460,7 +455,7 @@
                 {
                     if (a31player.ServerClientType == -1)
                     {
-                        new System.Net.WebClient().DownloadData(new Uri("http://" + a31player.ServerIP + "/httpapi.asp?command=multiroom:SlaveVolume:" + a31player.IPAddress + ":" + volume));
+                        new System.Net.WebClient().DownloadData(new Uri("http://" + a31player.MainPlayIP + "/httpapi.asp?command=multiroom:SlaveVolume:" + a31player.IPAddress + ":" + volume));
                     }
                     else if (a31player.ServerClientType == 1)
                     {

--
Gitblit v1.8.0