mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
replace llsd xml fw encoder
This commit is contained in:
@@ -131,16 +131,16 @@ namespace OpenSim.Capabilities.Handlers
|
||||
return;
|
||||
}
|
||||
|
||||
osUTF8 sb = OSUTF8Cached.Acquire();
|
||||
sb.AppendASCII("[WEB FETCH INV DESC HANDLER]: Unable to fetch folders owned by Unknown user:");
|
||||
osUTF8 osu = OSUTF8Cached.Acquire();
|
||||
osu.AppendASCII("[WEB FETCH INV DESC HANDLER]: Unable to fetch folders owned by Unknown user:");
|
||||
int limit = 5;
|
||||
int count = 0;
|
||||
foreach (UUID bad in bad_folders)
|
||||
{
|
||||
if (BadRequests.ContainsKey(bad))
|
||||
continue;
|
||||
sb.Append((byte)' ');
|
||||
sb.AppendASCII(bad.ToString());
|
||||
osu.Append((byte)' ');
|
||||
osu.AppendASCII(bad.ToString());
|
||||
++count;
|
||||
if (--limit < 0)
|
||||
break;
|
||||
@@ -149,21 +149,21 @@ namespace OpenSim.Capabilities.Handlers
|
||||
if(count > 0)
|
||||
{
|
||||
if (limit < 0)
|
||||
sb.AppendASCII(" ...");
|
||||
m_log.Warn(sb.ToString());
|
||||
osu.AppendASCII(" ...");
|
||||
m_log.Warn(osu.ToString());
|
||||
}
|
||||
|
||||
sb.Clear();
|
||||
osu.Clear();
|
||||
|
||||
sb.AppendASCII("<llsd><map><key>folders</key><array /></map><map><key>bad_folders</key><array>");
|
||||
osu.AppendASCII("<llsd><map><key>folders</key><array /></map><map><key>bad_folders</key><array>");
|
||||
foreach (UUID bad in bad_folders)
|
||||
{
|
||||
sb.AppendASCII("<map><key>folder_id</key><uuid>");
|
||||
sb.AppendASCII(bad.ToString());
|
||||
sb.AppendASCII("</uuid><key>error</key><string>Unknown</string></map>");
|
||||
osu.AppendASCII("<map><key>folder_id</key><uuid>");
|
||||
osu.AppendASCII(bad.ToString());
|
||||
osu.AppendASCII("</uuid><key>error</key><string>Unknown</string></map>");
|
||||
}
|
||||
sb.AppendASCII("</array></map></llsd>");
|
||||
httpResponse.RawBuffer = OSUTF8Cached.GetArrayAndRelease(sb);
|
||||
osu.AppendASCII("</array></map></llsd>");
|
||||
httpResponse.RawBuffer = OSUTF8Cached.GetArrayAndRelease(osu);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ using System.Text;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using Mono.Addins;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
@@ -42,6 +43,7 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using Caps=OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
|
||||
namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EstateAcessCapModule")]
|
||||
@@ -162,84 +164,84 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
UUID[] groups = regionSettings.EstateGroups;
|
||||
EstateBan[] EstateBans = regionSettings.EstateBans;
|
||||
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
osUTF8 sb = LLSDxmlEncode2.Start();
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
|
||||
if (allowed != null && allowed.Length > 0)
|
||||
{
|
||||
LLSDxmlEncode.AddArray("AllowedAgents", sb);
|
||||
LLSDxmlEncode2.AddArray("AllowedAgents", sb);
|
||||
for (int i = 0; i < allowed.Length; ++i)
|
||||
{
|
||||
UUID id = allowed[i];
|
||||
if (id == UUID.Zero)
|
||||
continue;
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("id", id, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("id", id, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
}
|
||||
LLSDxmlEncode.AddEndArray(sb);
|
||||
LLSDxmlEncode2.AddEndArray(sb);
|
||||
}
|
||||
else
|
||||
LLSDxmlEncode.AddEmptyArray("AllowedAgents", sb);
|
||||
LLSDxmlEncode2.AddEmptyArray("AllowedAgents", sb);
|
||||
|
||||
if (groups != null && groups.Length > 0)
|
||||
{
|
||||
LLSDxmlEncode.AddArray("AllowedGroups", sb);
|
||||
LLSDxmlEncode2.AddArray("AllowedGroups", sb);
|
||||
for (int i = 0; i < groups.Length; ++i)
|
||||
{
|
||||
UUID id = groups[i];
|
||||
if (id == UUID.Zero)
|
||||
continue;
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("id", id, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("id", id, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
}
|
||||
LLSDxmlEncode.AddEndArray(sb);
|
||||
LLSDxmlEncode2.AddEndArray(sb);
|
||||
}
|
||||
else
|
||||
LLSDxmlEncode.AddEmptyArray("AllowedGroups", sb);
|
||||
LLSDxmlEncode2.AddEmptyArray("AllowedGroups", sb);
|
||||
|
||||
if (EstateBans != null && EstateBans.Length > 0)
|
||||
{
|
||||
LLSDxmlEncode.AddArray("BannedAgents", sb);
|
||||
LLSDxmlEncode2.AddArray("BannedAgents", sb);
|
||||
for (int i = 0; i < EstateBans.Length; ++i)
|
||||
{
|
||||
EstateBan ban = EstateBans[i];
|
||||
UUID id = ban.BannedUserID;
|
||||
if (id == UUID.Zero)
|
||||
continue;
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("id", id, sb);
|
||||
LLSDxmlEncode.AddElem("banning_id", ban.BanningUserID, sb);
|
||||
LLSDxmlEncode.AddElem("last_login_date", "na", sb); // We will not have this. This information is far at grid
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("id", id, sb);
|
||||
LLSDxmlEncode2.AddElem("banning_id", ban.BanningUserID, sb);
|
||||
LLSDxmlEncode2.AddElem("last_login_date", "na", sb); // We will not have this. This information is far at grid
|
||||
if (ban.BanTime == 0)
|
||||
LLSDxmlEncode.AddElem("ban_date", "0000-00-00 00:00", sb);
|
||||
LLSDxmlEncode2.AddElem("ban_date", "0000-00-00 00:00", sb);
|
||||
else
|
||||
LLSDxmlEncode.AddElem("ban_date", (Util.ToDateTime(ban.BanTime)).ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture), sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
LLSDxmlEncode2.AddElem("ban_date", (Util.ToDateTime(ban.BanTime)).ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture), sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
}
|
||||
LLSDxmlEncode.AddEndArray(sb);
|
||||
LLSDxmlEncode2.AddEndArray(sb);
|
||||
}
|
||||
else
|
||||
LLSDxmlEncode.AddEmptyArray("BannedAgents", sb);
|
||||
LLSDxmlEncode2.AddEmptyArray("BannedAgents", sb);
|
||||
|
||||
if (managers != null && managers.Length > 0)
|
||||
{
|
||||
LLSDxmlEncode.AddArray("Managers", sb);
|
||||
LLSDxmlEncode2.AddArray("Managers", sb);
|
||||
for (int i = 0; i < managers.Length; ++i)
|
||||
{
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("agent_id", managers[i], sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("agent_id", managers[i], sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
}
|
||||
LLSDxmlEncode.AddEndArray(sb);
|
||||
LLSDxmlEncode2.AddEndArray(sb);
|
||||
}
|
||||
else
|
||||
LLSDxmlEncode.AddEmptyArray("Managers", sb);
|
||||
LLSDxmlEncode2.AddEmptyArray("Managers", sb);
|
||||
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
|
||||
response.RawBuffer = Util.UTF8.GetBytes(LLSDxmlEncode.End(sb));
|
||||
response.RawBuffer = LLSDxmlEncode2.EndToBytes(sb);
|
||||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,12 +468,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
// do nothing, in last case http server will do it
|
||||
}
|
||||
|
||||
private readonly byte[] EventHeader = GenEventHeader();
|
||||
|
||||
private static byte[] GenEventHeader()
|
||||
{
|
||||
return Encoding.UTF8.GetBytes("<llsd><map><key>events</key><array>");
|
||||
}
|
||||
private readonly byte[] EventHeader = osUTF8.GetASCIIBytes("<llsd><map><key>events</key><array>");
|
||||
|
||||
public Hashtable GetEvents(UUID requestID, UUID pAgentId)
|
||||
{
|
||||
@@ -539,11 +534,11 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
totalSize += EventHeader.Length;
|
||||
|
||||
StringBuilder sb = new StringBuilder(1024);
|
||||
LLSDxmlEncode.AddEndArray(sb); // events array
|
||||
LLSDxmlEncode.AddElem("id", thisID, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
element = LLSDxmlEncode.EndToNBBytes(sb);
|
||||
osUTF8 sb = OSUTF8Cached.Acquire();
|
||||
LLSDxmlEncode2.AddEndArray(sb); // events array
|
||||
LLSDxmlEncode2.AddElem("id", thisID, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
element = LLSDxmlEncode2.EndToBytes(sb);
|
||||
elements.Add(element);
|
||||
totalSize += element.Length;
|
||||
|
||||
|
||||
@@ -2208,11 +2208,11 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
}
|
||||
|
||||
//m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelID {0} {1}", parcelID, parcelID == UUID.Zero ? args.ToString() :"");
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("parcel_id", parcelID,sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
response.RawBuffer = Util.UTF8.GetBytes(LLSDxmlEncode.End(sb));
|
||||
osUTF8 sb = LLSDxmlEncode2.Start();
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("parcel_id", parcelID,sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
response.RawBuffer = LLSDxmlEncode2.EndToBytes(sb);
|
||||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -444,13 +444,13 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode.AddElem("success", true, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDxmlEncode.End(sb));
|
||||
osUTF8 sb = LLSDxmlEncode2.Start();
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode2.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode2.AddElem("success", true, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
httpResponse.RawBuffer = LLSDxmlEncode2.EndToBytes(sb);
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
@@ -498,14 +498,14 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||
byte[] envBytes = VEnv.ToCapBytes(regionID, parcelid);
|
||||
if(envBytes == null)
|
||||
{
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
LLSDxmlEncode.AddArray(sb);
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
LLSDxmlEncode.AddEndArray(sb);
|
||||
httpResponse.RawBuffer = LLSDxmlEncode.EndToNBBytes(sb);
|
||||
osUTF8 sb = LLSDxmlEncode2.Start();
|
||||
LLSDxmlEncode2.AddArray(sb);
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode2.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
LLSDxmlEncode2.AddEndArray(sb);
|
||||
httpResponse.RawBuffer = LLSDxmlEncode2.EndToBytes(sb);
|
||||
}
|
||||
else
|
||||
httpResponse.RawBuffer = envBytes;
|
||||
@@ -520,7 +520,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||
int parcel = -1;
|
||||
int track = -1;
|
||||
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
osUTF8 sb = LLSDxmlEncode2.Start();
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
if (sp == null || sp.IsChildAgent || sp.IsNPC)
|
||||
@@ -653,12 +653,12 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||
m_log.InfoFormat("[{0}]: ExtEnvironment region {1} settings from agentID {2} saved",
|
||||
Name, caps.RegionName, agentID);
|
||||
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode.AddElem("success", success, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDxmlEncode.End(sb));
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode2.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode2.AddElem("success", success, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
httpResponse.RawBuffer = LLSDxmlEncode2.EndToBytes(sb);
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||
return;
|
||||
}
|
||||
@@ -673,16 +673,13 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||
}
|
||||
|
||||
Error:
|
||||
string response;
|
||||
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("success", success, sb);
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("success", success, sb);
|
||||
if(!success)
|
||||
LLSDxmlEncode.AddElem("message", message, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
response = LLSDxmlEncode.End(sb);
|
||||
LLSDxmlEncode2.AddElem("message", message, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
|
||||
httpResponse.RawBuffer = Util.UTF8NBGetbytes(response);
|
||||
httpResponse.RawBuffer = LLSDxmlEncode2.EndToBytes(sb);
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
@@ -717,14 +714,14 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||
byte[] envBytes = VEnv.ToCapWLBytes(UUID.Zero, regionID);
|
||||
if(envBytes == null)
|
||||
{
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
LLSDxmlEncode.AddArray(sb);
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
LLSDxmlEncode.AddEndArray(sb);
|
||||
response.RawBuffer = LLSDxmlEncode.EndToNBBytes(sb);
|
||||
osUTF8 sb = LLSDxmlEncode2.Start();
|
||||
LLSDxmlEncode2.AddArray(sb);
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode2.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
LLSDxmlEncode2.AddEndArray(sb);
|
||||
response.RawBuffer = LLSDxmlEncode2.EndToBytes(sb);
|
||||
}
|
||||
else
|
||||
response.RawBuffer = envBytes;
|
||||
@@ -789,15 +786,15 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||
}
|
||||
|
||||
Error:
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode.AddElem("success", success, sb);
|
||||
osUTF8 sb = LLSDxmlEncode2.Start();
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("messageID", UUID.Zero, sb);
|
||||
LLSDxmlEncode2.AddElem("regionID", regionID, sb);
|
||||
LLSDxmlEncode2.AddElem("success", success, sb);
|
||||
if(!success)
|
||||
LLSDxmlEncode.AddElem("fail_reason", fail_reason, sb);
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
response.RawBuffer = Util.UTF8NBGetbytes(LLSDxmlEncode.End(sb));
|
||||
LLSDxmlEncode2.AddElem("fail_reason", fail_reason, sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
response.RawBuffer = LLSDxmlEncode2.EndToBytes(sb);
|
||||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -190,8 +190,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void genID()
|
||||
{
|
||||
string lslx = toLLSDxml();
|
||||
Byte[] data = System.Text.Encoding.ASCII.GetBytes(lslx);
|
||||
Byte[] data = toLLSDxml();
|
||||
using (var md5 = MD5.Create())
|
||||
ID = new UUID(md5.ComputeHash(data), 0);
|
||||
}
|
||||
@@ -291,52 +290,52 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return mat;
|
||||
}
|
||||
|
||||
public string toLLSDxml(StringBuilder sb = null)
|
||||
public byte[] toLLSDxml(osUTF8 sb = null)
|
||||
{
|
||||
const float scale = 10000f;
|
||||
bool fullLLSD = false;
|
||||
if (sb == null)
|
||||
{
|
||||
|
||||
sb = LLSDxmlEncode.Start(1024, false);
|
||||
sb = LLSDxmlEncode2.Start(1024, false);
|
||||
fullLLSD = true;
|
||||
}
|
||||
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("NormMap", NormalMapID, sb);
|
||||
LLSDxmlEncode.AddElem("NormOffsetX", (int)(scale * NormalOffsetX + 0.5f), sb);
|
||||
LLSDxmlEncode.AddElem("NormOffsetY", (int)(scale * NormalOffsetY + 0.5f), sb);
|
||||
LLSDxmlEncode.AddElem("NormRepeatX", (int)(scale * NormalRepeatX + 0.5f), sb);
|
||||
LLSDxmlEncode.AddElem("NormRepeatY", (int)(scale * NormalRepeatY + 0.5f), sb);
|
||||
LLSDxmlEncode.AddElem("NormRotation", (int)(scale * NormalRotation + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddMap(sb);
|
||||
LLSDxmlEncode2.AddElem("NormMap", NormalMapID, sb);
|
||||
LLSDxmlEncode2.AddElem("NormOffsetX", (int)(scale * NormalOffsetX + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("NormOffsetY", (int)(scale * NormalOffsetY + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("NormRepeatX", (int)(scale * NormalRepeatX + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("NormRepeatY", (int)(scale * NormalRepeatY + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("NormRotation", (int)(scale * NormalRotation + 0.5f), sb);
|
||||
|
||||
LLSDxmlEncode.AddElem("SpecMap", SpecularMapID, sb);
|
||||
LLSDxmlEncode.AddElem("SpecOffsetX", (int)(scale * SpecularOffsetX + 0.5f), sb);
|
||||
LLSDxmlEncode.AddElem("SpecOffsetY", (int)(scale * SpecularOffsetY + 0.5f), sb);
|
||||
LLSDxmlEncode.AddElem("SpecRepeatX", (int)(scale * SpecularRepeatX + 0.5f), sb);
|
||||
LLSDxmlEncode.AddElem("SpecRepeatY", (int)(scale * SpecularRepeatY + 0.5f), sb);
|
||||
LLSDxmlEncode.AddElem("SpecRotation", (int)(scale * SpecularRotation + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("SpecMap", SpecularMapID, sb);
|
||||
LLSDxmlEncode2.AddElem("SpecOffsetX", (int)(scale * SpecularOffsetX + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("SpecOffsetY", (int)(scale * SpecularOffsetY + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("SpecRepeatX", (int)(scale * SpecularRepeatX + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("SpecRepeatY", (int)(scale * SpecularRepeatY + 0.5f), sb);
|
||||
LLSDxmlEncode2.AddElem("SpecRotation", (int)(scale * SpecularRotation + 0.5f), sb);
|
||||
|
||||
LLSDxmlEncode.AddArray("SpecColor", sb);
|
||||
LLSDxmlEncode.AddElem(SpecularLightColorR, sb);
|
||||
LLSDxmlEncode.AddElem(SpecularLightColorG, sb);
|
||||
LLSDxmlEncode.AddElem(SpecularLightColorB, sb);
|
||||
LLSDxmlEncode.AddElem(255, sb);
|
||||
LLSDxmlEncode.AddEndArray(sb);
|
||||
LLSDxmlEncode2.AddArray("SpecColor", sb);
|
||||
LLSDxmlEncode2.AddElem(SpecularLightColorR, sb);
|
||||
LLSDxmlEncode2.AddElem(SpecularLightColorG, sb);
|
||||
LLSDxmlEncode2.AddElem(SpecularLightColorB, sb);
|
||||
LLSDxmlEncode2.AddElem(255, sb);
|
||||
LLSDxmlEncode2.AddEndArray(sb);
|
||||
|
||||
LLSDxmlEncode.AddElem("SpecExp", SpecularLightExponent, sb);
|
||||
LLSDxmlEncode.AddElem("EnvIntensity", EnvironmentIntensity, sb);
|
||||
LLSDxmlEncode.AddElem("DiffuseAlphaMode", DiffuseAlphaMode, sb);
|
||||
LLSDxmlEncode.AddElem("AlphaMaskCutoff", AlphaMaskCutoff, sb);
|
||||
LLSDxmlEncode2.AddElem("SpecExp", SpecularLightExponent, sb);
|
||||
LLSDxmlEncode2.AddElem("EnvIntensity", EnvironmentIntensity, sb);
|
||||
LLSDxmlEncode2.AddElem("DiffuseAlphaMode", DiffuseAlphaMode, sb);
|
||||
LLSDxmlEncode2.AddElem("AlphaMaskCutoff", AlphaMaskCutoff, sb);
|
||||
|
||||
LLSDxmlEncode.AddEndMap(sb);
|
||||
LLSDxmlEncode2.AddEndMap(sb);
|
||||
|
||||
if (fullLLSD)
|
||||
{
|
||||
return LLSDxmlEncode.End(sb);
|
||||
return LLSDxmlEncode2.EndToBytes(sb);
|
||||
}
|
||||
else
|
||||
return String.Empty; // ignored if appending
|
||||
return Utils.EmptyBytes; // ignored if appending
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user