Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

iar_mods
Diva Canto 2011-12-20 09:53:05 -08:00
commit dd69c9fd20
23 changed files with 306 additions and 285 deletions

View File

@ -80,6 +80,7 @@ what it is today.
* dmiles (Daxtron Labs) * dmiles (Daxtron Labs)
* dslake (Intel) * dslake (Intel)
* FredoChaplin * FredoChaplin
* Garmin Kawaguichi
* Gerhard * Gerhard
* Godfrey * Godfrey
* Grumly57 * Grumly57

View File

@ -1463,7 +1463,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
options["profile"] = (string)requestData["profile"]; options["profile"] = (string)requestData["profile"];
} }
if (requestData["noassets"].ToString() == "true") if ((string)requestData["noassets"] == "true")
{ {
options["noassets"] = (string)requestData["noassets"] ; options["noassets"] = (string)requestData["noassets"] ;
} }

View File

@ -104,7 +104,7 @@ namespace OpenSim.Capabilities.Handlers
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("[UPLOAD BAKED TEXTURE HANDLER]: " + e.ToString()); m_log.ErrorFormat("[UPLOAD BAKED TEXTURE HANDLER]: {0}{1}", e.Message, e.StackTrace);
} }
return null; return null;
@ -117,7 +117,7 @@ namespace OpenSim.Capabilities.Handlers
/// <param name="data"></param> /// <param name="data"></param>
private void BakedTextureUploaded(UUID assetID, byte[] data) private void BakedTextureUploaded(UUID assetID, byte[] data)
{ {
// m_log.WarnFormat("[CAPS]: Received baked texture {0}", assetID.ToString()); // m_log.DebugFormat("[UPLOAD BAKED TEXTURE HANDLER]: Received baked texture {0}", assetID.ToString());
AssetBase asset; AssetBase asset;
asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_HostCapsObj.AgentID.ToString()); asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_HostCapsObj.AgentID.ToString());

View File

@ -249,10 +249,12 @@ namespace OpenSim.Framework
} }
/// <summary> /// <summary>
/// Set up appearance textures. /// Set up appearance texture ids.
/// Returns boolean that indicates whether the new entries actually change the
/// existing values.
/// </summary> /// </summary>
/// <returns>
/// True if any existing texture id was changed by the new data.
/// False if there were no changes or no existing texture ids.
/// </returns>
public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry) public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry)
{ {
if (textureEntry == null) if (textureEntry == null)
@ -269,25 +271,30 @@ namespace OpenSim.Framework
if (newface == null) if (newface == null)
{ {
if (oldface == null) continue; if (oldface == null)
continue;
} }
else else
{ {
if (oldface != null && oldface.TextureID == newface.TextureID) continue; if (oldface != null && oldface.TextureID == newface.TextureID)
continue;
} }
changed = true; changed = true;
} }
m_texture = textureEntry; m_texture = textureEntry;
return changed; return changed;
} }
/// <summary> /// <summary>
/// Set up visual parameters for the avatar and refresh the avatar height /// Set up visual parameters for the avatar and refresh the avatar height
/// Returns boolean that indicates whether the new entries actually change the
/// existing values.
/// </summary> /// </summary>
/// <returns>
/// True if any existing visual parameter was changed by the new data.
/// False if there were no changes or no existing visual parameters.
/// </returns>
public virtual bool SetVisualParams(byte[] visualParams) public virtual bool SetVisualParams(byte[] visualParams)
{ {
if (visualParams == null) if (visualParams == null)

View File

@ -34,6 +34,7 @@ namespace OpenSim.Framework
string Name { get; set; } string Name { get; set; }
UUID UUID { get; } UUID UUID { get; }
uint LocalId { get; } uint LocalId { get; }
Vector3 AbsolutePosition { get; } Vector3 AbsolutePosition { get; }
} }
} }

View File

