From 56e6587c9f3ff9b8b9e48ff20a21244b739e2081 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 3 Apr 2007 13:37:11 +0000 Subject: Temporary fix for the object taking bug --- OpenSim.Framework/PrimData.cs | 4 ++++ OpenSim.GenericConfig/Xml/XmlConfig.cs | 2 +- OpenSim.RegionServer/Assets/AssetCache.cs | 3 --- OpenSim.RegionServer/CAPS/AdminWebFront.cs | 4 ++-- OpenSim.RegionServer/OpenSimMain.cs | 30 ++++++++++------------- OpenSim.RegionServer/PacketServer.cs | 13 ++++++---- OpenSim.RegionServer/RegionInfo.cs | 8 +++---- OpenSim.RegionServer/world/Primitive.cs | 38 +----------------------------- 8 files changed, 33 insertions(+), 69 deletions(-) diff --git a/OpenSim.Framework/PrimData.cs b/OpenSim.Framework/PrimData.cs index ce53c28..ee4188d 100644 --- a/OpenSim.Framework/PrimData.cs +++ b/OpenSim.Framework/PrimData.cs @@ -151,6 +151,10 @@ namespace OpenSim.Framework.Assets bytes[i++] = (byte)((this.BaseMask >> 16) % 256); bytes[i++] = (byte)((this.BaseMask >> 24) % 256); Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; + if (this.Rotation == new LLQuaternion(0,0,0,0)) + { + this.Rotation = new LLQuaternion(0, 1, 0, 0); + } Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12; bytes[i++] = (byte)(this.LocalID % 256); bytes[i++] = (byte)((this.LocalID >> 8) % 256); diff --git a/OpenSim.GenericConfig/Xml/XmlConfig.cs b/OpenSim.GenericConfig/Xml/XmlConfig.cs index c398229..62e3cbf 100644 --- a/OpenSim.GenericConfig/Xml/XmlConfig.cs +++ b/OpenSim.GenericConfig/Xml/XmlConfig.cs @@ -81,7 +81,7 @@ namespace OpenSim.GenericConfig { if (configNode.Attributes[attributeName] != null) { - configNode.Attributes.GetNamedItem(attributeName).Value = attributeValue; + ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; } else { diff --git a/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim.RegionServer/Assets/AssetCache.cs index 1d5b286..573e5fd 100644 --- a/OpenSim.RegionServer/Assets/AssetCache.cs +++ b/OpenSim.RegionServer/Assets/AssetCache.cs @@ -51,8 +51,6 @@ namespace OpenSim.Assets public Dictionary RequestedAssets = new Dictionary(); //Assets requested from the asset server public Dictionary RequestedTextures = new Dictionary(); //Textures requested from the asset server - //private Dictionary IncomingAssets; - private IAssetServer _assetServer; private Thread _assetCacheThread; private LLUUID[] textureList = new LLUUID[5]; @@ -67,7 +65,6 @@ namespace OpenSim.Assets _assetServer.SetReceiver(this); Assets = new Dictionary(); Textures = new Dictionary(); - //IncomingAssets = new Dictionary(); this._assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); this._assetCacheThread.IsBackground = true; this._assetCacheThread.Start(); diff --git a/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim.RegionServer/CAPS/AdminWebFront.cs index 72fbdaf..7f00225 100644 --- a/OpenSim.RegionServer/CAPS/AdminWebFront.cs +++ b/OpenSim.RegionServer/CAPS/AdminWebFront.cs @@ -126,7 +126,7 @@ namespace OpenSim.CAPS { TempAv = (OpenSim.world.Avatar)m_world.Entities[UUID]; responseString += "

Client: "; - responseString += TempAv.firstname + " , " + TempAv.lastname + " , " + UUID + " , " + TempAv.ControllingClient.SessionID + " , " + TempAv.ControllingClient.CircuitCode + " , " + TempAv.ControllingClient.userEP.ToString();//String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()); + responseString += TempAv.firstname + " , " + TempAv.lastname + " , " + UUID + " , " + TempAv.ControllingClient.SessionID + " , " + TempAv.ControllingClient.CircuitCode + " , " + TempAv.ControllingClient.userEP.ToString(); responseString += "

"; } } @@ -153,7 +153,7 @@ namespace OpenSim.CAPS foreach (InventoryItem item in inven.InventoryItems.Values) { responseString += "

InventoryItem: "; - responseString += item.Name +" , "+ item.ItemID +" , "+ item.Type +" , "+ item.FolderID +" , "+ item.AssetID +" , "+ item.Description ; //String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", item.Name, item.ItemID, item.Type, item.FolderID, item.AssetID, item.Description); + responseString += item.Name +" , "+ item.ItemID +" , "+ item.Type +" , "+ item.FolderID +" , "+ item.AssetID +" , "+ item.Description ; responseString += "

"; } } diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index 8bbdcd5..316bcd9 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs @@ -108,7 +108,7 @@ namespace OpenSim { Console.WriteLine(e.Message); } - + m_console.WriteLine("Main.cs:Startup() - Loading configuration"); string configfromgrid = localConfig.GetAttribute("ConfigFromGrid"); if (configfromgrid == "true") { @@ -122,6 +122,7 @@ namespace OpenSim { this.regionData.InitConfig(this.m_sandbox, this.localConfig); } + this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change GridServers = new Grid(); if (m_sandbox) @@ -146,11 +147,6 @@ namespace OpenSim AssetCache = new AssetCache(GridServers.AssetServer); InventoryCache = new InventoryCache(); - // We check our local database first, then the grid for config options - m_console.WriteLine("Main.cs:Startup() - Loading configuration"); - //Cfg = this.LoadConfigDll(this.ConfigDll); - //Cfg.InitConfig(this.m_sandbox); - PacketServer packetServer = new PacketServer(this); m_console.WriteLine("Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString()); @@ -207,11 +203,11 @@ namespace OpenSim return new XmlRpcResponse(); }); - _httpServer.AddRestHandler("GET","/simstatus/", - delegate(string request, string path) - { - return "OK"; - }); + _httpServer.AddRestHandler("GET", "/simstatus/", + delegate(string request, string path) + { + return "OK"; + }); } LoginServer loginServer = null; @@ -222,14 +218,14 @@ namespace OpenSim { loginServer = new LoginServer(gridServer, regionData.IPListenAddr, regionData.IPListenPort, this.user_accounts); loginServer.Startup(); - - if( user_accounts ) + + if (user_accounts) { //sandbox mode with loginserver using accounts this.GridServers.UserServer = loginServer; adminLoginServer = loginServer; - - _httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod); + + _httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod); } else { @@ -239,8 +235,8 @@ namespace OpenSim } AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer); - adminWebFront.LoadMethods( _httpServer ); - + adminWebFront.LoadMethods(_httpServer); + m_console.WriteLine("Main.cs:Startup() - Starting HTTP server"); _httpServer.Start(); diff --git a/OpenSim.RegionServer/PacketServer.cs b/OpenSim.RegionServer/PacketServer.cs index a02fa36..f0a1f52 100644 --- a/OpenSim.RegionServer/PacketServer.cs +++ b/OpenSim.RegionServer/PacketServer.cs @@ -51,11 +51,14 @@ namespace OpenSim public virtual void RegisterClientPacketHandlers() { - SimClient.AddPacketHandler(PacketType.ModifyLand, _localWorld.ModifyTerrain); - SimClient.AddPacketHandler(PacketType.ChatFromViewer, _localWorld.SimChat); - SimClient.AddPacketHandler(PacketType.RezObject, _localWorld.RezObject); - SimClient.AddPacketHandler(PacketType.DeRezObject, _localWorld.DeRezObject); - SimClient.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName); + if (this._localWorld != null) + { + SimClient.AddPacketHandler(PacketType.ModifyLand, _localWorld.ModifyTerrain); + SimClient.AddPacketHandler(PacketType.ChatFromViewer, _localWorld.SimChat); + SimClient.AddPacketHandler(PacketType.RezObject, _localWorld.RezObject); + SimClient.AddPacketHandler(PacketType.DeRezObject, _localWorld.DeRezObject); + SimClient.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName); + } } #region Client Packet Handlers diff --git a/OpenSim.RegionServer/RegionInfo.cs b/OpenSim.RegionServer/RegionInfo.cs index 15cc105..806d7cc 100644 --- a/OpenSim.RegionServer/RegionInfo.cs +++ b/OpenSim.RegionServer/RegionInfo.cs @@ -59,11 +59,11 @@ namespace OpenSim { string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location X [997]: ", "997"); configData.SetAttribute("SimLocationX", location); - this.RegionLocX = (uint)Convert.ToInt32(location); + this.RegionLocX = (uint)Convert.ToUInt32(location); } else { - this.RegionLocX = (uint)Convert.ToInt32(attri); + this.RegionLocX = (uint)Convert.ToUInt32(attri); } // Sim/Grid location Y attri = ""; @@ -72,11 +72,11 @@ namespace OpenSim { string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location Y [996]: ", "996"); configData.SetAttribute("SimLocationY", location); - this.RegionLocY = (uint)Convert.ToInt32(location); + this.RegionLocY = (uint)Convert.ToUInt32(location); } else { - this.RegionLocY = (uint)Convert.ToInt32(attri); + this.RegionLocY = (uint)Convert.ToUInt32(attri); } //Sim Listen Port attri = ""; diff --git a/OpenSim.RegionServer/world/Primitive.cs b/OpenSim.RegionServer/world/Primitive.cs index cbffa7e..f60d991 100644 --- a/OpenSim.RegionServer/world/Primitive.cs +++ b/OpenSim.RegionServer/world/Primitive.cs @@ -158,46 +158,10 @@ namespace OpenSim.world pos2 = new LLVector3(pPos.X, pPos.Y, pPos.Z); } if (this.newPrimFlag) - { - /* ObjectOwnerPacket objown = new ObjectOwnerPacket(); - objown.HeaderData.GroupID = LLUUID.Zero; - objown.HeaderData.Override = false; - objown.HeaderData.OwnerID = LLUUID.Zero; - objown.ObjectData = new ObjectOwnerPacket.ObjectDataBlock[1]; - objown.ObjectData[0] = new ObjectOwnerPacket.ObjectDataBlock(); - objown.ObjectData[0].ObjectLocalID = this.localid; - ObjectGroupPacket objgroup = new ObjectGroupPacket(); - objgroup.ObjectData = new ObjectGroupPacket.ObjectDataBlock[1]; - objgroup.ObjectData[0] = new ObjectGroupPacket.ObjectDataBlock(); - objgroup.ObjectData[0].ObjectLocalID = this.localid; - ObjectPermissionsPacket objper = new ObjectPermissionsPacket(); - objper.HeaderData.Override = false; - objper.ObjectData = new ObjectPermissionsPacket.ObjectDataBlock[3]; - for (int i = 0; i < 3; i++) - { - objper.ObjectData[i] = new ObjectPermissionsPacket.ObjectDataBlock(); - objper.ObjectData[i].ObjectLocalID = this.localid; - objper.ObjectData[i].Set = 1; - objper.ObjectData[i].Field = 0; - } - objper.ObjectData[0].Mask = 8192; - objper.ObjectData[1].Mask = 16384; - objper.ObjectData[2].Mask = 32768;*/ - + { foreach (SimClient client in m_clientThreads.Values) { client.OutPacket(OurPacket); - /* objown.AgentData.AgentID = client.AgentID; - objown.AgentData.SessionID = client.SessionID; - objown.HeaderData.OwnerID = client.AgentID; - client.OutPacket(objown); - objgroup.AgentData.AgentID = client.AgentID; - objgroup.AgentData.GroupID = LLUUID.Zero; - objgroup.AgentData.SessionID = client.SessionID; - client.OutPacket(objgroup); - objper.AgentData.AgentID = client.AgentID; - objper.AgentData.SessionID = client.SessionID; - client.OutPacket(objper);*/ } this.newPrimFlag = false; } -- cgit v1.1