diff --git a/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs b/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs index 0784ffa8cc..308e00ffd6 100644 --- a/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs +++ b/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs @@ -1,12 +1,13 @@ using System; using System.Collections.Generic; using System.Text; +using OpenSim.Framework.Types; using OpenGrid.Framework.Communications; namespace OpenGrid.Framework.Communications.OGS1 { public class GridCommsManager : CommunicationsManager { - public GridCommsManager() + public GridCommsManager(NetworkServersInfo serversInfo) :base(serversInfo) { GridServer = new OGS1GridServices(); InterRegion = new OGSInterSimComms(); diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj b/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj index 4a806358a0..3f4f22dc76 100644 --- a/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj +++ b/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj @@ -1,13 +1,12 @@ - + Local 8.0.50727 2.0 - {C1F40DD4-A68B-4233-9142-CE236775A3CE} + {17442AF1-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenGrid.Framework.Communications.OGS1 @@ -16,11 +15,9 @@ IE50 false Library - - + OpenGrid.Framework.Communications.OGS1 - - + @@ -31,8 +28,7 @@ TRACE;DEBUG - - + True 4096 False @@ -41,8 +37,7 @@ False False 4 - - + False @@ -51,8 +46,7 @@ TRACE - - + False 4096 True @@ -61,23 +55,22 @@ False False 4 - - + - + ..\..\bin\libsecondlife.dll False - + System.dll False - + System.Data.dll False - + System.Xml.dll False @@ -87,44 +80,52 @@ OpenGrid.Framework.Communications {683344D5-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False - {62CDF671-0000-0000-0000-000000000000} OpenGrid.Framework.Data + {62CDF671-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Servers {8BB20F0A-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False XMLRPC {8E81D43C-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False - + + Code + Code - - + + Code + + + Code + Code @@ -136,4 +137,4 @@ - \ No newline at end of file + diff --git a/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs b/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs index 2ed4fd20ee..8d8a647a32 100644 --- a/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs +++ b/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs @@ -43,7 +43,7 @@ namespace OpenGrid.Framework.Communications public IGridServices GridServer; public IInterRegionCommunications InterRegion; - public CommunicationsManager() + public CommunicationsManager(NetworkServersInfo serversInfo) { } diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj.user b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj.user index ae8a33c8f0..594154734d 100644 --- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj.user +++ b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj.user @@ -2,7 +2,7 @@ Debug AnyCPU - E:\work\oslauth\sim\branches\Sugilite\bin\ + C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\Sugilite\bin\ 8.0.50727 ProjectFiles 0 diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs index 9028d8d291..009648c87b 100644 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs @@ -55,11 +55,12 @@ namespace OpenSim.Framework.Interfaces public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); - public delegate void UpdatePrimVector(uint localID, LLVector3 pos, IClientAPI remoteClient); + public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); public delegate void StatusChange(bool status); public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); + public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient); public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); @@ -86,14 +87,17 @@ namespace OpenSim.Framework.Interfaces event UpdateAgent OnAgentUpdate; event GenericCall OnRequestAvatarsData; event GenericCall4 OnAddPrim; + event UpdateVector OnGrapObject; + event ObjectSelect OnDeGrapObject; + event MoveObject OnGrapUpdate; event UpdateShape OnUpdatePrimShape; event ObjectSelect OnObjectSelect; event UpdatePrimFlags OnUpdatePrimFlags; event UpdatePrimTexture OnUpdatePrimTexture; - event UpdatePrimVector OnUpdatePrimPosition; + event UpdateVector OnUpdatePrimPosition; event UpdatePrimRotation OnUpdatePrimRotation; - event UpdatePrimVector OnUpdatePrimScale; + event UpdateVector OnUpdatePrimScale; event StatusChange OnChildAgentStatus; event GenericCall2 OnStopMovement; event NewAvatar OnNewAvatar; @@ -143,13 +147,14 @@ namespace OpenSim.Framework.Interfaces void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags); void SendTeleportCancel(); void SendTeleportLocationStart(); + void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry); void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); - void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID); - void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID); + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags); + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags); void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); } } diff --git a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build index d2629474a1..a24003f5de 100644 --- a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build +++ b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build @@ -23,7 +23,7 @@ - + diff --git a/OpenSim.sln b/OpenSim.sln index 6ae399201f..9145db2c7f 100644 --- a/OpenSim.sln +++ b/OpenSim.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +# Visual C# Express 2005 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Communications", "Common\OpenGrid.Framework.Communications\OpenGrid.Framework.Communications.csproj", "{683344D5-0000-0000-0000-000000000000}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Communications.OGS1", "Common\OpenGrid.Framework.Communications.OGS1\OpenGrid.Framework.Communications.OGS1.csproj", "{17442AF1-0000-0000-0000-000000000000}" diff --git a/OpenSim/Examples/SimpleApp/Program.cs b/OpenSim/Examples/SimpleApp/Program.cs index b56e77ecca..378a09c294 100644 --- a/OpenSim/Examples/SimpleApp/Program.cs +++ b/OpenSim/Examples/SimpleApp/Program.cs @@ -53,7 +53,7 @@ namespace SimpleApp ClientView.TerrainManager = new TerrainManager(new SecondLife()); - CommunicationsManager communicationsManager = new CommunicationsLocal(1000, 1000); + CommunicationsManager communicationsManager = new CommunicationsLocal(null); RegionInfo regionInfo = new RegionInfo( ); BaseHttpServer httpServer = new BaseHttpServer(simPort); diff --git a/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs b/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs index 008d47e375..743b9b4b03 100644 --- a/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs +++ b/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs @@ -42,10 +42,11 @@ namespace OpenSim.LocalCommunications { public LocalBackEndServices SandBoxServices = new LocalBackEndServices(); public LocalUserServices UserServices; - - public CommunicationsLocal(uint defaultHomeX , uint defaultHomeY) + + public CommunicationsLocal(NetworkServersInfo serversInfo) + : base(serversInfo) { - UserServices = new LocalUserServices(this , defaultHomeX, defaultHomeY); + UserServices = new LocalUserServices(this , serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY); UserServices.AddPlugin("OpenGrid.Framework.Data.DB4o.dll"); UserServer = UserServices; GridServer = SandBoxServices; diff --git a/OpenSim/OpenSim.Region/Caps.cs b/OpenSim/OpenSim.Region/Caps.cs index 9cb921bf0f..88799a0ea1 100644 --- a/OpenSim/OpenSim.Region/Caps.cs +++ b/OpenSim/OpenSim.Region/Caps.cs @@ -27,6 +27,7 @@ namespace OpenSim.Region private LLUUID agentID; private AssetCache assetCache; private int eventQueueCount = 1; + private Queue CapsEventQueue = new Queue(); public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent) { @@ -77,7 +78,7 @@ namespace OpenSim.Region capURLS += "MapLayerhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + ""; capURLS += "NewFileAgentInventoryhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + ""; //capURLS += "RequestTextureDownloadhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + ""; - // capURLS += "EventQueueGethttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + ""; + //capURLS += "EventQueueGethttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + ""; return capURLS; } @@ -122,9 +123,26 @@ namespace OpenSim.Region public string ProcessEventQueue(string request, string path, string param) { - // Console.WriteLine("event queue request " + request); + // Console.WriteLine("event queue request " + request); string res = ""; - res = this.CreateEmptyEventResponse(); + int timer = 0; + + /*while ((timer < 200) || (this.CapsEventQueue.Count < 1)) + { + timer++; + }*/ + if (this.CapsEventQueue.Count > 0) + { + lock (this.CapsEventQueue) + { + string item = CapsEventQueue.Dequeue(); + res = item; + } + } + else + { + res = this.CreateEmptyEventResponse(); + } return res; } @@ -141,6 +159,7 @@ namespace OpenSim.Region res += ""; res += ""; eventQueueCount++; + this.CapsEventQueue.Enqueue(res); return res; } @@ -176,7 +195,7 @@ namespace OpenSim.Region public void UploadHandler(LLUUID assetID, LLUUID inventoryItem, byte[] data) { - // Console.WriteLine("upload handler called"); + Console.WriteLine("upload handler called"); AssetBase asset; asset = new AssetBase(); asset.FullID = assetID; @@ -185,7 +204,6 @@ namespace OpenSim.Region asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000"); asset.Data = data; this.assetCache.AddAsset(asset); - } public class AssetUploader diff --git a/OpenSim/OpenSim.Region/EstateManager.cs b/OpenSim/OpenSim.Region/EstateManager.cs index fbcab337b3..dcb556499f 100644 --- a/OpenSim/OpenSim.Region/EstateManager.cs +++ b/OpenSim/OpenSim.Region/EstateManager.cs @@ -265,6 +265,7 @@ namespace OpenSim.Region public void sendRegionInfoPacket(IClientAPI remote_client) { + Encoding _enc = System.Text.Encoding.ASCII; AgentCircuitData circuitData = remote_client.RequestClientInfo(); @@ -281,7 +282,7 @@ namespace OpenSim.Region regionInfoPacket.RegionInfo.RedirectGridY = m_regInfo.estateSettings.redirectGridY; regionInfoPacket.RegionInfo.RegionFlags = (uint)m_regInfo.estateSettings.regionFlags; regionInfoPacket.RegionInfo.SimAccess = (byte)m_regInfo.estateSettings.simAccess; - regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_regInfo.RegionName); + regionInfoPacket.RegionInfo.SimName = _enc.GetBytes( m_regInfo.RegionName); regionInfoPacket.RegionInfo.SunHour = m_regInfo.estateSettings.sunHour; regionInfoPacket.RegionInfo.TerrainLowerLimit = m_regInfo.estateSettings.terrainLowerLimit; regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_regInfo.estateSettings.terrainRaiseLimit; diff --git a/OpenSim/OpenSim.Region/Scenes/Primitive.cs b/OpenSim/OpenSim.Region/Scenes/Primitive.cs index 62f401cb4a..b0bfd1eb61 100644 --- a/OpenSim/OpenSim.Region/Scenes/Primitive.cs +++ b/OpenSim/OpenSim.Region/Scenes/Primitive.cs @@ -47,6 +47,7 @@ namespace OpenSim.Region.Scenes private const uint FULL_MASK_PERMISSIONS = 2147483647; private bool physicsEnabled = false; private byte updateFlag = 0; + private uint flags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456 + 128; private Dictionary inventoryItems; @@ -411,7 +412,7 @@ namespace OpenSim.Region.Scenes lPos = this.Pos; } - remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.primData, lPos, new LLUUID("00000000-0000-0000-9999-000000000005")); + remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.primData, lPos, new LLUUID("00000000-0000-0000-9999-000000000005"), this.flags); } /// @@ -434,7 +435,7 @@ namespace OpenSim.Region.Scenes { LLVector3 lPos; Axiom.MathLib.Quaternion lRot; - if (this._physActor != null && this.physicsEnabled) + if (this._physActor != null && this.physicsEnabled) //is this needed ? doesn't the property fields do this for us? { PhysicsVector pPos = this._physActor.Position; lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z); @@ -445,6 +446,8 @@ namespace OpenSim.Region.Scenes lPos = this.Pos; lRot = this.rotation; } + LLQuaternion mRot = new LLQuaternion(lRot.x, lRot.y, lRot.z, lRot.w); + RemoteClient.SendPrimTerseUpdate(this.m_regionHandle, 64096, this.LocalId, lPos, mRot); } /// @@ -534,6 +537,44 @@ namespace OpenSim.Region.Scenes { } + + public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) + { + Console.WriteLine("moving prim to new location " + pos.X + " , " + pos.Y + " , " + pos.Z); + this.Pos = pos; + this.SendTerseUpdateToALLClients(); + } + + public void GetProperites(IClientAPI client) + { + //needs changing + ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); + proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; + proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); + proper.ObjectData[0].ItemID = LLUUID.Zero; + proper.ObjectData[0].CreationDate = (ulong)primData.CreationDate; + proper.ObjectData[0].CreatorID = primData.OwnerID; + proper.ObjectData[0].FolderID = LLUUID.Zero; + proper.ObjectData[0].FromTaskID = LLUUID.Zero; + proper.ObjectData[0].GroupID = LLUUID.Zero; + proper.ObjectData[0].InventorySerial = 0; + proper.ObjectData[0].LastOwnerID = LLUUID.Zero; + proper.ObjectData[0].ObjectID = this.uuid; + proper.ObjectData[0].OwnerID = primData.OwnerID; + proper.ObjectData[0].TouchName = new byte[0]; + proper.ObjectData[0].TextureID = new byte[0]; + proper.ObjectData[0].SitName = new byte[0]; + proper.ObjectData[0].Name = new byte[0]; + proper.ObjectData[0].Description = new byte[0]; + proper.ObjectData[0].OwnerMask = primData.OwnerMask; + proper.ObjectData[0].NextOwnerMask = primData.NextOwnerMask; + proper.ObjectData[0].GroupMask = primData.GroupMask; + proper.ObjectData[0].EveryoneMask = primData.EveryoneMask; + proper.ObjectData[0].BaseMask = primData.BaseMask; + + client.OutPacket(proper); + + } #endregion diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs b/OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs index 01e38d573b..d1a2717993 100644 --- a/OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/OpenSim.Region/Scenes/Scene.PacketHandlers.cs @@ -214,7 +214,22 @@ namespace OpenSim.Region.Scenes /// public void SelectPrim(uint primLocalID, IClientAPI remoteClient) { - + foreach (Entity ent in Entities.Values) + { + if (ent.LocalId == primLocalID) + { + ((OpenSim.Region.Scenes.Primitive)ent).GetProperites(remoteClient); + break; + } + } + } + + public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) + { + if (this.Entities.ContainsKey(objectID)) + { + ((Primitive)this.Entities[objectID]).GrapMovement(offset, pos, remoteClient); + } } /// diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs index 62edc4bd75..426dd5023e 100644 --- a/OpenSim/OpenSim.Region/Scenes/Scene.cs +++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs @@ -57,19 +57,18 @@ namespace OpenSim.Region.Scenes protected Dictionary Prims; private PhysicsScene phyScene; private float timeStep = 0.1f; - public ILocalStorage localStorage; private Random Rand = new Random(); private uint _primCount = 702000; private int storageCount; private Dictionary m_scriptHandlers; private Dictionary m_scripts; private Mutex updateLock; - public string m_datastore; + protected AuthenticateSessionsBase authenticateHandler; protected RegionCommsListener regionCommsHost; protected CommunicationsManager commsManager; - protected List capsHandlers = new List(); + protected Dictionary capsHandlers = new Dictionary(); protected BaseHttpServer httpListener; public ParcelManager parcelManager; @@ -127,7 +126,6 @@ namespace OpenSim.Region.Scenes Prims = new Dictionary(); OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs - creating LandMap"); - TerrainManager = new TerrainManager(new SecondLife()); Terrain = new TerrainEngine(); ScenePresence.LoadAnims(); @@ -271,53 +269,6 @@ namespace OpenSim.Region.Scenes } #endregion - #region Setup Methods - /// - /// Loads a new storage subsystem from a named library - /// - /// Storage Library - /// Successful or not - public bool LoadStorageDLL(string dllName) - { - try - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - ILocalStorage store = null; - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("ILocalStorage", true); - - if (typeInterface != null) - { - ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - store = plug; - - store.Initialise(this.m_datastore); - break; - } - - typeInterface = null; - } - } - } - pluginAssembly = null; - this.localStorage = store; - return (store == null); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString()); - return false; - } - } - - #endregion - #region Regenerate Terrain /// @@ -558,6 +509,8 @@ namespace OpenSim.Region.Scenes remoteClient.OnUpdatePrimPosition += this.UpdatePrimPosition; remoteClient.OnRequestMapBlocks += this.RequestMapBlocks; remoteClient.OnTeleportLocationRequest += this.RequestTeleportLocation; + //remoteClient.OnObjectSelect += this.SelectPrim; + remoteClient.OnGrapUpdate += this.MoveObject; /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); @@ -680,22 +633,6 @@ namespace OpenSim.Region.Scenes } #endregion - #region ShutDown - /// - /// Tidy before shutdown - /// - public override void Close() - { - try - { - this.localStorage.ShutDown(); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainLog.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "World.cs: Close() - Failed with exception " + e.ToString()); - } - } - #endregion #region RegionCommsHost @@ -729,7 +666,7 @@ namespace OpenSim.Region.Scenes //Console.WriteLine("new user, so creating caps handler for it"); Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.CommsIPListenAddr, 9000, agent.CapsPath, agent.AgentID); cap.RegisterHandlers(); - this.capsHandlers.Add(cap); + this.capsHandlers.Add(agent.AgentID, cap); } this.authenticateHandler.AddNewCircuit(agent.circuitcode, agent); } @@ -767,6 +704,7 @@ namespace OpenSim.Region.Scenes agent.child = true; this.commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent); remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr), (ushort)neighbours[i].CommsIPListenPort); + //this.capsHandlers[remoteClient.AgentId].CreateEstablishAgentComms("", System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr) + ":" + neighbours[i].CommsIPListenPort); } } } @@ -845,16 +783,5 @@ namespace OpenSim.Region.Scenes } #endregion - - /// - /// - /// - /// - /// - /// - public override void SendLayerData(int px, int py, IClientAPI RemoteClient) - { - RemoteClient.SendLayerData(px, py, Terrain.getHeights1D()); - } } } diff --git a/OpenSim/OpenSim.Region/Scenes/SceneBase.cs b/OpenSim/OpenSim.Region/Scenes/SceneBase.cs index e650127bd2..4dbd374461 100644 --- a/OpenSim/OpenSim.Region/Scenes/SceneBase.cs +++ b/OpenSim/OpenSim.Region/Scenes/SceneBase.cs @@ -51,8 +51,11 @@ namespace OpenSim.Region.Scenes protected string m_regionName; protected RegionInfo m_regInfo; - public TerrainEngine Terrain; //TODO: Replace TerrainManager with this. - protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine + public TerrainEngine Terrain; + + public string m_datastore; + public ILocalStorage localStorage; + protected object m_syncRoot = new object(); private uint m_nextLocalId = 8880000; protected AssetCache assetCache; @@ -71,6 +74,51 @@ namespace OpenSim.Region.Scenes /// Loads the World heightmap /// public abstract void LoadWorldMap(); + + /// + /// Loads a new storage subsystem from a named library + /// + /// Storage Library + /// Successful or not + public bool LoadStorageDLL(string dllName) + { + try + { + Assembly pluginAssembly = Assembly.LoadFrom(dllName); + ILocalStorage store = null; + + foreach (Type pluginType in pluginAssembly.GetTypes()) + { + if (pluginType.IsPublic) + { + if (!pluginType.IsAbstract) + { + Type typeInterface = pluginType.GetInterface("ILocalStorage", true); + + if (typeInterface != null) + { + ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + store = plug; + + store.Initialise(this.m_datastore); + break; + } + + typeInterface = null; + } + } + } + pluginAssembly = null; + this.localStorage = store; + return (store == null); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString()); + return false; + } + } + /// /// Send the region heightmap to the client @@ -87,7 +135,10 @@ namespace OpenSim.Region.Scenes /// Patch coordinate (x) 0..16 /// Patch coordinate (y) 0..16 /// The client to send to - public abstract void SendLayerData(int px, int py, IClientAPI RemoteClient); + public virtual void SendLayerData(int px, int py, IClientAPI RemoteClient) + { + RemoteClient.SendLayerData(px, py, Terrain.getHeights1D()); + } #endregion @@ -114,7 +165,7 @@ namespace OpenSim.Region.Scenes /// public virtual RegionInfo RegionInfo { - get { return null; } + get { return this.m_regInfo; } } public object SyncRoot @@ -131,7 +182,17 @@ namespace OpenSim.Region.Scenes /// /// Tidy before shutdown /// - public abstract void Close(); + public virtual void Close() + { + try + { + this.localStorage.ShutDown(); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "World.cs: Close() - Failed with exception " + e.ToString()); + } + } #endregion diff --git a/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs b/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs index e2e30b96e5..ffec3e5728 100644 --- a/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs +++ b/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs @@ -223,26 +223,23 @@ namespace OpenSim.Region.Scenes Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); if (((movementflag & 1) == 0) || (q != this.bodyRot)) { - //we should add a new force to the list - // but for now we will deal with velocities - NewForce newVelocity = new NewForce(); Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); - Axiom.MathLib.Vector3 direc = q * v3; - direc.Normalize(); - - //work out velocity for sim physics system - direc = direc * ((0.03f) * 128f); - if (this._physActor.Flying) - direc *= 4; - - newVelocity.X = direc.x; - newVelocity.Y = direc.y; - newVelocity.Z = direc.z; - this.forcesList.Add(newVelocity); + this.AddNewMovement(v3, q); movementflag = 1; this.bodyRot = q; } } + else if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG) != 0) + { + Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); + if (((movementflag & 2) == 0) || (q != this.bodyRot)) + { + Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(-1, 0, 0); + this.AddNewMovement(v3, q); + movementflag = 2; + this.bodyRot = q; + } + } else { if ((movementflag) != 0) @@ -257,6 +254,23 @@ namespace OpenSim.Region.Scenes } } + + protected void AddNewMovement(Axiom.MathLib.Vector3 vec, Axiom.MathLib.Quaternion rotation) + { + NewForce newVelocity = new NewForce(); + Axiom.MathLib.Vector3 direc = rotation * vec; + direc.Normalize(); + + direc = direc * ((0.03f) * 128f); + if (this._physActor.Flying) + direc *= 4; + + newVelocity.X = direc.x; + newVelocity.Y = direc.y; + newVelocity.Z = direc.z; + this.forcesList.Add(newVelocity); + } + #endregion #region Overridden Methods diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs index ca473e314e..902f3c77fc 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs @@ -51,14 +51,17 @@ namespace OpenSim public event StartAnim OnStartAnim; public event GenericCall OnRequestAvatarsData; public event LinkObjects OnLinkObjects; + public event UpdateVector OnGrapObject; + public event ObjectSelect OnDeGrapObject; + public event MoveObject OnGrapUpdate; public event GenericCall4 OnAddPrim; public event UpdateShape OnUpdatePrimShape; public event ObjectSelect OnObjectSelect; public event UpdatePrimFlags OnUpdatePrimFlags; public event UpdatePrimTexture OnUpdatePrimTexture; - public event UpdatePrimVector OnUpdatePrimPosition; + public event UpdateVector OnUpdatePrimPosition; public event UpdatePrimRotation OnUpdatePrimRotation; - public event UpdatePrimVector OnUpdatePrimScale; + public event UpdateVector OnUpdatePrimScale; public event StatusChange OnChildAgentStatus; public event GenericCall2 OnStopMovement; public event NewAvatar OnNewAvatar; @@ -426,6 +429,17 @@ namespace OpenSim OutPacket(tpStart); } + public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) + { + MoneyBalanceReplyPacket money = new MoneyBalanceReplyPacket(); + money.MoneyData.AgentID = this.AgentID; + money.MoneyData.TransactionID = transaction; + money.MoneyData.TransactionSuccess = success; + money.MoneyData.Description = description; + money.MoneyData.MoneyBalance = balance; + OutPacket(money); + } + #region Appearance/ Wearables Methods /// @@ -569,13 +583,13 @@ namespace OpenSim /// /// /// - public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID) + public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags) { ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); outPacket.RegionData.RegionHandle = regionHandle; outPacket.RegionData.TimeDilation = timeDilation; outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; - outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID); + outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID, flags); outPacket.ObjectData[0].ID = localID; outPacket.ObjectData[0].FullID = primData.FullID; byte[] pb = pos.GetBytes(); @@ -592,13 +606,13 @@ namespace OpenSim /// /// /// - public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID) + public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID , uint flags) { ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); outPacket.RegionData.RegionHandle = regionHandle; outPacket.RegionData.TimeDilation = timeDilation; outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; - outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID); + outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID, flags); outPacket.ObjectData[0].ID = localID; outPacket.ObjectData[0].FullID = primData.FullID; byte[] pb = pos.GetBytes(); @@ -786,11 +800,11 @@ namespace OpenSim /// /// /// - protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID) + protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID, uint flags) { ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); this.SetDefaultPrimPacketValues(objupdate); - objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; + objupdate.UpdateFlags = flags; this.SetPrimPacketShapeData(objupdate, primData, textureID); return objupdate; diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs index 65066b8008..191ef2133c 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs @@ -254,6 +254,27 @@ namespace OpenSim } } break; + case PacketType.ObjectGrab: + ObjectGrabPacket grap = (ObjectGrabPacket)Pack; + if (OnGrapObject != null) + { + OnGrapObject(grap.ObjectData.LocalID, grap.ObjectData.GrabOffset, this); + } + break; + case PacketType.ObjectGrabUpdate: + ObjectGrabUpdatePacket grapUpdate = (ObjectGrabUpdatePacket)Pack; + if (OnGrapUpdate != null) + { + OnGrapUpdate(grapUpdate.ObjectData.ObjectID, grapUpdate.ObjectData.GrabOffsetInitial, grapUpdate.ObjectData.GrabPosition, this); + } + break; + case PacketType.ObjectDeGrab: + ObjectDeGrabPacket deGrap = (ObjectDeGrabPacket)Pack; + if (OnDeGrapObject != null) + { + OnDeGrapObject(deGrap.ObjectData.LocalID, this); + } + break; #endregion #region Inventory/Asset/Other related packets @@ -468,6 +489,10 @@ namespace OpenSim break; #endregion + case PacketType.MoneyBalanceRequest: + this.SendMoneyBalance(LLUUID.Zero, true, new byte[0], 1000); + break; + #region Parcel related packets case PacketType.ParcelPropertiesRequest: ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack; diff --git a/OpenSim/OpenSim/OpenSim.csproj b/OpenSim/OpenSim/OpenSim.csproj index 91eb4748a7..222e2f7098 100644 --- a/OpenSim/OpenSim/OpenSim.csproj +++ b/OpenSim/OpenSim/OpenSim.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,8 +6,7 @@ {438A9556-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenSim @@ -16,11 +15,9 @@ IE50 false Exe - - + OpenSim - - + @@ -31,8 +28,7 @@ TRACE;DEBUG - - + True 4096 False @@ -41,8 +37,7 @@ False False 4 - - + False @@ -51,8 +46,7 @@ TRACE - - + False 4096 True @@ -61,113 +55,114 @@ False False 4 - - + - + ..\..\bin\Axiom.MathLib.dll False - + ..\..\bin\Db4objects.Db4o.dll False - + ..\..\bin\libsecondlife.dll False - + System.dll False - + System.Xml.dll False - - {C1F40DD4-A68B-4233-9142-CE236775A3CE} - OpenGrid.Framework.Communications.OGS1 - OpenGrid.Framework.Communications {683344D5-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False + + + OpenGrid.Framework.Communications.OGS1 + {17442AF1-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False OpenGrid.Framework.UserManagement {DA9A7391-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Caches {1938EB12-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.GenericConfig.Xml {E88EF749-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.LocalCommunications {79CED992-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Physics.Manager {8BE16150-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Region {196916AF-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.RegionServer {632E1BFD-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Servers {8BB20F0A-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Terrain.BasicTerrain {2270B8FE-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False XMLRPC {8E81D43C-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -185,4 +180,4 @@ - \ No newline at end of file + diff --git a/OpenSim/OpenSim/OpenSim.exe.build b/OpenSim/OpenSim/OpenSim.exe.build index 068e16027e..13ca938693 100644 --- a/OpenSim/OpenSim/OpenSim.exe.build +++ b/OpenSim/OpenSim/OpenSim.exe.build @@ -23,6 +23,7 @@ + diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs index 50da5a15df..ef4aa62b49 100644 --- a/OpenSim/OpenSim/OpenSimMain.cs +++ b/OpenSim/OpenSim/OpenSimMain.cs @@ -109,13 +109,13 @@ namespace OpenSim this.SetupLocalGridServers(); // this.checkServer = new CheckSumServer(12036); // this.checkServer.ServerListener(); - sandboxCommunications = new CommunicationsLocal(this.serversData.DefaultHomeLocX, this.serversData.DefaultHomeLocY); + sandboxCommunications = new CommunicationsLocal(this.serversData); this.commsManager = sandboxCommunications; } else { this.SetupRemoteGridServers(); - this.commsManager = new GridCommsManager(); + this.commsManager = new GridCommsManager(this.serversData); } startuptime = DateTime.Now; diff --git a/prebuild.xml b/prebuild.xml index 44b41f0edd..d67ca4a371 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -534,6 +534,7 @@ + @@ -664,6 +665,7 @@ +