@ -33,6 +33,12 @@ namespace OpenSim.Framework
public interface ISceneObject public interface ISceneObject
{ {
UUID UUID { get; } UUID UUID { get; }
/// <summary>
/// The owner of this object.
/// </summary>
UUID OwnerID { get; set; }
ISceneObject CloneForNewScene(); ISceneObject CloneForNewScene();
string ToXml2(); string ToXml2();
string ExtraToXmlString(); string ExtraToXmlString();

View File

@ -188,6 +188,18 @@ namespace OpenSim
} }
} }
// Hook up to the watchdog timer
Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
PrintFileToConsole("startuplogo.txt");
// For now, start at the 'root' level by default
if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
ChangeSelectedRegion("region",
new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName});
else
ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
//Run Startup Commands //Run Startup Commands
if (String.IsNullOrEmpty(m_startupCommandsFile)) if (String.IsNullOrEmpty(m_startupCommandsFile))
{ {
@ -206,18 +218,6 @@ namespace OpenSim
m_scriptTimer.Interval = 1200*1000; m_scriptTimer.Interval = 1200*1000;
m_scriptTimer.Elapsed += RunAutoTimerScript; m_scriptTimer.Elapsed += RunAutoTimerScript;
} }
// Hook up to the watchdog timer
Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
PrintFileToConsole("startuplogo.txt");
// For now, start at the 'root' level by default
if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
ChangeSelectedRegion("region",
new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName});
else
ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
} }
/// <summary> /// <summary>
@ -796,6 +796,7 @@ namespace OpenSim
break; break;
case "backup": case "backup":
MainConsole.Instance.Output("Triggering save of pending object updates to persistent store");
m_sceneManager.BackupCurrentScene(); m_sceneManager.BackupCurrentScene();
break; break;
@ -806,7 +807,7 @@ namespace OpenSim
if (m_sceneManager.TryGetScene(regRemoveName, out removeScene)) if (m_sceneManager.TryGetScene(regRemoveName, out removeScene))
RemoveRegion(removeScene, false); RemoveRegion(removeScene, false);
else else
MainConsole.Instance.Output("no region with that name"); MainConsole.Instance.Output("No region with that name");
break; break;
case "delete-region": case "delete-region":

View File

