Formatting cleanup.

0.6.0-stable
Jeff Ames 2008-05-28 03:44:49 +00:00
parent e34f537a1a
commit 5752c1f5c2
23 changed files with 206 additions and 204 deletions

View File

@ -72,7 +72,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
{ {
get get
{ {
switch(idx.ToLower()) switch (idx.ToLower())
{ {
case "name": case "name":
return region_name; return region_name;

View File

@ -194,7 +194,7 @@ namespace OpenSim.ApplicationPlugins.Rest
try try
{ {
if ((_config = openSim.ConfigSource.Configs["RestPlugins"]) == null) if ((_config = openSim.ConfigSource.Configs["RestPlugins"]) == null)
{ {
m_log.WarnFormat("{0} Rest Plugins not configured", MsgID); m_log.WarnFormat("{0} Rest Plugins not configured", MsgID);
return; return;
@ -296,7 +296,7 @@ namespace OpenSim.ApplicationPlugins.Rest
public bool RemoveAgentHandler(string agentName, IHttpAgentHandler handler) public bool RemoveAgentHandler(string agentName, IHttpAgentHandler handler)
{ {
if (!IsEnabled) return false; if (!IsEnabled) return false;
if(_agents[agentName] == handler) if (_agents[agentName] == handler)
{ {
_agents.Remove(agentName); _agents.Remove(agentName);
return _httpd.RemoveAgentHandler(agentName, handler); return _httpd.RemoveAgentHandler(agentName, handler);

View File

@ -249,11 +249,11 @@ namespace OpenSim.Framework.Communications.Cache
//m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId); //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId);
// Xantor 20080526: // Xantor 20080526:
// if a request is made for an asset which is not in the cache yet, but has already been requested by // if a request is made for an asset which is not in the cache yet, but has already been requested by
// something else, queue up the callbacks on that requestor instead of swamping the assetserver // something else, queue up the callbacks on that requestor instead of swamping the assetserver
// with multiple requests for the same asset. // with multiple requests for the same asset.
AssetBase asset; AssetBase asset;
if (TryGetCachedAsset(assetId, out asset)) if (TryGetCachedAsset(assetId, out asset))
@ -265,8 +265,8 @@ namespace OpenSim.Framework.Communications.Cache
#if DEBUG #if DEBUG
// m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId);
#endif #endif
NewAssetRequest req = new NewAssetRequest(assetId, callback); NewAssetRequest req = new NewAssetRequest(assetId, callback);
AssetRequestsList requestList; AssetRequestsList requestList;
@ -499,7 +499,7 @@ namespace OpenSim.Framework.Communications.Cache
{ {
Assets[assetID] = null; Assets[assetID] = null;
} }
// Notify requesters for this asset // Notify requesters for this asset
AssetRequestsList reqList = null; AssetRequestsList reqList = null;
lock (RequestLists) lock (RequestLists)
@ -590,20 +590,20 @@ namespace OpenSim.Framework.Communications.Cache
RequestedAssets.Add(requestID, request); RequestedAssets.Add(requestID, request);
m_assetServer.RequestAsset(requestID, false); m_assetServer.RequestAsset(requestID, false);
} }
return; return;
} }
// It has an entry in our cache // It has an entry in our cache
AssetInfo asset = Assets[requestID]; AssetInfo asset = Assets[requestID];
// FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right. // FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right.
if (null == asset) if (null == asset)
{ {
//m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID); //m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID);
return; return;
} }
// The asset is knosn to exist and is in our cache, so add it to the AssetRequests list // The asset is knosn to exist and is in our cache, so add it to the AssetRequests list
AssetRequest req = new AssetRequest(); AssetRequest req = new AssetRequest();
req.RequestUser = userInfo; req.RequestUser = userInfo;

View File

@ -485,10 +485,10 @@ namespace OpenSim.Framework.Communications.Cache
{ {
if (HasInventory) if (HasInventory)
{ {
if(item.Folder == LLUUID.Zero) if (item.Folder == LLUUID.Zero)
{ {
InventoryFolderImpl f=FindFolderForType(item.AssetType); InventoryFolderImpl f=FindFolderForType(item.AssetType);
if(f != null) if (f != null)
item.Folder=f.ID; item.Folder=f.ID;
else else
item.Folder=RootFolder.ID; item.Folder=RootFolder.ID;
@ -617,14 +617,14 @@ namespace OpenSim.Framework.Communications.Cache
private InventoryFolderImpl FindFolderForType(int type) private InventoryFolderImpl FindFolderForType(int type)
{ {
if(RootFolder == null) if (RootFolder == null)
return null; return null;
lock(RootFolder.SubFolders) lock (RootFolder.SubFolders)
{ {
foreach (InventoryFolderImpl f in RootFolder.SubFolders.Values) foreach (InventoryFolderImpl f in RootFolder.SubFolders.Values)
{ {
if(f.Type == type) if (f.Type == type)
return f; return f;
} }
} }

View File

@ -310,19 +310,20 @@ namespace OpenSim.Framework.Servers
agentHandler = null; agentHandler = null;
try try
{ {
foreach(IHttpAgentHandler handler in m_agentHandlers.Values) foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
{ {
if(handler.Match(request, response)) if (handler.Match(request, response))
{ {
agentHandler = handler; agentHandler = handler;
return true; return true;
} }
} }
} }
catch(KeyNotFoundException) {} catch(KeyNotFoundException)
{
}
return false; return false;
} }
/// <summary> /// <summary>
@ -478,7 +479,6 @@ namespace OpenSim.Framework.Servers
private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response) private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response)
{ {
// In the case of REST, then handler is responsible for ALL aspects of // In the case of REST, then handler is responsible for ALL aspects of
// the request/response handling. Nothing is done here, not even encoding. // the request/response handling. Nothing is done here, not even encoding.
@ -500,11 +500,12 @@ namespace OpenSim.Framework.Servers
response.StatusCode = (int)OSHttpStatusCode.ServerErrorInternalError; response.StatusCode = (int)OSHttpStatusCode.ServerErrorInternalError;
response.OutputStream.Close(); response.OutputStream.Close();
} }
catch(Exception){} catch(Exception)
{
}
} }
return true; return true;
} }
public void HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response) public void HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response)
@ -759,13 +760,16 @@ namespace OpenSim.Framework.Servers
{ {
try try
{ {
if(handler == m_agentHandlers[agent]) if (handler == m_agentHandlers[agent])
{ {
m_agentHandlers.Remove(agent); m_agentHandlers.Remove(agent);
return true; return true;
} }
} }
catch(KeyNotFoundException) {} catch(KeyNotFoundException)
{
}
return false; return false;
} }

View File

@ -272,28 +272,28 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
public void llWhisper(int channelID, string text) public void llWhisper(int channelID, string text)
{ {
World.SimChat(Helpers.StringToField(text), World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition,
m_host.Name, m_host.UUID, false); m_host.Name, m_host.UUID, false);
} }
public void llSay(int channelID, string text) public void llSay(int channelID, string text)
{ {
World.SimChat(Helpers.StringToField(text), World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, ChatTypeEnum.Say, channelID, m_host.AbsolutePosition,
m_host.Name, m_host.UUID, false); m_host.Name, m_host.UUID, false);
} }
public void llShout(int channelID, string text) public void llShout(int channelID, string text)
{ {
World.SimChat(Helpers.StringToField(text), World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition,
m_host.Name, m_host.UUID, false); m_host.Name, m_host.UUID, false);
} }
public void llOwnerSay(string msg) public void llOwnerSay(string msg)
{ {
World.SimChatBroadcast(Helpers.StringToField(text), World.SimChatBroadcast(Helpers.StringToField(text),
ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, ChatTypeEnum.Owner, 0, m_host.AbsolutePosition,
m_host.Name, m_host.UUID, false); m_host.Name, m_host.UUID, false);
} }

View File

@ -122,24 +122,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
IClientAPI client = presence.ControllingClient; IClientAPI client = presence.ControllingClient;
if ((c.Type == ChatTypeEnum.Owner) && if ((c.Type == ChatTypeEnum.Owner) &&
(null != c.SenderObject) && (null != c.SenderObject) &&
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
return; return;
if (null == c.SenderObject) if (null == c.SenderObject)
client.SendChatMessage(c.Message, (byte)c.Type, client.SendChatMessage(c.Message, (byte)c.Type,
pos, c.From, LLUUID.Zero, pos, c.From, LLUUID.Zero,
(byte)ChatSourceType.Agent, (byte)ChatSourceType.Agent,
(byte)ChatAudibleLevel.Fully); (byte)ChatAudibleLevel.Fully);
else else
client.SendChatMessage(c.Message, (byte)c.Type, client.SendChatMessage(c.Message, (byte)c.Type,
pos, c.From, LLUUID.Zero, pos, c.From, LLUUID.Zero,
(byte)ChatSourceType.Object, (byte)ChatSourceType.Object,
(byte)ChatAudibleLevel.Fully); (byte)ChatAudibleLevel.Fully);
}); });
} }
public void SimChat(Object sender, ChatFromViewerArgs e) public void SimChat(Object sender, ChatFromViewerArgs e)
{ {
// early return if not on public or debug channel // early return if not on public or debug channel
@ -187,13 +187,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
if (e.Channel == DEBUG_CHANNEL) if (e.Channel == DEBUG_CHANNEL)
{ {
TrySendChatMessage(presence, fromPos, regionPos, TrySendChatMessage(presence, fromPos, regionPos,
fromID, fromName, e.Type, fromID, fromName, e.Type,
message, ChatSourceType.Object); message, ChatSourceType.Object);
} }
else else
{ {
TrySendChatMessage(presence, fromPos, regionPos, TrySendChatMessage(presence, fromPos, regionPos,
fromID, fromName, e.Type, fromID, fromName, e.Type,
message, ChatSourceType.Agent); message, ChatSourceType.Agent);
} }
}); });
@ -224,16 +224,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
LLVector3 fromRegionPos = fromPos + regionPos; LLVector3 fromRegionPos = fromPos + regionPos;
LLVector3 toRegionPos = presence.AbsolutePosition + regionPos; LLVector3 toRegionPos = presence.AbsolutePosition + regionPos;
int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos)); int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos));
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
type == ChatTypeEnum.Say && dis > m_saydistance || type == ChatTypeEnum.Say && dis > m_saydistance ||
type == ChatTypeEnum.Shout && dis > m_shoutdistance) type == ChatTypeEnum.Shout && dis > m_shoutdistance)
{ {
return; return;
} }
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
} }
} }

