mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
Formatting cleanup.
This commit is contained in:
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||
#region Constants
|
||||
|
||||
//Land types set with flags in ParcelOverlay.
|
||||
//Only one of these can be used.
|
||||
//Only one of these can be used.
|
||||
public const float BAN_LINE_SAFETY_HIEGHT = 100;
|
||||
public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000
|
||||
public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000
|
||||
@@ -584,7 +584,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||
if (byteArrayCount >= LAND_BLOCKS_PER_PACKET)
|
||||
{
|
||||
remote_client.sendLandParcelOverlay(byteArray, sequenceID);
|
||||
byteArrayCount = 0;
|
||||
byteArrayCount = 0;
|
||||
sequenceID++;
|
||||
byteArray = new byte[LAND_BLOCKS_PER_PACKET];
|
||||
}
|
||||
@@ -655,7 +655,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||
|
||||
public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client)
|
||||
{
|
||||
|
||||
|
||||
landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client);
|
||||
}
|
||||
|
||||
@@ -870,7 +870,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||
}
|
||||
|
||||
public void handleAnyClientMovement(ScenePresence avatar)
|
||||
//Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance.
|
||||
//Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance.
|
||||
{
|
||||
ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
||||
if (over != null)
|
||||
|
||||
@@ -622,7 +622,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||
/// <summary>
|
||||
/// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes
|
||||
/// aggreagete details such as the number of prims.
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="remote_client">
|
||||
/// A <see cref="IClientAPI"/>
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
|
||||
#region Constants
|
||||
// These are here for testing. They will be taken out
|
||||
|
||||
|
||||
//private uint PERM_ALL = (uint)2147483647;
|
||||
private uint PERM_COPY = (uint)32768;
|
||||
//private uint PERM_MODIFY = (uint)16384;
|
||||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
|
||||
#region Bypass Permissions / Debug Permissions Stuff
|
||||
|
||||
// Bypasses the permissions engine
|
||||
// Bypasses the permissions engine
|
||||
private bool m_bypassPermissions = false;
|
||||
private bool m_bypassPermissionsValue = true;
|
||||
private bool m_debugPermissions = false;
|
||||
@@ -126,18 +126,18 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
|
||||
IConfig myConfig = config.Configs["Startup"];
|
||||
|
||||
string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
|
||||
|
||||
List<string> modules=new List<string>(permissionModules.Split(','));
|
||||
string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
|
||||
|
||||
if(!modules.Contains("DefaultPermissionsModule"))
|
||||
return;
|
||||
List<string> modules=new List<string>(permissionModules.Split(','));
|
||||
|
||||
if (!modules.Contains("DefaultPermissionsModule"))
|
||||
return;
|
||||
|
||||
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
|
||||
|
||||
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
|
||||
|
||||
m_scene.RegisterModuleInterface<IScenePermissions>(this);
|
||||
|
||||
//Register functions with Scene External Checks!
|
||||
@@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Helper Functions
|
||||
protected void SendPermissionError(LLUUID user, string reason)
|
||||
@@ -252,38 +252,38 @@ 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
|
||||
|
||||
public uint GenerateClientFlags(LLUUID user, LLUUID objID)
|
||||
{
|
||||
// Here's the way this works,
|
||||
// Here's the way this works,
|
||||
// ObjectFlags and Permission flags are two different enumerations
|
||||
// ObjectFlags, however, tells the client to change what it will allow the user to do.
|
||||
// So, that means that all of the permissions type ObjectFlags are /temporary/ and only
|
||||
// supposed to be set when customizing the objectflags for the client.
|
||||
// So, that means that all of the permissions type ObjectFlags are /temporary/ and only
|
||||
// supposed to be set when customizing the objectflags for the client.
|
||||
|
||||
// These temporary objectflags get computed and added in this function based on the
|
||||
// These temporary objectflags get computed and added in this function based on the
|
||||
// Permission mask that's appropriate!
|
||||
// Outside of this method, they should never be added to objectflags!
|
||||
// -teravus
|
||||
|
||||
SceneObjectPart task=m_scene.GetSceneObjectPart(objID);
|
||||
|
||||
|
||||
// this shouldn't ever happen.. return no permissions/objectflags.
|
||||
if (task == null)
|
||||
return (uint)0;
|
||||
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
LLUUID objectOwner = task.OwnerID;
|
||||
|
||||
|
||||
// Remove any of the objectFlags that are temporary. These will get added back if appropriate
|
||||
// Remove any of the objectFlags that are temporary. These will get added back if appropriate
|
||||
// in the next bit of code
|
||||
|
||||
objflags &= (uint)
|
||||
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
|
||||
private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask)
|
||||
{
|
||||
// We are adding the temporary objectflags to the object's objectflags based on the
|
||||
// We are adding the temporary objectflags to the object's objectflags based on the
|
||||
// permission flag given. These change the F flags on the client.
|
||||
|
||||
if ((setPermissionMask & (uint)PermissionMask.Copy) != 0)
|
||||
@@ -404,7 +404,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0);
|
||||
|
||||
// People shouldn't be able to do anything with locked objects, except the Administrator
|
||||
// The 'set permissions' runs through a different permission check, so when an object owner
|
||||
// The 'set permissions' runs through a different permission check, so when an object owner
|
||||
// sets an object locked, the only thing that they can do is unlock it.
|
||||
//
|
||||
// Nobody but the object owner can set permissions on an object
|
||||
@@ -458,7 +458,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
bool permission = false;
|
||||
string reason = "Only registered users may communicate with another account.";
|
||||
|
||||
|
||||
|
||||
if (IsAdministrator(user))
|
||||
permission = true;
|
||||
|
||||
@@ -521,7 +521,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
return GenericParcelPermission(user, parcel);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Permission Checks
|
||||
private bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene)
|
||||
{
|
||||
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
{
|
||||
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
||||
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
||||
|
||||
|
||||
return GenericCommunicationPermission(user, target);
|
||||
}
|
||||
|
||||
@@ -632,8 +632,8 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
return false;
|
||||
}
|
||||
|
||||
// The client
|
||||
// may request to edit linked parts, and therefore, it needs
|
||||
// The client
|
||||
// may request to edit linked parts, and therefore, it needs
|
||||
// to also check for SceneObjectPart
|
||||
|
||||
// If it's not an object, we cant edit it.
|
||||
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
|
||||
|
||||
LLUUID taskOwner = null;
|
||||
// Added this because at this point in time it wouldn't be wise for
|
||||
// Added this because at this point in time it wouldn't be wise for
|
||||
// the administrator object permissions to take effect.
|
||||
LLUUID objectOwner = task.OwnerID;
|
||||
|
||||
@@ -682,12 +682,12 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
|
||||
|
||||
// This is an exception to the generic object permission.
|
||||
// Administrators who lock their objects should not be able to move them,
|
||||
// Administrators who lock their objects should not be able to move them,
|
||||
// however generic object permission should return true.
|
||||
// This keeps locked objects from being affected by random click + drag actions by accident
|
||||
// and allows the administrator to grab or delete a locked object.
|
||||
|
||||
// Administrators and estate managers are still able to click+grab locked objects not
|
||||
// Administrators and estate managers are still able to click+grab locked objects not
|
||||
// owned by them in the scene
|
||||
// This is by design.
|
||||
|
||||
@@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
|
||||
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID];
|
||||
LLUUID taskOwner = null;
|
||||
// Added this because at this point in time it wouldn't be wise for
|
||||
// Added this because at this point in time it wouldn't be wise for
|
||||
// the administrator object permissions to take effect.
|
||||
LLUUID objectOwner = task.OwnerID;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||
// Current time in elpased seconds since Jan 1st 1970
|
||||
private ulong CurrentTime
|
||||
{
|
||||
get {
|
||||
get {
|
||||
return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000);
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||
|
||||
TimeZone local = TimeZone.CurrentTimeZone;
|
||||
TicksOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks;
|
||||
|
||||
|
||||
m_log.Debug("[SUN] localtime offset is " + TicksOffset);
|
||||
|
||||
// Align ticks with Second Life
|
||||
@@ -246,7 +246,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||
avatar.ControllingClient.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition);
|
||||
}
|
||||
|
||||
// set estate settings for region access to sun position
|
||||
// set estate settings for region access to sun position
|
||||
m_scene.RegionInfo.EstateSettings.sunPosition = Position;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||
|
||||
Position = LLVector3.Rot(Position,Tilt);
|
||||
|
||||
// Finally we shift the axis so that more of the
|
||||
// Finally we shift the axis so that more of the
|
||||
// circle is above the horizon than below. This
|
||||
// makes the nights shorter than the days.
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ using OpenSim.Region.Environment.Interfaces;
|
||||
namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
|
||||
{
|
||||
/// <summary>
|
||||
/// A generic windows bitmap loader.
|
||||
/// A generic windows bitmap loader.
|
||||
/// Should be capable of handling 24-bit RGB images.
|
||||
///
|
||||
///
|
||||
/// Uses the System.Drawing filesystem loader.
|
||||
/// </summary>
|
||||
internal class BMP : GenericSystemDrawing
|
||||
|
||||
@@ -33,7 +33,7 @@ using OpenSim.Region.Environment.Interfaces;
|
||||
namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
|
||||
{
|
||||
/// <summary>
|
||||
/// A virtual class designed to have methods overloaded,
|
||||
/// A virtual class designed to have methods overloaded,
|
||||
/// this class provides an interface for a generic image
|
||||
/// saving and loading mechanism, but does not specify the
|
||||
/// format. It should not be insubstantiated directly.
|
||||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Protected method, generates a grayscale bitmap
|
||||
/// Protected method, generates a grayscale bitmap
|
||||
/// image from a specified terrain channel.
|
||||
/// </summary>
|
||||
/// <param name="map">The terrain channel to export to bitmap</param>
|
||||
@@ -134,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Protected method, generates a coloured bitmap
|
||||
/// Protected method, generates a coloured bitmap
|
||||
/// image from a specified terrain channel.
|
||||
/// </summary>
|
||||
/// <param name="map">The terrain channel to export to bitmap</param>
|
||||
|
||||
@@ -43,14 +43,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
|
||||
double sum = 0.0;
|
||||
double step2 = 0.0;
|
||||
|
||||
// compute delta map
|
||||
// compute delta map
|
||||
for (x = 0; x < map.Width; x++)
|
||||
{
|
||||
for (y = 0; y < map.Height; y++)
|
||||
{
|
||||
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
|
||||
|
||||
if (z > 0) // add in non-zero amount
|
||||
if (z > 0) // add in non-zero amount
|
||||
{
|
||||
sum += map[x, y] * z;
|
||||
step2 += z;
|
||||
@@ -60,14 +60,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
|
||||
|
||||
double avg = sum / step2;
|
||||
|
||||
// blend in map
|
||||
// blend in map
|
||||
for (x = 0; x < map.Width; x++)
|
||||
{
|
||||
for (y = 0; y < map.Height; y++)
|
||||
{
|
||||
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration;
|
||||
|
||||
if (z > 0) // add in non-zero amount
|
||||
if (z > 0) // add in non-zero amount
|
||||
{
|
||||
if (z > 1.0)
|
||||
z = 1.0;
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
|
||||
{
|
||||
/// <summary>
|
||||
/// Speed-Optimised Hybrid Erosion Brush
|
||||
///
|
||||
/// As per Jacob Olsen's Paper
|
||||
///
|
||||
/// As per Jacob Olsen's Paper
|
||||
/// http://www.oddlabs.com/download/terrain_generation.pdf
|
||||
/// </summary>
|
||||
public class OlsenSphere : ITerrainPaintableEffect
|
||||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
|
||||
{
|
||||
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
|
||||
|
||||
if (z > 0) // add in non-zero amount
|
||||
if (z > 0) // add in non-zero amount
|
||||
{
|
||||
const int NEIGHBOUR_ME = 4;
|
||||
const int NEIGHBOUR_MAX = 9;
|
||||
|
||||
@@ -43,14 +43,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
|
||||
double area = strength;
|
||||
double step = strength / 4.0;
|
||||
|
||||
// compute delta map
|
||||
// compute delta map
|
||||
for (x = 0; x < map.Width; x++)
|
||||
{
|
||||
for (y = 0; y < map.Height; y++)
|
||||
{
|
||||
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
|
||||
|
||||
if (z > 0) // add in non-zero amount
|
||||
if (z > 0) // add in non-zero amount
|
||||
{
|
||||
double average = 0.0;
|
||||
int avgsteps = 0;
|
||||
@@ -69,14 +69,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
|
||||
}
|
||||
}
|
||||
}
|
||||
// blend in map
|
||||
// blend in map
|
||||
for (x = 0; x < map.Width; x++)
|
||||
{
|
||||
for (y = 0; y < map.Height; y++)
|
||||
{
|
||||
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
|
||||
|
||||
if (z > 0) // add in non-zero amount
|
||||
if (z > 0) // add in non-zero amount
|
||||
{
|
||||
double da = z;
|
||||
double a = (map[x, y] - tweak[x, y]) * da;
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
|
||||
{
|
||||
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
|
||||
|
||||
if (z > 0) // add in non-zero amount
|
||||
if (z > 0) // add in non-zero amount
|
||||
{
|
||||
const int NEIGHBOUR_ME = 4;
|
||||
const int NEIGHBOUR_MAX = 9;
|
||||
|
||||
Reference in New Issue
Block a user