@ -441,6 +441,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo, public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo,
UUID agentId, UUID sessionId, uint circuitCode) UUID agentId, UUID sessionId, uint circuitCode)
{ {
// DebugPacketLevel = 1;
RegisterInterface<IClientIM>(this); RegisterInterface<IClientIM>(this);
RegisterInterface<IClientChat>(this); RegisterInterface<IClientChat>(this);
RegisterInterface<IClientIPEndpoint>(this); RegisterInterface<IClientIPEndpoint>(this);
@ -4893,8 +4895,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
update.Scale = new Vector3(0.45f, 0.6f, 1.9f); update.Scale = new Vector3(0.45f, 0.6f, 1.9f);
update.Text = Utils.EmptyBytes; update.Text = Utils.EmptyBytes;
update.TextColor = new byte[4]; update.TextColor = new byte[4];
// Don't send texture anim for avatars - this has no meaning for them.
update.TextureAnim = Utils.EmptyBytes; update.TextureAnim = Utils.EmptyBytes;
update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes;
// Don't send texture entry for avatars here - this is accomplished via the AvatarAppearance packet
update.TextureEntry = Utils.EmptyBytes;
// update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes;
update.UpdateFlags = (uint)( update.UpdateFlags = (uint)(
PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner | PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner |
PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer | PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer |
@ -6001,7 +6009,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// for the client session anyway, in order to protect ourselves against bad code in plugins // for the client session anyway, in order to protect ourselves against bad code in plugins
try try
{ {
byte[] visualparams = new byte[appear.VisualParam.Length]; byte[] visualparams = new byte[appear.VisualParam.Length];
for (int i = 0; i < appear.VisualParam.Length; i++) for (int i = 0; i < appear.VisualParam.Length; i++)
visualparams[i] = appear.VisualParam[i].ParamValue; visualparams[i] = appear.VisualParam[i].ParamValue;
@ -10345,6 +10352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
return true; return true;
} }
private bool HandleGroupRoleMembersRequest(IClientAPI sender, Packet Pack) private bool HandleGroupRoleMembersRequest(IClientAPI sender, Packet Pack)
{ {
GroupRoleMembersRequestPacket groupRoleMembersRequest = GroupRoleMembersRequestPacket groupRoleMembersRequest =
@ -11218,9 +11226,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary> /// <summary>
/// Send a response back to a client when it asks the asset server (via the region server) if it has /// Send a response back to a client when it asks the asset server (via the region server) if it has
/// its appearance texture cached. /// its appearance texture cached.
///
/// At the moment, we always reply that there is no cached texture.
/// </summary> /// </summary>
/// <remarks>
/// At the moment, we always reply that there is no cached texture.
/// </remarks>
/// <param name="simclient"></param> /// <param name="simclient"></param>
/// <param name="packet"></param> /// <param name="packet"></param>
/// <returns></returns> /// <returns></returns>
@ -11230,7 +11239,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet; AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
if (cachedtex.AgentData.SessionID != SessionId) return false; if (cachedtex.AgentData.SessionID != SessionId)
return false;
// TODO: don't create new blocks if recycling an old packet // TODO: don't create new blocks if recycling an old packet
cachedresp.AgentData.AgentID = AgentId; cachedresp.AgentData.AgentID = AgentId;
@ -11628,6 +11638,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate) if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate)
logPacket = false; logPacket = false;
if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily)
logPacket = false;
if (logPacket) if (logPacket)
m_log.DebugFormat( m_log.DebugFormat(
"[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}", "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
@ -11685,6 +11698,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
logPacket = false; logPacket = false;
if (DebugPacketLevel <= 25 && packet.Type == PacketType.RequestObjectPropertiesFamily)
logPacket = false;
if (logPacket) if (logPacket)
m_log.DebugFormat( m_log.DebugFormat(
"[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}",

View File

@ -26,16 +26,15 @@
*/ */
using System; using System;
using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Threading;
using System.Text;
using System.Timers;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using System.Threading;
using System.Timers;
using System.Collections.Generic;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
@ -45,6 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public const string BAKED_TEXTURES_REPORT_FORMAT = "{0,-9} {1}";
private Scene m_scene = null; private Scene m_scene = null;
private int m_savetime = 5; // seconds to wait before saving changed appearance private int m_savetime = 5; // seconds to wait before saving changed appearance
@ -147,9 +149,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// Process the baked texture array // Process the baked texture array
if (textureEntry != null) if (textureEntry != null)
{ {
m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID);
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); // WriteBakedTexturesReport(sp, m_log.DebugFormat);
ValidateBakedTextureCache(sp, false); ValidateBakedTextureCache(sp, false);
// This appears to be set only in the final stage of the appearance // This appears to be set only in the final stage of the appearance
@ -254,9 +260,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
} }
/// <summary> /// <summary>
/// Queue up a request to send appearance, makes it possible to /// Queue up a request to send appearance.
/// accumulate changes without sending out each one separately.
/// </summary> /// </summary>
/// <remarks>
/// Makes it possible to accumulate changes without sending out each one separately.
/// </remarks>
/// <param name="agentId"></param>
public void QueueAppearanceSend(UUID agentid) public void QueueAppearanceSend(UUID agentid)
{ {
// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); // m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
@ -408,11 +417,14 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
m_savequeue.Remove(avatarID); m_savequeue.Remove(avatarID);
} }
} }
}
// We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on
// another thread inbetween the first count calls and m_updateTimer.Stop() on this thread.
lock (m_sendqueue)
if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) if (m_savequeue.Count == 0 && m_sendqueue.Count == 0)
m_updateTimer.Stop(); m_updateTimer.Stop();
} }
}
private void SaveAppearance(UUID agentid) private void SaveAppearance(UUID agentid)
{ {
@ -557,5 +569,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
} }
} }
#endregion #endregion
public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction)
{
outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName);
outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID");
Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = GetBakedTextureFaces(sp.UUID);
foreach (BakeType bt in bakedTextures.Keys)
{
string rawTextureID;
if (bakedTextures[bt] == null)
{
rawTextureID = "not set";
}
else
{
rawTextureID = bakedTextures[bt].TextureID.ToString();
if (m_scene.AssetService.Get(rawTextureID) == null)
rawTextureID += " (not found)";
else
rawTextureID += " (uploaded)";
}
outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID);
}
bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp);
outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
}
} }
} }

View File

@ -385,8 +385,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName);
} }
// Checks if the given group is active and if the user is a group member /// <summary>
// with the powers requested (powers = 0 for no powers check) /// Checks if the given group is active and if the user is a group member
/// with the powers requested (powers = 0 for no powers check)
/// </summary>
/// <param name="groupID"></param>
/// <param name="userID"></param>
/// <param name="powers"></param>
/// <returns></returns>
protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers)
{ {
if (null == m_groupsModule) if (null == m_groupsModule)

View File

@ -31,9 +31,10 @@ using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces namespace OpenSim.Region.Framework.Interfaces
{ {
public delegate void ReportOutputAction(string format, params object[] args);
public interface IAvatarFactoryModule public interface IAvatarFactoryModule
{ {
void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams); void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
/// <summary> /// <summary>
@ -63,5 +64,13 @@ namespace OpenSim.Region.Framework.Interfaces
bool ValidateBakedTextureCache(IScenePresence sp); bool ValidateBakedTextureCache(IScenePresence sp);
void QueueAppearanceSend(UUID agentid); void QueueAppearanceSend(UUID agentid);
void QueueAppearanceSave(UUID agentid); void QueueAppearanceSave(UUID agentid);
/// <summary>
/// Get a report about the current state of a scene presence's baked appearance textures.
/// </summary>
/// <param name="sp"></param>
/// <param name="reportOutputAction"></param>
/// <returns></returns>
void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction reportOutputAction);
} }
} }

