From 9984ecf862ff7362b0caa6c55554c3fd2243873d Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 3 Jan 2014 07:41:06 -0800 Subject: varregion: Add region size to teleport event messages (EnableSimulator, CorssRegion, TeleportFinishEvent). Have Simian grid service return the region size. Many teleport related debug log messages. Can be removed when teleport works (like that's ever going to happen). --- .../Linden/Caps/EventQueue/EventQueueGetModule.cs | 28 ++++++++++++----- .../Linden/Caps/EventQueue/EventQueueHelper.cs | 36 +++++++++++++++------- 2 files changed, 45 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/Caps/EventQueue') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 0dbdbaf..a05e88c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -711,34 +711,46 @@ namespace OpenSim.Region.ClientStack.Linden Enqueue(item, avatarID); } - public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID) + public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) { - OSD item = EventQueueHelper.EnableSimulator(handle, endPoint); + m_log.DebugFormat("{0} EnableSimulator. handle={1}, avatarID={2}, regionSize={3},{4}>", + "[EVENT QUEUE GET MODULE]", handle, avatarID, regionSizeX, regionSizeY); + + OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY); Enqueue(item, avatarID); } - public virtual void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint, string capsPath) + public virtual void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint, string capsPath, + ulong regionHandle, int regionSizeX, int regionSizeY) { - OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath); + m_log.DebugFormat("{0} EstablishAgentCommunication. handle={1}, avatarID={2}, regionSize={3},{4}>", + "[EVENT QUEUE GET MODULE]", regionHandle, avatarID, regionSizeX, regionSizeY); + OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath, regionHandle, regionSizeX, regionSizeY); Enqueue(item, avatarID); } public virtual void TeleportFinishEvent(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL, - UUID avatarID) + UUID avatarID, int regionSizeX, int regionSizeY) { + m_log.DebugFormat("{0} TeleportFinishEvent. handle={1}, avatarID={2}, regionSize={3},{4}>", + "[EVENT QUEUE GET MODULE]", regionHandle, avatarID, regionSizeX, regionSizeY); + OSD item = EventQueueHelper.TeleportFinishEvent(regionHandle, simAccess, regionExternalEndPoint, - locationID, flags, capsURL, avatarID); + locationID, flags, capsURL, avatarID, regionSizeX, regionSizeY); Enqueue(item, avatarID); } public virtual void CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, - string capsURL, UUID avatarID, UUID sessionID) + string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY) { + m_log.DebugFormat("{0} CrossRegion. handle={1}, avatarID={2}, regionSize={3},{4}>", + "[EVENT QUEUE GET MODULE]", handle, avatarID, regionSizeX, regionSizeY); + OSD item = EventQueueHelper.CrossRegion(handle, pos, lookAt, newRegionExternalEndPoint, - capsURL, avatarID, sessionID); + capsURL, avatarID, sessionID, regionSizeX, regionSizeY); Enqueue(item, avatarID); } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs index dab727f..ded228d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs @@ -70,13 +70,15 @@ namespace OpenSim.Region.ClientStack.Linden return llsdEvent; } - public static OSD EnableSimulator(ulong handle, IPEndPoint endPoint) + public static OSD EnableSimulator(ulong handle, IPEndPoint endPoint, int regionSizeX, int regionSizeY) { - OSDMap llsdSimInfo = new OSDMap(3); + OSDMap llsdSimInfo = new OSDMap(5); llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle))); llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); + llsdSimInfo.Add("RegionSizeX", new OSDInteger(regionSizeX)); + llsdSimInfo.Add("RegionSizeY", new OSDInteger(regionSizeY)); OSDArray arr = new OSDArray(1); arr.Add(llsdSimInfo); @@ -104,7 +106,8 @@ namespace OpenSim.Region.ClientStack.Linden public static OSD CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, - string capsURL, UUID agentID, UUID sessionID) + string capsURL, UUID agentID, UUID sessionID, + int regionSizeX, int regionSizeY) { OSDArray lookAtArr = new OSDArray(3); lookAtArr.Add(OSD.FromReal(lookAt.X)); @@ -130,11 +133,13 @@ namespace OpenSim.Region.ClientStack.Linden OSDArray agentDataArr = new OSDArray(1); agentDataArr.Add(agentDataMap); - OSDMap regionDataMap = new OSDMap(4); + OSDMap regionDataMap = new OSDMap(6); regionDataMap.Add("RegionHandle", OSD.FromBinary(ulongToByteArray(handle))); regionDataMap.Add("SeedCapability", OSD.FromString(capsURL)); regionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); regionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port)); + regionDataMap.Add("RegionSizeX", new OSDInteger(regionSizeX)); + regionDataMap.Add("RegionSizeY", new OSDInteger(regionSizeY)); OSDArray regionDataArr = new OSDArray(1); regionDataArr.Add(regionDataMap); @@ -148,8 +153,9 @@ namespace OpenSim.Region.ClientStack.Linden } public static OSD TeleportFinishEvent( - ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, - uint locationID, uint flags, string capsURL, UUID agentID) + ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL, UUID agentID, + int regionSizeX, int regionSizeY) { OSDMap info = new OSDMap(); info.Add("AgentID", OSD.FromUUID(agentID)); @@ -160,6 +166,8 @@ namespace OpenSim.Region.ClientStack.Linden info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation + info.Add("RegionSizeX", new OSDInteger(regionSizeX)); + info.Add("RegionSizeY", new OSDInteger(regionSizeY)); OSDArray infoArr = new OSDArray(); infoArr.Add(info); @@ -187,12 +195,18 @@ namespace OpenSim.Region.ClientStack.Linden return BuildEvent("ScriptRunningReply", body); } - public static OSD EstablishAgentCommunication(UUID agentID, string simIpAndPort, string seedcap) + public static OSD EstablishAgentCommunication(UUID agentID, string simIpAndPort, string seedcap, + ulong regionHandle, int regionSizeX, int regionSizeY) { - OSDMap body = new OSDMap(3); - body.Add("agent-id", new OSDUUID(agentID)); - body.Add("sim-ip-and-port", new OSDString(simIpAndPort)); - body.Add("seed-capability", new OSDString(seedcap)); + OSDMap body = new OSDMap(6) + { + {"agent-id", new OSDUUID(agentID)}, + {"sim-ip-and-port", new OSDString(simIpAndPort)}, + {"seed-capability", new OSDString(seedcap)}, + {"region-handle", OSD.FromULong(regionHandle)}, + {"region-size-x", OSD.FromInteger(regionSizeX)}, + {"region-size-y", OSD.FromInteger(regionSizeY)} + }; return BuildEvent("EstablishAgentCommunication", body); } -- cgit v1.1