replace llsd xml fw encoder

This commit is contained in:
UbitUmarov
2020-10-13 16:20:55 +01:00
parent 1fc6f84790
commit c70904418a
9 changed files with 170 additions and 181 deletions

View File

@@ -367,21 +367,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
string accounturl = String.Format("http://{0}:{1}{2}/", m_openSimWellKnownHTTPAddress,
m_freeSwitchServicePort, m_freeSwitchAPIPrefix);
// fast foward encode
StringBuilder lsl = LLSDxmlEncode.Start(512);
LLSDxmlEncode.AddMap(lsl);
LLSDxmlEncode.AddElem("username", agentname, lsl);
LLSDxmlEncode.AddElem("password", password, lsl);
LLSDxmlEncode.AddElem("voice_sip_uri_hostname", m_freeSwitchRealm, lsl);
LLSDxmlEncode.AddElem("voice_account_server_name", accounturl, lsl);
LLSDxmlEncode.AddEndMap(lsl);
response.RawBuffer = Util.UTF8.GetBytes(LLSDxmlEncode.End(lsl));
osUTF8 lsl = LLSDxmlEncode2.Start();
LLSDxmlEncode2.AddMap(lsl);
LLSDxmlEncode2.AddElem("username", agentname, lsl);
LLSDxmlEncode2.AddElem("password", password, lsl);
LLSDxmlEncode2.AddElem("voice_sip_uri_hostname", m_freeSwitchRealm, lsl);
LLSDxmlEncode2.AddElem("voice_account_server_name", accounturl, lsl);
LLSDxmlEncode2.AddEndMap(lsl);
response.RawBuffer = LLSDxmlEncode2.EndToBytes(lsl);
}
catch (Exception e)
{
m_log.ErrorFormat("[FreeSwitchVoice][PROVISIONVOICE]: avatar \"{0}\": {1}, retry later", avatarName, e.Message);
m_log.DebugFormat("[FreeSwitchVoice][PROVISIONVOICE]: avatar \"{0}\": {1} failed", avatarName, e.ToString());
response.RawBuffer = Util.UTF8.GetBytes("<llsd>undef</llsd>");
response.RawBuffer = osUTF8.GetASCIIBytes("<llsd>undef</llsd>");
}
}
@@ -465,17 +465,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
}
// fast foward encode
StringBuilder lsl = LLSDxmlEncode.Start(512);
LLSDxmlEncode.AddMap(lsl);
LLSDxmlEncode.AddElem("parcel_local_id", land.LocalID, lsl);
LLSDxmlEncode.AddElem("region_name", scene.Name, lsl);
LLSDxmlEncode.AddMap("voice_credentials", lsl);
LLSDxmlEncode.AddElem("channel_uri", channelUri, lsl);
//LLSDxmlEncode.AddElem("channel_credentials", channel_credentials, lsl);
LLSDxmlEncode.AddEndMap(lsl);
LLSDxmlEncode.AddEndMap(lsl);
osUTF8 lsl = LLSDxmlEncode2.Start(512);
LLSDxmlEncode2.AddMap(lsl);
LLSDxmlEncode2.AddElem("parcel_local_id", land.LocalID, lsl);
LLSDxmlEncode2.AddElem("region_name", scene.Name, lsl);
LLSDxmlEncode2.AddMap("voice_credentials", lsl);
LLSDxmlEncode2.AddElem("channel_uri", channelUri, lsl);
//LLSDxmlEncode2.AddElem("channel_credentials", channel_credentials, lsl);
LLSDxmlEncode2.AddEndMap(lsl);
LLSDxmlEncode2.AddEndMap(lsl);
response.RawBuffer= Util.UTF8.GetBytes(LLSDxmlEncode.End(lsl));
response.RawBuffer= LLSDxmlEncode2.EndToBytes(lsl);
}
catch (Exception e)
{

View File

@@ -30,7 +30,6 @@ using System.IO;
using System.Net;
using System.Text;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Threading;
@@ -38,15 +37,13 @@ using OpenMetaverse;
using log4net;
using Mono.Addins;
using Nini.Config;
using Nwc.XmlRpc;
using OpenSim.Framework;
using OpenSim.Framework.Capabilities;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using Caps = OpenSim.Framework.Capabilities.Caps;
using OpenMetaverse.StructuredData;
namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
{
@@ -593,22 +590,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
VivoxPassword(agentname, password);
// fast foward encode
StringBuilder lsl = LLSDxmlEncode.Start(512);
LLSDxmlEncode.AddMap(lsl);
LLSDxmlEncode.AddElem("username", agentname, lsl);
LLSDxmlEncode.AddElem("password", password, lsl);
LLSDxmlEncode.AddElem("voice_sip_uri_hostname", m_vivoxSipUri, lsl);
LLSDxmlEncode.AddElem("voice_account_server_name", m_vivoxVoiceAccountApi, lsl);
LLSDxmlEncode.AddEndMap(lsl);
osUTF8 lsl = LLSDxmlEncode2.Start();
LLSDxmlEncode2.AddMap(lsl);
LLSDxmlEncode2.AddElem("username", agentname, lsl);
LLSDxmlEncode2.AddElem("password", password, lsl);
LLSDxmlEncode2.AddElem("voice_sip_uri_hostname", m_vivoxSipUri, lsl);
LLSDxmlEncode2.AddElem("voice_account_server_name", m_vivoxVoiceAccountApi, lsl);
LLSDxmlEncode2.AddEndMap(lsl);
response.RawBuffer = Util.UTF8.GetBytes(LLSDxmlEncode.End(lsl));
response.RawBuffer = LLSDxmlEncode2.EndToBytes(lsl);
return;
}
catch (Exception e)
{
m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: : {0} failed", e.ToString());
}
response.RawBuffer = Util.UTF8.GetBytes("<llsd><undef /></llsd>");
response.RawBuffer = osUTF8.GetASCIIBytes("<llsd><undef /></llsd>");
}
/// <summary>
@@ -693,17 +690,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
// m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}",
// scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r);
// fast foward encode
StringBuilder lsl = LLSDxmlEncode.Start(512);
LLSDxmlEncode.AddMap(lsl);
LLSDxmlEncode.AddElem("parcel_local_id", land.LocalID, lsl);
LLSDxmlEncode.AddElem("region_name", scene.Name, lsl);
LLSDxmlEncode.AddMap("voice_credentials",lsl);
LLSDxmlEncode.AddElem("channel_uri", channel_uri, lsl);
//LLSDxmlEncode.AddElem("channel_credentials", channel_credentials, lsl);
LLSDxmlEncode.AddEndMap(lsl);
LLSDxmlEncode.AddEndMap(lsl);
osUTF8 lsl = LLSDxmlEncode2.Start();
LLSDxmlEncode2.AddMap(lsl);
LLSDxmlEncode2.AddElem("parcel_local_id", land.LocalID, lsl);
LLSDxmlEncode2.AddElem("region_name", scene.Name, lsl);
LLSDxmlEncode2.AddMap("voice_credentials",lsl);
LLSDxmlEncode2.AddElem("channel_uri", channel_uri, lsl);
//LLSDxmlEncode2.AddElem("channel_credentials", channel_credentials, lsl);
LLSDxmlEncode2.AddEndMap(lsl);
LLSDxmlEncode2.AddEndMap(lsl);
response.RawBuffer = Util.UTF8.GetBytes(LLSDxmlEncode.End(lsl));
response.RawBuffer = LLSDxmlEncode2.EndToBytes(lsl);
return;
}
catch (Exception e)

View File

@@ -749,8 +749,7 @@ namespace OpenSim.Region.OptionalModules.Materials
{
// this are not true assets, should had never been...
AssetBase asset = null;
string txt = fm.toLLSDxml();
byte[] data = System.Text.Encoding.ASCII.GetBytes(txt);
byte[] data = fm.toLLSDxml();
asset = new AssetBase(fm.ID, "llmaterial", (sbyte)OpenSimAssetType.Material, "00000000-0000-0000-0000-000000000000");
asset.Data = data;