View File

@ -1564,6 +1564,12 @@ namespace OpenSim.Region.Framework.Scenes
public void TriggerRequestChangeWaterHeight(float height) public void TriggerRequestChangeWaterHeight(float height)
{ {
if (height < 0)
{
// ignore negative water height
return;
}
RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
if (handlerRequestChangeWaterHeight != null) if (handlerRequestChangeWaterHeight != null)
{ {

View File

@ -116,18 +116,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void RequestPrim(uint primLocalID, IClientAPI remoteClient) public void RequestPrim(uint primLocalID, IClientAPI remoteClient)
{ {
EntityBase[] entityList = GetEntities(); SceneObjectGroup sog = GetGroupByPrim(primLocalID);
foreach (EntityBase ent in entityList)
{ if (sog != null)
if (ent is SceneObjectGroup) sog.SendFullUpdateToClient(remoteClient);
{
if (((SceneObjectGroup)ent).LocalId == primLocalID)
{
((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient);
return;
}
}
}
} }
/// <summary> /// <summary>
@ -137,46 +129,66 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void SelectPrim(uint primLocalID, IClientAPI remoteClient) public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
{ {
EntityBase[] entityList = GetEntities(); SceneObjectPart part = GetSceneObjectPart(primLocalID);
foreach (EntityBase ent in entityList)
if (null == part)
return;
if (part.IsRoot)
{ {
if (ent is SceneObjectGroup) SceneObjectGroup sog = part.ParentGroup;
{ sog.SendPropertiesToClient(remoteClient);
if (((SceneObjectGroup) ent).LocalId == primLocalID) sog.IsSelected = true;
{
((SceneObjectGroup) ent).SendPropertiesToClient(remoteClient);
((SceneObjectGroup) ent).IsSelected = true;
// A prim is only tainted if it's allowed to be edited by the person clicking it. // A prim is only tainted if it's allowed to be edited by the person clicking it.
if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)
|| Permissions.CanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)) || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
{ {
EventManager.TriggerParcelPrimCountTainted(); EventManager.TriggerParcelPrimCountTainted();
} }
break;
} }
else else
{
// We also need to check the children of this prim as they
// can be selected as well and send property information
bool foundPrim = false;
SceneObjectGroup sog = ent as SceneObjectGroup;
SceneObjectPart[] partList = sog.Parts;
foreach (SceneObjectPart part in partList)
{
if (part.LocalId == primLocalID)
{ {
part.SendPropertiesToClient(remoteClient); part.SendPropertiesToClient(remoteClient);
foundPrim = true;
break;
} }
} }
if (foundPrim) /// <summary>
break; /// Handle the update of an object's user group.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="groupID"></param>
/// <param name="objectLocalID"></param>
/// <param name="Garbage"></param>
private void HandleObjectGroupUpdate(
IClientAPI remoteClient, UUID groupID, uint objectLocalID, UUID Garbage)
{
if (m_groupsModule == null)
return;
// XXX: Might be better to get rid of this special casing and have GetMembershipData return something
// reasonable for a UUID.Zero group.
if (groupID != UUID.Zero)
{
GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId);
if (gmd == null)
{
// m_log.WarnFormat(
// "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group",
// remoteClient.Name, GroupID, objectLocalID);
return;
} }
} }
SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID);
if (so != null)
{
if (so.OwnerID == remoteClient.AgentId)
{
so.SetGroup(groupID, remoteClient);
}
} }
} }
@ -250,32 +262,26 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
{ {
EntityBase[] EntityList = GetEntities(); SceneObjectPart part = GetSceneObjectPart(localID);
if (part == null)
return;
SceneObjectGroup obj = part.ParentGroup;
SurfaceTouchEventArgs surfaceArg = null; SurfaceTouchEventArgs surfaceArg = null;
if (surfaceArgs != null && surfaceArgs.Count > 0) if (surfaceArgs != null && surfaceArgs.Count > 0)
surfaceArg = surfaceArgs[0]; surfaceArg = surfaceArgs[0];
foreach (EntityBase ent in EntityList)
{
if (ent is SceneObjectGroup)
{
SceneObjectGroup obj = ent as SceneObjectGroup;
if (obj != null)
{
// Is this prim part of the group
if (obj.HasChildPrim(localID))
{
// Currently only grab/touch for the single prim // Currently only grab/touch for the single prim
// the client handles rez correctly // the client handles rez correctly
obj.ObjectGrabHandler(localID, offsetPos, remoteClient); obj.ObjectGrabHandler(localID, offsetPos, remoteClient);
SceneObjectPart part = obj.GetChildPart(localID);
// If the touched prim handles touches, deliver it // If the touched prim handles touches, deliver it
// If not, deliver to root prim // If not, deliver to root prim
if ((part.ScriptEvents & scriptEvents.touch_start) != 0) if ((part.ScriptEvents & scriptEvents.touch_start) != 0)
EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg);
// Deliver to the root prim if the touched prim doesn't handle touches // Deliver to the root prim if the touched prim doesn't handle touches
// or if we're meant to pass on touches anyway. Don't send to root prim // or if we're meant to pass on touches anyway. Don't send to root prim
// if prim touched is the root prim as we just did it // if prim touched is the root prim as we just did it
@ -284,34 +290,21 @@ namespace OpenSim.Region.Framework.Scenes
{ {
EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
} }
return;
}
}
}
}
} }
public virtual void ProcessObjectGrabUpdate(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) public virtual void ProcessObjectGrabUpdate(
UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
{ {
EntityBase[] EntityList = GetEntities(); SceneObjectPart part = GetSceneObjectPart(objectID);
if (part == null)
return;
SceneObjectGroup obj = part.ParentGroup;
SurfaceTouchEventArgs surfaceArg = null; SurfaceTouchEventArgs surfaceArg = null;
if (surfaceArgs != null && surfaceArgs.Count > 0) if (surfaceArgs != null && surfaceArgs.Count > 0)
surfaceArg = surfaceArgs[0]; surfaceArg = surfaceArgs[0];
foreach (EntityBase ent in EntityList)
{
if (ent is SceneObjectGroup)
{
SceneObjectGroup obj = ent as SceneObjectGroup;
if (obj != null)
{
// Is this prim part of the group
if (obj.HasChildPrim(objectID))
{
SceneObjectPart part = obj.GetChildPart(objectID);
// If the touched prim handles touches, deliver it // If the touched prim handles touches, deliver it
// If not, deliver to root prim // If not, deliver to root prim
if ((part.ScriptEvents & scriptEvents.touch) != 0) if ((part.ScriptEvents & scriptEvents.touch) != 0)
@ -324,47 +317,26 @@ namespace OpenSim.Region.Framework.Scenes
{ {
EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
} }
return;
}
}
}
}
} }
public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
{ {
EntityBase[] EntityList = GetEntities(); SceneObjectPart part = GetSceneObjectPart(localID);
if (part == null)
return;
SceneObjectGroup obj = part.ParentGroup;
SurfaceTouchEventArgs surfaceArg = null; SurfaceTouchEventArgs surfaceArg = null;
if (surfaceArgs != null && surfaceArgs.Count > 0) if (surfaceArgs != null && surfaceArgs.Count > 0)
surfaceArg = surfaceArgs[0]; surfaceArg = surfaceArgs[0];
foreach (EntityBase ent in EntityList)
{
if (ent is SceneObjectGroup)
{
SceneObjectGroup obj = ent as SceneObjectGroup;
// Is this prim part of the group
if (obj.HasChildPrim(localID))
{
SceneObjectPart part=obj.GetChildPart(localID);
if (part != null)
{
// If the touched prim handles touches, deliver it // If the touched prim handles touches, deliver it
// If not, deliver to root prim // If not, deliver to root prim
if ((part.ScriptEvents & scriptEvents.touch_end) != 0) if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg); EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
else else
EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg); EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg);
return;
}
return;
}
}
}
} }
public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query) public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query)