View File

@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{ {
public class IRCBridgeModule : IRegionModule public class IRCBridgeModule : IRegionModule
{ {
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private const int DEBUG_CHANNEL = 2147483647; private const int DEBUG_CHANNEL = 2147483647;
@ -68,7 +68,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{ {
try try
{ {
if ((m_config = config.Configs["IRC"]) == null) if ((m_config = config.Configs["IRC"]) == null)
{ {
m_log.InfoFormat("[IRC] module not configured"); m_log.InfoFormat("[IRC] module not configured");
return; return;
@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
m_log.Info("[IRC] module not configured"); m_log.Info("[IRC] module not configured");
return; return;
} }
lock (m_syncInit) lock (m_syncInit)
{ {
@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
m_irc_connector.Name = "IRCConnectorThread"; m_irc_connector.Name = "IRCConnectorThread";
m_irc_connector.IsBackground = true; m_irc_connector.IsBackground = true;
} }
m_log.InfoFormat("[IRC] initialized for {0}, nick: {1} ", scene.RegionInfo.RegionName, m_log.InfoFormat("[IRC] initialized for {0}, nick: {1} ", scene.RegionInfo.RegionName,
m_defaultzone); m_defaultzone);
} }
} }
@ -221,9 +221,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
if (e.Message.StartsWith("/me ") && (null != avatar)) if (e.Message.StartsWith("/me ") && (null != avatar))
e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4)); e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4));
// this is to keep objects from talking to IRC // this is to keep objects from talking to IRC
if (m_irc.Connected && (avatar != null)) if (m_irc.Connected && (avatar != null))
m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message); m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
} }
@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
if ((m_irc.Enabled) && (m_irc.Connected)) if ((m_irc.Enabled) && (m_irc.Connected))
{ {
m_log.DebugFormat("[IRC] {0} logging on", clientName); m_log.DebugFormat("[IRC] {0} logging on", clientName);
m_irc.PrivMsg(m_irc.Nick, "Sim", m_irc.PrivMsg(m_irc.Nick, "Sim",
String.Format("notices {0} logging on", clientName)); String.Format("notices {0} logging on", clientName));
} }
m_last_new_user = clientName; m_last_new_user = clientName;
@ -310,7 +310,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
m_log.InfoFormat("[IRC]: {0} logging out", clientName); m_log.InfoFormat("[IRC]: {0} logging out", clientName);
} }
if (m_last_new_user == clientName) if (m_last_new_user == clientName)
m_last_new_user = null; m_last_new_user = null;
} }
} }
@ -489,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[IRC] cannot connect to {0}:{1}: {2}", m_log.ErrorFormat("[IRC] cannot connect to {0}:{1}: {2}",
m_server, m_port, e.Message); m_server, m_port, e.Message);
} }
return m_connected; return m_connected;
@ -617,16 +617,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
// is message "\001ACTION foo // is message "\001ACTION foo
// bar\001"? -> "/me foo bar" // bar\001"? -> "/me foo bar"
if ((1 == c.Message[0]) && c.Message.Substring(1).StartsWith("ACTION")) if ((1 == c.Message[0]) && c.Message.Substring(1).StartsWith("ACTION"))
c.Message = String.Format("/me {0}", c.Message.Substring(8, c.Message.Length - 9)); c.Message = String.Format("/me {0}", c.Message.Substring(8, c.Message.Length - 9));
foreach (Scene scene in m_scenes) foreach (Scene scene in m_scenes)
{ {
c.Scene = scene; c.Scene = scene;
scene.EventManager.TriggerOnChatBroadcast(this, c); scene.EventManager.TriggerOnChatBroadcast(this, c);
} }
} }
Thread.Sleep(150); Thread.Sleep(150);
continue; continue;
} }

