diff --git a/OpenSim/Framework/Communications/RestClient/RestClient.cs b/OpenSim/Framework/Communications/RestClient/RestClient.cs index acb3fd4bb3..7a23e789b7 100644 --- a/OpenSim/Framework/Communications/RestClient/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient/RestClient.cs @@ -177,7 +177,7 @@ namespace OpenSim.Framework.Communications } /// - /// Build a Uri based on the intial Url, path elements and parameters + /// Build a Uri based on the initial Url, path elements and parameters /// /// fully constructed Uri private Uri buildUri() @@ -250,7 +250,7 @@ namespace OpenSim.Framework.Communications } /// - /// Async method, invoked when the intial response if received from the server + /// Async method, invoked when the initial response if received from the server /// /// private void ResponseIsReadyDelegate(IAsyncResult ar) diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs index e7ce957c3f..dd3f75d161 100644 --- a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs +++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs @@ -5,6 +5,6 @@ namespace OpenSim.Region.Environment.Interfaces { public interface IAvatarFactory : IRegionModule { - bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, out byte[] visualParams); + bool TryGetInitialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, out byte[] visualParams); } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs index 7adfdc2dd5..c11e039248 100644 --- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs @@ -14,20 +14,20 @@ namespace OpenSim.Region.Environment.Modules private Scene m_scene = null; private Dictionary m_avatarsClothes = new Dictionary(); - public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, - out byte[] visualParams) + public bool TryGetInitialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, + out byte[] visualParams) { - if (!m_avatarsClothes.ContainsKey(avatarId)) + if (m_avatarsClothes.ContainsKey(avatarId)) { - GetDefaultAvatarAppearance(out wearables, out visualParams); - AvatarAppearance wearing = new AvatarAppearance(wearables); - m_avatarsClothes[avatarId] = wearing; + visualParams = GetDefaultVisualParams(); + wearables = m_avatarsClothes[avatarId].IsWearing; return true; } else { - visualParams = GetDefaultVisualParams(); - wearables = m_avatarsClothes[avatarId].IsWearing; + GetDefaultAvatarAppearance(out wearables, out visualParams); + AvatarAppearance wearing = new AvatarAppearance(wearables); + m_avatarsClothes[avatarId] = wearing; return true; } } @@ -76,29 +76,29 @@ namespace OpenSim.Region.Environment.Modules IClientAPI clientView = (IClientAPI)sender; //Todo look up the assetid from the inventory cache (or something) for each itemId that is in AvatarWearingArgs // then store assetid and itemId and wearable type in a database - foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) + foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) + { + if (wear.Type < 13) { - if (wear.Type < 13) + LLUUID assetId; + CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); + if (profile != null) { - LLUUID assetId; - CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); - if (profile != null) + InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); + if (baseItem != null) { - InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); - if (baseItem != null) + assetId = baseItem.assetID; + //temporary dictionary storage. This should be storing to a database + if (m_avatarsClothes.ContainsKey(clientView.AgentId)) { - assetId = baseItem.assetID; - //temporary dictionary storage. This should be storing to a database - if (m_avatarsClothes.ContainsKey(clientView.AgentId)) - { - AvatarAppearance avWearing = m_avatarsClothes[clientView.AgentId]; - avWearing.IsWearing[wear.Type].AssetID = assetId; - avWearing.IsWearing[wear.Type].ItemID = wear.ItemID; - } + AvatarAppearance avWearing = m_avatarsClothes[clientView.AgentId]; + avWearing.IsWearing[wear.Type].AssetID = assetId; + avWearing.IsWearing[wear.Type].ItemID = wear.ItemID; } } } } + } } public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) @@ -155,5 +155,4 @@ namespace OpenSim.Region.Environment.Modules } } } - -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 19e00642ba..38cfc8ca58 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -251,7 +251,6 @@ namespace OpenSim.Region.Environment.Scenes httpListener = httpServer; m_dumpAssetsToFile = dumpAssetsToFile; - } #endregion @@ -311,8 +310,6 @@ namespace OpenSim.Region.Environment.Scenes m_restartTimer.Start(); SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes"); } - - } public void RestartTimer_Elapsed(object sender, ElapsedEventArgs e) @@ -329,7 +326,6 @@ namespace OpenSim.Region.Environment.Scenes m_restartTimer.AutoReset = false; RestartNow(); } - } public void RestartNow() @@ -391,7 +387,6 @@ namespace OpenSim.Region.Environment.Scenes avatar.ControllingClient.Stop(); }); - m_heartbeatTimer.Close(); m_innerScene.Close(); @@ -407,7 +402,6 @@ namespace OpenSim.Region.Environment.Scenes Modules.Clear(); base.Close(); - } /// @@ -568,7 +562,6 @@ namespace OpenSim.Region.Environment.Scenes } }); - Terrain.ResetTaint(); } } @@ -631,7 +624,7 @@ namespace OpenSim.Region.Environment.Scenes } } - foreach(AssetBase asset in textures) + foreach (AssetBase asset in textures) { System.Drawing.Image image= OpenJPEGNet.OpenJPEG.DecodeToImage(asset.Data); bitImages.Add(image); @@ -642,7 +635,7 @@ namespace OpenSim.Region.Environment.Scenes System.Drawing.SolidBrush sea = new System.Drawing.SolidBrush(System.Drawing.Color.DarkBlue); g.FillRectangle(sea, 0, 0, 2560, 2560); - for(int i =0; i public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) { - // What we're *supposed* to do is raytrace from the camera position given by the client to the nearest collision // in the direction the client supplies (the ground level that we clicked) // This function is pretty crappy right now.. so we're not affecting where the newly rezzed objects go @@ -813,7 +803,6 @@ namespace OpenSim.Region.Environment.Scenes Ray rezRay = new Ray(CameraPosition, rayDirection); - Vector3 RezDirectionFromCamera = rezRay.Direction; EntityIntersection rayTracing = m_innerScene.GetClosestIntersectingPrim(rezRay); @@ -838,14 +827,12 @@ namespace OpenSim.Region.Environment.Scenes MainLog.Instance.Verbose("REZINFO", "Possible Rez Point:" + RezPoint.ToString()); //pos = new LLVector3(RezPoint.x, RezPoint.y, RezPoint.z); - } else { // rez ON the ground, not IN the ground pos.Z += 0.25F; } - SceneObjectGroup sceneOb = new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); @@ -871,7 +858,6 @@ namespace OpenSim.Region.Environment.Scenes new Quaternion(), UsePhysics); // subscribe to physics events. rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); - } } } @@ -1037,13 +1023,12 @@ namespace OpenSim.Region.Environment.Scenes protected void LoadAvatarAppearance(IClientAPI client, out byte[] visualParams, out AvatarWearable[] wearables) { if (m_AvatarFactory == null || - !m_AvatarFactory.TryGetIntialAvatarAppearance(client.AgentId, out wearables, out visualParams)) + !m_AvatarFactory.TryGetInitialAvatarAppearance(client.AgentId, out wearables, out visualParams)) { AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams); } } - /// /// /// @@ -1066,7 +1051,6 @@ namespace OpenSim.Region.Environment.Scenes } }); - ForEachScenePresence( delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); @@ -1096,8 +1080,6 @@ namespace OpenSim.Region.Environment.Scenes // Remove client agent from profile, so new logins will work CommsManager.UserService.clearUserAgent(agentID); - - return; } public void NotifyMyCoarseLocationChange() @@ -1223,6 +1205,7 @@ namespace OpenSim.Region.Environment.Scenes { m_sceneGridService.EnableNeighbourChildAgents(presence); } + public void InformClientOfNeighbor(ScenePresence presence, RegionInfo region) { m_sceneGridService.InformNeighborChildAgent(presence, region); @@ -1281,6 +1264,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region Module Methods + public void AddModule(string name, IRegionModule module) { if (!Modules.ContainsKey(name)) @@ -1308,9 +1292,11 @@ namespace OpenSim.Region.Environment.Scenes return default(T); } } + #endregion #region Other Methods + public void SetTimePhase(int phase) { m_timePhase = phase; @@ -1343,7 +1329,6 @@ namespace OpenSim.Region.Environment.Scenes m_LandManager.landPrimCountTainted = false; } - public void addPrimsToParcelCounts() { foreach (EntityBase obj in Entities.Values) @@ -1409,7 +1394,6 @@ namespace OpenSim.Region.Environment.Scenes { m_scenePresences[agentID].ControllingClient.SendAgentAlertMessage("Request for god powers denied", false); } - } public void handleGodlikeKickUser(LLUUID godid, LLUUID sessionid, LLUUID agentid, uint kickflags, byte[] reason)