View File

@ -139,6 +139,7 @@ namespace OpenSim.Region.Framework.Scenes
protected IDialogModule m_dialogModule; protected IDialogModule m_dialogModule;
protected IEntityTransferModule m_teleportModule; protected IEntityTransferModule m_teleportModule;
protected ICapabilitiesModule m_capsModule; protected ICapabilitiesModule m_capsModule;
protected IGroupsModule m_groupsModule;
/// <summary> /// <summary>
/// Current scene frame number /// Current scene frame number
@ -1164,6 +1165,7 @@ namespace OpenSim.Region.Framework.Scenes
m_dialogModule = RequestModuleInterface<IDialogModule>(); m_dialogModule = RequestModuleInterface<IDialogModule>();
m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
m_groupsModule = RequestModuleInterface<IGroupsModule>();
} }
#endregion #endregion
@ -2733,6 +2735,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnObjectDescription += m_sceneGraph.PrimDescription; client.OnObjectDescription += m_sceneGraph.PrimDescription;
client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable;
client.OnObjectOwner += ObjectOwner; client.OnObjectOwner += ObjectOwner;
client.OnObjectGroupRequest += HandleObjectGroupUpdate;
} }
public virtual void SubscribeToClientPrimRezEvents(IClientAPI client) public virtual void SubscribeToClientPrimRezEvents(IClientAPI client)
@ -2776,7 +2779,6 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void SubscribeToClientParcelEvents(IClientAPI client) public virtual void SubscribeToClientParcelEvents(IClientAPI client)
{ {
client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate;
client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime;
client.OnParcelBuy += ProcessParcelBuy; client.OnParcelBuy += ProcessParcelBuy;
@ -2903,7 +2905,6 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void UnSubscribeToClientParcelEvents(IClientAPI client) public virtual void UnSubscribeToClientParcelEvents(IClientAPI client)
{ {
client.OnObjectGroupRequest -= m_sceneGraph.HandleObjectGroupUpdate;
client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel; client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel;
client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime; client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime;
client.OnParcelBuy -= ProcessParcelBuy; client.OnParcelBuy -= ProcessParcelBuy;
@ -3522,15 +3523,11 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!");
} }
IGroupsModule groupsModule =
RequestModuleInterface<IGroupsModule>();
List<UUID> agentGroups = new List<UUID>(); List<UUID> agentGroups = new List<UUID>();
if (groupsModule != null) if (m_groupsModule != null)
{ {
GroupMembershipData[] GroupMembership = GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID);
groupsModule.GetMembershipData(agent.AgentID);
if (GroupMembership != null) if (GroupMembership != null)
{ {

View File

@ -575,20 +575,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
protected internal void HandleObjectGroupUpdate(
IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
{
if (!remoteClient.IsGroupMember(GroupID))
return;
SceneObjectGroup group = GetGroupByPrim(objectLocalID);
if (group != null)
{
if (group.OwnerID == remoteClient.AgentId)
group.SetGroup(GroupID, remoteClient);
}
}
protected internal ScenePresence CreateAndAddChildScenePresence( protected internal ScenePresence CreateAndAddChildScenePresence(
IClientAPI client, AvatarAppearance appearance, PresenceType type) IClientAPI client, AvatarAppearance appearance, PresenceType type)
{ {

View File

@ -1373,19 +1373,23 @@ namespace OpenSim.Region.Framework.Scenes
#endregion #endregion
// Send the parts of this SOG to a single client /// <summary>
// Used when the client initially connects and when client sends RequestPrim packet /// Send the parts of this SOG to a single client
/// </summary>
/// <remarks>
/// Used when the client initially connects and when client sends RequestPrim packet
/// </remarks>
/// <param name="remoteClient"></param>
public void SendFullUpdateToClient(IClientAPI remoteClient) public void SendFullUpdateToClient(IClientAPI remoteClient)
{ {
RootPart.SendFullUpdate( RootPart.SendFullUpdate(remoteClient);
remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
SceneObjectPart[] parts = m_parts.GetArray(); SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++) for (int i = 0; i < parts.Length; i++)
{ {
SceneObjectPart part = parts[i]; SceneObjectPart part = parts[i];
if (part != RootPart) if (part != RootPart)
part.SendFullUpdate(remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); part.SendFullUpdate(remoteClient);
} }
} }
@ -1679,10 +1683,11 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary> /// <summary>
/// Reset the UUIDs for all the prims that make up this group. /// Reset the UUIDs for all the prims that make up this group.
/// /// </summary>
/// <remarks>
/// This is called by methods which want to add a new group to an existing scene, in order /// This is called by methods which want to add a new group to an existing scene, in order
/// to ensure that there are no clashes with groups already present. /// to ensure that there are no clashes with groups already present.
/// </summary> /// </remarks>
public void ResetIDs() public void ResetIDs()
{ {
lock (m_parts.SyncRoot) lock (m_parts.SyncRoot)
@ -3206,6 +3211,8 @@ namespace OpenSim.Region.Framework.Scenes
part.Inventory.ChangeInventoryGroup(GroupID); part.Inventory.ChangeInventoryGroup(GroupID);
} }
HasGroupChanged = true;
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
// for the same object with very different properties. The caller must schedule the update. // for the same object with very different properties. The caller must schedule the update.
//ScheduleGroupForFullUpdate(); //ScheduleGroupForFullUpdate();

View File

@ -2836,8 +2836,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Send a full update to the client for the given part /// Send a full update to the client for the given part
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="clientFlags"></param> protected internal void SendFullUpdate(IClientAPI remoteClient)
protected internal void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
{ {
if (ParentGroup == null) if (ParentGroup == null)
return; return;
@ -2849,16 +2848,16 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (ParentGroup.IsAttachment) if (ParentGroup.IsAttachment)
{ {
SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); SendFullUpdateToClient(remoteClient, AttachedPos);
} }
else else
{ {
SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags); SendFullUpdateToClient(remoteClient, AbsolutePosition);
} }
} }
else else
{ {
SendFullUpdateToClient(remoteClient, clientFlags); SendFullUpdateToClient(remoteClient);
} }
} }
@ -2872,7 +2871,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{ {
SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); SendFullUpdate(avatar.ControllingClient);
}); });
} }
@ -2880,12 +2879,9 @@ namespace OpenSim.Region.Framework.Scenes
/// Sends a full update to the client /// Sends a full update to the client
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="clientFlags"></param> public void SendFullUpdateToClient(IClientAPI remoteClient)
public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientflags)
{ {
Vector3 lPos; SendFullUpdateToClient(remoteClient, OffsetPosition);
lPos = OffsetPosition;
SendFullUpdateToClient(remoteClient, lPos, clientflags);
} }
/// <summary> /// <summary>
@ -2893,8 +2889,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="lPos"></param> /// <param name="lPos"></param>
/// <param name="clientFlags"></param> public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos)
public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos, uint clientFlags)
{ {
if (ParentGroup == null) if (ParentGroup == null)
return; return;
@ -2911,16 +2906,11 @@ namespace OpenSim.Region.Framework.Scenes
(ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38)) (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38))
return; return;
clientFlags &= ~(uint) PrimFlags.CreateSelected;
if (remoteClient.AgentId == OwnerID) if (remoteClient.AgentId == OwnerID)
{ {
if ((Flags & PrimFlags.CreateSelected) != 0) if ((Flags & PrimFlags.CreateSelected) != 0)
{
clientFlags |= (uint) PrimFlags.CreateSelected;
Flags &= ~PrimFlags.CreateSelected; Flags &= ~PrimFlags.CreateSelected;
} }
}
//bool isattachment = IsAttachment; //bool isattachment = IsAttachment;
//if (LocalId != ParentGroup.RootPart.LocalId) //if (LocalId != ParentGroup.RootPart.LocalId)
//isattachment = ParentGroup.RootPart.IsAttachment; //isattachment = ParentGroup.RootPart.IsAttachment;
@ -3354,6 +3344,11 @@ namespace OpenSim.Region.Framework.Scenes
public void SetGroup(UUID groupID, IClientAPI client) public void SetGroup(UUID groupID, IClientAPI client)
{ {
// Scene.AddNewPrims() calls with client == null so can't use this.
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Setting group for {0} to {1} for {2}",
// Name, groupID, OwnerID);
GroupID = groupID; GroupID = groupID;
if (client != null) if (client != null)
SendPropertiesToClient(client); SendPropertiesToClient(client);

View File

@ -784,7 +784,6 @@ namespace OpenSim.Region.Framework.Scenes
public void RegisterToEvents() public void RegisterToEvents()
{ {
ControllingClient.OnCompleteMovementToRegion += CompleteMovement; ControllingClient.OnCompleteMovementToRegion += CompleteMovement;
//ControllingClient.OnCompleteMovementToRegion += SendInitialData;
ControllingClient.OnAgentUpdate += HandleAgentUpdate; ControllingClient.OnAgentUpdate += HandleAgentUpdate;
ControllingClient.OnAgentRequestSit += HandleAgentRequestSit; ControllingClient.OnAgentRequestSit += HandleAgentRequestSit;
ControllingClient.OnAgentSit += HandleAgentSit; ControllingClient.OnAgentSit += HandleAgentSit;
@ -832,11 +831,6 @@ namespace OpenSim.Region.Framework.Scenes
#endregion #endregion
public uint GenerateClientFlags(UUID ObjectID)
{
return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
}
#region Status Methods #region Status Methods
/// <summary> /// <summary>
@ -2538,7 +2532,10 @@ namespace OpenSim.Region.Framework.Scenes
// again here... this comes after the cached appearance check because the avatars // again here... this comes after the cached appearance check because the avatars
// appearance goes into the avatar update packet // appearance goes into the avatar update packet
SendAvatarDataToAllAgents(); SendAvatarDataToAllAgents();
SendAppearanceToAgent(this);
// Sending us our own appearance does not seem to be necessary, and the viewer warns in the log if you do
// this.
// SendAppearanceToAgent(this);
// If we are using the the cached appearance then send it out to everyone // If we are using the the cached appearance then send it out to everyone
if (cachedappearance) if (cachedappearance)
@ -2673,7 +2670,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendAppearanceToAgent(ScenePresence avatar) public void SendAppearanceToAgent(ScenePresence avatar)
{ {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE PRESENCE] Send appearance from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
avatar.ControllingClient.SendAppearance( avatar.ControllingClient.SendAppearance(
UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());

View File

@ -50,8 +50,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{ {
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}";
private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
// private IAvatarFactoryModule m_avatarFactory; // private IAvatarFactoryModule m_avatarFactory;
@ -197,37 +195,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{ {
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
if (sp != null && !sp.IsChildAgent) if (sp != null && !sp.IsChildAgent)
{ scene.AvatarFactory.WriteBakedTexturesReport(sp, MainConsole.Instance.OutputFormat);
MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName);
MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID");
Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures
= scene.AvatarFactory.GetBakedTextureFaces(sp.UUID);
foreach (BakeType bt in bakedTextures.Keys)
{
string rawTextureID;
if (bakedTextures[bt] == null)
{
rawTextureID = "not set";
}
else
{
rawTextureID = bakedTextures[bt].TextureID.ToString();
if (scene.AssetService.Get(rawTextureID) == null)
rawTextureID += " (not found)";
else
rawTextureID += " (uploaded)";
}
MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID);
}
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
MainConsole.Instance.OutputFormat(
"{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
}
} }
else else
{ {

View File

@ -29,25 +29,18 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Timers; using System.Timers;
using log4net; using log4net;
using Mono.Addins; using Mono.Addins;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags;
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
@ -90,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Configuration settings // Configuration settings
private bool m_groupsEnabled = false; private bool m_groupsEnabled = false;
private bool m_groupNoticesEnabled = true; private bool m_groupNoticesEnabled = true;
private bool m_debugEnabled = true; private bool m_debugEnabled = false;
#region IRegionModuleBase Members #region IRegionModuleBase Members
@ -232,7 +225,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Used for Notices and Group Invites/Accept/Reject // Used for Notices and Group Invites/Accept/Reject
client.OnInstantMessage += OnInstantMessage; client.OnInstantMessage += OnInstantMessage;
// Send client thier groups information. // Send client their groups information.
SendAgentGroupDataUpdate(client, client.AgentId); SendAgentGroupDataUpdate(client, client.AgentId);
} }

View File

@ -52,6 +52,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private bool m_debugEnabled = false;
public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome |
GroupPowers.Accountable | GroupPowers.Accountable |
GroupPowers.JoinChat | GroupPowers.JoinChat |
@ -81,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>(); private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>();
private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>(); private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>();
#region IRegionModuleBase Members #region IRegionModuleBase Members
public string Name public string Name
@ -115,7 +116,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return; return;
} }
m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name);
m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty);
if ((m_groupsServerURI == null) || if ((m_groupsServerURI == null) ||
@ -142,6 +143,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout); m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout);
} }
m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false);
// If we got all the config options we need, lets start'er'up // If we got all the config options we need, lets start'er'up
m_memoryCache = new ExpiringCache<string, XmlRpcResponse>(); m_memoryCache = new ExpiringCache<string, XmlRpcResponse>();
m_connectorEnabled = true; m_connectorEnabled = true;
@ -150,7 +153,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public void Close() public void Close()
{ {
m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name); m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name);
} }
public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene) public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
@ -958,6 +961,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (resp == null) if (resp == null)
{ {
if (m_debugEnabled)
m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Cache miss for key {0}", CacheKey);
string UserService; string UserService;
UUID SessionID; UUID SessionID;
GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID);

View File

@ -1780,7 +1780,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
Vector3 size, Quaternion rotation, bool isPhysical, uint localid) Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
{ {
m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); // m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name);
return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid);
} }

View File

@ -13,7 +13,10 @@
; Change the connection string to your db details ; Change the connection string to your db details
;StorageProvider = "OpenSim.Data.MySQL.dll" ;StorageProvider = "OpenSim.Data.MySQL.dll"
;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
; Uncomment this line if you are using MySQL and want to use a different database for estates
; Uncomment this line if you are using MySQL and want to use a different database for estates.
; The usual application for this is to allow estates to be spread out across multiple simulators by share the same database.
; Most people won't need to do this so only uncomment if you know what you're doing.
;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" ;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
; MSSQL ; MSSQL