View File

@ -569,7 +569,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
{ {
foreach (ListenerInfo l in list) foreach (ListenerInfo l in list)
{ {
if(l.GetItemID() == itemID) if (l.GetItemID() == itemID)
data.AddRange(l.GetSerializationData()); data.AddRange(l.GetSerializationData());
} }
} }
@ -582,14 +582,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
int idx = 0; int idx = 0;
Object[] item = new Object[6]; Object[] item = new Object[6];
while(idx < data.Length) while (idx < data.Length)
{ {
Array.Copy(data, idx, item, 0, 6); Array.Copy(data, idx, item, 0, 6);
ListenerInfo info = ListenerInfo info =
ListenerInfo.FromData(localID, itemID, hostID, item); ListenerInfo.FromData(localID, itemID, hostID, item);
if(!m_listeners.ContainsKey((int)item[2])) if (!m_listeners.ContainsKey((int)item[2]))
m_listeners.Add((int)item[2], new List<ListenerInfo>()); m_listeners.Add((int)item[2], new List<ListenerInfo>());
m_listeners[(int)item[2]].Add(info); m_listeners[(int)item[2]].Add(info);

View File

@ -160,9 +160,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
* *
* Generate a LLUUID channel key and add it and * Generate a LLUUID channel key and add it and
* the prim id to dictionary <channelUUID, primUUID> * the prim id to dictionary <channelUUID, primUUID>
* *
* A custom channel key can be proposed. * A custom channel key can be proposed.
* Otherwise, passing LLUUID.Zero will generate * Otherwise, passing LLUUID.Zero will generate
* and return a random channel * and return a random channel
* *
* First check if there is a channel assigned for * First check if there is a channel assigned for

View File

@ -37,37 +37,37 @@ using log4net;
using Nini.Config; using Nini.Config;
namespace OpenSim.Region.Environment namespace OpenSim.Region.Environment
{ {
/// <summary> /// <summary>
/// Method called when all the necessary assets for an archive request have been received. /// Method called when all the necessary assets for an archive request have been received.
/// </summary> /// </summary>
public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assets); public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assets);
/// <summary> /// <summary>
/// Handles an individual archive request /// Handles an individual archive request
/// </summary> /// </summary>
public class ArchiveRequest public class ArchiveRequest
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene; private Scene m_scene;
private string m_savePath; private string m_savePath;
private string m_serializedEntities; private string m_serializedEntities;
public ArchiveRequest(Scene scene, string savePath) public ArchiveRequest(Scene scene, string savePath)
{ {
m_scene = scene; m_scene = scene;
m_savePath = savePath; m_savePath = savePath;
ArchiveRegion(); ArchiveRegion();
} }
protected void ArchiveRegion() protected void ArchiveRegion()
{ {
m_log.Warn("[ARCHIVER]: Archive region not yet implemented"); m_log.Warn("[ARCHIVER]: Archive region not yet implemented");
Dictionary<LLUUID, int> textureUuids = new Dictionary<LLUUID, int>(); Dictionary<LLUUID, int> textureUuids = new Dictionary<LLUUID, int>();
List<EntityBase> entities = m_scene.GetEntities(); List<EntityBase> entities = m_scene.GetEntities();
@ -76,14 +76,14 @@ namespace OpenSim.Region.Environment
if (entity is SceneObjectGroup) if (entity is SceneObjectGroup)
{ {
SceneObjectGroup sceneObject = (SceneObjectGroup)entity; SceneObjectGroup sceneObject = (SceneObjectGroup)entity;
foreach (SceneObjectPart part in sceneObject.GetParts()) foreach (SceneObjectPart part in sceneObject.GetParts())
{ {
LLUUID texture = new LLUUID(part.Shape.TextureEntry, 0); LLUUID texture = new LLUUID(part.Shape.TextureEntry, 0);
textureUuids[texture] = 1; textureUuids[texture] = 1;
} }
} }
} }
m_serializedEntities = SerializeObjects(entities); m_serializedEntities = SerializeObjects(entities);
@ -91,30 +91,30 @@ namespace OpenSim.Region.Environment
{ {
m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count); m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count);
m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} textures", textureUuids.Count); m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} textures", textureUuids.Count);
// Asynchronously request all the assets required to perform this archive operation // Asynchronously request all the assets required to perform this archive operation
new AssetsRequest(ReceivedAllAssets, m_scene.AssetCache, textureUuids.Keys); new AssetsRequest(ReceivedAllAssets, m_scene.AssetCache, textureUuids.Keys);
} }
} }
protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assets) protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assets)
{ {
m_log.DebugFormat("[ARCHIVER]: Received all {0} textures required", assets.Count); m_log.DebugFormat("[ARCHIVER]: Received all {0} textures required", assets.Count);
// XXX: Shouldn't hijack the asset async callback thread like this - this is only temporary // XXX: Shouldn't hijack the asset async callback thread like this - this is only temporary
TarArchive archive = new TarArchive(); TarArchive archive = new TarArchive();
archive.AddFile("prims.xml", m_serializedEntities); archive.AddFile("prims.xml", m_serializedEntities);
foreach (LLUUID uuid in assets.Keys) foreach (LLUUID uuid in assets.Keys)
{ {
archive.AddFile(uuid.ToString() + ".jp2", assets[uuid].Data); archive.AddFile(uuid.ToString() + ".jp2", assets[uuid].Data);
} }
archive.WriteTar(m_savePath); archive.WriteTar(m_savePath);
} }
/// <summary> /// <summary>
/// Get an xml representation of the given scene objects. /// Get an xml representation of the given scene objects.
/// </summary> /// </summary>
@ -152,38 +152,38 @@ namespace OpenSim.Region.Environment
/// Callback used when all the assets requested have been received. /// Callback used when all the assets requested have been received.
/// </summary> /// </summary>
protected AssetsRequestCallback m_assetsRequestCallback; protected AssetsRequestCallback m_assetsRequestCallback;
/// <summary> /// <summary>
/// Assets retrieved in this request /// Assets retrieved in this request
/// </summary> /// </summary>
protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>();
/// <summary> /// <summary>
/// Record the number of asset replies required so we know when we've finished /// Record the number of asset replies required so we know when we've finished
/// </summary> /// </summary>
private int m_repliesRequired; private int m_repliesRequired;
/// <summary> /// <summary>
/// Asset cache used to request the assets /// Asset cache used to request the assets
/// </summary> /// </summary>
protected AssetCache m_assetCache; protected AssetCache m_assetCache;
protected internal AssetsRequest(AssetsRequestCallback assetsRequestCallback, AssetCache assetCache, ICollection<LLUUID> uuids) protected internal AssetsRequest(AssetsRequestCallback assetsRequestCallback, AssetCache assetCache, ICollection<LLUUID> uuids)
{ {
m_assetsRequestCallback = assetsRequestCallback; m_assetsRequestCallback = assetsRequestCallback;
m_assetCache = assetCache; m_assetCache = assetCache;
m_repliesRequired = uuids.Count; m_repliesRequired = uuids.Count;
// We can stop here if there are no assets to fetch // We can stop here if there are no assets to fetch
if (m_repliesRequired == 0) if (m_repliesRequired == 0)
m_assetsRequestCallback(m_assets); m_assetsRequestCallback(m_assets);
foreach (LLUUID uuid in uuids) foreach (LLUUID uuid in uuids)
{ {
m_assetCache.GetAsset(uuid, AssetRequestCallback, true); m_assetCache.GetAsset(uuid, AssetRequestCallback, true);
} }
} }
/// <summary> /// <summary>
/// Called back by the asset cache when it has the asset /// Called back by the asset cache when it has the asset
/// </summary> /// </summary>
@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment
public void AssetRequestCallback(LLUUID assetID, AssetBase asset) public void AssetRequestCallback(LLUUID assetID, AssetBase asset)
{ {
m_assets[assetID] = asset; m_assets[assetID] = asset;
if (m_assets.Count == m_repliesRequired) if (m_assets.Count == m_repliesRequired)
{ {
m_assetsRequestCallback(m_assets); m_assetsRequestCallback(m_assets);

View File

@ -34,16 +34,16 @@ using System.Reflection;
using log4net; using log4net;
namespace OpenSim.Region.Environment namespace OpenSim.Region.Environment
{ {
/// <summary> /// <summary>
/// Temporary code to produce a tar archive in tar v7 format /// Temporary code to produce a tar archive in tar v7 format
/// </summary> /// </summary>
public class TarArchive public class TarArchive
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<string, byte[]> m_files = new Dictionary<string, byte[]>(); protected Dictionary<string, byte[]> m_files = new Dictionary<string, byte[]>();
protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
/// <summary> /// <summary>
@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment
{ {
AddFile(filePath, m_asciiEncoding.GetBytes(data)); AddFile(filePath, m_asciiEncoding.GetBytes(data));
} }
/// <summary> /// <summary>
/// Add a file to the tar archive /// Add a file to the tar archive
/// </summary> /// </summary>
@ -65,117 +65,117 @@ namespace OpenSim.Region.Environment
{ {
m_files[filePath] = data; m_files[filePath] = data;
} }
/// <summary> /// <summary>
/// Write the raw tar archive data to a file /// Write the raw tar archive data to a file
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public void WriteTar(string archivePath) public void WriteTar(string archivePath)
{ {
BinaryWriter bw = new BinaryWriter(new FileStream(archivePath, FileMode.Create)); BinaryWriter bw = new BinaryWriter(new FileStream(archivePath, FileMode.Create));
foreach (string filePath in m_files.Keys) foreach (string filePath in m_files.Keys)
{ {
byte[] header = new byte[512]; byte[] header = new byte[512];
byte[] data = m_files[filePath]; byte[] data = m_files[filePath];
//string filePath = "test.txt"; //string filePath = "test.txt";
//byte[] data = m_asciiEncoding.GetBytes("hello\n"); //byte[] data = m_asciiEncoding.GetBytes("hello\n");
// file path field (100) // file path field (100)
byte[] nameBytes = m_asciiEncoding.GetBytes(filePath); byte[] nameBytes = m_asciiEncoding.GetBytes(filePath);
int nameSize = (nameBytes.Length >= 100) ? 100 : nameBytes.Length; int nameSize = (nameBytes.Length >= 100) ? 100 : nameBytes.Length;
Array.Copy(nameBytes, header, nameSize); Array.Copy(nameBytes, header, nameSize);
// file mode (8) // file mode (8)
byte[] modeBytes = m_asciiEncoding.GetBytes("0000644"); byte[] modeBytes = m_asciiEncoding.GetBytes("0000644");
Array.Copy(modeBytes, 0, header, 100, 7); Array.Copy(modeBytes, 0, header, 100, 7);
// owner user id (8) // owner user id (8)
byte[] ownerIdBytes = m_asciiEncoding.GetBytes("0000764"); byte[] ownerIdBytes = m_asciiEncoding.GetBytes("0000764");
Array.Copy(ownerIdBytes, 0, header, 108, 7); Array.Copy(ownerIdBytes, 0, header, 108, 7);
// group user id (8) // group user id (8)
byte[] groupIdBytes = m_asciiEncoding.GetBytes("0000764"); byte[] groupIdBytes = m_asciiEncoding.GetBytes("0000764");
Array.Copy(groupIdBytes, 0, header, 116, 7); Array.Copy(groupIdBytes, 0, header, 116, 7);
// file size in bytes (12) // file size in bytes (12)
int fileSize = data.Length; int fileSize = data.Length;
m_log.DebugFormat("[TAR ARCHIVE]: File size of {0} is {1}", filePath, fileSize); m_log.DebugFormat("[TAR ARCHIVE]: File size of {0} is {1}", filePath, fileSize);
byte[] fileSizeBytes = ConvertDecimalToPaddedOctalBytes(fileSize, 11); byte[] fileSizeBytes = ConvertDecimalToPaddedOctalBytes(fileSize, 11);
Array.Copy(fileSizeBytes, 0, header, 124, 11); Array.Copy(fileSizeBytes, 0, header, 124, 11);
// last modification time (12) // last modification time (12)
byte[] lastModTimeBytes = m_asciiEncoding.GetBytes("11017037332"); byte[] lastModTimeBytes = m_asciiEncoding.GetBytes("11017037332");
Array.Copy(lastModTimeBytes, 0, header, 136, 11); Array.Copy(lastModTimeBytes, 0, header, 136, 11);
// link indicator (1) // link indicator (1)
//header[156] = m_asciiEncoding.GetBytes("0")[0]; //header[156] = m_asciiEncoding.GetBytes("0")[0];
header[156] = 0; header[156] = 0;
Array.Copy(m_asciiEncoding.GetBytes("0000000"), 0, header, 329, 7); Array.Copy(m_asciiEncoding.GetBytes("0000000"), 0, header, 329, 7);
Array.Copy(m_asciiEncoding.GetBytes("0000000"), 0, header, 337, 7); Array.Copy(m_asciiEncoding.GetBytes("0000000"), 0, header, 337, 7);
// check sum for header block (8) [calculated last] // check sum for header block (8) [calculated last]
Array.Copy(m_asciiEncoding.GetBytes(" "), 0, header, 148, 8); Array.Copy(m_asciiEncoding.GetBytes(" "), 0, header, 148, 8);
int checksum = 0; int checksum = 0;
foreach (byte b in header) foreach (byte b in header)
{ {
checksum += b; checksum += b;
} }
m_log.DebugFormat("[TAR ARCHIVE]: Decimal header checksum is {0}", checksum); m_log.DebugFormat("[TAR ARCHIVE]: Decimal header checksum is {0}", checksum);
byte[] checkSumBytes = ConvertDecimalToPaddedOctalBytes(checksum, 6); byte[] checkSumBytes = ConvertDecimalToPaddedOctalBytes(checksum, 6);
//byte[] checkSumBytes = m_asciiEncoding.GetBytes("007520"); //byte[] checkSumBytes = m_asciiEncoding.GetBytes("007520");
Array.Copy(checkSumBytes, 0, header, 148, 6); Array.Copy(checkSumBytes, 0, header, 148, 6);
header[154] = 0; header[154] = 0;
// Write out header // Write out header
bw.Write(header); bw.Write(header);
// Write out data // Write out data
bw.Write(data); bw.Write(data);
int paddingRequired = 512 - (data.Length % 512); int paddingRequired = 512 - (data.Length % 512);
if (paddingRequired > 0) if (paddingRequired > 0)
{ {
m_log.DebugFormat("Padding data with {0} bytes", paddingRequired); m_log.DebugFormat("Padding data with {0} bytes", paddingRequired);
byte[] padding = new byte[paddingRequired]; byte[] padding = new byte[paddingRequired];
bw.Write(padding); bw.Write(padding);
} }
} }
// Write two consecutive 0 blocks to end the archive // Write two consecutive 0 blocks to end the archive
byte[] finalZeroPadding = new byte[1024]; byte[] finalZeroPadding = new byte[1024];
bw.Write(finalZeroPadding); bw.Write(finalZeroPadding);
bw.Close(); bw.Close();
} }
public static byte[] ConvertDecimalToPaddedOctalBytes(int d, int padding) public static byte[] ConvertDecimalToPaddedOctalBytes(int d, int padding)
{ {
string oString = ""; string oString = "";
while (d > 0) while (d > 0)
{ {
oString = Convert.ToString((byte)'0' + d & 7) + oString; oString = Convert.ToString((byte)'0' + d & 7) + oString;
d >>= 3; d >>= 3;
} }
while (oString.Length < padding) while (oString.Length < padding)
{ {
oString = "0" + oString; oString = "0" + oString;
} }
byte[] oBytes = m_asciiEncoding.GetBytes(oString); byte[] oBytes = m_asciiEncoding.GetBytes(oString);
return oBytes; return oBytes;
} }
} }

View File

@ -112,7 +112,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
double t = map[x, y]; double t = map[x, y];
int index = 0; int index = 0;
// The lookup table is pre-sorted, so we either find an exact match or // The lookup table is pre-sorted, so we either find an exact match or
// the next closest (smaller) match with a binary search // the next closest (smaller) match with a binary search
index = Array.BinarySearch<HeightmapLookupValue>(LookupHeightTable, new HeightmapLookupValue(0, t)); index = Array.BinarySearch<HeightmapLookupValue>(LookupHeightTable, new HeightmapLookupValue(0, t));
if (index < 0) if (index < 0)

View File

@ -196,7 +196,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
sceneObject.UpdateParentIDs(); sceneObject.UpdateParentIDs();
AddSceneObject(sceneObject); AddSceneObject(sceneObject);
} }
@ -215,14 +215,14 @@ namespace OpenSim.Region.Environment.Scenes
// QuadTree.AddSceneObject(sceneObject); // QuadTree.AddSceneObject(sceneObject);
Entities.Add(sceneObject.UUID, sceneObject); Entities.Add(sceneObject.UUID, sceneObject);
m_numPrim++; m_numPrim++;
return true; return true;
} }
return false; return false;
} }
} }
/// <summary> /// <summary>
/// Delete an object from the scene /// Delete an object from the scene
/// </summary> /// </summary>
@ -236,11 +236,11 @@ namespace OpenSim.Region.Environment.Scenes
{ {
Entities.Remove(uuid); Entities.Remove(uuid);
m_numPrim--; m_numPrim--;
return true; return true;
} }
} }
return false; return false;
} }
@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
m_activeScripts += number; m_activeScripts += number;
} }
protected internal void DetachObject(uint objectLocalID, IClientAPI remoteClient) protected internal void DetachObject(uint objectLocalID, IClientAPI remoteClient)
{ {
List<EntityBase> EntityList = GetEntities(); List<EntityBase> EntityList = GetEntities();
@ -340,9 +340,9 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId);
if (part != null) if (part != null)
part.Undo(); part.Undo();
} }
} }
protected internal void HandleObjectGroupUpdate( protected internal void HandleObjectGroupUpdate(
IClientAPI remoteClient, LLUUID GroupID, uint objectLocalID, LLUUID Garbage) IClientAPI remoteClient, LLUUID GroupID, uint objectLocalID, LLUUID Garbage)
{ {
@ -360,12 +360,11 @@ namespace OpenSim.Region.Environment.Scenes
group.SetGroup(GroupID, remoteClient); group.SetGroup(GroupID, remoteClient);
else else
remoteClient.SendAgentAlertMessage("You don't have permission to set the group", false); remoteClient.SendAgentAlertMessage("You don't have permission to set the group", false);
} }
} }
} }
} }
/// <summary> /// <summary>
/// Event Handling routine for Attach Object /// Event Handling routine for Attach Object
/// </summary> /// </summary>
@ -379,7 +378,7 @@ namespace OpenSim.Region.Environment.Scenes
AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero);
} }
protected internal void RezSingleAttachment( protected internal void RezSingleAttachment(
IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask)
{ {
@ -492,7 +491,7 @@ namespace OpenSim.Region.Environment.Scenes
newAvatar.IsChildAgent = child; newAvatar.IsChildAgent = child;
AddScenePresence(newAvatar); AddScenePresence(newAvatar);
return newAvatar; return newAvatar;
} }
@ -528,7 +527,7 @@ namespace OpenSim.Region.Environment.Scenes
ScenePresences[presence.UUID] = presence; ScenePresences[presence.UUID] = presence;
} }
} }
/// <summary> /// <summary>
/// Remove a presence from the scene /// Remove a presence from the scene
/// </summary> /// </summary>
@ -545,9 +544,9 @@ namespace OpenSim.Region.Environment.Scenes
m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene Entities list", agentID); m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene Entities list", agentID);
} }
} }
lock (ScenePresences) lock (ScenePresences)
{ {
if (ScenePresences.Remove(agentID)) if (ScenePresences.Remove(agentID))
{ {
//m_log.InfoFormat("[SCENE] Removed scene presence {0}", agentID); //m_log.InfoFormat("[SCENE] Removed scene presence {0}", agentID);
@ -556,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
} }
} }
} }
protected internal void SwapRootChildAgent(bool direction_RC_CR_T_F) protected internal void SwapRootChildAgent(bool direction_RC_CR_T_F)
@ -622,7 +621,7 @@ namespace OpenSim.Region.Environment.Scenes
m_scriptLPS = 0; m_scriptLPS = 0;
return returnval; return returnval;
} }
#endregion #endregion
#region Get Methods #region Get Methods
@ -863,7 +862,6 @@ namespace OpenSim.Region.Environment.Scenes
{ {
break; break;
} }
} }
grp.scriptScore = 0; grp.scriptScore = 0;
} }
@ -964,7 +962,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
} }
protected internal void UpdatePrimGroupScale(uint localID, LLVector3 scale, IClientAPI remoteClient) protected internal void UpdatePrimGroupScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
{ {
SceneObjectGroup group = GetGroupByPrim(localID); SceneObjectGroup group = GetGroupByPrim(localID);

View File

@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Scenes
public void AddUploadedInventoryItem(LLUUID agentID, InventoryItemBase item) public void AddUploadedInventoryItem(LLUUID agentID, InventoryItemBase item)
{ {
IMoneyModule money=RequestModuleInterface<IMoneyModule>(); IMoneyModule money=RequestModuleInterface<IMoneyModule>();
if(money != null) if (money != null)
{ {
money.ApplyUploadCharge(agentID); money.ApplyUploadCharge(agentID);
} }
@ -930,7 +930,7 @@ namespace OpenSim.Region.Environment.Scenes
if (part != null) if (part != null)
{ {
TaskInventoryItem currentItem=part.GetInventoryItem(itemID); TaskInventoryItem currentItem=part.GetInventoryItem(itemID);
if(currentItem == null) if (currentItem == null)
{ {
LLUUID copyID = LLUUID.Random(); LLUUID copyID = LLUUID.Random();
if (itemID != LLUUID.Zero) if (itemID != LLUUID.Zero)
@ -972,9 +972,9 @@ namespace OpenSim.Region.Environment.Scenes
} }
else // Updating existing item with new perms etc else // Updating existing item with new perms etc
{ {
TaskInventoryItem prevItem=part.GetInventoryItem(itemID); TaskInventoryItem prevItem=part.GetInventoryItem(itemID);
itemInfo.AssetID = prevItem.AssetID; itemInfo.AssetID = prevItem.AssetID;
if(part.UpdateInventoryItem(itemInfo)) if (part.UpdateInventoryItem(itemInfo))
part.GetProperties(remoteClient); part.GetProperties(remoteClient);
} }
} }

View File

@ -63,9 +63,9 @@ namespace OpenSim.Region.Environment.Scenes
if (broadcast) if (broadcast)
EventManager.TriggerOnChatBroadcast(this, args); EventManager.TriggerOnChatBroadcast(this, args);
else else
EventManager.TriggerOnChatFromWorld(this, args); EventManager.TriggerOnChatFromWorld(this, args);
} }
/// <summary> /// <summary>
/// ///
@ -293,7 +293,7 @@ namespace OpenSim.Region.Environment.Scenes
LLUUID itemID) LLUUID itemID)
{ {
SceneObjectPart part=GetSceneObjectPart(objectID); SceneObjectPart part=GetSceneObjectPart(objectID);
if(part == null) if (part == null)
return; return;
EventManager.TriggerScriptReset(part.LocalId, itemID); EventManager.TriggerScriptReset(part.LocalId, itemID);
} }

