mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
Formatting cleanup.
This commit is contained in:
@@ -1204,11 +1204,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
public void SendPayPrice(LLUUID objectID, int[] payPrice)
|
||||
{
|
||||
if(payPrice[0] == 0 &&
|
||||
payPrice[1] == 0 &&
|
||||
payPrice[2] == 0 &&
|
||||
payPrice[3] == 0 &&
|
||||
payPrice[4] == 0)
|
||||
if (payPrice[0] == 0 &&
|
||||
payPrice[1] == 0 &&
|
||||
payPrice[2] == 0 &&
|
||||
payPrice[3] == 0 &&
|
||||
payPrice[4] == 0)
|
||||
return;
|
||||
|
||||
PayPriceReplyPacket payPriceReply = (PayPriceReplyPacket)PacketPool.Instance.GetPacket(PacketType.PayPriceReply);
|
||||
@@ -3094,7 +3094,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question)
|
||||
{
|
||||
ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion);
|
||||
@@ -3108,13 +3107,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
OutPacket(scriptQuestion, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
private void InitDefaultAnimations()
|
||||
{
|
||||
}
|
||||
|
||||
public LLUUID GetDefaultAnimation(string name)
|
||||
{
|
||||
if(m_defaultAnimations.ContainsKey(name))
|
||||
if (m_defaultAnimations.ContainsKey(name))
|
||||
return m_defaultAnimations[name];
|
||||
return LLUUID.Zero;
|
||||
}
|
||||
@@ -3318,8 +3318,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
|
||||
if (handlerUpdatePrimGroupScale != null)
|
||||
{
|
||||
|
||||
// Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z );
|
||||
// Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
|
||||
handlerUpdatePrimGroupScale(localId, scale5, this);
|
||||
handlerUpdateVector = OnUpdatePrimGroupPosition;
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
protected virtual void AddNewClient(Packet packet)
|
||||
{
|
||||
//Slave regions don't accept new clients
|
||||
if(m_localScene.Region_Status != RegionStatus.SlaveScene)
|
||||
if (m_localScene.Region_Status != RegionStatus.SlaveScene)
|
||||
{
|
||||
UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet;
|
||||
lock (clientCircuits)
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace OpenSim.Region.Communications.Local
|
||||
//Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
|
||||
if (!m_regions.ContainsKey(regionInfo.RegionHandle))
|
||||
{
|
||||
//Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
|
||||
//Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle);
|
||||
m_regions.Add(regionInfo.RegionHandle, regionInfo);
|
||||
|
||||
RegionCommsListener regionHost = new RegionCommsListener();
|
||||
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Communications.Local
|
||||
|
||||
public RegionInfo RequestClosestRegion(string regionName)
|
||||
{
|
||||
foreach(RegionInfo regInfo in m_regions.Values)
|
||||
foreach (RegionInfo regInfo in m_regions.Values)
|
||||
{
|
||||
if (regInfo.RegionName == regionName) return regInfo;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
|
||||
{
|
||||
if (Data.Length < 1000)
|
||||
{
|
||||
// for now (testing ) we only support files under 1000 bytes
|
||||
// for now (testing) we only support files under 1000 bytes
|
||||
byte[] transferData = new byte[Data.Length + 4];
|
||||
Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4);
|
||||
Array.Copy(Data, 0, transferData, 4, Data.Length);
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||
list.Add(entry.AgentID);
|
||||
}
|
||||
}
|
||||
if(list.Count == 0)
|
||||
if (list.Count == 0)
|
||||
{
|
||||
list.Add(LLUUID.Zero);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
}
|
||||
protected void DebugPermissionInformation(string permissionCalled)
|
||||
{
|
||||
if(m_debugPermissions)
|
||||
if (m_debugPermissions)
|
||||
m_log.Info("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||
if (user != LLUUID.Zero)
|
||||
{
|
||||
LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers;
|
||||
foreach(LLUUID estatemanager in estatemanagers)
|
||||
foreach (LLUUID estatemanager in estatemanagers)
|
||||
{
|
||||
if (estatemanager == user)
|
||||
return true;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||
private double d_day_length = 4; // A VW day is 4 RW hours long
|
||||
private int d_year_length = 60; // There are 60 VW days in a VW year
|
||||
private double d_day_night = 0.45; // axis offset: ratio of light-to-dark, approx 1:3
|
||||
private double d_longitude = -73.53;
|
||||
private double d_longitude = -73.53;
|
||||
private double d_latitude = 41.29;
|
||||
|
||||
// Frame counter
|
||||
@@ -155,48 +155,44 @@ namespace OpenSim.Region.Environment.Modules
|
||||
m_longitude = d_longitude;
|
||||
}
|
||||
|
||||
switch(m_mode)
|
||||
switch (m_mode)
|
||||
{
|
||||
case "T1":
|
||||
default:
|
||||
case "SL":
|
||||
// Time taken to complete a cycle (day and season)
|
||||
|
||||
case "T1" :
|
||||
SecondsPerSunCycle = (uint) (m_day_length * 60 * 60);
|
||||
SecondsPerYear = (uint) (SecondsPerSunCycle*m_year_length);
|
||||
|
||||
default :
|
||||
// Ration of real-to-virtual time
|
||||
|
||||
case "SL" :
|
||||
// Time taken to complete a cycle (day and season)
|
||||
VWTimeRatio = 24/m_day_length;
|
||||
|
||||
SecondsPerSunCycle = (uint) (m_day_length * 60 * 60);
|
||||
SecondsPerYear = (uint) (SecondsPerSunCycle*m_year_length);
|
||||
// Speed of rotation needed to complete a cycle in the
|
||||
// designated period (day and season)
|
||||
|
||||
// Ration of real-to-virtual time
|
||||
SunSpeed = SunCycle/SecondsPerSunCycle;
|
||||
SeasonSpeed = SeasonalCycle/SecondsPerYear;
|
||||
|
||||
VWTimeRatio = 24/m_day_length;
|
||||
// Horizon translation
|
||||
|
||||
// Speed of rotation needed to complete a cycle in the
|
||||
// designated period (day and season)
|
||||
HorizonShift = m_day_night; // Z axis translation
|
||||
HoursToRadians = (SunCycle/24)*VWTimeRatio;
|
||||
|
||||
SunSpeed = SunCycle/SecondsPerSunCycle;
|
||||
SeasonSpeed = SeasonalCycle/SecondsPerYear;
|
||||
// Insert our event handling hooks
|
||||
|
||||
// Horizon translation
|
||||
scene.EventManager.OnFrame += SunUpdate;
|
||||
scene.EventManager.OnNewClient += SunToClient;
|
||||
|
||||
HorizonShift = m_day_night; // Z axis translation
|
||||
HoursToRadians = (SunCycle/24)*VWTimeRatio;
|
||||
ready = true;
|
||||
|
||||
// Insert our event handling hooks
|
||||
|
||||
scene.EventManager.OnFrame += SunUpdate;
|
||||
scene.EventManager.OnNewClient += SunToClient;
|
||||
|
||||
ready = true;
|
||||
|
||||
m_log.Debug("[SUN] Mode is "+m_mode);
|
||||
m_log.Debug("[SUN] Initialization completed. Day is "+SecondsPerSunCycle+" seconds, and year is "+m_year_length+" days");
|
||||
m_log.Debug("[SUN] Axis offset is "+m_day_night);
|
||||
m_log.Debug("[SUN] Positional data updated every "+m_frame_mod+" frames");
|
||||
m_log.Debug("[SUN] Mode is "+m_mode);
|
||||
m_log.Debug("[SUN] Initialization completed. Day is "+SecondsPerSunCycle+" seconds, and year is "+m_year_length+" days");
|
||||
m_log.Debug("[SUN] Axis offset is "+m_day_night);
|
||||
m_log.Debug("[SUN] Positional data updated every "+m_frame_mod+" frames");
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,21 +220,20 @@ namespace OpenSim.Region.Environment.Modules
|
||||
|
||||
public void SunToClient(IClientAPI client)
|
||||
{
|
||||
if(m_mode != "T1")
|
||||
if (m_mode != "T1")
|
||||
{
|
||||
if(ready)
|
||||
{
|
||||
GenSunPos(); // Generate shared values once
|
||||
client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition);
|
||||
if (ready)
|
||||
{
|
||||
GenSunPos(); // Generate shared values once
|
||||
client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition);
|
||||
m_log.Debug("[SUN] Initial update for new client");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SunUpdate()
|
||||
{
|
||||
|
||||
if(((m_frame++%m_frame_mod) != 0) || !ready)
|
||||
if (((m_frame++%m_frame_mod) != 0) || !ready)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -253,7 +248,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||
|
||||
// set estate settings for region access to sun position
|
||||
m_scene.RegionInfo.EstateSettings.sunPosition = Position;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -596,7 +596,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
ScenePresence presence;
|
||||
TryGetAvatar(remoteClient.AgentId, out presence);
|
||||
byte[] data = null;
|
||||
if(invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum
|
||||
if (invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum
|
||||
{
|
||||
LLVector3 pos=presence.AbsolutePosition;
|
||||
string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n",
|
||||
@@ -996,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
permissionToDelete = false; //Just taking copy!
|
||||
|
||||
}
|
||||
else if(DeRezPacket.AgentBlock.Destination == 4) //Take
|
||||
else if (DeRezPacket.AgentBlock.Destination == 4) //Take
|
||||
{
|
||||
// Take
|
||||
permissionToTake = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
|
||||
|
||||
@@ -452,7 +452,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
d);
|
||||
}
|
||||
|
||||
public delegate void SendCloseChildAgentDelegate( LLUUID agentID, List<ulong> regionlst);
|
||||
public delegate void SendCloseChildAgentDelegate(LLUUID agentID, List<ulong> regionlst);
|
||||
|
||||
/// <summary>
|
||||
/// This Closes child agents on neighboring regions
|
||||
@@ -568,7 +568,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// assume local regions are always up
|
||||
destRegionUp = true;
|
||||
}
|
||||
if(destRegionUp)
|
||||
|
||||
if (destRegionUp)
|
||||
{
|
||||
avatar.Close();
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
public void addCheckRezObject(CanRezObject delegateFunc)
|
||||
{
|
||||
if(!CanRezObjectCheckFunctions.Contains(delegateFunc))
|
||||
if (!CanRezObjectCheckFunctions.Contains(delegateFunc))
|
||||
CanRezObjectCheckFunctions.Add(delegateFunc);
|
||||
}
|
||||
public void removeCheckRezObject(CanRezObject delegateFunc)
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
foreach (Scene mscene in m_localScenes)
|
||||
{
|
||||
if((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) &&
|
||||
if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) &&
|
||||
(mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port))
|
||||
{
|
||||
scene = mscene;
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_taskInventory.Values)
|
||||
{
|
||||
if(item.Name == name)
|
||||
if (item.Name == name)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -271,14 +271,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
private string FindAvailableInventoryName(string name)
|
||||
{
|
||||
if(!InventoryContainsName(name))
|
||||
if (!InventoryContainsName(name))
|
||||
return name;
|
||||
|
||||
int suffix=1;
|
||||
while(suffix < 256)
|
||||
while (suffix < 256)
|
||||
{
|
||||
string tryName=String.Format("{0} {1}", name, suffix);
|
||||
if(!InventoryContainsName(tryName))
|
||||
if (!InventoryContainsName(tryName))
|
||||
return tryName;
|
||||
suffix++;
|
||||
}
|
||||
@@ -296,7 +296,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
item.ParentPartID = UUID;
|
||||
|
||||
string name=FindAvailableInventoryName(item.Name);
|
||||
if(name == String.Empty)
|
||||
if (name == String.Empty)
|
||||
return;
|
||||
|
||||
item.Name=name;
|
||||
|
||||
@@ -2049,7 +2049,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
data[pos] = (byte)pTexAnim.SizeY; pos++;
|
||||
|
||||
Helpers.FloatToBytes(pTexAnim.Start).CopyTo(data, pos);
|
||||
Helpers.FloatToBytes(pTexAnim.Length ).CopyTo(data, pos + 4);
|
||||
Helpers.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4);
|
||||
Helpers.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8);
|
||||
|
||||
m_TextureAnimation = data;
|
||||
@@ -2495,7 +2495,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
(int) (color.x*0xff),
|
||||
(int) (color.y*0xff),
|
||||
(int) (color.z*0xff));
|
||||
SetText( text );
|
||||
SetText(text);
|
||||
}
|
||||
|
||||
public int registerTargetWaypoint(LLVector3 target, float tolerance)
|
||||
|
||||
@@ -1263,7 +1263,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
//bool colliding = (m_physicsActor.IsColliding==true);
|
||||
//if (controlland)
|
||||
// m_log.Info("[AGENT]: landCommand");
|
||||
//if (colliding )
|
||||
//if (colliding)
|
||||
// m_log.Info("[AGENT]: colliding");
|
||||
//if (m_physicsActor.Flying && colliding && controlland)
|
||||
//{
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
float cpu = m_counter.NextValue()/40f;
|
||||
LLVector3 size = new LLVector3(cpu, cpu, cpu);
|
||||
|
||||
RootPart.Resize( size );
|
||||
RootPart.Resize(size);
|
||||
|
||||
base.UpdateMovement();
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
|
||||
for (int i = 0; i < (objs*objs*objs); i++)
|
||||
{
|
||||
LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / ( objs )) * 4, (i / (objs*objs)) * 4);
|
||||
LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4);
|
||||
ComplexObject complexObject =
|
||||
new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(),
|
||||
pos + posOffset);
|
||||
|
||||
@@ -729,7 +729,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
|
||||
{
|
||||
prim.UpdateKinetics();
|
||||
}
|
||||
//if(this._simFlatPlanet!=null) this._simFlatPlanet.Restore();
|
||||
//if (this._simFlatPlanet!=null) this._simFlatPlanet.Restore();
|
||||
}
|
||||
|
||||
public override void GetResults()
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
}
|
||||
|
||||
// each simplex still in the list belongs to the hull of the region in question
|
||||
// The new vertex (yes, we still deal with verices here :-) ) forms a triangle
|
||||
// The new vertex (yes, we still deal with verices here :-)) forms a triangle
|
||||
// with each of these simplices. Build the new triangles and add them to the list
|
||||
foreach (Simplex s in simplices)
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
public bool m_returnCollisions = false;
|
||||
|
||||
// Default we're a Geometry
|
||||
private CollisionCategories m_collisionCategories = (CollisionCategories.Geom );
|
||||
private CollisionCategories m_collisionCategories = (CollisionCategories.Geom);
|
||||
|
||||
// Default, Collide with Other Geometries, spaces and Bodies
|
||||
private CollisionCategories m_collisionFlags = m_default_collisionFlags;
|
||||
@@ -1170,9 +1170,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
if (m_usePID)
|
||||
{
|
||||
|
||||
// If we're using the PID controller, then we have no gravity
|
||||
fz = ((9.8f) * this.Mass );
|
||||
fz = 9.8f * this.Mass;
|
||||
|
||||
// no lock; for now it's only called from within Simulate()
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if(inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
|
||||
if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
|
||||
{
|
||||
invItemID=inv.Key;
|
||||
break;
|
||||
@@ -152,9 +152,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.AddScriptLPS(1);
|
||||
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if(inv.Value.Name == name)
|
||||
if (inv.Value.Name == name)
|
||||
{
|
||||
if(inv.Value.Type != type)
|
||||
if (inv.Value.Type != type)
|
||||
return LLUUID.Zero;
|
||||
|
||||
return inv.Value.AssetID.ToString();
|
||||
@@ -168,7 +168,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.AddScriptLPS(1);
|
||||
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if(inv.Value.Name == name)
|
||||
if (inv.Value.Name == name)
|
||||
{
|
||||
return inv.Value.AssetID.ToString();
|
||||
}
|
||||
@@ -362,11 +362,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
double x,y,z,s;
|
||||
|
||||
double c1 = Math.Cos(v.y / 2);
|
||||
double s1 = Math.Sin(v.y / 2 );
|
||||
double c2 = Math.Cos(v.z / 2 );
|
||||
double s2 = Math.Sin(v.z / 2 );
|
||||
double c3 = Math.Cos(v.x / 2 );
|
||||
double s3 = Math.Sin(v.x / 2 );
|
||||
double s1 = Math.Sin(v.y / 2);
|
||||
double c2 = Math.Cos(v.z / 2);
|
||||
double s2 = Math.Sin(v.z / 2);
|
||||
double c3 = Math.Cos(v.x / 2);
|
||||
double s3 = Math.Sin(v.x / 2);
|
||||
|
||||
double c1c2 = c1 * c2;
|
||||
double s1s2 = s1 * s2;
|
||||
@@ -2900,7 +2900,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
rotation rot = llEuler2Rot(<0,70,0> * DEG_TO_RAD);
|
||||
|
||||
llOwnerSay("to get here, we rotate over: "+ (string) llRot2Axis(rot) );
|
||||
llOwnerSay("to get here, we rotate over: "+ (string) llRot2Axis(rot));
|
||||
llOwnerSay("and we rotate for: "+ (llRot2Angle(rot) * RAD_TO_DEG));
|
||||
|
||||
// convert back and forth between quaternion <-> vector and angle
|
||||
@@ -3339,14 +3339,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if (src.Data.Length > 0)
|
||||
{
|
||||
ret = src.Data[x++].ToString();
|
||||
for(;x<src.Data.Length;x++)
|
||||
for (; x < src.Data.Length; x++)
|
||||
{
|
||||
ret += ", "+src.Data[x].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3367,9 +3366,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
for(int i=0; i<src.Length; i++)
|
||||
for (int i = 0; i < src.Length; i++)
|
||||
{
|
||||
switch(src[i])
|
||||
switch (src[i])
|
||||
{
|
||||
case '<' :
|
||||
parens++;
|
||||
@@ -3435,15 +3434,14 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
if (src.Length != stride && src.Length%stride == 0)
|
||||
{
|
||||
|
||||
chunkk = src.Length/stride;
|
||||
|
||||
chunks = new int[chunkk];
|
||||
|
||||
for(int i=0;i<chunkk;i++)
|
||||
for (int i = 0; i < chunkk; i++)
|
||||
chunks[i] = i;
|
||||
|
||||
for(int i=0; i<chunkk-1; i++)
|
||||
for (int i = 0; i < chunkk - 1; i++)
|
||||
{
|
||||
// randomly select 2 chunks
|
||||
index1 = rand.Next(rand.Next(65536));
|
||||
@@ -3461,10 +3459,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
result = new LSL_Types.list();
|
||||
|
||||
for(int i=0; i<chunkk; i++)
|
||||
for(int j=0;j<stride;j++)
|
||||
for (int i = 0; i < chunkk; i++)
|
||||
{
|
||||
for (int j = 0; j < stride; j++)
|
||||
{
|
||||
result.Add(src.Data[chunks[i]*stride+j]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
object[] array = new object[src.Length];
|
||||
@@ -3540,25 +3541,28 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
stride = 1;
|
||||
|
||||
if (stride > 0)
|
||||
for(int i=0;i<src.Length;i+=stride)
|
||||
{
|
||||
for (int i = 0; i < src.Length; i += stride)
|
||||
{
|
||||
if (i<=ei[0] && i>=si[0])
|
||||
result.Add(src.Data[i]);
|
||||
if (twopass && i>=si[1] && i<=ei[1])
|
||||
result.Add(src.Data[i]);
|
||||
}
|
||||
}
|
||||
else if (stride < 0)
|
||||
for(int i=src.Length-1;i>=0;i+=stride)
|
||||
{
|
||||
for (int i = src.Length - 1; i >= 0; i += stride)
|
||||
{
|
||||
if (i<=ei[0] && i>=si[0])
|
||||
if (i <= ei[0] && i >= si[0])
|
||||
result.Add(src.Data[i]);
|
||||
if (twopass && i>=si[1] && i<=ei[1])
|
||||
if (twopass && i >= si[1] && i <= ei[1])
|
||||
result.Add(src.Data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public LSL_Types.Vector3 llGetRegionCorner()
|
||||
@@ -3635,12 +3639,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
if (src.Length != 0 && test.Length != 0)
|
||||
{
|
||||
for(int i=0; i< length; i++)
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
if (src.Data[i].Equals(test.Data[0]))
|
||||
{
|
||||
int j;
|
||||
for(j=1;j<test.Length;j++)
|
||||
for (j = 1; j < test.Length; j++)
|
||||
if (!src.Data[i+j].Equals(test.Data[j]))
|
||||
break;
|
||||
if (j == test.Length)
|
||||
@@ -4328,7 +4332,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
return;
|
||||
}
|
||||
string[] buts = new string[buttons.Length];
|
||||
for(int i = 0; i < buttons.Length; i++)
|
||||
for (int i = 0; i < buttons.Length; i++)
|
||||
{
|
||||
if (buttons.Data[i].ToString() == String.Empty)
|
||||
{
|
||||
@@ -4516,7 +4520,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
int face;
|
||||
LSL_Types.Vector3 v;
|
||||
|
||||
switch(code)
|
||||
switch (code)
|
||||
{
|
||||
case 6: // PRIM_POSITION
|
||||
if (remain < 1)
|
||||
@@ -4826,12 +4830,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
LSL_Types.list res = new LSL_Types.list();
|
||||
int idx=0;
|
||||
while(idx < rules.Length)
|
||||
while (idx < rules.Length)
|
||||
{
|
||||
int code=Convert.ToInt32(rules.Data[idx++]);
|
||||
int remain=rules.Length-idx;
|
||||
|
||||
switch(code)
|
||||
switch (code)
|
||||
{
|
||||
case 2: // PRIM_MATERIAL
|
||||
res.Add(new LSL_Types.LSLInteger(m_host.Material));
|
||||
@@ -5339,19 +5343,20 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
// All entries are initially valid
|
||||
|
||||
for(int i=0; i<mlen; i++) active[i] = true;
|
||||
for (int i = 0; i < mlen; i++)
|
||||
active[i] = true;
|
||||
|
||||
offset[mlen] = srclen;
|
||||
|
||||
while(beginning<srclen)
|
||||
while (beginning < srclen)
|
||||
{
|
||||
|
||||
best = mlen; // as bad as it gets
|
||||
|
||||
// Scan for separators
|
||||
|
||||
for(j=0; j<seplen; j++)
|
||||
{
|
||||
for (j = 0; j < seplen; j++)
|
||||
{
|
||||
if (active[j])
|
||||
{
|
||||
// scan all of the markers
|
||||
@@ -5359,7 +5364,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
// not present at all
|
||||
active[j] = false;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
// present and correct
|
||||
if (offset[j] < offset[best])
|
||||
@@ -5377,7 +5383,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
if (offset[best] != beginning)
|
||||
{
|
||||
for(j=seplen; (j<mlen) && (offset[best] > beginning); j++)
|
||||
for (j = seplen; (j < mlen) && (offset[best] > beginning); j++)
|
||||
{
|
||||
if (active[j])
|
||||
{
|
||||
@@ -6174,7 +6180,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
foreach (object o in args.Data)
|
||||
{
|
||||
switch(o.ToString())
|
||||
switch (o.ToString())
|
||||
{
|
||||
case "1":
|
||||
ret.Add(av.Firstname + " " + av.Lastname);
|
||||
@@ -6207,9 +6213,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
SceneObjectPart obj = World.GetSceneObjectPart(key);
|
||||
if (obj != null)
|
||||
{
|
||||
foreach(object o in args.Data)
|
||||
foreach (object o in args.Data)
|
||||
{
|
||||
switch(o.ToString())
|
||||
switch (o.ToString())
|
||||
{
|
||||
case "1":
|
||||
ret.Add(obj.Name);
|
||||
|
||||
@@ -370,21 +370,21 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
LSL_Types.list llList2List(LSL_Types.list src, int start, int end);
|
||||
//wiki: llDeleteSubList(list src, integer start, integer end)
|
||||
LSL_Types.list llDeleteSubList(LSL_Types.list src, int start, int end);
|
||||
//wiki: integer llGetListEntryType( list src, integer index )
|
||||
//wiki: integer llGetListEntryType(list src, integer index)
|
||||
LSL_Types.LSLInteger llGetListEntryType(LSL_Types.list src, int index);
|
||||
//wiki: string llList2CSV( list src )
|
||||
//wiki: string llList2CSV(list src)
|
||||
string llList2CSV(LSL_Types.list src);
|
||||
//wiki: list llCSV2List( string src )
|
||||
//wiki: list llCSV2List(string src)
|
||||
LSL_Types.list llCSV2List(string src);
|
||||
//wiki: list llListRandomize( list src, integer stride )
|
||||
//wiki: list llListRandomize(list src, integer stride)
|
||||
LSL_Types.list llListRandomize(LSL_Types.list src, int stride);
|
||||
//wiki: list llList2ListStrided( list src, integer start, integer end, integer stride )
|
||||
//wiki: list llList2ListStrided(list src, integer start, integer end, integer stride)
|
||||
LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride);
|
||||
//wiki: vector llGetRegionCorner( )
|
||||
//wiki: vector llGetRegionCorner()
|
||||
LSL_Types.Vector3 llGetRegionCorner();
|
||||
//wiki: list llListInsertList( list dest, list src, integer start )
|
||||
//wiki: list llListInsertList(list dest, list src, integer start)
|
||||
LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start);
|
||||
//wiki: integer llListFindList( list src, list test )
|
||||
//wiki: integer llListFindList(list src, list test)
|
||||
LSL_Types.LSLInteger llListFindList(LSL_Types.list src, LSL_Types.list test);
|
||||
//wiki: string llGetObjectName()
|
||||
string llGetObjectName();
|
||||
@@ -479,7 +479,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
string llDumpList2String(LSL_Types.list src, string seperator);
|
||||
//wiki: integer llScriptDanger(vector pos)
|
||||
LSL_Types.LSLInteger llScriptDanger(LSL_Types.Vector3 pos);
|
||||
//wiki: llDialog( key avatar, string message, list buttons, integer chat_channel )
|
||||
//wiki: llDialog(key avatar, string message, list buttons, integer chat_channel)
|
||||
void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel);
|
||||
//wiki: llVolumeDetect(integer detect)
|
||||
void llVolumeDetect(int detect);
|
||||
@@ -503,9 +503,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
void llCloseRemoteDataChannel(string channel);
|
||||
//wiki: string llMD5String(string src, integer nonce)
|
||||
string llMD5String(string src, int nonce);
|
||||
//wiki: llSetPrimitiveParams( list rules )
|
||||
//wiki: llSetPrimitiveParams(list rules)
|
||||
void llSetPrimitiveParams(LSL_Types.list rules);
|
||||
//wiki: llSetLinkPrimitiveParams(integer linknumber, list rules )
|
||||
//wiki: llSetLinkPrimitiveParams(integer linknumber, list rules)
|
||||
void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules);
|
||||
//wiki: string llStringToBase64(string str)
|
||||
string llStringToBase64(string str);
|
||||
@@ -519,7 +519,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
double llLog10(double val);
|
||||
//wiki: double llLog(double val)
|
||||
double llLog(double val);
|
||||
//wiki: list llGetAnimationList( key id )
|
||||
//wiki: list llGetAnimationList(key id)
|
||||
LSL_Types.list llGetAnimationList(string id);
|
||||
//wiki: llSetParcelMusicURL(string url)
|
||||
void llSetParcelMusicURL(string url);
|
||||
@@ -541,7 +541,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
LSL_Types.LSLInteger llGetNumberOfPrims();
|
||||
//wiki: key llGetNumberOfNotecardLines(string name)
|
||||
string llGetNumberOfNotecardLines(string name);
|
||||
//wiki: list llGetBoundingBox( key object )
|
||||
//wiki: list llGetBoundingBox(key object)
|
||||
LSL_Types.list llGetBoundingBox(string obj);
|
||||
//wiki: vector llGetGeometricCenter()
|
||||
LSL_Types.Vector3 llGetGeometricCenter();
|
||||
@@ -557,7 +557,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
string llGetSimulatorHostname();
|
||||
//llSetLocalRot(rotation rot)
|
||||
void llSetLocalRot(LSL_Types.Quaternion rot);
|
||||
//wiki: list llParseStringKeepNulls( string src, list separators, list spacers )
|
||||
//wiki: list llParseStringKeepNulls(string src, list separators, list spacers)
|
||||
LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers);
|
||||
//wiki: llRezAtRoot(string inventory, vector position, vector velocity, rotation rot, integer param)
|
||||
void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity,
|
||||
@@ -584,14 +584,14 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end);
|
||||
//wiki: llLoadURL(key avatar_id, string message, string url)
|
||||
void llLoadURL(string avatar_id, string message, string url);
|
||||
//wiki: llParcelMediaCommandList( list commandList )
|
||||
//wiki: llParcelMediaCommandList(list commandList)
|
||||
void llParcelMediaCommandList(LSL_Types.list commandList);
|
||||
void llParcelMediaQuery();
|
||||
//wiki integer llModPow(integer a, integer b, integer c)
|
||||
LSL_Types.LSLInteger llModPow(int a, int b, int c);
|
||||
//wiki: integer llGetInventoryType(string name)
|
||||
LSL_Types.LSLInteger llGetInventoryType(string name);
|
||||
//wiki: llSetPayPrice( integer price, list quick_pay_buttons )
|
||||
//wiki: llSetPayPrice(integer price, list quick_pay_buttons)
|
||||
void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons);
|
||||
//wiki: vector llGetCameraPos()
|
||||
LSL_Types.Vector3 llGetCameraPos();
|
||||
@@ -613,11 +613,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
void llRemoveFromLandPassList(string avatar);
|
||||
//wiki: llRemoveFromLandBanList(key avatar)
|
||||
void llRemoveFromLandBanList(string avatar);
|
||||
//wiki: llSetCameraParams( list rules )
|
||||
//wiki: llSetCameraParams(list rules)
|
||||
void llSetCameraParams(LSL_Types.list rules);
|
||||
//wiki: llClearCameraParams()
|
||||
void llClearCameraParams();
|
||||
//wiki: double llListStatistics( integer operation, list src )
|
||||
//wiki: double llListStatistics(integer operation, list src)
|
||||
double llListStatistics(int operation, LSL_Types.list src);
|
||||
//wiki: integer llGetUnixTime()
|
||||
LSL_Types.LSLInteger llGetUnixTime();
|
||||
@@ -634,15 +634,15 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
void llResetLandPassList();
|
||||
//wiki: integer llGetParcelPrimCount(vector pos, integer category, integer sim_wide)
|
||||
LSL_Types.LSLInteger llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide);
|
||||
//wiki: list llGetParcelPrimOwners( vector pos )
|
||||
//wiki: list llGetParcelPrimOwners(vector pos)
|
||||
LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos);
|
||||
//wiki: integer llGetObjectPrimCount(key object_id)
|
||||
LSL_Types.LSLInteger llGetObjectPrimCount(string object_id);
|
||||
//wiki: integer llGetParcelMaxPrims( vector pos, integer sim_wide )
|
||||
//wiki: integer llGetParcelMaxPrims(vector pos, integer sim_wide)
|
||||
LSL_Types.LSLInteger llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide);
|
||||
//wiki: llGetParcelDetails(vector pos, list params)
|
||||
LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param);
|
||||
//wiki: llSetLinkTexture(integer linknumber, string texture, integer face )
|
||||
//wiki: llSetLinkTexture(integer linknumber, string texture, integer face)
|
||||
void llSetLinkTexture(int linknumber, string texture, int face);
|
||||
//wiki: string llStringTrim(string src, int type)
|
||||
string llStringTrim(string src, int type);
|
||||
|
||||
@@ -506,7 +506,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
int src;
|
||||
int dest=0;
|
||||
|
||||
for(src = 0 ; src < m_data.Length ; src++)
|
||||
for (src = 0; src < m_data.Length; src++)
|
||||
{
|
||||
if (src < start || src > end)
|
||||
ret[dest++]=m_data[src];
|
||||
@@ -624,9 +624,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
Array.Copy(Data, 0, ret, 0, Data.Length);
|
||||
|
||||
keys=new string[Data.Length];
|
||||
int k;
|
||||
for(k=0;k<Data.Length;k++)
|
||||
keys[k]=Data[k].ToString();
|
||||
|
||||
for (int k = 0; k < Data.Length; k++)
|
||||
keys[k] = Data[k].ToString();
|
||||
|
||||
Array.Sort(keys, ret);
|
||||
|
||||
@@ -644,11 +644,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
int i;
|
||||
|
||||
while(src < Data.Length)
|
||||
while (src < Data.Length)
|
||||
{
|
||||
Object[] o=new Object[stride];
|
||||
|
||||
for(i=0;i<stride;i++)
|
||||
for (i = 0; i < stride; i++)
|
||||
{
|
||||
if (src < Data.Length)
|
||||
o[i]=Data[src++];
|
||||
@@ -672,11 +672,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
Object[] sorted=new Object[stride*vals.Length];
|
||||
|
||||
int j;
|
||||
|
||||
for(i=0;i<vals.Length;i++)
|
||||
for(j=0;j<stride;j++)
|
||||
sorted[i*stride+j]=vals[i][j];
|
||||
for (i = 0; i < vals.Length; i++)
|
||||
for (int j = 0; j < stride; j++)
|
||||
sorted[i*stride+j] = vals[i][j];
|
||||
|
||||
return new list(sorted);
|
||||
}
|
||||
@@ -691,7 +689,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string ToCSV()
|
||||
{
|
||||
string ret = "";
|
||||
foreach(object o in this.Data)
|
||||
foreach (object o in this.Data)
|
||||
{
|
||||
if (ret == "")
|
||||
{
|
||||
|
||||
@@ -340,7 +340,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
|
||||
LLUUID createdTexture =
|
||||
textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url,
|
||||
extraParams, timer, true, (byte) alpha );
|
||||
extraParams, timer, true, (byte) alpha);
|
||||
return createdTexture.ToString();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
|
||||
// dot=dot(forward_dir,obj_dir)
|
||||
// mag_fwd = mag(forward_dir)
|
||||
// mag_obj = mag(obj_dir)
|
||||
// ang = acos( dot /(mag_fwd*mag_obj))
|
||||
// ang = acos(dot /(mag_fwd*mag_obj))
|
||||
double ang_obj = 0;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
|
||||
// TODO: HOOK ALL EVENTS UP TO SERVER!
|
||||
IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>();
|
||||
if(money != null)
|
||||
if (money != null)
|
||||
{
|
||||
money.OnObjectPaid+=HandleObjectPaid;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
private void HandleObjectPaid(LLUUID objectID, LLUUID agentID, int amount)
|
||||
{
|
||||
SceneObjectPart part=myScriptEngine.World.GetSceneObjectPart(objectID);
|
||||
if(part != null)
|
||||
if (part != null)
|
||||
{
|
||||
money(part.LocalId, agentID, amount);
|
||||
}
|
||||
|
||||
@@ -297,10 +297,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
// Send inner exception
|
||||
string[] lines=e.InnerException.ToString().Replace("\r", "").Split('\n');
|
||||
int line=0;
|
||||
foreach(string t in lines)
|
||||
foreach (string t in lines)
|
||||
{
|
||||
int idx=t.IndexOf("SecondLife.Script.");
|
||||
if(idx != -1)
|
||||
if (idx != -1)
|
||||
{
|
||||
int colon=t.IndexOf(":");
|
||||
line=Convert.ToInt32(t.Substring(colon+1));
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
if (DateTime.Now.Ticks - Last_ReReadConfigFilens >
|
||||
m_ScriptEngine.RefreshConfigFilens)
|
||||
{
|
||||
//Console.WriteLine("Time passed: " + (DateTime.Now.Ticks - Last_ReReadConfigFilens) + ">" + m_ScriptEngine.RefreshConfigFilens );
|
||||
//Console.WriteLine("Time passed: " + (DateTime.Now.Ticks - Last_ReReadConfigFilens) + ">" + m_ScriptEngine.RefreshConfigFilens);
|
||||
// Its time to re-read config file
|
||||
m_ScriptEngine.ReadConfig();
|
||||
Last_ReReadConfigFilens = DateTime.Now.Ticks; // Reset time
|
||||
|
||||
Reference in New Issue
Block a user