Formatting cleanup.

0.6.0-stable
Jeff Ames 2008-05-16 01:22:11 +00:00
parent e25818d832
commit 65c5efe43b
261 changed files with 3718 additions and 3831 deletions

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -129,12 +129,12 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
IConfig myConfig = config.Configs["Startup"];
string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
List<string> modules=new List<string>(permissionModules.Split(','));
List<string> modules=new List<string>(permissionModules.Split(','));
if(!modules.Contains("DefaultPermissionsModule"))
return;
if (!modules.Contains("DefaultPermissionsModule"))
return;
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
@ -252,20 +252,20 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
}
#endregion
public bool PropagatePermissions()
{
return false;
}
public bool PropagatePermissions()
{
return false;
}
public bool BypassPermissions()
{
return m_bypassPermissions;
}
public bool BypassPermissions()
{
return m_bypassPermissions;
}
public void SetBypassPermissions(bool value)
{
m_bypassPermissions=value;
}
public void SetBypassPermissions(bool value)
{
m_bypassPermissions=value;
}
#region Object Permissions
@ -895,61 +895,61 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
#endregion
public bool CanLinkObject(LLUUID userID, LLUUID objectID)
{
public bool CanLinkObject(LLUUID userID, LLUUID objectID)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return true;
}
return true;
}
public bool CanDelinkObject(LLUUID userID, LLUUID objectID)
{
public bool CanDelinkObject(LLUUID userID, LLUUID objectID)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return true;
}
return true;
}
public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene)
{
public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return true;
}
return true;
}
public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
{
public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return true;
}
return true;
}
public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
{
public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return true;
}
return true;
}
public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID)
{
public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return true;
}
return true;
}
public bool CanTeleport(LLUUID userID)
{
public bool CanTeleport(LLUUID userID)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return true;
}
return true;
}
}

View File