View File

@ -199,9 +199,9 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary> /// <summary>
/// The dictionary of all entities in this scene. The contents of this dictionary may be changed at any time. /// The dictionary of all entities in this scene. The contents of this dictionary may be changed at any time.
/// If you wish to add or remove entities, please use the appropriate method for that entity rather than /// If you wish to add or remove entities, please use the appropriate method for that entity rather than
/// editing this dictionary directly. /// editing this dictionary directly.
/// ///
/// If you want a list of entities where the list itself is guaranteed not to change, please use /// If you want a list of entities where the list itself is guaranteed not to change, please use
/// GetEntities() /// GetEntities()
/// </summary> /// </summary>
public Dictionary<LLUUID, EntityBase> Entities public Dictionary<LLUUID, EntityBase> Entities
@ -565,19 +565,19 @@ namespace OpenSim.Region.Environment.Scenes
m_scripts_enabled = !ScriptEngine; m_scripts_enabled = !ScriptEngine;
m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine");
} }
if (m_physics_enabled != !PhysicsEngine) if (m_physics_enabled != !PhysicsEngine)
{ {
m_physics_enabled = !PhysicsEngine; m_physics_enabled = !PhysicsEngine;
} }
} }
public int GetInaccurateNeighborCount() public int GetInaccurateNeighborCount()
{ {
lock (m_neighbours) lock (m_neighbours)
return m_neighbours.Count; return m_neighbours.Count;
} }
// This is the method that shuts down the scene. // This is the method that shuts down the scene.
public override void Close() public override void Close()
{ {

View File

@ -2100,26 +2100,26 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="pos"></param> /// <param name="pos"></param>
public void UpdateOffSet(LLVector3 pos) public void UpdateOffSet(LLVector3 pos)
{ {
if ((pos.X != OffsetPosition.X) || if ((pos.X != OffsetPosition.X) ||
(pos.Y != OffsetPosition.Y) || (pos.Y != OffsetPosition.Y) ||
(pos.Z != OffsetPosition.Z)) (pos.Z != OffsetPosition.Z))
{ {
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
OffsetPosition = newPos; OffsetPosition = newPos;
ScheduleTerseUpdate(); ScheduleTerseUpdate();
} }
} }
public void UpdateGroupPosition(LLVector3 pos) public void UpdateGroupPosition(LLVector3 pos)
{ {
if ((pos.X != GroupPosition.X) || if ((pos.X != GroupPosition.X) ||
(pos.Y != GroupPosition.Y) || (pos.Y != GroupPosition.Y) ||
(pos.Z != GroupPosition.Z)) (pos.Z != GroupPosition.Z))
{ {
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
GroupPosition = newPos; GroupPosition = newPos;
ScheduleTerseUpdate(); ScheduleTerseUpdate();
} }
} }
#endregion #endregion
@ -2128,15 +2128,15 @@ namespace OpenSim.Region.Environment.Scenes
public void UpdateRotation(LLQuaternion rot) public void UpdateRotation(LLQuaternion rot)
{ {
if ((rot.X != RotationOffset.X) || if ((rot.X != RotationOffset.X) ||
(rot.Y != RotationOffset.Y) || (rot.Y != RotationOffset.Y) ||
(rot.Z != RotationOffset.Z) || (rot.Z != RotationOffset.Z) ||
(rot.W != RotationOffset.W)) (rot.W != RotationOffset.W))
{ {
//StoreUndoState(); //StoreUndoState();
RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W);
ScheduleTerseUpdate(); ScheduleTerseUpdate();
} }
} }
#endregion #endregion

View File

@ -1407,9 +1407,9 @@ namespace OpenSim.Region.Environment.Scenes
if (remoteAvatar == null) if (remoteAvatar == null)
return; return;
IClientAPI cl=remoteAvatar.ControllingClient; IClientAPI cl=remoteAvatar.ControllingClient;
if(cl == null) if (cl == null)
return; return;
if(m_appearance.Texture == null) if (m_appearance.Texture == null)
return; return;
remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid,

View File

@ -157,7 +157,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
{ {
IClientAPI clientView = (IClientAPI)sender; IClientAPI clientView = (IClientAPI)sender;
ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId); ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId);
if(avatar == null) { if (avatar == null) {
m_log.Info("Avatar is child agent, ignoring AvatarIsWearing event"); m_log.Info("Avatar is child agent, ignoring AvatarIsWearing event");
return; return;
} }
@ -165,7 +165,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId);
AvatarAppearance avatAppearance = null; AvatarAppearance avatAppearance = null;
if(!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) { if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) {
m_log.Info("We didn't seem to find the appearance, falling back to ScenePresense"); m_log.Info("We didn't seem to find the appearance, falling back to ScenePresense");
avatAppearance = avatar.Appearance; avatAppearance = avatar.Appearance;
} }

