Merge branch 'master' of /home/opensim/var/repo/opensim

integration
BlueWall 2012-04-27 15:41:53 -04:00
commit 515b7eabbd
14 changed files with 243 additions and 40 deletions

View File

@ -143,6 +143,7 @@ what it is today.
* sempuki * sempuki
* SignpostMarv * SignpostMarv
* SpotOn3D * SpotOn3D
* Stefan_Boom / stoehr
* Strawberry Fride * Strawberry Fride
* Talun * Talun
* tglion * tglion

View File

@ -39,6 +39,9 @@ using OpenSim.Framework.Serialization.External;
using OpenSim.Region.CoreModules.World.Archiver; using OpenSim.Region.CoreModules.World.Archiver;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using Ionic.Zlib;
using GZipStream = Ionic.Zlib.GZipStream;
using CompressionMode = Ionic.Zlib.CompressionMode;
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{ {
@ -99,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
scene, scene,
userInfo, userInfo,
invPath, invPath,
new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress)) new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress, CompressionLevel.BestCompression))
{ {
} }

View File

@ -161,6 +161,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public void Teleport(ScenePresence sp, ulong regionHandle, Vector3 position, Vector3 lookAt, uint teleportFlags) public void Teleport(ScenePresence sp, ulong regionHandle, Vector3 position, Vector3 lookAt, uint teleportFlags)
{ {
if (sp.Scene.Permissions.IsGridGod(sp.UUID))
{
// This user will be a God in the destination scene, too
teleportFlags |= (uint)TeleportFlags.Godlike;
}
if (!sp.Scene.Permissions.CanTeleport(sp.UUID)) if (!sp.Scene.Permissions.CanTeleport(sp.UUID))
return; return;

View File

@ -40,6 +40,9 @@ using OpenSim.Framework.Serialization;
using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.CoreModules.World.Terrain;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using Ionic.Zlib;
using GZipStream = Ionic.Zlib.GZipStream;
using CompressionMode = Ionic.Zlib.CompressionMode;
namespace OpenSim.Region.CoreModules.World.Archiver namespace OpenSim.Region.CoreModules.World.Archiver
{ {
@ -82,7 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{ {
try try
{ {
m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress); m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress, CompressionLevel.BestCompression);
} }
catch (EntryPointNotFoundException e) catch (EntryPointNotFoundException e)
{ {

View File

@ -166,6 +166,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_scene.Permissions.OnDeedParcel += CanDeedParcel; m_scene.Permissions.OnDeedParcel += CanDeedParcel;
m_scene.Permissions.OnDeedObject += CanDeedObject; m_scene.Permissions.OnDeedObject += CanDeedObject;
m_scene.Permissions.OnIsGod += IsGod; m_scene.Permissions.OnIsGod += IsGod;
m_scene.Permissions.OnIsGridGod += IsGridGod;
m_scene.Permissions.OnIsAdministrator += IsAdministrator; m_scene.Permissions.OnIsAdministrator += IsAdministrator;
m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
@ -466,22 +467,34 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (IsEstateManager(user) && m_RegionManagerIsGod) if (IsEstateManager(user) && m_RegionManagerIsGod)
return true; return true;
if (IsGridGod(user, null))
return true;
return false;
}
/// <summary>
/// Is the given user a God throughout the grid (not just in the current scene)?
/// </summary>
/// <param name="user">The user</param>
/// <param name="scene">Unused, can be null</param>
/// <returns></returns>
protected bool IsGridGod(UUID user, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (user == UUID.Zero) return false;
if (m_allowGridGods) if (m_allowGridGods)
{ {
ScenePresence sp = m_scene.GetScenePresence(user); ScenePresence sp = m_scene.GetScenePresence(user);
if (sp != null) if (sp != null)
{ return (sp.UserLevel >= 200);
if (sp.UserLevel >= 200)
return true;
return false;
}
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user); UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user);
if (account != null) if (account != null)
{ return (account.UserLevel >= 200);
if (account.UserLevel >= 200)
return true;
}
} }
return false; return false;

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -278,6 +278,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
return "FALLDOWN"; return "FALLDOWN";
} }
// Check if the user has stopped walking just now
if (CurrentMovementAnimation == "WALK" && (move == Vector3.Zero))
return "STAND";
return CurrentMovementAnimation; return CurrentMovementAnimation;
} }
@ -401,6 +405,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
/// Update the movement animation of this avatar according to its current state /// Update the movement animation of this avatar according to its current state
/// </summary> /// </summary>
public void UpdateMovementAnimations() public void UpdateMovementAnimations()
{
lock (m_animations)
{ {
CurrentMovementAnimation = DetermineMovementAnimation(); CurrentMovementAnimation = DetermineMovementAnimation();
@ -410,6 +416,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
TrySetMovementAnimation(CurrentMovementAnimation); TrySetMovementAnimation(CurrentMovementAnimation);
} }
}
public UUID[] GetAnimationArray() public UUID[] GetAnimationArray()
{ {

View File

@ -67,6 +67,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene);
public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand);
public delegate bool IsGodHandler(UUID user, Scene requestFromScene); public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene);
public delegate bool IsAdministratorHandler(UUID user); public delegate bool IsAdministratorHandler(UUID user);
public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene); public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene);
@ -134,6 +135,7 @@ namespace OpenSim.Region.Framework.Scenes
public event RunConsoleCommandHandler OnRunConsoleCommand; public event RunConsoleCommandHandler OnRunConsoleCommand;
public event IssueEstateCommandHandler OnIssueEstateCommand; public event IssueEstateCommandHandler OnIssueEstateCommand;
public event IsGodHandler OnIsGod; public event IsGodHandler OnIsGod;
public event IsGridGodHandler OnIsGridGod;
public event IsAdministratorHandler OnIsAdministrator; public event IsAdministratorHandler OnIsAdministrator;
// public event EditParcelHandler OnEditParcel; // public event EditParcelHandler OnEditParcel;
public event EditParcelPropertiesHandler OnEditParcelProperties; public event EditParcelPropertiesHandler OnEditParcelProperties;
@ -728,6 +730,21 @@ namespace OpenSim.Region.Framework.Scenes
return true; return true;
} }
public bool IsGridGod(UUID user)
{
IsGridGodHandler handler = OnIsGridGod;
if (handler != null)
{
Delegate[] list = handler.GetInvocationList();
foreach (IsGridGodHandler h in list)
{
if (h(user, m_scene) == false)
return false;
}
}
return true;
}
public bool IsAdministrator(UUID user) public bool IsAdministrator(UUID user)
{ {
IsAdministratorHandler handler = OnIsAdministrator; IsAdministratorHandler handler = OnIsAdministrator;

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -45,6 +45,7 @@ using TeleportFlags = OpenSim.Framework.Constants.TeleportFlags;
namespace OpenSim.Region.Framework.Scenes namespace OpenSim.Region.Framework.Scenes
{ {
[Flags]
enum ScriptControlled : uint enum ScriptControlled : uint
{ {
CONTROL_ZERO = 0, CONTROL_ZERO = 0,
@ -1220,7 +1221,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}", // "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}",
// Scene.RegionInfo.RegionName, remoteClient.Name, agentData.ControlFlags); // Scene.RegionInfo.RegionName, remoteClient.Name, (AgentManager.ControlFlags)agentData.ControlFlags);
if (IsChildAgent) if (IsChildAgent)
{ {
@ -1320,14 +1321,8 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
lock (scriptedcontrols) uint flagsForScripts = (uint)flags;
{
if (scriptedcontrols.Count > 0)
{
SendControlToScripts((uint)flags);
flags = RemoveIgnoredControls(flags, IgnoredControls); flags = RemoveIgnoredControls(flags, IgnoredControls);
}
}
if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0) if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0)
HandleAgentSitOnGround(); HandleAgentSitOnGround();
@ -1420,7 +1415,7 @@ namespace OpenSim.Region.Framework.Scenes
MovementFlag |= (byte)nudgehack; MovementFlag |= (byte)nudgehack;
} }
// m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with {1}", Name, DCF); //m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with {1}", Name, DCF);
MovementFlag += (byte)(uint)DCF; MovementFlag += (byte)(uint)DCF;
update_movementflag = true; update_movementflag = true;
} }
@ -1433,7 +1428,7 @@ namespace OpenSim.Region.Framework.Scenes
&& ((MovementFlag & (byte)nudgehack) == nudgehack)) && ((MovementFlag & (byte)nudgehack) == nudgehack))
) // This or is for Nudge forward ) // This or is for Nudge forward
{ {
// m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with lack of {1}", Name, DCF); //m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with lack of {1}", Name, DCF);
MovementFlag -= ((byte)(uint)DCF); MovementFlag -= ((byte)(uint)DCF);
update_movementflag = true; update_movementflag = true;
@ -1514,8 +1509,18 @@ namespace OpenSim.Region.Framework.Scenes
// } // }
// } // }
// if (update_movementflag && ParentID == 0) if (update_movementflag && ParentID == 0)
// Animator.UpdateMovementAnimations(); Animator.UpdateMovementAnimations();
lock (scriptedcontrols)
{
if (scriptedcontrols.Count > 0)
{
// Notify the scripts only after calling UpdateMovementAnimations(), so that if a script
// (e.g., a walking script) checks which animation is active it will be the correct animation.
SendControlToScripts(flagsForScripts);
}
}
} }
m_scene.EventManager.TriggerOnClientMovement(this); m_scene.EventManager.TriggerOnClientMovement(this);

