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.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -129,12 +129,12 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
IConfig myConfig = config.Configs["Startup"]; 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")) if (!modules.Contains("DefaultPermissionsModule"))
return; return;
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
@ -252,20 +252,20 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
} }
#endregion #endregion
public bool PropagatePermissions() public bool PropagatePermissions()
{ {
return false; return false;
} }
public bool BypassPermissions() public bool BypassPermissions()
{ {
return m_bypassPermissions; return m_bypassPermissions;
} }
public void SetBypassPermissions(bool value) public void SetBypassPermissions(bool value)
{ {
m_bypassPermissions=value; m_bypassPermissions=value;
} }
#region Object Permissions #region Object Permissions
@ -895,61 +895,61 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
#endregion #endregion
public bool CanLinkObject(LLUUID userID, LLUUID objectID) public bool CanLinkObject(LLUUID userID, LLUUID objectID)
{ {
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; 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); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; 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); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; 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); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; 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); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; 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); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; if (m_bypassPermissions) return m_bypassPermissionsValue;
return true; return true;
} }
public bool CanTeleport(LLUUID userID) public bool CanTeleport(LLUUID userID)
{ {
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; 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.Name = itemUpd.Name;
item.Description = itemUpd.Description; item.Description = itemUpd.Description;
item.NextPermissions = itemUpd.NextPermissions; item.NextPermissions = itemUpd.NextPermissions;
item.CurrentPermissions |= 8; // Slam! item.CurrentPermissions |= 8; // Slam!
item.EveryOnePermissions = itemUpd.EveryOnePermissions; item.EveryOnePermissions = itemUpd.EveryOnePermissions;
// TODO: Requires sanity checks // TODO: Requires sanity checks
@ -349,11 +349,11 @@ namespace OpenSim.Region.Environment.Scenes
if (item != null) if (item != null)
{ {
if (!ExternalChecks.ExternalChecksBypassPermissions()) if (!ExternalChecks.ExternalChecksBypassPermissions())
{ {
if((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
return; return;
} }
// TODO get recipient's root folder // TODO get recipient's root folder
CachedUserInfo recipientUserInfo CachedUserInfo recipientUserInfo
@ -372,37 +372,37 @@ namespace OpenSim.Region.Environment.Scenes
itemCopy.AssetType = item.AssetType; itemCopy.AssetType = item.AssetType;
itemCopy.InvType = item.InvType; itemCopy.InvType = item.InvType;
itemCopy.Folder = recipientUserInfo.RootFolder.ID; itemCopy.Folder = recipientUserInfo.RootFolder.ID;
if (ExternalChecks.ExternalChecksPropagatePermissions()) if (ExternalChecks.ExternalChecksPropagatePermissions())
{ {
if(item.InvType == 6) if (item.InvType == 6)
{ {
itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13;
} }
else else
{ {
Console.WriteLine("Non-Prim item ==>"); Console.WriteLine("Non-Prim item ==>");
itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
} }
itemCopy.CurrentPermissions = itemCopy.BasePermissions; itemCopy.CurrentPermissions = itemCopy.BasePermissions;
if((item.CurrentPermissions & 8) != 0) // Propagate slam bit if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit
{ {
itemCopy.CurrentPermissions = item.NextPermissions; itemCopy.CurrentPermissions = item.NextPermissions;
itemCopy.BasePermissions=itemCopy.CurrentPermissions; itemCopy.BasePermissions=itemCopy.CurrentPermissions;
itemCopy.CurrentPermissions |= 8; itemCopy.CurrentPermissions |= 8;
} }
itemCopy.NextPermissions = item.NextPermissions; itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
} }
else else
{ {
itemCopy.CurrentPermissions = item.CurrentPermissions; itemCopy.CurrentPermissions = item.CurrentPermissions;
itemCopy.NextPermissions = item.NextPermissions; itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
itemCopy.BasePermissions = item.BasePermissions; itemCopy.BasePermissions = item.BasePermissions;
} }
itemCopy.GroupID = item.GroupID; itemCopy.GroupID = item.GroupID;
itemCopy.GroupOwned = item.GroupOwned; itemCopy.GroupOwned = item.GroupOwned;
itemCopy.Flags = item.Flags; itemCopy.Flags = item.Flags;
@ -411,11 +411,11 @@ namespace OpenSim.Region.Environment.Scenes
recipientUserInfo.AddItem(itemCopy); recipientUserInfo.AddItem(itemCopy);
if (!ExternalChecks.ExternalChecksBypassPermissions()) if (!ExternalChecks.ExternalChecksBypassPermissions())
{ {
if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
senderUserInfo.DeleteItem(itemId); senderUserInfo.DeleteItem(itemId);
} }
// Let the recipient client know about this new item // Let the recipient client know about this new item
recipientClient.SendBulkUpdateInventory(itemCopy); recipientClient.SendBulkUpdateInventory(itemCopy);
@ -484,16 +484,16 @@ namespace OpenSim.Region.Environment.Scenes
if (asset != null) if (asset != null)
{ {
if(remoteClient.AgentId == oldAgentID) if (remoteClient.AgentId == oldAgentID)
{ {
CreateNewInventoryItem( CreateNewInventoryItem(
remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions); remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions);
} }
else else
{ {
CreateNewInventoryItem( CreateNewInventoryItem(
remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions); remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions);
} }
} }
else else
{ {
@ -571,9 +571,9 @@ namespace OpenSim.Region.Environment.Scenes
private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
AssetBase asset, uint nextOwnerMask) AssetBase asset, uint nextOwnerMask)
{ {
CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask); CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask);
} }
/// <summary> /// <summary>
/// Create a new inventory item. /// Create a new inventory item.
@ -603,8 +603,8 @@ namespace OpenSim.Region.Environment.Scenes
item.Folder = folderID; item.Folder = folderID;
item.CurrentPermissions = currentMask; item.CurrentPermissions = currentMask;
item.NextPermissions = nextOwnerMask; item.NextPermissions = nextOwnerMask;
item.EveryOnePermissions = everyoneMask; item.EveryOnePermissions = everyoneMask;
item.BasePermissions = baseMask; item.BasePermissions = baseMask;
userInfo.AddItem(item); userInfo.AddItem(item);
remoteClient.SendInventoryItemCreateUpdate(item); remoteClient.SendInventoryItemCreateUpdate(item);
@ -861,22 +861,22 @@ namespace OpenSim.Region.Environment.Scenes
agentItem.BasePermissions = taskItem.NextOwnerMask; agentItem.BasePermissions = taskItem.NextOwnerMask;
agentItem.CurrentPermissions = taskItem.NextOwnerMask; agentItem.CurrentPermissions = taskItem.NextOwnerMask;
agentItem.NextPermissions = taskItem.NextOwnerMask; agentItem.NextPermissions = taskItem.NextOwnerMask;
agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask; agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask;
} }
else else
{ {
agentItem.BasePermissions = taskItem.BaseMask; agentItem.BasePermissions = taskItem.BaseMask;
agentItem.CurrentPermissions = taskItem.OwnerMask; agentItem.CurrentPermissions = taskItem.OwnerMask;
agentItem.NextPermissions = taskItem.NextOwnerMask; agentItem.NextPermissions = taskItem.NextOwnerMask;
agentItem.EveryOnePermissions = taskItem.EveryoneMask; agentItem.EveryOnePermissions = taskItem.EveryoneMask;
} }
AddInventoryItem(remoteClient, agentItem); AddInventoryItem(remoteClient, agentItem);
if (!ExternalChecks.ExternalChecksBypassPermissions()) if (!ExternalChecks.ExternalChecksBypassPermissions())
{ {
if((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0) if ((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
part.RemoveInventoryItem(itemId); part.RemoveInventoryItem(itemId);
} }
} }
@ -918,11 +918,11 @@ namespace OpenSim.Region.Environment.Scenes
"[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
item.Name, primLocalID, remoteClient.Name); item.Name, primLocalID, remoteClient.Name);
part.ParentGroup.GetProperties(remoteClient); part.ParentGroup.GetProperties(remoteClient);
if (!ExternalChecks.ExternalChecksBypassPermissions()) if (!ExternalChecks.ExternalChecksBypassPermissions())
{ {
if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
RemoveInventoryItem(remoteClient, itemID); RemoveInventoryItem(remoteClient, itemID);
} }
} }
else else
{ {
@ -1094,27 +1094,27 @@ namespace OpenSim.Region.Environment.Scenes
item.Folder = DeRezPacket.AgentBlock.DestinationID; item.Folder = DeRezPacket.AgentBlock.DestinationID;
if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
{ {
uint perms=objectGroup.GetEffectivePermissions(); uint perms=objectGroup.GetEffectivePermissions();
uint nextPerms=(perms & 7) << 13; uint nextPerms=(perms & 7) << 13;
if((nextPerms & (uint)PermissionMask.Copy) == 0) if ((nextPerms & (uint)PermissionMask.Copy) == 0)
perms &= ~(uint)PermissionMask.Copy; perms &= ~(uint)PermissionMask.Copy;
if((nextPerms & (uint)PermissionMask.Transfer) == 0) if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer; perms &= ~(uint)PermissionMask.Transfer;
if((nextPerms & (uint)PermissionMask.Modify) == 0) if ((nextPerms & (uint)PermissionMask.Modify) == 0)
perms &= ~(uint)PermissionMask.Modify; perms &= ~(uint)PermissionMask.Modify;
item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask; item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions = item.BasePermissions; item.CurrentPermissions = item.BasePermissions;
item.NextPermissions = objectGroup.RootPart.NextOwnerMask; item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions |= 8; // Slam! item.CurrentPermissions |= 8; // Slam!
} }
else else
{ {
item.BasePermissions = objectGroup.GetEffectivePermissions(); item.BasePermissions = objectGroup.GetEffectivePermissions();
item.CurrentPermissions = objectGroup.GetEffectivePermissions(); item.CurrentPermissions = objectGroup.GetEffectivePermissions();
item.NextPermissions = objectGroup.RootPart.NextOwnerMask; item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
} }
// TODO: add the new fields (Flags, Sale info, etc) // TODO: add the new fields (Flags, Sale info, etc)
@ -1201,15 +1201,15 @@ namespace OpenSim.Region.Environment.Scenes
item.BasePermissions = objectGroup.RootPart.NextOwnerMask; item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
item.NextPermissions = 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.BasePermissions = objectGroup.GetEffectivePermissions();
item.CurrentPermissions = objectGroup.GetEffectivePermissions(); item.CurrentPermissions = objectGroup.GetEffectivePermissions();
item.NextPermissions = objectGroup.RootPart.NextOwnerMask; item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
} }
userInfo.AddItem(item); userInfo.AddItem(item);
@ -1259,14 +1259,14 @@ namespace OpenSim.Region.Environment.Scenes
item.BasePermissions = objectGroup.RootPart.NextOwnerMask; item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
item.NextPermissions = 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.RootPart.BaseMask; item.BasePermissions = objectGroup.RootPart.BaseMask;
item.CurrentPermissions = objectGroup.RootPart.OwnerMask; item.CurrentPermissions = objectGroup.RootPart.OwnerMask;
item.NextPermissions = objectGroup.RootPart.NextOwnerMask; item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
} }
userInfo.AddItem(item); userInfo.AddItem(item);
@ -1413,18 +1413,18 @@ namespace OpenSim.Region.Environment.Scenes
List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
if(rootPart.OwnerID != item.Owner) if (rootPart.OwnerID != item.Owner)
{ {
if((item.CurrentPermissions & 8) != 0) if ((item.CurrentPermissions & 8) != 0)
{ {
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {
part.EveryoneMask = item.EveryOnePermissions; part.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions; part.NextOwnerMask = item.NextPermissions;
} }
} }
group.ApplyNextOwnerPermissions(); group.ApplyNextOwnerPermissions();
} }
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {
@ -1434,11 +1434,11 @@ namespace OpenSim.Region.Environment.Scenes
part.OwnerID = item.Owner; part.OwnerID = item.Owner;
part.ChangeInventoryOwner(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.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions; part.NextOwnerMask = item.NextPermissions;
} }
} }
rootPart.TrimPermissions(); rootPart.TrimPermissions();
@ -1505,18 +1505,18 @@ namespace OpenSim.Region.Environment.Scenes
List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
if(rootPart.OwnerID != item.OwnerID) if (rootPart.OwnerID != item.OwnerID)
{ {
if((item.OwnerMask & 8) != 0) if ((item.OwnerMask & 8) != 0)
{ {
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {
part.EveryoneMask = item.EveryoneMask; part.EveryoneMask = item.EveryoneMask;
part.NextOwnerMask = item.NextOwnerMask; part.NextOwnerMask = item.NextOwnerMask;
} }
} }
group.ApplyNextOwnerPermissions(); group.ApplyNextOwnerPermissions();
} }
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {
@ -1526,11 +1526,11 @@ namespace OpenSim.Region.Environment.Scenes
part.OwnerID = item.OwnerID; part.OwnerID = item.OwnerID;
part.ChangeInventoryOwner(item.OwnerID); part.ChangeInventoryOwner(item.OwnerID);
} }
else if((item.OwnerMask & 8) != 0) // Slam! else if ((item.OwnerMask & 8) != 0) // Slam!
{ {
part.EveryoneMask = item.EveryoneMask; part.EveryoneMask = item.EveryoneMask;
part.NextOwnerMask = item.NextOwnerMask; part.NextOwnerMask = item.NextOwnerMask;
} }
} }
rootPart.TrimPermissions(); rootPart.TrimPermissions();
if (group.RootPart.Shape.PCode == (byte)PCode.Prim) 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) public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID)
{ {
SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); SceneObjectPart part=m_scene.GetSceneObjectPart(objectID);
uint perms=part.GetEffectiveObjectFlags() | uint perms=part.GetEffectiveObjectFlags() |
(uint)LLObject.ObjectFlags.ObjectModify | (uint)LLObject.ObjectFlags.ObjectModify |
(uint)LLObject.ObjectFlags.ObjectCopy | (uint)LLObject.ObjectFlags.ObjectCopy |
(uint)LLObject.ObjectFlags.ObjectMove | (uint)LLObject.ObjectFlags.ObjectMove |
(uint)LLObject.ObjectFlags.ObjectTransfer | (uint)LLObject.ObjectFlags.ObjectTransfer |
(uint)LLObject.ObjectFlags.ObjectYouOwner | (uint)LLObject.ObjectFlags.ObjectYouOwner |
(uint)LLObject.ObjectFlags.ObjectYouOfficer; (uint)LLObject.ObjectFlags.ObjectYouOfficer;
foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
{ {
perms &= check(userID, objectID); perms &= check(userID, objectID);
} }
return perms; return perms;
} }

