陈嘉乐
2020-06-16 7167334c0e89dd84827d59e726123d14776e3a09
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)
                    {