@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes
item.Name = itemUpd.Name;
item.Description = itemUpd.Description;
item.NextPermissions = itemUpd.NextPermissions;
item.CurrentPermissions |= 8; // Slam!
item.CurrentPermissions |= 8; // Slam!
item.EveryOnePermissions = itemUpd.EveryOnePermissions;
// TODO: Requires sanity checks
@ -349,11 +349,11 @@ namespace OpenSim.Region.Environment.Scenes
if (item != null)
{
if (!ExternalChecks.ExternalChecksBypassPermissions())
{
if((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
return;
}
if (!ExternalChecks.ExternalChecksBypassPermissions())
{
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
return;
}
// TODO get recipient's root folder
CachedUserInfo recipientUserInfo
@ -372,37 +372,37 @@ namespace OpenSim.Region.Environment.Scenes
itemCopy.AssetType = item.AssetType;
itemCopy.InvType = item.InvType;
itemCopy.Folder = recipientUserInfo.RootFolder.ID;
if (ExternalChecks.ExternalChecksPropagatePermissions())
{
if(item.InvType == 6)
{
itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13;
}
else
{
Console.WriteLine("Non-Prim item ==>");
itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
}
if (ExternalChecks.ExternalChecksPropagatePermissions())
{
if (item.InvType == 6)
{
itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13;
}
else
{
Console.WriteLine("Non-Prim item ==>");
itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
}
itemCopy.CurrentPermissions = itemCopy.BasePermissions;
if((item.CurrentPermissions & 8) != 0) // Propagate slam bit
{
itemCopy.CurrentPermissions = item.NextPermissions;
itemCopy.BasePermissions=itemCopy.CurrentPermissions;
itemCopy.CurrentPermissions |= 8;
}
itemCopy.CurrentPermissions = itemCopy.BasePermissions;
if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit
{
itemCopy.CurrentPermissions = item.NextPermissions;
itemCopy.BasePermissions=itemCopy.CurrentPermissions;
itemCopy.CurrentPermissions |= 8;
}
itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
}
else
{
itemCopy.CurrentPermissions = item.CurrentPermissions;
itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
itemCopy.BasePermissions = item.BasePermissions;
}
itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
}
else
{
itemCopy.CurrentPermissions = item.CurrentPermissions;
itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
itemCopy.BasePermissions = item.BasePermissions;
}
itemCopy.GroupID = item.GroupID;
itemCopy.GroupOwned = item.GroupOwned;
itemCopy.Flags = item.Flags;
@ -411,11 +411,11 @@ namespace OpenSim.Region.Environment.Scenes
recipientUserInfo.AddItem(itemCopy);
if (!ExternalChecks.ExternalChecksBypassPermissions())
{
if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
senderUserInfo.DeleteItem(itemId);
}
if (!ExternalChecks.ExternalChecksBypassPermissions())
{
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
senderUserInfo.DeleteItem(itemId);
}
// Let the recipient client know about this new item
recipientClient.SendBulkUpdateInventory(itemCopy);
@ -484,16 +484,16 @@ namespace OpenSim.Region.Environment.Scenes
if (asset != null)
{
if(remoteClient.AgentId == oldAgentID)
{
CreateNewInventoryItem(
remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions);
}
else
{
CreateNewInventoryItem(
remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions);
}
if (remoteClient.AgentId == oldAgentID)
{
CreateNewInventoryItem(
remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions);
}
else
{
CreateNewInventoryItem(
remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions);
}
}
else
{
@ -571,9 +571,9 @@ namespace OpenSim.Region.Environment.Scenes
private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
AssetBase asset, uint nextOwnerMask)
{
CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask);
}
{
CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask);
}
/// <summary>
/// Create a new inventory item.
@ -603,8 +603,8 @@ namespace OpenSim.Region.Environment.Scenes
item.Folder = folderID;
item.CurrentPermissions = currentMask;
item.NextPermissions = nextOwnerMask;
item.EveryOnePermissions = everyoneMask;
item.BasePermissions = baseMask;
item.EveryOnePermissions = everyoneMask;
item.BasePermissions = baseMask;
userInfo.AddItem(item);
remoteClient.SendInventoryItemCreateUpdate(item);
@ -861,22 +861,22 @@ namespace OpenSim.Region.Environment.Scenes
agentItem.BasePermissions = taskItem.NextOwnerMask;
agentItem.CurrentPermissions = taskItem.NextOwnerMask;
agentItem.NextPermissions = taskItem.NextOwnerMask;
agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask;
agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask;
}
else
{
agentItem.BasePermissions = taskItem.BaseMask;
agentItem.CurrentPermissions = taskItem.OwnerMask;
agentItem.NextPermissions = taskItem.NextOwnerMask;
agentItem.EveryOnePermissions = taskItem.EveryoneMask;
agentItem.EveryOnePermissions = taskItem.EveryoneMask;
}
AddInventoryItem(remoteClient, agentItem);
if (!ExternalChecks.ExternalChecksBypassPermissions())
{
if((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
part.RemoveInventoryItem(itemId);
}
if (!ExternalChecks.ExternalChecksBypassPermissions())
{
if ((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
part.RemoveInventoryItem(itemId);
}
}
@ -918,11 +918,11 @@ namespace OpenSim.Region.Environment.Scenes
"[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
item.Name, primLocalID, remoteClient.Name);
part.ParentGroup.GetProperties(remoteClient);
if (!ExternalChecks.ExternalChecksBypassPermissions())
{
if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
RemoveInventoryItem(remoteClient, itemID);
}
if (!ExternalChecks.ExternalChecksBypassPermissions())
{
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
RemoveInventoryItem(remoteClient, itemID);
}
}
else
{
@ -1094,27 +1094,27 @@ namespace OpenSim.Region.Environment.Scenes
item.Folder = DeRezPacket.AgentBlock.DestinationID;
if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
{
uint perms=objectGroup.GetEffectivePermissions();
uint nextPerms=(perms & 7) << 13;
if((nextPerms & (uint)PermissionMask.Copy) == 0)
perms &= ~(uint)PermissionMask.Copy;
if((nextPerms & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer;
if((nextPerms & (uint)PermissionMask.Modify) == 0)
perms &= ~(uint)PermissionMask.Modify;
uint perms=objectGroup.GetEffectivePermissions();
uint nextPerms=(perms & 7) << 13;
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
perms &= ~(uint)PermissionMask.Copy;
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer;
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
perms &= ~(uint)PermissionMask.Modify;
item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions = item.BasePermissions;
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions |= 8; // Slam!
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions |= 8; // Slam!
}
else
{
item.BasePermissions = objectGroup.GetEffectivePermissions();
item.CurrentPermissions = objectGroup.GetEffectivePermissions();
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
}
// TODO: add the new fields (Flags, Sale info, etc)
@ -1201,15 +1201,15 @@ namespace OpenSim.Region.Environment.Scenes
item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
}
else
{
else
{
item.BasePermissions = objectGroup.GetEffectivePermissions();
item.CurrentPermissions = objectGroup.GetEffectivePermissions();
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
}
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
}
userInfo.AddItem(item);
@ -1259,14 +1259,14 @@ namespace OpenSim.Region.Environment.Scenes
item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
}
else
{
item.BasePermissions = objectGroup.RootPart.BaseMask;
item.CurrentPermissions = objectGroup.RootPart.OwnerMask;
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
}
userInfo.AddItem(item);
@ -1413,18 +1413,18 @@ namespace OpenSim.Region.Environment.Scenes
List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
if(rootPart.OwnerID != item.Owner)
{
if((item.CurrentPermissions & 8) != 0)
{
foreach (SceneObjectPart part in partList)
{
part.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions;
}
}
group.ApplyNextOwnerPermissions();
}
if (rootPart.OwnerID != item.Owner)
{
if ((item.CurrentPermissions & 8) != 0)
{
foreach (SceneObjectPart part in partList)
{
part.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions;
}
}
group.ApplyNextOwnerPermissions();
}
foreach (SceneObjectPart part in partList)
{
@ -1434,11 +1434,11 @@ namespace OpenSim.Region.Environment.Scenes
part.OwnerID = item.Owner;
part.ChangeInventoryOwner(item.Owner);
}
else if(((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam!
{
else if (((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam!
{
part.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions;
}
}
}
rootPart.TrimPermissions();
@ -1505,18 +1505,18 @@ namespace OpenSim.Region.Environment.Scenes
List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
if(rootPart.OwnerID != item.OwnerID)
{
if((item.OwnerMask & 8) != 0)
{
foreach (SceneObjectPart part in partList)
{
part.EveryoneMask = item.EveryoneMask;
part.NextOwnerMask = item.NextOwnerMask;
}
}
group.ApplyNextOwnerPermissions();
}
if (rootPart.OwnerID != item.OwnerID)
{
if ((item.OwnerMask & 8) != 0)
{
foreach (SceneObjectPart part in partList)
{
part.EveryoneMask = item.EveryoneMask;
part.NextOwnerMask = item.NextOwnerMask;
}
}
group.ApplyNextOwnerPermissions();
}
foreach (SceneObjectPart part in partList)
{
@ -1526,11 +1526,11 @@ namespace OpenSim.Region.Environment.Scenes
part.OwnerID = item.OwnerID;
part.ChangeInventoryOwner(item.OwnerID);
}
else if((item.OwnerMask & 8) != 0) // Slam!
{
part.EveryoneMask = item.EveryoneMask;
part.NextOwnerMask = item.NextOwnerMask;
}
else if ((item.OwnerMask & 8) != 0) // Slam!
{
part.EveryoneMask = item.EveryoneMask;
part.NextOwnerMask = item.NextOwnerMask;
}
}
rootPart.TrimPermissions();
if (group.RootPart.Shape.PCode == (byte)PCode.Prim)

View File

@ -61,19 +61,19 @@ namespace OpenSim.Region.Environment.Scenes
public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID)
{
SceneObjectPart part=m_scene.GetSceneObjectPart(objectID);
SceneObjectPart part=m_scene.GetSceneObjectPart(objectID);
uint perms=part.GetEffectiveObjectFlags() |
(uint)LLObject.ObjectFlags.ObjectModify |
(uint)LLObject.ObjectFlags.ObjectCopy |
(uint)LLObject.ObjectFlags.ObjectMove |
(uint)LLObject.ObjectFlags.ObjectTransfer |
(uint)LLObject.ObjectFlags.ObjectYouOwner |
(uint)LLObject.ObjectFlags.ObjectYouOfficer;
uint perms=part.GetEffectiveObjectFlags() |
(uint)LLObject.ObjectFlags.ObjectModify |
(uint)LLObject.ObjectFlags.ObjectCopy |
(uint)LLObject.ObjectFlags.ObjectMove |
(uint)LLObject.ObjectFlags.ObjectTransfer |
(uint)LLObject.ObjectFlags.ObjectYouOwner |
(uint)LLObject.ObjectFlags.ObjectYouOfficer;
foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
{
perms &= check(userID, objectID);
perms &= check(userID, objectID);
}
return perms;
}

View File

@ -284,37 +284,37 @@ namespace OpenSim.Region.Environment.Scenes
return -1;
}
public uint GetEffectivePermissions()
{
uint perms=(uint)(PermissionMask.Modify |
PermissionMask.Copy |
PermissionMask.Move |
PermissionMask.Transfer) | 7;
public uint GetEffectivePermissions()
{
uint perms=(uint)(PermissionMask.Modify |
PermissionMask.Copy |
PermissionMask.Move |
PermissionMask.Transfer) | 7;
foreach (SceneObjectPart part in m_parts.Values)
perms &= part.MaskEffectivePermissions();
foreach (SceneObjectPart part in m_parts.Values)
perms &= part.MaskEffectivePermissions();
if((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0)
perms &= ~(uint)PermissionMask.Modify;
if((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0)
perms &= ~(uint)PermissionMask.Copy;
if((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer;
if ((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0)
perms &= ~(uint)PermissionMask.Modify;
if ((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0)
perms &= ~(uint)PermissionMask.Copy;
if ((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer;
if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
perms &= ~((uint)PermissionMask.Modify >> 13);
if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
perms &= ~((uint)PermissionMask.Copy >> 13);
if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
perms &= ~((uint)PermissionMask.Transfer >> 13);
if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
perms &= ~((uint)PermissionMask.Modify >> 13);
if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
perms &= ~((uint)PermissionMask.Copy >> 13);
if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
perms &= ~((uint)PermissionMask.Transfer >> 13);
return perms;
}
return perms;
}
public void ApplyNextOwnerPermissions()
{
foreach (SceneObjectPart part in m_parts.Values)
part.ApplyNextOwnerPermissions();
}
public void ApplyNextOwnerPermissions()
{
foreach (SceneObjectPart part in m_parts.Values)
part.ApplyNextOwnerPermissions();
}
}
}

View File

@ -491,8 +491,8 @@ namespace OpenSim.Region.Environment.Scenes
invString.AddPermissionsStart();
invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask));
invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask));
invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask));
invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask));
invString.AddNameValueLine("group_mask", "00000000");
invString.AddNameValueLine("everyone_mask", "00000000");
invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask));
@ -610,64 +610,64 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public uint MaskEffectivePermissions()
{
uint mask=0x7fffffff;
public uint MaskEffectivePermissions()
{
uint mask=0x7fffffff;
foreach (TaskInventoryItem item in m_taskInventory.Values)
{
if(item.InvType != 6)
{
if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13);
if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13);
if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
}
else
{
if((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13);
if((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13);
if((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
}
foreach (TaskInventoryItem item in m_taskInventory.Values)
{
if (item.InvType != 6)
{
if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13);
if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
}
else
{
if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13);
if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
}
if((item.OwnerMask & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
if((item.OwnerMask & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer;
if((item.OwnerMask & (uint)PermissionMask.Modify) == 0)
mask &= ~(uint)PermissionMask.Modify;
}
return mask;
}
if ((item.OwnerMask & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
if ((item.OwnerMask & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer;
if ((item.OwnerMask & (uint)PermissionMask.Modify) == 0)
mask &= ~(uint)PermissionMask.Modify;
}
return mask;
}
public void ApplyNextOwnerPermissions()
{
BaseMask &= NextOwnerMask;
OwnerMask &= NextOwnerMask;
EveryoneMask &= NextOwnerMask;
public void ApplyNextOwnerPermissions()
{
BaseMask &= NextOwnerMask;
OwnerMask &= NextOwnerMask;
EveryoneMask &= NextOwnerMask;
foreach (TaskInventoryItem item in m_taskInventory.Values)
{
if(item.InvType == 6)
{
if((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Copy;
if((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Transfer;
if((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Modify;
}
item.OwnerMask &= item.NextOwnerMask;
item.BaseMask &= item.NextOwnerMask;
item.EveryoneMask &= item.NextOwnerMask;
}
foreach (TaskInventoryItem item in m_taskInventory.Values)
{
if (item.InvType == 6)
{
if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Copy;
if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Transfer;
if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Modify;
}
item.OwnerMask &= item.NextOwnerMask;
item.BaseMask &= item.NextOwnerMask;
item.EveryoneMask &= item.NextOwnerMask;
}
TriggerScriptChangedEvent(Changed.OWNER);
}
TriggerScriptChangedEvent(Changed.OWNER);
}
}
}

View File

@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_invulnerable; }
}
public float GodLevel
{
get { return m_godlevel; }
}
public float GodLevel
{
get { return m_godlevel; }
}
private readonly ulong m_regionHandle;

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSim.Region.Examples.SimpleModule")]

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSim.Region.Modules.AvatarFactory")]

View File

@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Python")]

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SvnSerialiser")]

View File

@ -51,7 +51,6 @@ namespace OpenSim.Region.Physics.OdePlugin
private CollisionLocker ode;
private OdeScene _mScene;
public OdePlugin()
{
ode = new CollisionLocker();
@ -81,7 +80,6 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
public enum StatusIndicators : int
{
Generic = 0,
@ -89,7 +87,6 @@ namespace OpenSim.Region.Physics.OdePlugin
End = 2
}
public struct sCollisionData
{
public uint ColliderLocalId;
@ -165,7 +162,6 @@ namespace OpenSim.Region.Physics.OdePlugin
private float mAvatarObjectContactFriction = 75f;
private float mAvatarObjectContactBounce = 0.1f;
private float avPIDD = 3200f;
private float avPIDP = 1400f;
private float avCapRadius = 0.37f;
@ -175,7 +171,6 @@ namespace OpenSim.Region.Physics.OdePlugin
private float avMovementDivisorWalk = 1.3f;
private float avMovementDivisorRun = 0.8f;
private float[] _heightmap;
private float[] _watermap;
@ -200,7 +195,6 @@ namespace OpenSim.Region.Physics.OdePlugin
private d.Contact AvatarMovementTerrainContact;
private d.Contact WaterContact;
//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it
//Ckrinke private int m_randomizeWater = 200;
private int m_physicsiterations = 10;
@ -233,7 +227,6 @@ namespace OpenSim.Region.Physics.OdePlugin
private IConfigSource m_config;
/// <summary>
/// Initiailizes the scene
/// Sets many properties that ODE requires to be stable
@ -246,24 +239,16 @@ namespace OpenSim.Region.Physics.OdePlugin
triCallback = TriCallback;
triArrayCallback = TriArrayCallback;
lock (OdeLock)
{
// Creat the world and the first space
// Create the world and the first space
world = d.WorldCreate();
space = d.HashSpaceCreate(IntPtr.Zero);
contactgroup = d.JointGroupCreate(0);
//contactgroup
d.WorldSetAutoDisableFlag(world, false);
}
// zero out a heightmap array float array (single dimention [flattened]))
@ -272,10 +257,8 @@ namespace OpenSim.Region.Physics.OdePlugin
// Zero out the prim spaces array (we split our space into smaller spaces so
// we can hit test less.
}
// Initialize the mesh plugin
public override void Initialise(IMesher meshmerizer, IConfigSource config)
{
@ -349,10 +332,7 @@ namespace OpenSim.Region.Physics.OdePlugin
avPIDP = physicsconfig.GetFloat("av_pid_proportional_win", 900.0f);
avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_win", 550000f);
}
}
}
staticPrimspace = new IntPtr[(int)(300 / metersInSpace), (int)(300 / metersInSpace)];
@ -409,7 +389,6 @@ namespace OpenSim.Region.Physics.OdePlugin
staticPrimspace[i, j] = IntPtr.Zero;
}
}
}
internal void waitForSpaceUnlock(IntPtr space)
@ -440,7 +419,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
// no lock here! It's invoked from within Simulate(), which is thread-locked
// Test if we're collidng a geom with a space.
// Test if we're colliding a geom with a space.
// If so we have to drill down into the space recursively
if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2))
@ -468,7 +447,6 @@ namespace OpenSim.Region.Physics.OdePlugin
return;
}
if (g1 == (IntPtr)0 || g2 == (IntPtr)0)
return;
@ -499,13 +477,9 @@ namespace OpenSim.Region.Physics.OdePlugin
int count = 0;
try
{
// Colliding Geom To Geom
// This portion of the function 'was' blatantly ripped off from BoxStack.cs
if (g1 == g2)
return; // Can't collide with yourself
@ -514,8 +488,6 @@ namespace OpenSim.Region.Physics.OdePlugin
lock (contacts)
{
count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf);
}
}
@ -539,6 +511,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
p1 = PANull;
}
if (!actor_name_map.TryGetValue(g2, out p2))
{
p2 = PANull;
@ -554,15 +527,11 @@ namespace OpenSim.Region.Physics.OdePlugin
// If we're colliding with terrain, use 'TerrainContact' instead of contact.
// allows us to have different settings
// We only need to test p2 for 'jump crouch purposes'
p2.IsColliding = true;
//if ((framecount % m_returncollisions) == 0)
switch (p1.PhysicsActorType)
{
case (int)ActorTypes.Agent:
@ -600,8 +569,6 @@ namespace OpenSim.Region.Physics.OdePlugin
(p1.PhysicsActorType == (int) ActorTypes.Agent &&
p2.PhysicsActorType == (int) ActorTypes.Prim))
{
# region disabled code1
//contacts[i].depth = contacts[i].depth * 4.15f;
/*
@ -637,10 +604,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
*/
#endregion
}
// If you interpenetrate a prim with another prim
if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim)
{
@ -650,7 +615,6 @@ namespace OpenSim.Region.Physics.OdePlugin
//op1.m_collisionscore++;
//op2.m_collisionscore++;
//if (op1.m_collisionscore > 8000 || op2.m_collisionscore > 8000)
//{
//op1.m_taintdisable = true;
@ -663,7 +627,6 @@ namespace OpenSim.Region.Physics.OdePlugin
//{
// Don't collide, one or both prim will expld.
//op1.m_interpenetrationcount++;
//op2.m_interpenetrationcount++;
//interpenetrations_before_disable = 200;
@ -678,7 +641,6 @@ namespace OpenSim.Region.Physics.OdePlugin
//AddPhysicsActorTaint(p2);
//}
//contacts[i].depth = contacts[i].depth / 8f;
//contacts[i].normal = new d.Vector3(0, 0, 1);
//}
@ -689,6 +651,7 @@ namespace OpenSim.Region.Physics.OdePlugin
//}
#endregion
}
if (contacts[i].depth >= 1.00f)
{
//m_log.Info("[P]: " + contacts[i].depth.ToString());
@ -713,6 +676,7 @@ namespace OpenSim.Region.Physics.OdePlugin
else
{
}
if (p1.PhysicsActorType == (int) ActorTypes.Agent)
{
OdeCharacter character = (OdeCharacter)p1;
@ -738,7 +702,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (contacts[i].depth >= 0f)
{
// If we're collidng against terrain
// If we're colliding against terrain
if (name1 == "Terrain" || name2 == "Terrain")
{
// If we're moving
@ -760,12 +724,11 @@ namespace OpenSim.Region.Physics.OdePlugin
{
if ((p2.PhysicsActorType == (int)ActorTypes.Prim))
{
}
else
{
}
//WaterContact.surface.soft_cfm = 0.0000f;
//WaterContact.surface.soft_erp = 0.00000f;
if (contacts[i].depth > 0.1f)
@ -814,7 +777,6 @@ namespace OpenSim.Region.Physics.OdePlugin
//System.Console.WriteLine(count.ToString());
//System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2);
}
}
private void collision_accounting_events(PhysicsActor p1, PhysicsActor p2, float collisiondepth)
@ -870,8 +832,6 @@ namespace OpenSim.Region.Physics.OdePlugin
break;
}
cc2.AddCollisionEvent(obj2LocalID, collisiondepth);
break;
case ActorTypes.Prim:
@ -1030,14 +990,10 @@ namespace OpenSim.Region.Physics.OdePlugin
//}
}
lock (_activeprims)
{
foreach (OdePrim chr in _activeprims)
{
if (d.BodyIsEnabled(chr.Body) && (!chr.m_disabled))
{
try
@ -1049,18 +1005,14 @@ namespace OpenSim.Region.Physics.OdePlugin
else
m_log.Debug("[PHYSICS]: unable to collide test active prim against space. The space was zero, the geom was zero or it was in the process of being removed");
}
}
catch (AccessViolationException)
{
m_log.Warn("[PHYSICS]: Unable to space collide");
}
}
}
}
}
#endregion
@ -1077,7 +1029,6 @@ namespace OpenSim.Region.Physics.OdePlugin
{
if (!_collisionEventPrim.Contains(obj))
_collisionEventPrim.Add(obj);
}
}
@ -1090,7 +1041,6 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
#region Add/Remove Entities
public override PhysicsActor AddAvatar(string avName, PhysicsVector position, PhysicsVector size)
@ -1131,8 +1081,6 @@ namespace OpenSim.Region.Physics.OdePlugin
rot.y = rotation.y;
rot.z = rotation.z;
OdePrim newPrim;
lock (OdeLock)
{
@ -1141,7 +1089,6 @@ namespace OpenSim.Region.Physics.OdePlugin
_prims.Add(newPrim);
}
return newPrim;
}
@ -1178,11 +1125,9 @@ namespace OpenSim.Region.Physics.OdePlugin
result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical);
return result;
}
public void remActivePrim(OdePrim deactivatePrim)
{
lock (_activeprims)
@ -1226,7 +1171,6 @@ namespace OpenSim.Region.Physics.OdePlugin
{
prim.ResetTaints();
if (prim.IsPhysical)
{
prim.disableBody();
@ -1267,7 +1211,6 @@ namespace OpenSim.Region.Physics.OdePlugin
{
m_log.Warn("[PHYSICS]: Unable to remove prim from physics scene");
}
}
catch (AccessViolationException)
{
@ -1297,8 +1240,6 @@ namespace OpenSim.Region.Physics.OdePlugin
//}
//}
}
}
}
}
@ -1337,7 +1278,6 @@ namespace OpenSim.Region.Physics.OdePlugin
/// <returns>a pointer to the new space it's in</returns>
public IntPtr recalculateSpaceForGeom(IntPtr geom, PhysicsVector pos, IntPtr currentspace)
{
// Called from setting the Position and Size of an ODEPrim so
// it's already in locked space.
@ -1418,7 +1358,6 @@ namespace OpenSim.Region.Physics.OdePlugin
{
if (d.SpaceQuery(currentspace, geom))
{
if (d.GeomIsSpace(currentspace))
{
waitForSpaceUnlock(currentspace);
@ -1523,14 +1462,11 @@ namespace OpenSim.Region.Physics.OdePlugin
if (returnint[1] < 0)
returnint[1] = 0;
return returnint;
}
#endregion
/// <summary>
/// Routine to figure out if we need to mesh this prim with our mesher
/// </summary>
@ -1564,7 +1500,6 @@ namespace OpenSim.Region.Physics.OdePlugin
return false;
}
/// <summary>
/// Called after our prim properties are set Scale, position etc.
/// We use this event queue like method to keep changes to the physical scene occuring in the threadlocked mutex
@ -1610,7 +1545,6 @@ namespace OpenSim.Region.Physics.OdePlugin
// skip a few frames to catch up gracefully.
// without shooting the physicsactors all over the place
if (step_time >= m_SkipFramesAtms)
{
// Instead of trying to catch up, it'll do 5 physics frames only
@ -1661,7 +1595,6 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
bool processedtaints = false;
lock (_taintedPrim)
@ -1682,7 +1615,6 @@ namespace OpenSim.Region.Physics.OdePlugin
if (processedtaints)
_taintedPrim = new List<OdePrim>();
}
lock (_activeprims)
@ -1697,7 +1629,6 @@ namespace OpenSim.Region.Physics.OdePlugin
//if ((framecount % m_randomizeWater) == 0)
// randomizeWater(waterlevel);
collision_optimized(timeStep);
lock (_collisionEventPrim)
@ -1718,7 +1649,6 @@ namespace OpenSim.Region.Physics.OdePlugin
pobj.SendCollisions();
break;
}
}
}
@ -1765,7 +1695,6 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
}
}
return fps;
}
@ -1893,6 +1822,7 @@ namespace OpenSim.Region.Physics.OdePlugin
return returnarr;
}
public float[] ResizeTerrain512Interpolation(float[] heightMap)
{
float[] returnarr = new float[262144];
@ -2139,7 +2069,6 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_log.Info((baseheight - 0.1f) + ((float)fluidRandomizer.Next(1, 9) / 10f));
}
lock (OdeLock)
{
if (!(WaterGeom == (IntPtr)0))
@ -2183,7 +2112,6 @@ namespace OpenSim.Region.Physics.OdePlugin
{
lock (OdeLock)
{
foreach (OdePrim prm in _prims)
{
RemovePrim(prm);

View File

@ -350,19 +350,19 @@ namespace OpenSim.Region.ScriptEngine.Common
double sinY = Math.Sin(v.y);
double sinZ = Math.Sin(v.z);
s = Math.Sqrt( cosY * cosZ - sinX * sinY * sinZ + cosX * cosZ + cosX * cosY + 1.0f) * 0.5f;
s = Math.Sqrt(cosY * cosZ - sinX * sinY * sinZ + cosX * cosZ + cosX * cosY + 1.0f) * 0.5f;
if (Math.Abs(s) < 0.00001) // null rotation
{
x = 0.0f;
x = 0.0f;
y = 1.0f;
z = 0.0f;
z = 0.0f;
}
else
{
s_i = 1.0f / (4.0f * s);
x = - ( -sinX * cosY - cosX * sinY * sinZ - sinX * cosZ) * s_i;
y = - ( -cosX * sinY * cosZ + sinX * sinZ - sinY) * s_i;
z = - ( -cosY * sinZ - sinX * sinY * cosZ - cosX * sinZ) * s_i;
s_i = 1.0f / (4.0f * s);
x = - (-sinX * cosY - cosX * sinY * sinZ - sinX * cosZ) * s_i;
y = - (-cosX * sinY * cosZ + sinX * sinZ - sinY) * s_i;
z = - (-cosY * sinZ - sinX * sinY * cosZ - cosX * sinZ) * s_i;
}
return new LSL_Types.Quaternion(x, y, z, s);
}
@ -2832,7 +2832,7 @@ namespace OpenSim.Region.ScriptEngine.Common
// Xantor 29/apr/2008
// Returns rotation described by rotating angle radians about axis.
// q = cos(a/2) + i ( x * sin(a/2)) + j (y * sin(a/2)) + k ( z * sin(a/2))
// q = cos(a/2) + i (x * sin(a/2)) + j (y * sin(a/2)) + k (z * sin(a/2))
public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle)
{
m_host.AddScriptLPS(1);

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -32,18 +32,14 @@ using System.Text.RegularExpressions;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
public class LSL2CSConverter
{
// Uses regex to convert LSL code to C# code.
//private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled);
private Dictionary<string, string> dataTypes = new Dictionary<string, string>();
private Dictionary<string, string> quotes = new Dictionary<string, string>();
public LSL2CSConverter()
{
// Only the types we need to convert
@ -72,7 +68,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
Script = Regex.Replace(Script, @"\r\n", "\n");
Script = Regex.Replace(Script, @"\n", "\r\n");
// QUOTE REPLACEMENT
// temporarily replace quotes so we can work our magic on the script without
// always considering if we are inside our outside quotes's
@ -86,21 +81,16 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
bool last_was_escape = false;
int quote_replaced_count = 0;
string[] blocked = new string[] {"Axiom","Db4objects","libsecondlife","log4net","Microsoft",
"Modified","Mono","MonoXnaCompactMaths","mscorlib","MySql",
"NHibernate","Nini","nunit","Ode","OpenSim","PhysX_Wrapper_Dotnet",
"PumaCode","RAIL","XMLRPC","System"};
for (int p = 0; p < blocked.Length;p++)
{
Match SecurityM = Regex.Match(Script, "[;}][^\"']+" + blocked[p].Replace(".", "\\.") + "\\.[^\"']", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
if (SecurityM.Success)
throw new Exception("CS0103: 'The name '" + blocked[p] + "' does not exist in the current context'");
}
for (int p = 0; p < Script.Length; p++)
@ -166,7 +156,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// END OF QUOTE REPLACEMENT
//
//
// PROCESS STATES
// Remove state definitions and add state names to start of each event within state
@ -253,7 +242,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
Script = ret;
ret = String.Empty;
foreach (string key in dataTypes.Keys)
{
string val;
@ -291,7 +279,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
Regex.Replace(Script, @"\[([^\]]*)\]", @"new LSL_Types.list($1)",
RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
// Replace (string) to .ToString() //
Script =
Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_.]+(\s*\([^\)]*\))?)", @"$1.ToString()",
@ -313,13 +300,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
Script = Script.Replace(key, "\"" + val + "\"");
}
//System.Console.WriteLine(Script);
Return = String.Empty;// +
//"using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;";
//Return += String.Empty +
// "namespace SecondLife { ";
//Return += String.Empty +
@ -333,8 +317,5 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
return Return;
}
}
}

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -69,7 +69,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
fs.Close();
}
/// <summary>
/// Parse LSO file.
/// </summary>
@ -77,7 +76,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
{
// The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack.
// HEADER BLOCK
Common.SendToDebug("Reading HEADER BLOCK at: 0");
fs.Seek(0, SeekOrigin.Begin);
@ -156,7 +154,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount);
// FUNCTION BLOCK
// Always right after STATIC BLOCK
LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock();
@ -186,7 +183,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
}
// STATE FRAME BLOCK
// Always right after FUNCTION BLOCK
Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR);
@ -213,7 +209,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
}
// STATE BLOCK
// For each StateFrameBlock there is one StateBlock with multiple event handlers
@ -239,7 +234,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
// We need to count number of bits flagged in EventMask?
// for each bit in myStateFrameBlock.StatePointer[i].EventMask
// ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE
@ -273,7 +267,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
}
//// READ FUNCTION CODE CHUNKS
//// Functions + Function start pos (GFR)
//// TODO: Somehow be able to identify and reference this
@ -320,7 +313,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
}
if (Common.IL_CreateFunctionList)
IL_INSERT_FUNCTIONLIST();
}
@ -459,7 +451,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " +
((LSO_Enums.Variable_Type_Codes) myCodeChunk.ReturnType.ObjectType).ToString());
// TODO: How to determine number of codechunks -- does this method work?
myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>();
byte reader = br_read(1)[0];
@ -492,7 +483,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
// End marker is 0x000
myCodeChunk.EndMarker = reader;
//
// Emit: START OF METHOD (FUNCTION)
//
@ -515,11 +505,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();");
ILGenerator il = methodBuilder.GetILGenerator();
if (Common.IL_UseTryCatch)
IL_INSERT_TRY(il, eventname);
// Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!");
//Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call...");
//il.Emit(OpCodes.Call, typeof(Console).GetMethod
@ -534,7 +522,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
il.Emit(OpCodes.Ldarg, _ic);
}
//
// CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL
//
@ -544,7 +531,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
FoundRet = LSL_PROCESS_OPCODE(il);
}
if (Common.IL_UseTryCatch)
IL_INSERT_END_TRY(il, eventname);
@ -558,17 +544,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
{
Common.SendToDebug("Creating function list");
string eventname = "GetFunctions";
Common.SendToDebug("Creating IL " + eventname);
// Define a private String field.
//FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public);
//FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private);
MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname,
MethodAttributes.Public,
typeof (string[]),
@ -579,7 +562,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
ILGenerator il = methodBuilder.GetILGenerator();
// IL_INSERT_TRY(il, eventname);
// // Push string to stack
@ -615,17 +597,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
//il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) }));
}
// IL_INSERT_END_TRY(il, eventname);
il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack
// il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) }));
il.Emit(OpCodes.Ret); // Return
}
private void IL_INSERT_TRY(ILGenerator il, string eventname)
{
/*
@ -687,7 +666,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
{
Common.SendToDebug("Found cached STATIC BLOCK");
return StaticBlocks[pos];
}

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSim.DataStore.DB4o")]

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Inventory")]

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LaunchSLClient")]

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSim.32BitLaunch")]

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSim.GUI")]