View File

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

View File

@ -491,8 +491,8 @@ namespace OpenSim.Region.Environment.Scenes
invString.AddPermissionsStart(); invString.AddPermissionsStart();
invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask)); invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask));
invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask)); invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask));
invString.AddNameValueLine("group_mask", "00000000"); invString.AddNameValueLine("group_mask", "00000000");
invString.AddNameValueLine("everyone_mask", "00000000"); invString.AddNameValueLine("everyone_mask", "00000000");
invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask)); invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask));
@ -610,64 +610,64 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
public uint MaskEffectivePermissions() public uint MaskEffectivePermissions()
{ {
uint mask=0x7fffffff; uint mask=0x7fffffff;
foreach (TaskInventoryItem item in m_taskInventory.Values) foreach (TaskInventoryItem item in m_taskInventory.Values)
{ {
if(item.InvType != 6) if (item.InvType != 6)
{ {
if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0) if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13); mask &= ~((uint)PermissionMask.Copy >> 13);
if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13); mask &= ~((uint)PermissionMask.Transfer >> 13);
if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0) if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13); mask &= ~((uint)PermissionMask.Modify >> 13);
} }
else else
{ {
if((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13); mask &= ~((uint)PermissionMask.Copy >> 13);
if((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13); mask &= ~((uint)PermissionMask.Transfer >> 13);
if((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13); mask &= ~((uint)PermissionMask.Modify >> 13);
} }
if((item.OwnerMask & (uint)PermissionMask.Copy) == 0) if ((item.OwnerMask & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy; mask &= ~(uint)PermissionMask.Copy;
if((item.OwnerMask & (uint)PermissionMask.Transfer) == 0) if ((item.OwnerMask & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer; mask &= ~(uint)PermissionMask.Transfer;
if((item.OwnerMask & (uint)PermissionMask.Modify) == 0) if ((item.OwnerMask & (uint)PermissionMask.Modify) == 0)
mask &= ~(uint)PermissionMask.Modify; mask &= ~(uint)PermissionMask.Modify;
} }
return mask; return mask;
} }
public void ApplyNextOwnerPermissions() public void ApplyNextOwnerPermissions()
{ {
BaseMask &= NextOwnerMask; BaseMask &= NextOwnerMask;
OwnerMask &= NextOwnerMask; OwnerMask &= NextOwnerMask;
EveryoneMask &= NextOwnerMask; EveryoneMask &= NextOwnerMask;
foreach (TaskInventoryItem item in m_taskInventory.Values) foreach (TaskInventoryItem item in m_taskInventory.Values)
{ {
if(item.InvType == 6) if (item.InvType == 6)
{ {
if((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Copy; item.OwnerMask &= ~(uint)PermissionMask.Copy;
if((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Transfer; item.OwnerMask &= ~(uint)PermissionMask.Transfer;
if((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Modify; item.OwnerMask &= ~(uint)PermissionMask.Modify;
} }
item.OwnerMask &= item.NextOwnerMask; item.OwnerMask &= item.NextOwnerMask;
item.BaseMask &= item.NextOwnerMask; item.BaseMask &= item.NextOwnerMask;
item.EveryoneMask &= 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; } get { return m_invulnerable; }
} }
public float GodLevel public float GodLevel
{ {
get { return m_godlevel; } get { return m_godlevel; }
} }
private readonly ulong m_regionHandle; private readonly ulong m_regionHandle;

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("OpenSim.Region.Examples.SimpleModule")] [assembly: AssemblyTitle("OpenSim.Region.Examples.SimpleModule")]

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("OpenSim.Region.Modules.AvatarFactory")] [assembly: AssemblyTitle("OpenSim.Region.Modules.AvatarFactory")]

View File

@ -2,7 +2,7 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Python")] [assembly: AssemblyTitle("Python")]

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("SvnSerialiser")] [assembly: AssemblyTitle("SvnSerialiser")]

View File

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

View File

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

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

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

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

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

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -28,7 +28,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("OpenSim.DataStore.DB4o")] [assembly: AssemblyTitle("OpenSim.DataStore.DB4o")]

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Inventory")] [assembly: AssemblyTitle("Inventory")]

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("LaunchSLClient")] [assembly: AssemblyTitle("LaunchSLClient")]

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("OpenSim.32BitLaunch")] [assembly: AssemblyTitle("OpenSim.32BitLaunch")]

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; 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 // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("OpenSim.GUI")] [assembly: AssemblyTitle("OpenSim.GUI")]