View File

@ -308,7 +308,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
} }
SceneObjectPart SensePoint = ts.host; SceneObjectPart SensePoint = ts.host;
Vector3 fromRegionPos = SensePoint.AbsolutePosition; Vector3 fromRegionPos = SensePoint.GetWorldPosition();
// pre define some things to avoid repeated definitions in the loop body // pre define some things to avoid repeated definitions in the loop body
Vector3 toRegionPos; Vector3 toRegionPos;
@ -319,15 +319,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
float dy; float dy;
float dz; float dz;
Quaternion q = SensePoint.RotationOffset; Quaternion q = SensePoint.GetWorldRotation();
if (SensePoint.ParentGroup.IsAttachment) if (SensePoint.ParentGroup.IsAttachment)
{ {
// In attachments, the sensor cone always orients with the // In attachments, rotate the sensor cone with the
// avatar rotation. This may include a nonzero elevation if // avatar rotation. This may include a nonzero elevation if
// in mouselook. // in mouselook.
// This will not include the rotation and position of the
// attachment point (e.g. your head when a sensor is in your
// hair attached to your scull. Your hair will turn with
// your head but the sensor will stay with your (global)
// avatar rotation and position.
// Position of a sensor in a child prim attached to an avatar
// will be still wrong.
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
q = avatar.Rotation; q = avatar.Rotation * q;
} }
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
@ -439,16 +447,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
return sensedEntities; return sensedEntities;
SceneObjectPart SensePoint = ts.host; SceneObjectPart SensePoint = ts.host;
Vector3 fromRegionPos = SensePoint.AbsolutePosition; Vector3 fromRegionPos = SensePoint.GetWorldPosition();
Quaternion q = SensePoint.RotationOffset; Quaternion q = SensePoint.GetWorldRotation();
if (SensePoint.ParentGroup.IsAttachment) if (SensePoint.ParentGroup.IsAttachment)
{ {
// In attachments, the sensor cone always orients with the // In attachments, rotate the sensor cone with the
// avatar rotation. This may include a nonzero elevation if // avatar rotation. This may include a nonzero elevation if
// in mouselook. // in mouselook.
// This will not include the rotation and position of the
// attachment point (e.g. your head when a sensor is in your
// hair attached to your scull. Your hair will turn with
// your head but the sensor will stay with your (global)
// avatar rotation and position.
// Position of a sensor in a child prim attached to an avatar
// will be still wrong.
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
q = avatar.Rotation; q = avatar.Rotation * q;
} }
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);

