Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
910a5c842a | ||
|
|
2a2f4f6fda | ||
|
|
6b867773a8 | ||
|
|
80ec2ac167 | ||
|
|
df960d5767 | ||
|
|
c0760f9f91 | ||
|
|
c906128191 | ||
|
|
f574d3c8fc | ||
|
|
ebe5e1731d | ||
|
|
2ebb421331 | ||
|
|
a9e8bd59a3 | ||
|
|
4589ce61bc | ||
|
|
33e66107be | ||
|
|
db90dea9bd | ||
|
|
04544b4510 | ||
|
|
0b17a66e68 | ||
|
|
04986bbb15 | ||
|
|
b0d02adeee | ||
|
|
48b962c401 | ||
|
|
04a195266b | ||
|
|
21393af631 | ||
|
|
189c67db95 | ||
|
|
b92b9228ef | ||
|
|
f49897a419 | ||
|
|
aab30f5e67 | ||
|
|
e7fd732209 |
@@ -235,4 +235,11 @@ CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
|
||||
regionName
|
||||
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
|
||||
COMMIT
|
||||
COMMIT
|
||||
|
||||
:VERSION 9
|
||||
|
||||
BEGIN TRANSACTION
|
||||
ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
|
||||
|
||||
COMMIT
|
||||
|
||||
@@ -472,3 +472,73 @@ COMMIT;
|
||||
BEGIN;
|
||||
ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 23
|
||||
BEGIN;
|
||||
CREATE TABLE regionwindlight (
|
||||
region_id VARCHAR(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
|
||||
water_color_r FLOAT NOT NULL DEFAULT '4.000000',
|
||||
water_color_g FLOAT NOT NULL DEFAULT '38.000000',
|
||||
water_color_b FLOAT NOT NULL DEFAULT '64.000000',
|
||||
water_color_i FLOAT NOT NULL DEFAULT '1.000000',
|
||||
water_fog_density_exponent FLOAT NOT NULL DEFAULT '4.0',
|
||||
underwater_fog_modifier FLOAT NOT NULL DEFAULT '0.25',
|
||||
reflection_wavelet_scale_1 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_2 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_3 FLOAT NOT NULL DEFAULT '2.0',
|
||||
fresnel_scale FLOAT NOT NULL DEFAULT '0.40',
|
||||
fresnel_offset FLOAT NOT NULL DEFAULT '0.50',
|
||||
refract_scale_above FLOAT NOT NULL DEFAULT '0.03',
|
||||
refract_scale_below FLOAT NOT NULL DEFAULT '0.20',
|
||||
blur_multiplier FLOAT NOT NULL DEFAULT '0.040',
|
||||
big_wave_direction_x FLOAT NOT NULL DEFAULT '1.05',
|
||||
big_wave_direction_y FLOAT NOT NULL DEFAULT '-0.42',
|
||||
little_wave_direction_x FLOAT NOT NULL DEFAULT '1.11',
|
||||
little_wave_direction_y FLOAT NOT NULL DEFAULT '-1.16',
|
||||
normal_map_texture VARCHAR(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
|
||||
horizon_r FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_g FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_b FLOAT NOT NULL DEFAULT '0.32',
|
||||
horizon_i FLOAT NOT NULL DEFAULT '0.32',
|
||||
haze_horizon FLOAT NOT NULL DEFAULT '0.19',
|
||||
blue_density_r FLOAT NOT NULL DEFAULT '0.12',
|
||||
blue_density_g FLOAT NOT NULL DEFAULT '0.22',
|
||||
blue_density_b FLOAT NOT NULL DEFAULT '0.38',
|
||||
blue_density_i FLOAT NOT NULL DEFAULT '0.38',
|
||||
haze_density FLOAT NOT NULL DEFAULT '0.70',
|
||||
density_multiplier FLOAT NOT NULL DEFAULT '0.18',
|
||||
distance_multiplier FLOAT NOT NULL DEFAULT '0.8',
|
||||
max_altitude INTEGER NOT NULL DEFAULT '1605',
|
||||
sun_moon_color_r FLOAT NOT NULL DEFAULT '0.24',
|
||||
sun_moon_color_g FLOAT NOT NULL DEFAULT '0.26',
|
||||
sun_moon_color_b FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_color_i FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_position FLOAT NOT NULL DEFAULT '0.317',
|
||||
ambient_r FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_g FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_b FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_i FLOAT NOT NULL DEFAULT '0.35',
|
||||
east_angle FLOAT NOT NULL DEFAULT '0.00',
|
||||
sun_glow_focus FLOAT NOT NULL DEFAULT '0.10',
|
||||
sun_glow_size FLOAT NOT NULL DEFAULT '1.75',
|
||||
scene_gamma FLOAT NOT NULL DEFAULT '1.00',
|
||||
star_brightness FLOAT NOT NULL DEFAULT '0.00',
|
||||
cloud_color_r FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_g FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_b FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_i FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_density FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_coverage FLOAT NOT NULL DEFAULT '0.27',
|
||||
cloud_scale FLOAT NOT NULL DEFAULT '0.42',
|
||||
cloud_detail_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_detail_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_detail_density FLOAT NOT NULL DEFAULT '0.12',
|
||||
cloud_scroll_x FLOAT NOT NULL DEFAULT '0.20',
|
||||
cloud_scroll_x_lock INTEGER NOT NULL DEFAULT '0',
|
||||
cloud_scroll_y FLOAT NOT NULL DEFAULT '0.01',
|
||||
cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
|
||||
draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
|
||||
|
||||
COMMIT;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="nodeToFill"></param>
|
||||
/// <param name="processors">/param>
|
||||
/// <param name="xtr"></param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
|
||||
{
|
||||
ExecuteReadProcessors(
|
||||
return ExecuteReadProcessors(
|
||||
nodeToFill,
|
||||
processors,
|
||||
xtr,
|
||||
(o, name, e)
|
||||
=> m_log.ErrorFormat(
|
||||
=> m_log.DebugFormat(
|
||||
"[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
|
||||
name, e.Message, e.StackTrace));
|
||||
}
|
||||
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="parseExceptionAction">
|
||||
/// Action to take if there is a parsing problem. This will usually just be to log the exception
|
||||
/// </param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill,
|
||||
Dictionary<string, Action<NodeType, XmlTextReader>> processors,
|
||||
XmlTextReader xtr,
|
||||
Action<NodeType, string, Exception> parseExceptionAction)
|
||||
{
|
||||
bool errors = false;
|
||||
|
||||
string nodeName = string.Empty;
|
||||
while (xtr.NodeType != XmlNodeType.EndElement)
|
||||
{
|
||||
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errors = true;
|
||||
parseExceptionAction(nodeToFill, nodeName, e);
|
||||
|
||||
if (xtr.NodeType == XmlNodeType.EndElement)
|
||||
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
|
||||
xtr.ReadOuterXml(); // ignore
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
UUID.TryParse(node.InnerText, out uuid);
|
||||
creator = userService.GetUserAccount(scopeID, uuid);
|
||||
}
|
||||
|
||||
if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
|
||||
hasCreatorData = true;
|
||||
|
||||
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
|
||||
doc.Save(wr);
|
||||
return wr.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -903,47 +903,64 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private void HandleUseCircuitCode(object o)
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
IPEndPoint remoteEndPoint = null;
|
||||
IClientAPI client = null;
|
||||
|
||||
try
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
|
||||
|
||||
remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
{
|
||||
// Begin the process of adding the client to the simulator
|
||||
client
|
||||
= AddClient(
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
sessionInfo);
|
||||
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
client.SceneAgent.SendInitialDataToMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
|
||||
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
|
||||
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
|
||||
|
||||
IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
{
|
||||
// Begin the process of adding the client to the simulator
|
||||
IClientAPI client
|
||||
= AddClient(
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
sessionInfo);
|
||||
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
client.SceneAgent.SendInitialDataToMe();
|
||||
}
|
||||
else
|
||||
catch (Exception e)
|
||||
{
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
|
||||
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
m_log.ErrorFormat(
|
||||
"[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
|
||||
remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
|
||||
client != null ? client.Name : "unknown",
|
||||
client != null ? client.AgentId.ToString() : "unknown",
|
||||
e.Message,
|
||||
e.StackTrace);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
|
||||
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -111,6 +111,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
|
||||
#region IAvatarFactoryModule
|
||||
|
||||
/// </summary>
|
||||
/// <param name="sp"></param>
|
||||
/// <param name="texture"></param>
|
||||
/// <param name="visualParam"></param>
|
||||
public void SetAppearance(IScenePresence sp, AvatarAppearance appearance)
|
||||
{
|
||||
SetAppearance(sp, appearance.Texture, appearance.VisualParams);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set appearance data (texture asset IDs and slider settings)
|
||||
/// </summary>
|
||||
@@ -156,14 +165,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
|
||||
|
||||
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
|
||||
if (!ValidateBakedTextureCache(sp))
|
||||
|
||||
// If bake textures are missing and this is not an NPC, request a rebake from client
|
||||
if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc))
|
||||
RequestRebake(sp, true);
|
||||
|
||||
// This appears to be set only in the final stage of the appearance
|
||||
// update transaction. In theory, we should be able to do an immediate
|
||||
// appearance send and save here.
|
||||
}
|
||||
|
||||
|
||||
// NPC should send to clients immediately and skip saving appearance
|
||||
if (((ScenePresence)sp).PresenceType == PresenceType.Npc)
|
||||
{
|
||||
SendAppearance((ScenePresence)sp);
|
||||
return;
|
||||
}
|
||||
|
||||
// save only if there were changes, send no matter what (doesn't hurt to send twice)
|
||||
if (changed)
|
||||
QueueAppearanceSave(sp.ControllingClient.AgentId);
|
||||
@@ -174,6 +192,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
|
||||
}
|
||||
|
||||
private void SendAppearance(ScenePresence sp)
|
||||
{
|
||||
// Send the appearance to everyone in the scene
|
||||
sp.SendAppearanceToAllOtherAgents();
|
||||
|
||||
// Send animations back to the avatar as well
|
||||
sp.Animator.SendAnimPack();
|
||||
}
|
||||
|
||||
public bool SendAppearance(UUID agentId)
|
||||
{
|
||||
// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
|
||||
@@ -185,12 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send the appearance to everyone in the scene
|
||||
sp.SendAppearanceToAllOtherAgents();
|
||||
|
||||
// Send animations back to the avatar as well
|
||||
sp.Animator.SendAnimPack();
|
||||
|
||||
SendAppearance(sp);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -626,4 +648,4 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public InventoryArchiveWriteRequest(
|
||||
Guid id, InventoryArchiverModule module, Scene scene,
|
||||
Guid id, InventoryArchiverModule module, Scene scene,
|
||||
UserAccount userInfo, string invPath, string savePath)
|
||||
: this(
|
||||
id,
|
||||
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public InventoryArchiveWriteRequest(
|
||||
Guid id, InventoryArchiverModule module, Scene scene,
|
||||
Guid id, InventoryArchiverModule module, Scene scene,
|
||||
UserAccount userInfo, string invPath, Stream saveStream)
|
||||
{
|
||||
m_id = id;
|
||||
@@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
Exception reportedException = null;
|
||||
bool succeeded = true;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
m_archiveWriter.Close();
|
||||
@@ -144,8 +144,28 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException);
|
||||
}
|
||||
|
||||
protected void SaveInvItem(InventoryItemBase inventoryItem, string path, Dictionary<string, object> options, IUserAccountService userAccountService)
|
||||
protected void SaveInvItem(
|
||||
InventoryItemBase inventoryItem, string path, Dictionary<string, object> options,
|
||||
IUserAccountService userAccountService, string folderPath)
|
||||
{
|
||||
if (options.ContainsKey("exclude"))
|
||||
{
|
||||
//Full details of current item is folder path plus item name.
|
||||
folderPath = CreateFolderPath(folderPath, inventoryItem.Name);
|
||||
|
||||
if (((List<String>)options["exclude"]).Contains(folderPath) ||
|
||||
((List<String>)options["exclude"]).Contains(inventoryItem.ID.ToString()))
|
||||
{
|
||||
if (options.ContainsKey("verbose"))
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY ARCHIVER]: Skipping inventory item {0} {1} at {2}",
|
||||
inventoryItem.Name, inventoryItem.ID, path);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.ContainsKey("verbose"))
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY ARCHIVER]: Saving item {0} {1} with asset {2}",
|
||||
@@ -174,13 +194,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// <param name="saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="userAccountService"></param>
|
||||
/// <param name="folderPath">Path to previous (parent) folder</param>
|
||||
protected void SaveInvFolder(
|
||||
InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself,
|
||||
Dictionary<string, object> options, IUserAccountService userAccountService)
|
||||
InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself,
|
||||
Dictionary<string, object> options, IUserAccountService userAccountService, string folderPath)
|
||||
{
|
||||
//Current folder path is previous folder path plus current folder.
|
||||
folderPath = CreateFolderPath(folderPath, inventoryFolder.Name);
|
||||
|
||||
if (options.ContainsKey("excludefolders"))
|
||||
{
|
||||
if (((List<String>)options["excludefolders"]).Contains(folderPath) ||
|
||||
((List<String>)options["excludefolders"]).Contains(inventoryFolder.ID.ToString()))
|
||||
{
|
||||
if (options.ContainsKey("verbose"))
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY ARCHIVER]: Skipping folder {0} at {1}",
|
||||
inventoryFolder.Name, path);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.ContainsKey("verbose"))
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving folder {0}", inventoryFolder.Name);
|
||||
|
||||
|
||||
if (saveThisFolderItself)
|
||||
{
|
||||
path += CreateArchiveFolderName(inventoryFolder);
|
||||
@@ -189,17 +228,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_archiveWriter.WriteDir(path);
|
||||
}
|
||||
|
||||
InventoryCollection contents
|
||||
InventoryCollection contents
|
||||
= m_scene.InventoryService.GetFolderContent(inventoryFolder.Owner, inventoryFolder.ID);
|
||||
|
||||
foreach (InventoryFolderBase childFolder in contents.Folders)
|
||||
{
|
||||
SaveInvFolder(childFolder, path, true, options, userAccountService);
|
||||
SaveInvFolder(childFolder, path, true, options, userAccountService, folderPath);
|
||||
}
|
||||
|
||||
foreach (InventoryItemBase item in contents.Items)
|
||||
{
|
||||
SaveInvItem(item, path, options, userAccountService);
|
||||
SaveInvItem(item, path, options, userAccountService, folderPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,16 +255,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
InventoryFolderBase inventoryFolder = null;
|
||||
InventoryItemBase inventoryItem = null;
|
||||
InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID);
|
||||
|
||||
|
||||
bool saveFolderContentsOnly = false;
|
||||
|
||||
|
||||
// Eliminate double slashes and any leading / on the path.
|
||||
string[] components
|
||||
= m_invPath.Split(
|
||||
new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
|
||||
int maxComponentIndex = components.Length - 1;
|
||||
|
||||
|
||||
// If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the
|
||||
// folder itself. This may get more sophisicated later on
|
||||
if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD)
|
||||
@@ -233,13 +272,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
saveFolderContentsOnly = true;
|
||||
maxComponentIndex--;
|
||||
}
|
||||
|
||||
|
||||
m_invPath = String.Empty;
|
||||
for (int i = 0; i <= maxComponentIndex; i++)
|
||||
{
|
||||
m_invPath += components[i] + InventoryFolderImpl.PATH_DELIMITER;
|
||||
}
|
||||
|
||||
|
||||
// Annoyingly Split actually returns the original string if the input string consists only of delimiters
|
||||
// Therefore if we still start with a / after the split, then we need the root folder
|
||||
if (m_invPath.Length == 0)
|
||||
@@ -249,25 +288,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
else
|
||||
{
|
||||
m_invPath = m_invPath.Remove(m_invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER));
|
||||
List<InventoryFolderBase> candidateFolders
|
||||
List<InventoryFolderBase> candidateFolders
|
||||
= InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, rootFolder, m_invPath);
|
||||
if (candidateFolders.Count > 0)
|
||||
inventoryFolder = candidateFolders[0];
|
||||
}
|
||||
|
||||
|
||||
// The path may point to an item instead
|
||||
if (inventoryFolder == null)
|
||||
inventoryItem = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, rootFolder, m_invPath);
|
||||
|
||||
|
||||
if (null == inventoryFolder && null == inventoryItem)
|
||||
{
|
||||
// We couldn't find the path indicated
|
||||
// We couldn't find the path indicated
|
||||
string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath);
|
||||
Exception e = new InventoryArchiverException(errorMessage);
|
||||
m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
m_archiveWriter = new TarArchiveWriter(m_saveStream);
|
||||
|
||||
// Write out control file. This has to be done first so that subsequent loaders will see this file first
|
||||
@@ -275,27 +314,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
// not sure how to fix this though, short of going with a completely different file format.
|
||||
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options));
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
|
||||
|
||||
|
||||
if (inventoryFolder != null)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}",
|
||||
inventoryFolder.Name,
|
||||
inventoryFolder.ID,
|
||||
inventoryFolder.Name,
|
||||
inventoryFolder.ID,
|
||||
m_invPath == String.Empty ? InventoryFolderImpl.PATH_DELIMITER : m_invPath);
|
||||
|
||||
|
||||
//recurse through all dirs getting dirs and files
|
||||
SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !saveFolderContentsOnly, options, userAccountService);
|
||||
SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !saveFolderContentsOnly, options, userAccountService, String.Empty);
|
||||
}
|
||||
else if (inventoryItem != null)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[INVENTORY ARCHIVER]: Found item {0} {1} at {2}",
|
||||
inventoryItem.Name, inventoryItem.ID, m_invPath);
|
||||
|
||||
SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH, options, userAccountService);
|
||||
|
||||
SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH, options, userAccountService, m_invPath);
|
||||
}
|
||||
|
||||
|
||||
// Don't put all this profile information into the archive right now.
|
||||
//SaveUsers();
|
||||
|
||||
@@ -354,7 +393,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
///
|
||||
/// These names are prepended with an inventory folder's UUID so that more than one folder can have the
|
||||
/// same name
|
||||
///
|
||||
///
|
||||
/// <param name="folder"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateArchiveFolderName(InventoryFolderBase folder)
|
||||
@@ -368,7 +407,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
///
|
||||
/// These names are prepended with an inventory item's UUID so that more than one item can have the
|
||||
/// same name
|
||||
///
|
||||
///
|
||||
/// <param name="item"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateArchiveItemName(InventoryItemBase item)
|
||||
@@ -406,6 +445,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create the path to the inventory folder about to be processed
|
||||
/// </summary>
|
||||
/// <param name="folderPath"></param>
|
||||
/// <param name="subFolder"></param>
|
||||
/// <returns></returns>
|
||||
public string CreateFolderPath(string folderPath, string subFolder)
|
||||
{
|
||||
if (folderPath != "")
|
||||
folderPath += "/";
|
||||
|
||||
return folderPath + subFolder;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create the control file for the archive
|
||||
/// </summary>
|
||||
@@ -414,7 +467,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
public string CreateControlFile(Dictionary<string, object> options)
|
||||
{
|
||||
int majorVersion, minorVersion;
|
||||
|
||||
|
||||
if (options.ContainsKey("home"))
|
||||
{
|
||||
majorVersion = 1;
|
||||
@@ -424,10 +477,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
majorVersion = 0;
|
||||
minorVersion = 3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);
|
||||
|
||||
|
||||
StringWriter sw = new StringWriter();
|
||||
XmlTextWriter xtw = new XmlTextWriter(sw);
|
||||
xtw.Formatting = Formatting.Indented;
|
||||
@@ -449,4 +502,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,18 +47,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
|
||||
public string Name { get { return "Inventory Archiver Module"; } }
|
||||
|
||||
|
||||
public bool IsSharedModule { get { return true; } }
|
||||
|
||||
/// <value>
|
||||
/// Enable or disable checking whether the iar user is actually logged in
|
||||
/// Enable or disable checking whether the iar user is actually logged in
|
||||
/// </value>
|
||||
// public bool DisablePresenceChecks { get; set; }
|
||||
|
||||
|
||||
public event InventoryArchiveSaved OnInventoryArchiveSaved;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The file to load and save inventory if no filename has been specified
|
||||
/// </summary>
|
||||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// Pending save completions initiated from the console
|
||||
/// </value>
|
||||
protected List<Guid> m_pendingConsoleSaves = new List<Guid>();
|
||||
|
||||
|
||||
/// <value>
|
||||
/// All scenes that this module knows about
|
||||
/// </value>
|
||||
@@ -106,7 +106,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
scene.RegisterModuleInterface<IInventoryArchiverModule>(this);
|
||||
OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted;
|
||||
|
||||
|
||||
scene.AddCommand(
|
||||
this, "load iar",
|
||||
"load iar [-m|--merge] <first> <last> <inventory path> <password> [<IAR path>]",
|
||||
@@ -119,44 +119,46 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
+ "<IAR path> is the filesystem path or URI from which to load the IAR."
|
||||
+ string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME),
|
||||
HandleLoadInvConsoleCommand);
|
||||
|
||||
|
||||
scene.AddCommand(
|
||||
this, "save iar",
|
||||
"save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-v|--verbose]",
|
||||
"Save user inventory archive (IAR).",
|
||||
"save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-e|--exclude=<name/uuid>] [-f|--excludefolder=<foldername/uuid>] [-v|--verbose]",
|
||||
"Save user inventory archive (IAR).",
|
||||
"<first> is the user's first name." + Environment.NewLine
|
||||
+ "<last> is the user's last name." + Environment.NewLine
|
||||
+ "<inventory path> is the path inside the user's inventory for the folder/item to be saved." + Environment.NewLine
|
||||
+ "-h|--home=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
|
||||
+ "-c|--creators preserves information about foreign creators." + Environment.NewLine
|
||||
+ "-e|--exclude=<name/uuid> don't save the inventory item in archive" + Environment.NewLine
|
||||
+ "-f|--excludefolder=<folder/uuid> don't save contents of the folder in archive" + Environment.NewLine
|
||||
+ "-v|--verbose extra debug messages." + Environment.NewLine
|
||||
+ "--noassets stops assets being saved to the IAR."
|
||||
+ "--noassets stops assets being saved to the IAR." + Environment.NewLine
|
||||
+ "<IAR path> is the filesystem path at which to save the IAR."
|
||||
+ string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME),
|
||||
HandleSaveInvConsoleCommand);
|
||||
|
||||
m_aScene = scene;
|
||||
}
|
||||
|
||||
|
||||
m_scenes[scene.RegionInfo.RegionID] = scene;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
|
||||
public void Close() {}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Trigger the inventory archive saved event.
|
||||
/// </summary>
|
||||
protected internal void TriggerInventoryArchiveSaved(
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
Exception reportedException)
|
||||
{
|
||||
InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved;
|
||||
if (handlerInventoryArchiveSaved != null)
|
||||
handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException);
|
||||
}
|
||||
|
||||
|
||||
public bool ArchiveInventory(
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream)
|
||||
{
|
||||
@@ -164,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
}
|
||||
|
||||
public bool ArchiveInventory(
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream,
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream,
|
||||
Dictionary<string, object> options)
|
||||
{
|
||||
if (m_scenes.Count > 0)
|
||||
@@ -188,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
// }
|
||||
// else
|
||||
@@ -202,15 +204,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public bool ArchiveInventory(
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, string savePath,
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, string savePath,
|
||||
Dictionary<string, object> options)
|
||||
{
|
||||
if (m_scenes.Count > 0)
|
||||
{
|
||||
UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
|
||||
|
||||
|
||||
if (userInfo != null)
|
||||
{
|
||||
// if (CheckPresence(userInfo.PrincipalID))
|
||||
@@ -228,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
// }
|
||||
// else
|
||||
@@ -239,7 +241,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -247,9 +249,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
return DearchiveInventory(firstName, lastName, invPath, pass, loadStream, new Dictionary<string, object>());
|
||||
}
|
||||
|
||||
|
||||
public bool DearchiveInventory(
|
||||
string firstName, string lastName, string invPath, string pass, Stream loadStream,
|
||||
string firstName, string lastName, string invPath, string pass, Stream loadStream,
|
||||
Dictionary<string, object> options)
|
||||
{
|
||||
if (m_scenes.Count > 0)
|
||||
@@ -295,22 +297,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public bool DearchiveInventory(
|
||||
string firstName, string lastName, string invPath, string pass, string loadPath,
|
||||
string firstName, string lastName, string invPath, string pass, string loadPath,
|
||||
Dictionary<string, object> options)
|
||||
{
|
||||
if (m_scenes.Count > 0)
|
||||
{
|
||||
UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
|
||||
|
||||
|
||||
if (userInfo != null)
|
||||
{
|
||||
// if (CheckPresence(userInfo.PrincipalID))
|
||||
// {
|
||||
InventoryArchiveReadRequest request;
|
||||
bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath, merge);
|
||||
@@ -324,7 +326,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
UpdateClientWithLoadedNodes(userInfo, request.Execute());
|
||||
|
||||
return true;
|
||||
@@ -340,7 +342,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Load inventory from an inventory file archive
|
||||
/// </summary>
|
||||
@@ -350,29 +352,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
try
|
||||
{
|
||||
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
|
||||
|
||||
|
||||
Dictionary<string, object> options = new Dictionary<string, object>();
|
||||
OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; });
|
||||
|
||||
|
||||
List<string> mainParams = optionSet.Parse(cmdparams);
|
||||
|
||||
|
||||
if (mainParams.Count < 6)
|
||||
{
|
||||
m_log.Error(
|
||||
"[INVENTORY ARCHIVER]: usage is load iar [-m|--merge] <first name> <last name> <inventory path> <user password> [<load file path>]");
|
||||
"[INVENTORY ARCHIVER]: usage is load iar [-m|--merge] <first name> <last name> <inventory path> <user password> [<load file path>]");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
string firstName = mainParams[2];
|
||||
string lastName = mainParams[3];
|
||||
string invPath = mainParams[4];
|
||||
string pass = mainParams[5];
|
||||
string loadPath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME);
|
||||
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}",
|
||||
loadPath, invPath, firstName, lastName);
|
||||
|
||||
|
||||
if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options))
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}",
|
||||
@@ -383,7 +385,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Save inventory to a file archive
|
||||
/// </summary>
|
||||
@@ -400,6 +402,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
ops.Add("v|verbose", delegate(string v) { options["verbose"] = v; });
|
||||
ops.Add("c|creators", delegate(string v) { options["creators"] = v; });
|
||||
ops.Add("noassets", delegate(string v) { options["noassets"] = v != null; });
|
||||
ops.Add("e|exclude=", delegate(string v)
|
||||
{
|
||||
if (!options.ContainsKey("exclude"))
|
||||
options["exclude"] = new List<String>();
|
||||
((List<String>)options["exclude"]).Add(v);
|
||||
});
|
||||
ops.Add("f|excludefolder=", delegate(string v)
|
||||
{
|
||||
if (!options.ContainsKey("excludefolders"))
|
||||
options["excludefolders"] = new List<String>();
|
||||
((List<String>)options["excludefolders"]).Add(v);
|
||||
});
|
||||
|
||||
List<string> mainParams = ops.Parse(cmdparams);
|
||||
|
||||
@@ -408,10 +422,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
if (mainParams.Count < 6)
|
||||
{
|
||||
m_log.Error(
|
||||
"[INVENTORY ARCHIVER]: usage is save iar [-h|--home=<url>] [--noassets] <first name> <last name> <inventory path> <user password> [<save file path>] [-c|--creators] [-v|--verbose]");
|
||||
"[INVENTORY ARCHIVER]: save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-e|--exclude=<name/uuid>] [-f|--excludefolder=<foldername/uuid>] [-v|--verbose]");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
|
||||
if (options.ContainsKey("home"))
|
||||
m_log.WarnFormat("[INVENTORY ARCHIVER]: Please be aware that inventory archives with creator information are not compatible with OpenSim 0.7.0.2 and earlier. Do not use the -home option if you want to produce a compatible IAR");
|
||||
@@ -421,7 +435,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
string invPath = mainParams[4];
|
||||
string pass = mainParams[5];
|
||||
string savePath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME);
|
||||
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}",
|
||||
savePath, invPath, firstName, lastName);
|
||||
@@ -436,9 +450,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SaveInvConsoleCommandCompleted(
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
Exception reportedException)
|
||||
{
|
||||
lock (m_pendingConsoleSaves)
|
||||
@@ -448,7 +462,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (succeeded)
|
||||
{
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Saved archive for {0} {1}", userInfo.FirstName, userInfo.LastName);
|
||||
@@ -456,11 +470,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[INVENTORY ARCHIVER]: Archive save for {0} {1} failed - {2}",
|
||||
"[INVENTORY ARCHIVER]: Archive save for {0} {1} failed - {2}",
|
||||
userInfo.FirstName, userInfo.LastName, reportedException.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get user information for the given name.
|
||||
/// </summary>
|
||||
@@ -470,13 +484,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// <returns></returns>
|
||||
protected UserAccount GetUserInfo(string firstName, string lastName, string pass)
|
||||
{
|
||||
UserAccount account
|
||||
UserAccount account
|
||||
= m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName);
|
||||
|
||||
|
||||
if (null == account)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[INVENTORY ARCHIVER]: Failed to find user info for {0} {1}",
|
||||
"[INVENTORY ARCHIVER]: Failed to find user info for {0} {1}",
|
||||
firstName, lastName);
|
||||
return null;
|
||||
}
|
||||
@@ -491,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
|
||||
"[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
|
||||
firstName, lastName);
|
||||
return null;
|
||||
}
|
||||
@@ -502,7 +516,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Notify the client of loaded nodes if they are logged in
|
||||
/// </summary>
|
||||
@@ -511,22 +525,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
if (loadedNodes.Count == 0)
|
||||
return;
|
||||
|
||||
|
||||
foreach (Scene scene in m_scenes.Values)
|
||||
{
|
||||
ScenePresence user = scene.GetScenePresence(userInfo.PrincipalID);
|
||||
|
||||
|
||||
if (user != null && !user.IsChildAgent)
|
||||
{
|
||||
foreach (InventoryNodeBase node in loadedNodes)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
|
||||
// "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
|
||||
// user.Name, node.Name);
|
||||
|
||||
|
||||
user.ControllingClient.SendBulkUpdateInventory(node);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -541,7 +555,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
// {
|
||||
// if (DisablePresenceChecks)
|
||||
// return true;
|
||||
//
|
||||
//
|
||||
// foreach (Scene scene in m_scenes.Values)
|
||||
// {
|
||||
// ScenePresence p;
|
||||
|
||||
@@ -707,7 +707,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
// Object owners should be able to edit their own content
|
||||
if (currentUser == objectOwner)
|
||||
{
|
||||
permission = true;
|
||||
// there is no way that later code can change this back to false
|
||||
// so just return true immediately and short circuit the more
|
||||
// expensive group checks
|
||||
return true;
|
||||
|
||||
//permission = true;
|
||||
}
|
||||
else if (group.IsAttachment)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
|
||||
public interface IAvatarFactoryModule
|
||||
{
|
||||
void SetAppearance(IScenePresence sp, AvatarAppearance appearance);
|
||||
void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3272,9 +3272,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Don't disable this log message - it's too helpful
|
||||
m_log.DebugFormat(
|
||||
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6}, position {7})",
|
||||
RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
|
||||
agent.AgentID, agent.circuitcode, teleportFlags, agent.startpos);
|
||||
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags {8}, position {9})",
|
||||
RegionInfo.RegionName, (agent.child ? "child" : "root"),agent.firstname, agent.lastname,
|
||||
agent.AgentID, agent.circuitcode, agent.IPAddress, agent.Viewer, teleportFlags, agent.startpos);
|
||||
|
||||
if (LoginsDisabled)
|
||||
{
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.ErrorFormat(
|
||||
"[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",
|
||||
sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -368,12 +368,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()",
|
||||
// m_parentScene.RegionInfo.RegionName, sceneObject.UUID);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
|
||||
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
|
||||
// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
|
||||
|
||||
SceneObjectPart[] parts = sceneObject.Parts;
|
||||
@@ -409,7 +409,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
lock (SceneObjectGroupsByFullID)
|
||||
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
|
||||
|
||||
|
||||
lock (SceneObjectGroupsByFullPartID)
|
||||
{
|
||||
foreach (SceneObjectPart part in parts)
|
||||
|
||||
@@ -303,6 +303,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// ~SceneObjectPart()
|
||||
// {
|
||||
// Console.WriteLine(
|
||||
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
|
||||
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
|
||||
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
|
||||
|
||||
@@ -291,13 +291,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public PhysicsActor PhysicsActor { get; private set; }
|
||||
|
||||
private byte m_movementflag;
|
||||
|
||||
public byte MovementFlag
|
||||
{
|
||||
set { m_movementflag = value; }
|
||||
get { return m_movementflag; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Record user movement inputs.
|
||||
/// </summary>
|
||||
public byte MovementFlag { get; private set; }
|
||||
|
||||
private bool m_updateflag;
|
||||
|
||||
|
||||
@@ -1470,7 +1470,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
m_SOPXmlProcessors,
|
||||
reader,
|
||||
(o, nodeName, e)
|
||||
=> m_log.ErrorFormat(
|
||||
=> m_log.DebugFormat(
|
||||
"[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}",
|
||||
((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace));
|
||||
|
||||
@@ -1535,14 +1535,18 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
|
||||
reader.ReadStartElement(name, String.Empty); // Shape
|
||||
|
||||
ExternalRepresentationUtils.ExecuteReadProcessors(
|
||||
errors = ExternalRepresentationUtils.ExecuteReadProcessors(
|
||||
shape,
|
||||
m_ShapeXmlProcessors,
|
||||
reader,
|
||||
(o, nodeName, e)
|
||||
=> m_log.ErrorFormat(
|
||||
"[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
|
||||
nodeName, e.Message, e.StackTrace));
|
||||
=>
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
|
||||
nodeName, e.Message, e.StackTrace);
|
||||
}
|
||||
);
|
||||
|
||||
reader.ReadEndElement(); // Shape
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -43,6 +44,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
[TestFixture]
|
||||
public class SceneObjectBasicTests
|
||||
{
|
||||
// [TearDown]
|
||||
// public void TearDown()
|
||||
// {
|
||||
// Console.WriteLine("TearDown");
|
||||
// GC.Collect();
|
||||
// Thread.Sleep(3000);
|
||||
// }
|
||||
|
||||
// public class GcNotify
|
||||
// {
|
||||
// public static AutoResetEvent gcEvent = new AutoResetEvent(false);
|
||||
// private static bool _initialized = false;
|
||||
//
|
||||
// public static void Initialize()
|
||||
// {
|
||||
// if (!_initialized)
|
||||
// {
|
||||
// _initialized = true;
|
||||
// new GcNotify();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private GcNotify(){}
|
||||
//
|
||||
// ~GcNotify()
|
||||
// {
|
||||
// if (!Environment.HasShutdownStarted &&
|
||||
// !AppDomain.CurrentDomain.IsFinalizingForUnload())
|
||||
// {
|
||||
// Console.WriteLine("GcNotify called");
|
||||
// gcEvent.Set();
|
||||
// new GcNotify();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Test adding an object to a scene.
|
||||
/// </summary>
|
||||
@@ -147,11 +184,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
public void TestDeleteSceneObject()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
|
||||
|
||||
TestScene scene = SceneHelpers.SetupScene();
|
||||
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||
scene.DeleteSceneObject(part.ParentGroup, false);
|
||||
|
||||
|
||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
||||
Assert.That(retrievedPart, Is.Null);
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// Capability string prefixes
|
||||
private static readonly string m_parcelVoiceInfoRequestPath = "0007/";
|
||||
private static readonly string m_provisionVoiceAccountRequestPath = "0008/";
|
||||
private static readonly string m_chatSessionRequestPath = "0009/";
|
||||
private static readonly string m_parcelVoiceInfoRequestPath = "0207/";
|
||||
private static readonly string m_provisionVoiceAccountRequestPath = "0208/";
|
||||
private static readonly string m_chatSessionRequestPath = "0209/";
|
||||
|
||||
// Control info
|
||||
private static bool m_Enabled = false;
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
|
||||
using Nwc.XmlRpc;
|
||||
|
||||
@@ -167,6 +168,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
private bool m_debugEnabled = false;
|
||||
|
||||
private Dictionary<string, bool> m_pendingRequests = new Dictionary<string,bool>();
|
||||
|
||||
private ExpiringCache<string, OSDMap> m_memoryCache;
|
||||
private int m_cacheTimeout = 30;
|
||||
|
||||
@@ -1348,6 +1351,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
// Immediately forward the request if the cache is disabled.
|
||||
if (m_cacheTimeout == 0)
|
||||
{
|
||||
m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: cache is disabled");
|
||||
return WebUtil.PostToService(m_groupsServerURI, requestArgs);
|
||||
}
|
||||
|
||||
@@ -1355,6 +1359,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
if (requestArgs["RequestMethod"] == "RemoveGeneric"
|
||||
|| requestArgs["RequestMethod"] == "AddGeneric")
|
||||
{
|
||||
m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: clearing generics cache");
|
||||
|
||||
// Any and all updates cause the cache to clear
|
||||
m_memoryCache.Clear();
|
||||
|
||||
@@ -1366,18 +1372,67 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
// Create the cache key for the request and see if we have it cached
|
||||
string CacheKey = WebUtil.BuildQueryString(requestArgs);
|
||||
OSDMap response = null;
|
||||
if (!m_memoryCache.TryGetValue(CacheKey, out response))
|
||||
{
|
||||
// if it wasn't in the cache, pass the request to the Simian Grid Services
|
||||
response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
|
||||
|
||||
// and cache the response
|
||||
m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
|
||||
// This code uses a leader/follower pattern. On a cache miss, the request is added
|
||||
// to a queue; the first thread to add it to the queue completes the request while
|
||||
// follow on threads busy wait for the results, this situation seems to happen
|
||||
// often when checking permissions
|
||||
while (true)
|
||||
{
|
||||
OSDMap response = null;
|
||||
bool firstRequest = false;
|
||||
|
||||
lock (m_memoryCache)
|
||||
{
|
||||
if (m_memoryCache.TryGetValue(CacheKey, out response))
|
||||
return response;
|
||||
|
||||
if (! m_pendingRequests.ContainsKey(CacheKey))
|
||||
{
|
||||
m_pendingRequests.Add(CacheKey,true);
|
||||
firstRequest = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (firstRequest)
|
||||
{
|
||||
// if it wasn't in the cache, pass the request to the Simian Grid Services
|
||||
try
|
||||
{
|
||||
response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.InfoFormat("[SIMIAN GROUPS CONNECTOR] request failed {0}",CacheKey);
|
||||
}
|
||||
|
||||
// and cache the response
|
||||
lock (m_memoryCache)
|
||||
{
|
||||
m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
|
||||
m_pendingRequests.Remove(CacheKey);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Thread.Sleep(50); // waiting for a web request to complete, 50msecs is reasonable
|
||||
}
|
||||
|
||||
// return cached response
|
||||
return response;
|
||||
// if (!m_memoryCache.TryGetValue(CacheKey, out response))
|
||||
// {
|
||||
// m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: query not in the cache");
|
||||
// Util.PrintCallStack();
|
||||
|
||||
// // if it wasn't in the cache, pass the request to the Simian Grid Services
|
||||
// response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
|
||||
|
||||
// // and cache the response
|
||||
// m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
|
||||
// }
|
||||
|
||||
// // return cached response
|
||||
// return response;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -230,8 +230,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
|
||||
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
|
||||
|
||||
m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
|
||||
m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
|
||||
// m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
|
||||
// m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
|
||||
|
||||
m_log.InfoFormat("[RegionReady]: Logins enabled for {0}", m_scene.RegionInfo.RegionName);
|
||||
|
||||
if ( m_uri != string.Empty )
|
||||
{
|
||||
|
||||
@@ -96,15 +96,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
if (!m_avatars.ContainsKey(agentId))
|
||||
return false;
|
||||
|
||||
// Delete existing sp attachments
|
||||
scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, false);
|
||||
|
||||
AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true);
|
||||
sp.Appearance = npcAppearance;
|
||||
// Set new sp appearance. Also sends to clients.
|
||||
scene.RequestModuleInterface<IAvatarFactoryModule>().SetAppearance(sp, new AvatarAppearance(appearance, true));
|
||||
|
||||
// Rez needed sp attachments
|
||||
scene.AttachmentsModule.RezAttachments(sp);
|
||||
|
||||
IAvatarFactoryModule module = scene.RequestModuleInterface<IAvatarFactoryModule>();
|
||||
module.SendAppearance(sp.UUID);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -121,8 +121,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[NPC MODULE]: Creating NPC {0} {1} {2} at {3} in {4}",
|
||||
firstname, lastname, npcAvatar.AgentId, position, scene.RegionInfo.RegionName);
|
||||
"[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
|
||||
firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);
|
||||
|
||||
AgentCircuitData acd = new AgentCircuitData();
|
||||
acd.AgentID = npcAvatar.AgentId;
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
private bool GenerateCoordsAndFacesFromPrimMeshData(
|
||||
string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces)
|
||||
{
|
||||
m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
|
||||
// m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
|
||||
|
||||
coords = new List<Coord>();
|
||||
faces = new List<Face>();
|
||||
@@ -321,7 +321,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
|
||||
if (primShape.SculptData.Length <= 0)
|
||||
{
|
||||
m_log.Error("[MESH]: asset data is zero length");
|
||||
m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,22 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
internal UUID m_uuid { get; private set; }
|
||||
internal bool bad = false;
|
||||
|
||||
/// <summary>
|
||||
/// ODE Avatar.
|
||||
/// </summary>
|
||||
/// <param name="avName"></param>
|
||||
/// <param name="parent_scene"></param>
|
||||
/// <param name="pos"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="pid_d"></param>
|
||||
/// <param name="pid_p"></param>
|
||||
/// <param name="capsule_radius"></param>
|
||||
/// <param name="tensor"></param>
|
||||
/// <param name="density">
|
||||
/// Only used right now to return information to LSL. Not actually used to set mass in ODE!
|
||||
/// </param>
|
||||
/// <param name="walk_divisor"></param>
|
||||
/// <param name="rundivisor"></param>
|
||||
public OdeCharacter(
|
||||
String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p,
|
||||
float capsule_radius, float tensor, float density,
|
||||
@@ -786,6 +802,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
Vector3 vec = Vector3.Zero;
|
||||
d.Vector3 vel = d.BodyGetLinearVel(Body);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[ODE CHARACTER]: Current velocity in Move() is <{0},{1},{2}>, target {3} for {4}",
|
||||
// vel.X, vel.Y, vel.Z, _target_velocity, Name);
|
||||
|
||||
float movementdivisor = 1f;
|
||||
|
||||
if (!m_alwaysRun)
|
||||
@@ -884,18 +904,20 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
if (flying)
|
||||
{
|
||||
// This also acts as anti-gravity so that we hover when flying rather than fall.
|
||||
vec.Z = (_target_velocity.Z - vel.Z) * (PID_D);
|
||||
}
|
||||
}
|
||||
|
||||
if (flying)
|
||||
{
|
||||
// Anti-gravity so that we hover when flying rather than fall.
|
||||
vec.Z += ((-1 * _parent_scene.gravityz) * m_mass);
|
||||
|
||||
//Added for auto fly height. Kitto Flora
|
||||
//d.Vector3 pos = d.BodyGetPosition(Body);
|
||||
float target_altitude = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + MinimumGroundFlightOffset;
|
||||
|
||||
|
||||
if (_position.Z < target_altitude)
|
||||
{
|
||||
vec.Z += (target_altitude - _position.Z) * PID_P * 5.0f;
|
||||
@@ -921,6 +943,25 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
d.Vector3 newVel = d.BodyGetLinearVel(Body);
|
||||
if (newVel.X >= 256 || newVel.X <= 256 || newVel.Y >= 256 || newVel.Y <= 256 || newVel.Z >= 256 || newVel.Z <= 256)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[ODE CHARACTER]: Limiting falling velocity from {0} to {1} for {2}", newVel.Z, -9.8, Name);
|
||||
|
||||
newVel.X = Util.Clamp<float>(newVel.X, -255f, 255f);
|
||||
newVel.Y = Util.Clamp<float>(newVel.Y, -255f, 255f);
|
||||
|
||||
if (!flying)
|
||||
newVel.Z
|
||||
= Util.Clamp<float>(
|
||||
newVel.Z, -_parent_scene.AvatarTerminalVelocity, _parent_scene.AvatarTerminalVelocity);
|
||||
else
|
||||
newVel.Z = Util.Clamp<float>(newVel.Z, -255f, 255f);
|
||||
|
||||
d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -144,6 +144,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
public float gravityy = 0f;
|
||||
public float gravityz = -9.8f;
|
||||
|
||||
public float AvatarTerminalVelocity { get; set; }
|
||||
|
||||
private float contactsurfacelayer = 0.001f;
|
||||
|
||||
private int worldHashspaceLow = -4;
|
||||
@@ -459,6 +461,15 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
gravityy = physicsconfig.GetFloat("world_gravityy", 0f);
|
||||
gravityz = physicsconfig.GetFloat("world_gravityz", -9.8f);
|
||||
|
||||
float avatarTerminalVelocity = physicsconfig.GetFloat("avatar_terminal_velocity", 54f);
|
||||
AvatarTerminalVelocity = Util.Clamp<float>(avatarTerminalVelocity, 0, 255f);
|
||||
if (AvatarTerminalVelocity != avatarTerminalVelocity)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[ODE SCENE]: avatar_terminal_velocity of {0} is invalid. Clamping to {1}",
|
||||
avatarTerminalVelocity, AvatarTerminalVelocity);
|
||||
}
|
||||
|
||||
worldHashspaceLow = physicsconfig.GetInt("world_hashspace_size_low", -4);
|
||||
worldHashspaceHigh = physicsconfig.GetInt("world_hashspace_size_high", 128);
|
||||
|
||||
|
||||
@@ -2233,7 +2233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
return NpcCreate(firstname, lastname, position, notecard, false, true);
|
||||
return NpcCreate(firstname, lastname, position, notecard, false, false);
|
||||
}
|
||||
|
||||
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options)
|
||||
@@ -2244,7 +2244,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return NpcCreate(
|
||||
firstname, lastname, position, notecard,
|
||||
(options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0,
|
||||
(options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0);
|
||||
(options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) != 0);
|
||||
}
|
||||
|
||||
private LSL_Key NpcCreate(
|
||||
|
||||
@@ -31,7 +31,6 @@ using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using log4net;
|
||||
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
@@ -41,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
{
|
||||
public class SensorRepeat
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public AsyncCommandManager m_CmdManager;
|
||||
|
||||
public SensorRepeat(AsyncCommandManager CmdManager)
|
||||
@@ -447,11 +448,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
|
||||
Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence =>
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}",
|
||||
// presence.Name, presence.PresenceType, ts.name, ts.type);
|
||||
|
||||
if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
|
||||
{
|
||||
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
|
||||
if (npcData == null || !npcData.SenseAsAgent)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Discarding NPC {0} from agent sense sweep for script item id {1}",
|
||||
// presence.Name, ts.itemID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ts.type & AGENT) == 0)
|
||||
@@ -464,7 +474,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
{
|
||||
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
|
||||
if (npcData != null && npcData.SenseAsAgent)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Discarding NPC {0} from non-agent sense sweep for script item id {1}",
|
||||
// presence.Name, ts.itemID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace OpenSim.Services.Connectors.Friends
|
||||
public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend)
|
||||
{
|
||||
string reply = string.Empty;
|
||||
string uri = m_ServerURI = "/friends";
|
||||
string uri = m_ServerURI + "/friends";
|
||||
try
|
||||
{
|
||||
reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
|
||||
|
||||
@@ -50,7 +50,8 @@ namespace OpenSim.Tests.Common.Mock
|
||||
|
||||
~TestScene()
|
||||
{
|
||||
Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
|
||||
//Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
|
||||
Console.WriteLine("TestScene destructor called");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -49,6 +49,13 @@ namespace OpenSim.Tests.Torture
|
||||
[TestFixture]
|
||||
public class ObjectTortureTests
|
||||
{
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
}
|
||||
|
||||
// [Test]
|
||||
// public void Test0000Clean()
|
||||
// {
|
||||
@@ -141,8 +148,18 @@ namespace OpenSim.Tests.Torture
|
||||
string.Format("Object {0} could not be retrieved", i));
|
||||
}
|
||||
|
||||
// This does not work to fire the SceneObjectGroup destructors - something else is hanging on to them.
|
||||
// scene.DeleteAllSceneObjects();
|
||||
// When a scene object is added to a scene, it is placed in the update list for sending to viewers
|
||||
// (though in this case we have none). When it is deleted, it is not removed from the update which is
|
||||
// fine since it will later be ignored.
|
||||
//
|
||||
// However, that means that we need to manually run an update here to clear out that list so that deleted
|
||||
// objects will be clean up by the garbage collector before the next stress test is run.
|
||||
scene.Update();
|
||||
|
||||
// Currently, we need to do this in order to garbage collect the scene objects ready for the next test run.
|
||||
// However, what we really need to do is find out why the entire scene is not garbage collected in
|
||||
// teardown.
|
||||
scene.DeleteAllSceneObjects();
|
||||
|
||||
Console.WriteLine(
|
||||
"Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
|
||||
|
||||
@@ -484,7 +484,6 @@
|
||||
;; such as the Meta7 viewer.
|
||||
;; It has no ill effect on viewers which do not support server-side
|
||||
;; windlight settings.
|
||||
;; Currently we only have support for MySQL databases.
|
||||
; enable_windlight = false
|
||||
|
||||
|
||||
@@ -573,10 +572,15 @@
|
||||
; DeleteScriptsOnStartup = true
|
||||
|
||||
;; Set this to true (the default) to load each script into a separate
|
||||
;; AppDomain. Setting this to false will load all script assemblies into the
|
||||
;; current AppDomain, which will reduce the per-script overhead at the
|
||||
;; expense of reduced security and the inability to garbage collect the
|
||||
;; script assemblies
|
||||
;; AppDomain.
|
||||
;;
|
||||
;; Setting this to false will load all script assemblies into the
|
||||
;; current AppDomain, which will significantly improve script loading times.
|
||||
;; It will also reduce initial per-script memory overhead.
|
||||
;;
|
||||
;; However, setting this to false will also prevent script DLLs from being unloaded from memory if the script is deleted.
|
||||
;; This may cause an OutOfMemory problem over time when avatars with scripted attachments move in and out of the region.
|
||||
;; Some Windows users have also reported script loading problems when AppDomainLoading = false
|
||||
; AppDomainLoading = true
|
||||
|
||||
;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl
|
||||
|
||||
@@ -655,6 +655,11 @@
|
||||
world_gravityy = 0
|
||||
world_gravityz = -9.8
|
||||
|
||||
; Terminal velocity of a falling avatar
|
||||
; This is the same http://en.wikipedia.org/wiki/Terminal_velocity#Examples
|
||||
; Max value is 255, min value is 0
|
||||
avatar_terminal_velocity = 54
|
||||
|
||||
; World Step size. (warning these are dangerous. Changing these will probably cause your scene to explode dramatically)
|
||||
; reference: fps = (0.089/ODE_STEPSIZE) * 1000;
|
||||
world_stepsize = 0.0178
|
||||
@@ -1065,7 +1070,6 @@
|
||||
[LightShare]
|
||||
; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer.
|
||||
; It has no ill effect on viewers which do not support server-side windlight settings.
|
||||
; Currently we only have support for MySQL databases.
|
||||
enable_windlight = false
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user