mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
* Update libOMV to r2359. This is necessary for the progressive texture patch
* Update libopenjpeg as well for this patch. * Appears to be okay on a very short sniff test * Source code will be placed in opensim-libs shortly
This commit is contained in:
@@ -44,18 +44,18 @@ using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
|
||||
using LLSD = OpenMetaverse.StructuredData.LLSD;
|
||||
using LLSDMap = OpenMetaverse.StructuredData.LLSDMap;
|
||||
using LLSDArray = OpenMetaverse.StructuredData.LLSDArray;
|
||||
using OSD = OpenMetaverse.StructuredData.OSD;
|
||||
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
||||
using OSDArray = OpenMetaverse.StructuredData.OSDArray;
|
||||
using Caps = OpenSim.Framework.Communications.Capabilities.Caps;
|
||||
using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue<OpenMetaverse.StructuredData.LLSD>;
|
||||
using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue<OpenMetaverse.StructuredData.OSD>;
|
||||
|
||||
namespace OpenSim.Region.Environment.Modules.Framework
|
||||
{
|
||||
public struct QueueItem
|
||||
{
|
||||
public int id;
|
||||
public LLSDMap body;
|
||||
public OSDMap body;
|
||||
}
|
||||
|
||||
public class EventQueueGetModule : IEventQueue, IRegionModule
|
||||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
|
||||
|
||||
#region IEventQueue Members
|
||||
public bool Enqueue(LLSD ev, UUID avatarID)
|
||||
public bool Enqueue(OSD ev, UUID avatarID)
|
||||
{
|
||||
m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName);
|
||||
try
|
||||
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
// }
|
||||
|
||||
BlockingLLSDQueue queue = GetQueue(agentID);
|
||||
LLSD element = queue.Dequeue(15000); // 15s timeout
|
||||
OSD element = queue.Dequeue(15000); // 15s timeout
|
||||
|
||||
Hashtable responsedata = new Hashtable();
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
|
||||
|
||||
|
||||
LLSDArray array = new LLSDArray();
|
||||
OSDArray array = new OSDArray();
|
||||
if (element == null) // didn't have an event in 15s
|
||||
{
|
||||
// Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say!
|
||||
@@ -354,10 +354,10 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
}
|
||||
}
|
||||
|
||||
LLSDMap events = new LLSDMap();
|
||||
OSDMap events = new OSDMap();
|
||||
events.Add("events", array);
|
||||
|
||||
events.Add("id", new LLSDInteger(thisID));
|
||||
events.Add("id", new OSDInteger(thisID));
|
||||
lock (m_ids)
|
||||
{
|
||||
m_ids[agentID] = thisID + 1;
|
||||
@@ -366,7 +366,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
responsedata["int_response_code"] = 200;
|
||||
responsedata["content_type"] = "application/xml";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = LLSDParser.SerializeXmlString(events);
|
||||
responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events);
|
||||
m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
|
||||
|
||||
return responsedata;
|
||||
@@ -424,7 +424,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
|
||||
}
|
||||
|
||||
public LLSD EventQueueFallBack(string path, LLSD request, string endpoint)
|
||||
public OSD EventQueueFallBack(string path, OSD request, string endpoint)
|
||||
{
|
||||
// This is a fallback element to keep the client from loosing EventQueueGet
|
||||
// Why does CAPS fail sometimes!?
|
||||
@@ -473,7 +473,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
thisID = m_ids[AvatarID];
|
||||
|
||||
BlockingLLSDQueue queue = GetQueue(AvatarID);
|
||||
LLSDArray array = new LLSDArray();
|
||||
OSDArray array = new OSDArray();
|
||||
LLSD element = queue.Dequeue(15000); // 15s timeout
|
||||
if (element == null)
|
||||
{
|
||||
@@ -489,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
thisID++;
|
||||
}
|
||||
}
|
||||
LLSDMap events = new LLSDMap();
|
||||
OSDMap events = new OSDMap();
|
||||
events.Add("events", array);
|
||||
|
||||
events.Add("id", new LLSDInteger(thisID));
|
||||
@@ -512,7 +512,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
|
||||
{
|
||||
//return new LLSD();
|
||||
}
|
||||
return new LLSDString("shutdown404!");
|
||||
return new OSDString("shutdown404!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,70 +52,70 @@ namespace OpenSim.Region.Environment
|
||||
};
|
||||
}
|
||||
|
||||
public static LLSD buildEvent(string eventName, LLSD eventBody)
|
||||
public static OSD buildEvent(string eventName, OSD eventBody)
|
||||
{
|
||||
LLSDMap llsdEvent = new LLSDMap(2);
|
||||
llsdEvent.Add("message", new LLSDString(eventName));
|
||||
OSDMap llsdEvent = new OSDMap(2);
|
||||
llsdEvent.Add("message", new OSDString(eventName));
|
||||
llsdEvent.Add("body", eventBody);
|
||||
|
||||
return llsdEvent;
|
||||
}
|
||||
|
||||
public static LLSD EnableSimulator(ulong Handle, IPEndPoint endPoint)
|
||||
public static OSD EnableSimulator(ulong Handle, IPEndPoint endPoint)
|
||||
{
|
||||
LLSDMap llsdSimInfo = new LLSDMap(3);
|
||||
OSDMap llsdSimInfo = new OSDMap(3);
|
||||
|
||||
llsdSimInfo.Add("Handle", new LLSDBinary(regionHandleToByteArray(Handle)));
|
||||
llsdSimInfo.Add("IP", new LLSDBinary(endPoint.Address.GetAddressBytes()));
|
||||
llsdSimInfo.Add("Port", new LLSDInteger(endPoint.Port));
|
||||
llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(Handle)));
|
||||
llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes()));
|
||||
llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port));
|
||||
|
||||
LLSDArray arr = new LLSDArray(1);
|
||||
OSDArray arr = new OSDArray(1);
|
||||
arr.Add(llsdSimInfo);
|
||||
|
||||
LLSDMap llsdBody = new LLSDMap(1);
|
||||
OSDMap llsdBody = new OSDMap(1);
|
||||
llsdBody.Add("SimulatorInfo", arr);
|
||||
|
||||
return buildEvent("EnableSimulator", llsdBody);
|
||||
}
|
||||
|
||||
public static LLSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt,
|
||||
public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt,
|
||||
IPEndPoint newRegionExternalEndPoint,
|
||||
string capsURL, UUID AgentID, UUID SessionID)
|
||||
{
|
||||
LLSDArray LookAtArr = new LLSDArray(3);
|
||||
LookAtArr.Add(LLSD.FromReal(lookAt.X));
|
||||
LookAtArr.Add(LLSD.FromReal(lookAt.Y));
|
||||
LookAtArr.Add(LLSD.FromReal(lookAt.Z));
|
||||
OSDArray LookAtArr = new OSDArray(3);
|
||||
LookAtArr.Add(OSD.FromReal(lookAt.X));
|
||||
LookAtArr.Add(OSD.FromReal(lookAt.Y));
|
||||
LookAtArr.Add(OSD.FromReal(lookAt.Z));
|
||||
|
||||
LLSDArray PositionArr = new LLSDArray(3);
|
||||
PositionArr.Add(LLSD.FromReal(pos.X));
|
||||
PositionArr.Add(LLSD.FromReal(pos.Y));
|
||||
PositionArr.Add(LLSD.FromReal(pos.Z));
|
||||
OSDArray PositionArr = new OSDArray(3);
|
||||
PositionArr.Add(OSD.FromReal(pos.X));
|
||||
PositionArr.Add(OSD.FromReal(pos.Y));
|
||||
PositionArr.Add(OSD.FromReal(pos.Z));
|
||||
|
||||
LLSDMap InfoMap = new LLSDMap(2);
|
||||
OSDMap InfoMap = new OSDMap(2);
|
||||
InfoMap.Add("LookAt", LookAtArr);
|
||||
InfoMap.Add("Position", PositionArr);
|
||||
|
||||
LLSDArray InfoArr = new LLSDArray(1);
|
||||
OSDArray InfoArr = new OSDArray(1);
|
||||
InfoArr.Add(InfoMap);
|
||||
|
||||
LLSDMap AgentDataMap = new LLSDMap(2);
|
||||
AgentDataMap.Add("AgentID", LLSD.FromUUID(AgentID));
|
||||
AgentDataMap.Add("SessionID", LLSD.FromUUID(SessionID));
|
||||
OSDMap AgentDataMap = new OSDMap(2);
|
||||
AgentDataMap.Add("AgentID", OSD.FromUUID(AgentID));
|
||||
AgentDataMap.Add("SessionID", OSD.FromUUID(SessionID));
|
||||
|
||||
LLSDArray AgentDataArr = new LLSDArray(1);
|
||||
OSDArray AgentDataArr = new OSDArray(1);
|
||||
AgentDataArr.Add(AgentDataMap);
|
||||
|
||||
LLSDMap RegionDataMap = new LLSDMap(4);
|
||||
RegionDataMap.Add("RegionHandle", LLSD.FromBinary(regionHandleToByteArray(Handle)));
|
||||
RegionDataMap.Add("SeedCapability", LLSD.FromString(capsURL));
|
||||
RegionDataMap.Add("SimIP", LLSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes()));
|
||||
RegionDataMap.Add("SimPort", LLSD.FromInteger(newRegionExternalEndPoint.Port));
|
||||
OSDMap RegionDataMap = new OSDMap(4);
|
||||
RegionDataMap.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(Handle)));
|
||||
RegionDataMap.Add("SeedCapability", OSD.FromString(capsURL));
|
||||
RegionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes()));
|
||||
RegionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port));
|
||||
|
||||
LLSDArray RegionDataArr = new LLSDArray(1);
|
||||
OSDArray RegionDataArr = new OSDArray(1);
|
||||
RegionDataArr.Add(RegionDataMap);
|
||||
|
||||
LLSDMap llsdBody = new LLSDMap(3);
|
||||
OSDMap llsdBody = new OSDMap(3);
|
||||
llsdBody.Add("Info", InfoArr);
|
||||
llsdBody.Add("AgentData", AgentDataArr);
|
||||
llsdBody.Add("RegionData", RegionDataArr);
|
||||
@@ -123,49 +123,49 @@ namespace OpenSim.Region.Environment
|
||||
return buildEvent("CrossedRegion", llsdBody);
|
||||
}
|
||||
|
||||
public static LLSD TeleportFinishEvent(
|
||||
public static OSD TeleportFinishEvent(
|
||||
ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint,
|
||||
uint locationID, uint flags, string capsURL, UUID AgentID)
|
||||
{
|
||||
LLSDMap info = new LLSDMap();
|
||||
info.Add("AgentID", LLSD.FromUUID(AgentID));
|
||||
info.Add("LocationID", LLSD.FromInteger(4)); // TODO what is this?
|
||||
info.Add("RegionHandle", LLSD.FromBinary(regionHandleToByteArray(regionHandle)));
|
||||
info.Add("SeedCapability", LLSD.FromString(capsURL));
|
||||
info.Add("SimAccess", LLSD.FromInteger(simAccess));
|
||||
info.Add("SimIP", LLSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes()));
|
||||
info.Add("SimPort", LLSD.FromInteger(regionExternalEndPoint.Port));
|
||||
info.Add("TeleportFlags", LLSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation
|
||||
OSDMap info = new OSDMap();
|
||||
info.Add("AgentID", OSD.FromUUID(AgentID));
|
||||
info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this?
|
||||
info.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(regionHandle)));
|
||||
info.Add("SeedCapability", OSD.FromString(capsURL));
|
||||
info.Add("SimAccess", OSD.FromInteger(simAccess));
|
||||
info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes()));
|
||||
info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port));
|
||||
info.Add("TeleportFlags", OSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation
|
||||
|
||||
LLSDArray infoArr = new LLSDArray();
|
||||
OSDArray infoArr = new OSDArray();
|
||||
infoArr.Add(info);
|
||||
|
||||
LLSDMap body = new LLSDMap();
|
||||
OSDMap body = new OSDMap();
|
||||
body.Add("Info", infoArr);
|
||||
|
||||
return buildEvent("TeleportFinish", body);
|
||||
}
|
||||
|
||||
public static LLSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono)
|
||||
public static OSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono)
|
||||
{
|
||||
LLSDMap script = new LLSDMap();
|
||||
script.Add("ObjectID", LLSD.FromUUID(objectID));
|
||||
script.Add("ItemID", LLSD.FromUUID(itemID));
|
||||
script.Add("Running", LLSD.FromBoolean(running));
|
||||
script.Add("Mono", LLSD.FromBoolean(mono));
|
||||
OSDMap script = new OSDMap();
|
||||
script.Add("ObjectID", OSD.FromUUID(objectID));
|
||||
script.Add("ItemID", OSD.FromUUID(itemID));
|
||||
script.Add("Running", OSD.FromBoolean(running));
|
||||
script.Add("Mono", OSD.FromBoolean(mono));
|
||||
|
||||
LLSDArray scriptArr = new LLSDArray();
|
||||
OSDArray scriptArr = new OSDArray();
|
||||
scriptArr.Add(script);
|
||||
|
||||
LLSDMap body = new LLSDMap();
|
||||
OSDMap body = new OSDMap();
|
||||
body.Add("Script", scriptArr);
|
||||
|
||||
return buildEvent("ScriptRunningReply", body);
|
||||
}
|
||||
|
||||
public static LLSD KeepAliveEvent()
|
||||
public static OSD KeepAliveEvent()
|
||||
{
|
||||
return buildEvent("FAKEEVENT", new LLSDMap());
|
||||
return buildEvent("FAKEEVENT", new OSDMap());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user