View File

@ -5480,7 +5480,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
World.SimChatBroadcast(Helpers.StringToField(msg), World.SimChatBroadcast(Helpers.StringToField(msg),
ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, ChatTypeEnum.Owner, 0, m_host.AbsolutePosition,
m_host.Name, m_host.UUID, false); m_host.Name, m_host.UUID, false);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();

View File

@ -304,7 +304,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{ {
int colon=t.IndexOf(":"); int colon=t.IndexOf(":");
if(-1 != colon) if (-1 != colon)
{ {
line = " at line " + Convert.ToInt32(t.Substring(colon + 1)).ToString(); line = " at line " + Convert.ToInt32(t.Substring(colon + 1)).ToString();
break; break;

View File

@ -78,7 +78,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Xantor 20080525: I need assetID here to see if we already compiled this one previously // Xantor 20080525: I need assetID here to see if we already compiled this one previously
LLUUID assetID = LLUUID.Zero; LLUUID assetID = LLUUID.Zero;
TaskInventoryItem taskInventoryItem = new TaskInventoryItem(); TaskInventoryItem taskInventoryItem = new TaskInventoryItem();
if(m_host.TaskInventory.TryGetValue(itemID,out taskInventoryItem)) if (m_host.TaskInventory.TryGetValue(itemID,out taskInventoryItem))
assetID = taskInventoryItem.AssetID; assetID = taskInventoryItem.AssetID;
@ -140,7 +140,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
string text = "Error compiling script:\r\n" + e.Message.ToString(); string text = "Error compiling script:\r\n" + e.Message.ToString();
if (text.Length > 1500) if (text.Length > 1500)
text = text.Substring(0, 1500); text = text.Substring(0, 1500);
World.SimChat(Helpers.StringToField(text), ChatTypeEnum.DebugChannel, 2147483647, World.SimChat(Helpers.StringToField(text), ChatTypeEnum.DebugChannel, 2147483647,
m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
} }
catch (Exception e2) // LEGIT: User Scripting catch (Exception e2) // LEGIT: User Scripting