View File

@ -0,0 +1,29 @@
The managed BZIP2 code included in Ionic.BZip2.dll and Ionic.Zip.dll is
modified code, based on the bzip2 code in the Apache commons compress
library.
The original BZip2 was created by Julian Seward, and is licensed under
the BSD license.
The following license applies to the Apache code:
-----------------------------------------------------------------------
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

View File

@ -0,0 +1,70 @@
The following licenses govern use of the accompanying software, the
DotNetZip library ("the software"). If you use the software, you accept
these licenses. If you do not accept the license, do not use the software.
The managed ZLIB code included in Ionic.Zlib.dll and Ionic.Zip.dll is
modified code, based on jzlib.
The following notice applies to jzlib:
-----------------------------------------------------------------------
Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------
jzlib is based on zlib-1.1.3.
The following notice applies to zlib:
-----------------------------------------------------------------------
Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler
The ZLIB software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly jloup@gzip.org
Mark Adler madler@alumni.caltech.edu
-----------------------------------------------------------------------

View File

@ -0,0 +1,33 @@
Microsoft Public License (Ms-PL)
This license governs use of the accompanying software, the DotNetZip library ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.

BIN
bin/Ionic.Zip.dll Normal file

Binary file not shown.

View File

@ -1511,6 +1511,7 @@
<Reference name="OpenSim.Services.Connectors"/> <Reference name="OpenSim.Services.Connectors"/>
<Reference name="OpenSim.Services.Base"/> <Reference name="OpenSim.Services.Base"/>
<Reference name="OpenSim.Services.Interfaces"/> <Reference name="OpenSim.Services.Interfaces"/>
<Reference name="Ionic.Zip"/>
<Reference name="GlynnTucker.Cache" path="../../../bin/"/> <Reference name="GlynnTucker.Cache" path="../../../bin/"/>