From ef0e5e913e2c22f8e2cba96d54436443b573c1ed Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 17 Jun 2007 14:10:19 +0000 Subject: Very Preliminary local teleporting added (currently only can teleport within the current region). Now need to add teleporting between regions and use of the dynamic texture for the terrain. --- .../CommunicationsManager.cs | 2 +- .../IGridServices.cs | 3 +- Common/OpenSim.Framework/IRegionCommsHost.cs | 47 --------------- Common/OpenSim.Framework/IRegionCommsListener.cs | 47 +++++++++++++++ Common/OpenSim.Framework/Interfaces/IClientAPI.cs | 15 ++++- Common/OpenSim.Framework/OpenSim.Framework.csproj | 7 ++- .../OpenSim.Framework/OpenSim.Framework.dll.build | 5 +- Common/OpenSim.Framework/RegionCommsHostBase.cs | 69 ---------------------- Common/OpenSim.Framework/RegionCommsListener.cs | 69 ++++++++++++++++++++++ Common/OpenSim.Framework/Types/MapBlockData.cs | 25 ++++++++ 10 files changed, 166 insertions(+), 123 deletions(-) delete mode 100644 Common/OpenSim.Framework/IRegionCommsHost.cs create mode 100644 Common/OpenSim.Framework/IRegionCommsListener.cs delete mode 100644 Common/OpenSim.Framework/RegionCommsHostBase.cs create mode 100644 Common/OpenSim.Framework/RegionCommsListener.cs create mode 100644 Common/OpenSim.Framework/Types/MapBlockData.cs (limited to 'Common') diff --git a/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs b/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs index 10fe251..2ed4fd2 100644 --- a/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs +++ b/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs @@ -41,7 +41,7 @@ namespace OpenGrid.Framework.Communications { public IUserServices UserServer; public IGridServices GridServer; - public IInterRegionCommunications InterSims; + public IInterRegionCommunications InterRegion; public CommunicationsManager() { diff --git a/Common/OpenGrid.Framework.Communications/IGridServices.cs b/Common/OpenGrid.Framework.Communications/IGridServices.cs index 9466647..b4bc3b6 100644 --- a/Common/OpenGrid.Framework.Communications/IGridServices.cs +++ b/Common/OpenGrid.Framework.Communications/IGridServices.cs @@ -36,8 +36,9 @@ namespace OpenGrid.Framework.Communications { public interface IGridServices { - RegionCommsHostBase RegisterRegion(RegionInfo regionInfo); + RegionCommsListener RegisterRegion(RegionInfo regionInfo); List RequestNeighbours(RegionInfo regionInfo); RegionInfo RequestNeighbourInfo(ulong regionHandle); + List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); } } diff --git a/Common/OpenSim.Framework/IRegionCommsHost.cs b/Common/OpenSim.Framework/IRegionCommsHost.cs deleted file mode 100644 index 658afe6..0000000 --- a/Common/OpenSim.Framework/IRegionCommsHost.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; - -namespace OpenSim.Framework -{ - public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); - public delegate void UpdateNeighbours(List neighbours); - public delegate void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); - - public interface IRegionCommsHost - { - event ExpectUserDelegate OnExpectUser; - event GenericCall2 OnExpectChildAgent; - event AgentCrossing OnAvatarCrossingIntoRegion; - event UpdateNeighbours OnNeighboursUpdate; - } -} diff --git a/Common/OpenSim.Framework/IRegionCommsListener.cs b/Common/OpenSim.Framework/IRegionCommsListener.cs new file mode 100644 index 0000000..0e80941 --- /dev/null +++ b/Common/OpenSim.Framework/IRegionCommsListener.cs @@ -0,0 +1,47 @@ +/* +* Copyright (c) Contributors, http://www.openmetaverse.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework +{ + public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); + public delegate void UpdateNeighbours(List neighbours); + public delegate void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); + + public interface IRegionCommsListener + { + event ExpectUserDelegate OnExpectUser; + event GenericCall2 OnExpectChildAgent; + event AgentCrossing OnAvatarCrossingIntoRegion; + event UpdateNeighbours OnNeighboursUpdate; + } +} diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs index 45d73ef..6e758b2 100644 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs @@ -41,12 +41,16 @@ namespace OpenSim.Framework.Interfaces public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); public delegate void StartAnim(LLUUID animID, int seq); public delegate void LinkObjects(uint parent, List children); + public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); + public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); + public delegate void GenericCall(IClientAPI remoteClient); public delegate void GenericCall2(); public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary. public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); public delegate void GenericCall5(IClientAPI remoteClient, bool status); public delegate void GenericCall6(LLUUID uid); + public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); @@ -72,6 +76,9 @@ namespace OpenSim.Framework.Interfaces event SetAppearance OnSetAppearance; event StartAnim OnStartAnim; event LinkObjects OnLinkObjects; + event RequestMapBlocks OnRequestMapBlocks; + event TeleportLocationRequest OnTeleportLocationRequest; + event GenericCall4 OnDeRezObject; event GenericCall OnRegionHandShakeReply; event GenericCall OnRequestWearables; @@ -79,6 +86,7 @@ namespace OpenSim.Framework.Interfaces event UpdateAgent OnAgentUpdate; event GenericCall OnRequestAvatarsData; event GenericCall4 OnAddPrim; + event UpdateShape OnUpdatePrimShape; event ObjectSelect OnObjectSelect; event UpdatePrimFlags OnUpdatePrimFlags; @@ -125,10 +133,15 @@ namespace OpenSim.Framework.Interfaces void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendLayerData(float[] map); - void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos); + void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); AgentCircuitData RequestClientInfo(); void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort); + void SendMapBlock(List mapBlocks); + void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); + void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags); + void SendTeleportCancel(); + void SendTeleportLocationStart(); void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos); void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj b/Common/OpenSim.Framework/OpenSim.Framework.csproj index 4939b59..060e471 100644 --- a/Common/OpenSim.Framework/OpenSim.Framework.csproj +++ b/Common/OpenSim.Framework/OpenSim.Framework.csproj @@ -99,13 +99,13 @@ Code - + Code Code - + Code @@ -183,6 +183,9 @@ Code + + Code + Code diff --git a/Common/OpenSim.Framework/OpenSim.Framework.dll.build b/Common/OpenSim.Framework/OpenSim.Framework.dll.build index 65a58dc..524255c 100644 --- a/Common/OpenSim.Framework/OpenSim.Framework.dll.build +++ b/Common/OpenSim.Framework/OpenSim.Framework.dll.build @@ -14,9 +14,9 @@ - + - + @@ -42,6 +42,7 @@ + diff --git a/Common/OpenSim.Framework/RegionCommsHostBase.cs b/Common/OpenSim.Framework/RegionCommsHostBase.cs deleted file mode 100644 index 88751b8..0000000 --- a/Common/OpenSim.Framework/RegionCommsHostBase.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; - -namespace OpenSim.Framework -{ - public class RegionCommsHostBase :IRegionCommsHost - { - public event ExpectUserDelegate OnExpectUser; - public event GenericCall2 OnExpectChildAgent; - public event AgentCrossing OnAvatarCrossingIntoRegion; - public event UpdateNeighbours OnNeighboursUpdate; - - /// - /// - /// - /// - /// - public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) - { - if(OnExpectUser != null) - { - OnExpectUser(regionHandle, agent); - return true; - } - - return false; - } - - public virtual bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) - { - if (OnAvatarCrossingIntoRegion != null) - { - OnAvatarCrossingIntoRegion(regionHandle, agentID, position); - return true; - } - return false; - } - } -} diff --git a/Common/OpenSim.Framework/RegionCommsListener.cs b/Common/OpenSim.Framework/RegionCommsListener.cs new file mode 100644 index 0000000..3fec937 --- /dev/null +++ b/Common/OpenSim.Framework/RegionCommsListener.cs @@ -0,0 +1,69 @@ +/* +* Copyright (c) Contributors, http://www.openmetaverse.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework +{ + public class RegionCommsListener :IRegionCommsListener + { + public event ExpectUserDelegate OnExpectUser; + public event GenericCall2 OnExpectChildAgent; + public event AgentCrossing OnAvatarCrossingIntoRegion; + public event UpdateNeighbours OnNeighboursUpdate; + + /// + /// + /// + /// + /// + public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) + { + if(OnExpectUser != null) + { + OnExpectUser(regionHandle, agent); + return true; + } + + return false; + } + + public virtual bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + { + if (OnAvatarCrossingIntoRegion != null) + { + OnAvatarCrossingIntoRegion(regionHandle, agentID, position); + return true; + } + return false; + } + } +} diff --git a/Common/OpenSim.Framework/Types/MapBlockData.cs b/Common/OpenSim.Framework/Types/MapBlockData.cs new file mode 100644 index 0000000..2e6f56e --- /dev/null +++ b/Common/OpenSim.Framework/Types/MapBlockData.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class MapBlockData + { + public uint Flags; + public ushort X; + public ushort Y; + public byte Agents; + public byte Access; + public byte WaterHeight; + public LLUUID MapImageId; + public String Name; + public uint RegionFlags; + + public MapBlockData() + { + + } + } +} -- cgit v1.1