Update svn properties. Formatting cleanup. Remove a compiler warning.

0.6.0-stable
Jeff Ames 2008-07-23 13:24:25 +00:00
parent 9e8b456bbc
commit 80d8e2889e
29 changed files with 402 additions and 396 deletions

View File

@ -101,8 +101,10 @@ namespace OpenSim.Data.MySQL
BindingFlags.DeclaredOnly); BindingFlags.DeclaredOnly);
foreach (FieldInfo f in m_Fields) foreach (FieldInfo f in m_Fields)
if(f.Name.Substring(0, 2) == "m_") {
if (f.Name.Substring(0, 2) == "m_")
m_FieldMap[f.Name.Substring(2)] = f; m_FieldMap[f.Name.Substring(2)] = f;
}
} }
private string[] FieldList private string[] FieldList
@ -171,14 +173,14 @@ namespace OpenSim.Data.MySQL
IDataReader r = cmd.ExecuteReader(); IDataReader r = cmd.ExecuteReader();
if(r.Read()) if (r.Read())
{ {
foreach (string name in FieldList) foreach (string name in FieldList)
{ {
if(m_FieldMap[name].GetValue(es) is bool) if (m_FieldMap[name].GetValue(es) is bool)
{ {
int v = Convert.ToInt32(r[name]); int v = Convert.ToInt32(r[name]);
if(v != 0) if (v != 0)
m_FieldMap[name].SetValue(es, true); m_FieldMap[name].SetValue(es, true);
else else
m_FieldMap[name].SetValue(es, false); m_FieldMap[name].SetValue(es, false);
@ -207,9 +209,9 @@ namespace OpenSim.Data.MySQL
foreach (string name in FieldList) foreach (string name in FieldList)
{ {
if(m_FieldMap[name].GetValue(es) is bool) if (m_FieldMap[name].GetValue(es) is bool)
{ {
if((bool)m_FieldMap[name].GetValue(es)) if ((bool)m_FieldMap[name].GetValue(es))
cmd.Parameters.AddWithValue("?"+name, "1"); cmd.Parameters.AddWithValue("?"+name, "1");
else else
cmd.Parameters.AddWithValue("?"+name, "0"); cmd.Parameters.AddWithValue("?"+name, "0");
@ -283,9 +285,9 @@ namespace OpenSim.Data.MySQL
foreach (string name in FieldList) foreach (string name in FieldList)
{ {
if(m_FieldMap[name].GetValue(es) is bool) if (m_FieldMap[name].GetValue(es) is bool)
{ {
if((bool)m_FieldMap[name].GetValue(es)) if ((bool)m_FieldMap[name].GetValue(es))
cmd.Parameters.AddWithValue("?"+name, "1"); cmd.Parameters.AddWithValue("?"+name, "1");
else else
cmd.Parameters.AddWithValue("?"+name, "0"); cmd.Parameters.AddWithValue("?"+name, "0");
@ -317,7 +319,7 @@ namespace OpenSim.Data.MySQL
IDataReader r = cmd.ExecuteReader(); IDataReader r = cmd.ExecuteReader();
while(r.Read()) while (r.Read())
{ {
EstateBan eb = new EstateBan(); EstateBan eb = new EstateBan();
@ -347,7 +349,7 @@ namespace OpenSim.Data.MySQL
cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )"; cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )";
foreach(EstateBan b in es.EstateBans) foreach (EstateBan b in es.EstateBans)
{ {
cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
cmd.Parameters.AddWithValue("?bannedUUID", b.bannedUUID.ToString()); cmd.Parameters.AddWithValue("?bannedUUID", b.bannedUUID.ToString());
@ -372,7 +374,7 @@ namespace OpenSim.Data.MySQL
cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )"; cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )";
foreach(LLUUID uuid in data) foreach (LLUUID uuid in data)
{ {
cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString());
cmd.Parameters.AddWithValue("?uuid", uuid.ToString()); cmd.Parameters.AddWithValue("?uuid", uuid.ToString());
@ -395,7 +397,7 @@ namespace OpenSim.Data.MySQL
IDataReader r = cmd.ExecuteReader(); IDataReader r = cmd.ExecuteReader();
while(r.Read()) while (r.Read())
{ {
// EstateBan eb = new EstateBan(); // EstateBan eb = new EstateBan();

View File

@ -94,7 +94,7 @@ namespace OpenSim.Data.SQLite
/// <returns>Asset base</returns> /// <returns>Asset base</returns>
override public AssetBase FetchAsset(LLUUID uuid) override public AssetBase FetchAsset(LLUUID uuid)
{ {
lock(this) lock (this)
{ {
using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
{ {
@ -130,7 +130,8 @@ namespace OpenSim.Data.SQLite
} }
else else
{ {
lock(this) { lock (this)
{
using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn))
{ {
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID)));
@ -155,7 +156,8 @@ namespace OpenSim.Data.SQLite
{ {
LogAssetLoad(asset); LogAssetLoad(asset);
lock(this) { lock (this)
{
using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn))
{ {
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID)));

View File

@ -74,7 +74,7 @@ namespace OpenSim.Data.SQLite
BindingFlags.DeclaredOnly); BindingFlags.DeclaredOnly);
foreach (FieldInfo f in m_Fields) foreach (FieldInfo f in m_Fields)
if(f.Name.Substring(0, 2) == "m_") if (f.Name.Substring(0, 2) == "m_")
m_FieldMap[f.Name.Substring(2)] = f; m_FieldMap[f.Name.Substring(2)] = f;
} }
@ -97,14 +97,14 @@ namespace OpenSim.Data.SQLite
IDataReader r = cmd.ExecuteReader(); IDataReader r = cmd.ExecuteReader();
if(r.Read()) if (r.Read())
{ {
foreach (string name in FieldList) foreach (string name in FieldList)
{ {
if(m_FieldMap[name].GetValue(es) is bool) if (m_FieldMap[name].GetValue(es) is bool)
{ {
int v = Convert.ToInt32(r[name]); int v = Convert.ToInt32(r[name]);
if(v != 0) if (v != 0)
m_FieldMap[name].SetValue(es, true); m_FieldMap[name].SetValue(es, true);
else else
m_FieldMap[name].SetValue(es, false); m_FieldMap[name].SetValue(es, false);
@ -133,9 +133,9 @@ namespace OpenSim.Data.SQLite
foreach (string name in FieldList) foreach (string name in FieldList)
{ {
if(m_FieldMap[name].GetValue(es) is bool) if (m_FieldMap[name].GetValue(es) is bool)
{ {
if((bool)m_FieldMap[name].GetValue(es)) if ((bool)m_FieldMap[name].GetValue(es))
cmd.Parameters.Add(":"+name, "1"); cmd.Parameters.Add(":"+name, "1");
else else
cmd.Parameters.Add(":"+name, "0"); cmd.Parameters.Add(":"+name, "0");
@ -215,9 +215,9 @@ namespace OpenSim.Data.SQLite
foreach (string name in FieldList) foreach (string name in FieldList)
{ {
if(m_FieldMap[name].GetValue(es) is bool) if (m_FieldMap[name].GetValue(es) is bool)
{ {
if((bool)m_FieldMap[name].GetValue(es)) if ((bool)m_FieldMap[name].GetValue(es))
cmd.Parameters.Add(":"+name, "1"); cmd.Parameters.Add(":"+name, "1");
else else
cmd.Parameters.Add(":"+name, "0"); cmd.Parameters.Add(":"+name, "0");
@ -247,7 +247,7 @@ namespace OpenSim.Data.SQLite
IDataReader r = cmd.ExecuteReader(); IDataReader r = cmd.ExecuteReader();
while(r.Read()) while (r.Read())
{ {
EstateBan eb = new EstateBan(); EstateBan eb = new EstateBan();
@ -275,7 +275,7 @@ namespace OpenSim.Data.SQLite
cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )";
foreach(EstateBan b in es.EstateBans) foreach (EstateBan b in es.EstateBans)
{ {
cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); cmd.Parameters.Add(":EstateID", es.EstateID.ToString());
cmd.Parameters.Add(":bannedUUID", b.bannedUUID.ToString()); cmd.Parameters.Add(":bannedUUID", b.bannedUUID.ToString());
@ -298,7 +298,7 @@ namespace OpenSim.Data.SQLite
cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )";
foreach(LLUUID uuid in data) foreach (LLUUID uuid in data)
{ {
cmd.Parameters.Add(":EstateID", EstateID.ToString()); cmd.Parameters.Add(":EstateID", EstateID.ToString());
cmd.Parameters.Add(":uuid", uuid.ToString()); cmd.Parameters.Add(":uuid", uuid.ToString());
@ -319,7 +319,7 @@ namespace OpenSim.Data.SQLite
IDataReader r = cmd.ExecuteReader(); IDataReader r = cmd.ExecuteReader();
while(r.Read()) while (r.Read())
{ {
// EstateBan eb = new EstateBan(); // EstateBan eb = new EstateBan();

View File

@ -63,7 +63,7 @@ namespace OpenSim.Framework
Monitor.Wait(m_queueSync); Monitor.Wait(m_queueSync);
} }
if(m_pqueue.Count > 0) if (m_pqueue.Count > 0)
return m_pqueue.Dequeue(); return m_pqueue.Dequeue();
return m_queue.Dequeue(); return m_queue.Dequeue();
} }
@ -73,7 +73,7 @@ namespace OpenSim.Framework
{ {
lock (m_queueSync) lock (m_queueSync)
{ {
if(m_pqueue.Contains(item)) if (m_pqueue.Contains(item))
return true; return true;
return m_queue.Contains(item); return m_queue.Contains(item);
} }

View File

@ -447,7 +447,7 @@ namespace OpenSim.Framework.Communications.Cache
RequestedAssets.Remove(assetInf.FullID); RequestedAssets.Remove(assetInf.FullID);
// If it's a direct request for a script, drop it // If it's a direct request for a script, drop it
// because it's a hacked client // because it's a hacked client
if(req.AssetRequestSource != 2 || assetInf.Type != 10) if (req.AssetRequestSource != 2 || assetInf.Type != 10)
AssetRequests.Add(req); AssetRequests.Add(req);
} }
} }

View File

@ -728,7 +728,7 @@ namespace OpenSim.Framework.Communications.Cache
public void Execute() public void Execute()
{ {
if(m_delegate != null) if (m_delegate != null)
m_delegate.DynamicInvoke(m_args); m_delegate.DynamicInvoke(m_args);
} }
} }

View File

@ -233,7 +233,7 @@ namespace OpenSim.Framework
public void Save() public void Save()
{ {
if(OnSave != null) if (OnSave != null)
OnSave(this); OnSave(this);
} }

View File

@ -4737,51 +4737,51 @@ namespace OpenSim.Region.ClientStack.LindenUDP
requestID = new LLUUID(transfer.TransferInfo.Params, 80); requestID = new LLUUID(transfer.TransferInfo.Params, 80);
if (!(((Scene)m_scene).ExternalChecks.ExternalChecksBypassPermissions())) if (!(((Scene)m_scene).ExternalChecks.ExternalChecksBypassPermissions()))
{ {
if(taskID != LLUUID.Zero) // Prim if (taskID != LLUUID.Zero) // Prim
{ {
SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID);
if(part == null) if (part == null)
break; break;
if(part.OwnerID != AgentId) if (part.OwnerID != AgentId)
break; break;
if((part.OwnerMask & (uint)PermissionMask.Modify) == 0) if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
break; break;
TaskInventoryItem ti = part.GetInventoryItem(itemID); TaskInventoryItem ti = part.GetInventoryItem(itemID);
if(ti == null) if (ti == null)
break; break;
if(ti.OwnerID != AgentId) if (ti.OwnerID != AgentId)
break; break;
if((ti.OwnerMask & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) if ((ti.OwnerMask & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
break; break;
if(ti.AssetID != requestID) if (ti.AssetID != requestID)
break; break;
} }
else // Agent else // Agent
{ {
CachedUserInfo userInfo = ((Scene)m_scene).CommsManager.UserProfileCacheService.GetUserDetails(AgentId); CachedUserInfo userInfo = ((Scene)m_scene).CommsManager.UserProfileCacheService.GetUserDetails(AgentId);
if(userInfo == null) if (userInfo == null)
break; break;
if(userInfo.RootFolder == null) if (userInfo.RootFolder == null)
break; break;
InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(itemID); InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(itemID);
if(assetRequestItem == null) if (assetRequestItem == null)
{ {
assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID); assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
if(assetRequestItem == null) if (assetRequestItem == null)
return; return;
} }
if((assetRequestItem.CurrentPermissions & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) if ((assetRequestItem.CurrentPermissions & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
break; break;
if(assetRequestItem.AssetID != requestID) if (assetRequestItem.AssetID != requestID)
break; break;
} }
} }

View File

@ -57,9 +57,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
void InPacket(Packet packet); void InPacket(Packet packet);
void ProcessInPacket(Packet packet); void ProcessInPacket(Packet packet);
void OutPacket(Packet NewPack, void OutPacket(Packet NewPack,
ThrottleOutPacketType throttlePacketType); ThrottleOutPacketType throttlePacketType);
void OutPacket(Packet NewPack, void OutPacket(Packet NewPack,
ThrottleOutPacketType throttlePacketType, Object id); ThrottleOutPacketType throttlePacketType, Object id);
LLPacketQueue PacketQueue { get; } LLPacketQueue PacketQueue { get; }
void Stop(); void Stop();
void Flush(); void Flush();
@ -136,7 +136,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// time for a linear scan. // time for a linear scan.
// //
private Dictionary<uint, int> m_DupeTracker = private Dictionary<uint, int> m_DupeTracker =
new Dictionary<uint, int>(); new Dictionary<uint, int>();
private uint m_DupeTrackerWindow = 30; private uint m_DupeTrackerWindow = 30;
// Values for the SimStatsReporter // Values for the SimStatsReporter
@ -207,14 +207,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// notifier. // notifier.
// //
public void OutPacket( public void OutPacket(
Packet packet, ThrottleOutPacketType throttlePacketType) Packet packet, ThrottleOutPacketType throttlePacketType)
{ {
OutPacket(packet, throttlePacketType, null); OutPacket(packet, throttlePacketType, null);
} }
public void OutPacket( public void OutPacket(
Packet packet, ThrottleOutPacketType throttlePacketType, Packet packet, ThrottleOutPacketType throttlePacketType,
Object id) Object id)
{ {
// Call the load balancer's hook. If this is not active here // Call the load balancer's hook. If this is not active here
// we defer to the sim server this client is actually connected // we defer to the sim server this client is actually connected
@ -224,20 +224,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) if ((m_SynchronizeClient != null) && (!m_Client.IsActive))
{ {
if (m_SynchronizeClient(m_Client.Scene, packet, if (m_SynchronizeClient(m_Client.Scene, packet,
m_Client.AgentId, throttlePacketType)) m_Client.AgentId, throttlePacketType))
return; return;
} }
packet.Header.Sequence = NextPacketSequenceNumber(); packet.Header.Sequence = NextPacketSequenceNumber();
lock(m_NeedAck) lock (m_NeedAck)
{ {
DropResend(id); DropResend(id);
QueuePacket(packet, throttlePacketType, id); QueuePacket(packet, throttlePacketType, id);
// We want to see that packet arrive if it's reliable // We want to see that packet arrive if it's reliable
if(packet.Header.Reliable) if (packet.Header.Reliable)
{ {
m_UnackedBytes += packet.ToBytes().Length; m_UnackedBytes += packet.ToBytes().Length;
m_NeedAck[packet.Header.Sequence] = new AckData(packet, id); m_NeedAck[packet.Header.Sequence] = new AckData(packet, id);
@ -251,24 +251,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
// Add acks to outgoing packets // Add acks to outgoing packets
// //
if(m_PendingAcks.Count > 0) if (m_PendingAcks.Count > 0)
{ {
int count = m_PendingAcks.Count; int count = m_PendingAcks.Count;
if(count > 10) if (count > 10)
count = 10; count = 10;
packet.Header.AckList = new uint[count]; packet.Header.AckList = new uint[count];
int i = 0; int i = 0;
foreach (uint ack in new List<uint>(m_PendingAcks.Keys)) foreach (uint ack in new List<uint>(m_PendingAcks.Keys))
{ {
packet.Header.AckList[i] = ack; packet.Header.AckList[i] = ack;
i++; i++;
m_PendingAcks.Remove(ack); m_PendingAcks.Remove(ack);
if (i >= 10) // That is how much space there is if (i >= 10) // That is how much space there is
break; break;
} }
} }
packet.TickCount = System.Environment.TickCount; packet.TickCount = System.Environment.TickCount;
@ -291,14 +291,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// anything. There may not be a client there, don't clog up the // anything. There may not be a client there, don't clog up the
// pipes. // pipes.
// //
if(lastAck == 0) if (lastAck == 0)
return; return;
lock (m_NeedAck) lock (m_NeedAck)
{ {
// Nothing to do // Nothing to do
// //
if(m_NeedAck.Count == 0) if (m_NeedAck.Count == 0)
return; return;
// If we have seen no acks in <SilenceLimit> s but are // If we have seen no acks in <SilenceLimit> s but are
@ -307,7 +307,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// then it will be dropped. // then it will be dropped.
// //
if ((((now - lastAck) > m_SilenceLimit) && if ((((now - lastAck) > m_SilenceLimit) &&
m_NeedAck.Count > 0) || m_NeedAck.Count == 0) m_NeedAck.Count > 0) || m_NeedAck.Count == 0)
{ {
return; return;
} }
@ -336,7 +336,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// //
if ((now - packet.TickCount) > m_DiscardTimeout) if ((now - packet.TickCount) > m_DiscardTimeout)
{ {
if(!m_ImportantPackets.Contains(packet.Type)) if (!m_ImportantPackets.Contains(packet.Type))
m_NeedAck.Remove(packet.Header.Sequence); m_NeedAck.Remove(packet.Header.Sequence);
TriggerOnPacketDrop(packet, data.Identifier); TriggerOnPacketDrop(packet, data.Identifier);
@ -364,8 +364,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// the counter reaches 250. So there is a good chance another // the counter reaches 250. So there is a good chance another
// packet with 250 blocks exists. // packet with 250 blocks exists.
// //
if(acks.Packets == null || if (acks.Packets == null ||
acks.Packets.Length != m_PendingAcks.Count) acks.Packets.Length != m_PendingAcks.Count)
acks.Packets = new PacketAckPacket.PacketsBlock[m_PendingAcks.Count]; acks.Packets = new PacketAckPacket.PacketsBlock[m_PendingAcks.Count];
int i = 0; int i = 0;
foreach (uint ack in new List<uint>(m_PendingAcks.Keys)) foreach (uint ack in new List<uint>(m_PendingAcks.Keys))
@ -389,11 +389,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
lock (m_PendingAcks) lock (m_PendingAcks)
{ {
if(m_PendingAcks.Count < 250) if (m_PendingAcks.Count < 250)
{ {
if(!m_PendingAcks.ContainsKey(packet.Header.Sequence)) if (!m_PendingAcks.ContainsKey(packet.Header.Sequence))
m_PendingAcks.Add(packet.Header.Sequence, m_PendingAcks.Add(packet.Header.Sequence,
packet.Header.Sequence); packet.Header.Sequence);
return; return;
} }
} }
@ -405,11 +405,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// If this is still full we have a truly exceptional // If this is still full we have a truly exceptional
// condition (means, can't happen) // condition (means, can't happen)
// //
if(m_PendingAcks.Count < 250) if (m_PendingAcks.Count < 250)
{ {
if(!m_PendingAcks.ContainsKey(packet.Header.Sequence)) if (!m_PendingAcks.ContainsKey(packet.Header.Sequence))
m_PendingAcks.Add(packet.Header.Sequence, m_PendingAcks.Add(packet.Header.Sequence,
packet.Header.Sequence); packet.Header.Sequence);
return; return;
} }
} }
@ -433,9 +433,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerPacketStats != null) if (handlerPacketStats != null)
{ {
handlerPacketStats( handlerPacketStats(
m_PacketsReceived - m_PacketsReceivedReported, m_PacketsReceived - m_PacketsReceivedReported,
m_PacketsSent - m_PacketsSentReported, m_PacketsSent - m_PacketsSentReported,
m_UnackedBytes); m_UnackedBytes);
m_PacketsReceivedReported = m_PacketsReceived; m_PacketsReceivedReported = m_PacketsReceived;
m_PacketsSentReported = m_PacketsSent; m_PacketsSentReported = m_PacketsSent;
@ -450,12 +450,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
lock (m_DupeTracker) lock (m_DupeTracker)
{ {
Dictionary<uint, int> packs = Dictionary<uint, int> packs =
new Dictionary<uint, int>(m_DupeTracker); new Dictionary<uint, int>(m_DupeTracker);
foreach (uint pack in packs.Keys) foreach (uint pack in packs.Keys)
{ {
if(Util.UnixTimeSinceEpoch() - m_DupeTracker[pack] > if (Util.UnixTimeSinceEpoch() - m_DupeTracker[pack] >
m_DupeTrackerWindow) m_DupeTrackerWindow)
m_DupeTracker.Remove(pack); m_DupeTracker.Remove(pack);
} }
} }
@ -463,13 +463,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void InPacket(Packet packet) public void InPacket(Packet packet)
{ {
if(packet == null) if (packet == null)
return; return;
// If this client is on another partial instance, no need // If this client is on another partial instance, no need
// to handle packets // to handle packets
// //
if(!m_Client.IsActive && packet.Type != PacketType.LogoutRequest) if (!m_Client.IsActive && packet.Type != PacketType.LogoutRequest)
{ {
PacketPool.Instance.ReturnPacket(packet); PacketPool.Instance.ReturnPacket(packet);
return; return;
@ -478,9 +478,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Any packet can have some packet acks in the header. // Any packet can have some packet acks in the header.
// Process them here // Process them here
// //
if(packet.Header.AppendedAcks) if (packet.Header.AppendedAcks)
{ {
foreach(uint id in packet.Header.AckList) foreach (uint id in packet.Header.AckList)
{ {
ProcessAck(id); ProcessAck(id);
} }
@ -489,12 +489,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// When too many acks are needed to be sent, the client sends // When too many acks are needed to be sent, the client sends
// a packet consisting of acks only // a packet consisting of acks only
// //
if(packet.Type == PacketType.PacketAck) if (packet.Type == PacketType.PacketAck)
{ {
PacketAckPacket ackPacket = (PacketAckPacket)packet; PacketAckPacket ackPacket = (PacketAckPacket)packet;
foreach (PacketAckPacket.PacketsBlock block in foreach (PacketAckPacket.PacketsBlock block in
ackPacket.Packets) ackPacket.Packets)
{ {
ProcessAck(block.ID); ProcessAck(block.ID);
} }
@ -502,7 +502,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
PacketPool.Instance.ReturnPacket(packet); PacketPool.Instance.ReturnPacket(packet);
return; return;
} }
else if(packet.Type == PacketType.StartPingCheck) else if (packet.Type == PacketType.StartPingCheck)
{ {
StartPingCheckPacket startPing = (StartPingCheckPacket)packet; StartPingCheckPacket startPing = (StartPingCheckPacket)packet;
CompletePingCheckPacket endPing = (CompletePingCheckPacket)PacketPool.Instance.GetPacket(PacketType.CompletePingCheck); CompletePingCheckPacket endPing = (CompletePingCheckPacket)PacketPool.Instance.GetPacket(PacketType.CompletePingCheck);
@ -537,7 +537,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return; return;
m_DupeTracker.Add(packet.Header.Sequence, m_DupeTracker.Add(packet.Header.Sequence,
Util.UnixTimeSinceEpoch()); Util.UnixTimeSinceEpoch());
} }
m_Client.ProcessInPacket(packet); m_Client.ProcessInPacket(packet);
@ -560,9 +560,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AckData data; AckData data;
Packet packet; Packet packet;
lock(m_NeedAck) lock (m_NeedAck)
{ {
if(!m_NeedAck.TryGetValue(id, out data)) if (!m_NeedAck.TryGetValue(id, out data))
return; return;
packet = data.Packet; packet = data.Packet;
@ -650,7 +650,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void AddImportantPacket(PacketType type) public void AddImportantPacket(PacketType type)
{ {
if(m_ImportantPackets.Contains(type)) if (m_ImportantPackets.Contains(type))
return; return;
m_ImportantPackets.Add(type); m_ImportantPackets.Add(type);
@ -658,7 +658,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void RemoveImportantPacket(PacketType type) public void RemoveImportantPacket(PacketType type)
{ {
if(!m_ImportantPackets.Contains(type)) if (!m_ImportantPackets.Contains(type))
return; return;
m_ImportantPackets.Remove(type); m_ImportantPackets.Remove(type);
@ -668,7 +668,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
foreach (AckData data in new List<AckData>(m_NeedAck.Values)) foreach (AckData data in new List<AckData>(m_NeedAck.Values))
{ {
if(data.Identifier != null && data.Identifier == id) if (data.Identifier != null && data.Identifier == id)
{ {
m_NeedAck.Remove(data.Packet.Header.Sequence); m_NeedAck.Remove(data.Packet.Header.Sequence);
return; return;
@ -680,7 +680,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
PacketDrop handlerPacketDrop = OnPacketDrop; PacketDrop handlerPacketDrop = OnPacketDrop;
if(handlerPacketDrop == null) if (handlerPacketDrop == null)
return; return;
handlerPacketDrop(packet, id); handlerPacketDrop(packet, id);

View File

@ -338,7 +338,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (TaskThrottle.UnderLimit() && (TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0)) if (TaskThrottle.UnderLimit() && (TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0))
{ {
LLQueItem qpack; LLQueItem qpack;
if(TaskOutgoingPacketQueue.Count > 0) if (TaskOutgoingPacketQueue.Count > 0)
{ {
qpack = TaskOutgoingPacketQueue.Dequeue(); qpack = TaskOutgoingPacketQueue.Dequeue();
SendQueue.PriorityEnqueue(qpack); SendQueue.PriorityEnqueue(qpack);

View File

@ -380,8 +380,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//Slave regions don't accept new clients //Slave regions don't accept new clients
if (m_localScene.Region_Status != RegionStatus.SlaveScene) if (m_localScene.Region_Status != RegionStatus.SlaveScene)
{ {
if (!(packet is UseCircuitCodePacket)) if (!(packet is UseCircuitCodePacket))
return; return;
UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet;
lock (clientCircuits) lock (clientCircuits)
{ {

View File

@ -78,33 +78,33 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
//Load SMTP SERVER config //Load SMTP SERVER config
try try
{ {
if ((SMTPConfig = m_Config.Configs["SMTP"]) == null) if ((SMTPConfig = m_Config.Configs["SMTP"]) == null)
{ {
m_log.InfoFormat("[SMTP] SMTP server not configured"); m_log.InfoFormat("[SMTP] SMTP server not configured");
m_Enabled = false; m_Enabled = false;
return; return;
} }
if (!SMTPConfig.GetBoolean("enabled", false)) if (!SMTPConfig.GetBoolean("enabled", false))
{ {
m_log.InfoFormat("[SMTP] module disabled in configuration"); m_log.InfoFormat("[SMTP] module disabled in configuration");
m_Enabled = false; m_Enabled = false;
return; return;
} }
m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName);
SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME);
SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT);
SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN);
SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD);
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("[EMAIL] DefaultEmailModule not configured: "+ e.Message); m_log.Error("[EMAIL] DefaultEmailModule not configured: "+ e.Message);
m_Enabled = false; m_Enabled = false;
return; return;
} }
// It's a go! // It's a go!
if (m_Enabled) if (m_Enabled)
@ -152,14 +152,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
/// </summary> /// </summary>
/// <param name="seconds"></param> /// <param name="seconds"></param>
private void DelayInSeconds(int seconds) private void DelayInSeconds(int seconds)
{ {
TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); TimeSpan DiffDelay = new TimeSpan(0, 0, seconds);
DateTime EndDelay = DateTime.Now.Add(DiffDelay); DateTime EndDelay = DateTime.Now.Add(DiffDelay);
while (DateTime.Now < EndDelay) while (DateTime.Now < EndDelay)
{ {
;//Do nothing!! ;//Do nothing!!
} }
} }
private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName)
{ {
@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
if (part != null) if (part != null)
{ {
ObjectRegionName = s.RegionInfo.RegionName; ObjectRegionName = s.RegionInfo.RegionName;
return part; return part;
} }
} }
} }
@ -181,14 +181,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
private void resolveNamePositionRegionName(LLUUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) private void resolveNamePositionRegionName(LLUUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName)
{ {
string m_ObjectRegionName; string m_ObjectRegionName;
SceneObjectPart part = findPrim(objectID, out m_ObjectRegionName); SceneObjectPart part = findPrim(objectID, out m_ObjectRegionName);
if (part != null) if (part != null)
{ {
ObjectAbsolutePosition = part.AbsolutePosition.ToString(); ObjectAbsolutePosition = part.AbsolutePosition.ToString();
ObjectName = part.Name; ObjectName = part.Name;
ObjectRegionName = m_ObjectRegionName; ObjectRegionName = m_ObjectRegionName;
return; return;
} }
ObjectAbsolutePosition = part.AbsolutePosition.ToString(); ObjectAbsolutePosition = part.AbsolutePosition.ToString();
ObjectName = part.Name; ObjectName = part.Name;
@ -196,93 +196,93 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
return; return;
} }
/// <summary> /// <summary>
/// SendMail function utilized by llEMail /// SendMail function utilized by llEMail
/// </summary> /// </summary>
/// <param name="objectID"></param> /// <param name="objectID"></param>
/// <param name="address"></param> /// <param name="address"></param>
/// <param name="subject"></param> /// <param name="subject"></param>
/// <param name="body"></param> /// <param name="body"></param>
public void SendEmail(LLUUID objectID, string address, string subject, string body) public void SendEmail(LLUUID objectID, string address, string subject, string body)
{ {
//Check if address is empty //Check if address is empty
if (address == string.Empty) if (address == string.Empty)
return; return;
//FIXED:Check the email is correct form in REGEX //FIXED:Check the email is correct form in REGEX
string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+"
+ @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@"
+ @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
+ @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+"
+ @"[a-zA-Z]{2,}))$"; + @"[a-zA-Z]{2,}))$";
Regex EMailreStrict = new Regex(EMailpatternStrict); Regex EMailreStrict = new Regex(EMailpatternStrict);
bool isEMailStrictMatch = EMailreStrict.IsMatch(address); bool isEMailStrictMatch = EMailreStrict.IsMatch(address);
if (!isEMailStrictMatch) if (!isEMailStrictMatch)
{ {
m_log.Error("[EMAIL] REGEX Problem in EMail Address: "+address); m_log.Error("[EMAIL] REGEX Problem in EMail Address: "+address);
return; return;
} }
//FIXME:Check if subject + body = 4096 Byte //FIXME:Check if subject + body = 4096 Byte
if ((subject.Length + body.Length) > 1024) if ((subject.Length + body.Length) > 1024)
{ {
m_log.Error("[EMAIL] subject + body > 1024 Byte"); m_log.Error("[EMAIL] subject + body > 1024 Byte");
return; return;
} }
try try
{ {
string LastObjectName = string.Empty; string LastObjectName = string.Empty;
string LastObjectPosition = string.Empty; string LastObjectPosition = string.Empty;
string LastObjectRegionName = string.Empty; string LastObjectRegionName = string.Empty;
//DONE: Message as Second Life style //DONE: Message as Second Life style
//20 second delay - AntiSpam System - for now only 10 seconds //20 second delay - AntiSpam System - for now only 10 seconds
DelayInSeconds(10); DelayInSeconds(10);
//Creation EmailMessage //Creation EmailMessage
EmailMessage emailMessage = new EmailMessage(); EmailMessage emailMessage = new EmailMessage();
//From //From
emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName);
//To - Only One //To - Only One
emailMessage.AddToAddress(new EmailAddress(address)); emailMessage.AddToAddress(new EmailAddress(address));
//Subject //Subject
emailMessage.Subject = subject; emailMessage.Subject = subject;
//TEXT Body //TEXT Body
resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName);
emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName +
"\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " +
LastObjectPosition+"\r\n\r\n\r\n" + body); LastObjectPosition+"\r\n\r\n\r\n" + body);
//HTML Body //HTML Body
emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" + emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" +
"<BR>Object-Name: " + LastObjectName + "<BR>Object-Name: " + LastObjectName +
"<BR>Region: " + LastObjectRegionName + "<BR>Region: " + LastObjectRegionName +
"<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>" "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>"
+body+"\r\n</p></body><html>"); +body+"\r\n</p></body><html>");
//Set SMTP SERVER config //Set SMTP SERVER config
SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT);
//Authentication //Authentication
smtpServer.SmtpAuthToken=new SmtpAuthToken(SMTP_SERVER_LOGIN, SMTP_SERVER_PASSWORD); smtpServer.SmtpAuthToken=new SmtpAuthToken(SMTP_SERVER_LOGIN, SMTP_SERVER_PASSWORD);
//Send Email Message //Send Email Message
emailMessage.Send(smtpServer); emailMessage.Send(smtpServer);
//Log //Log
m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.UUID.ToString()); m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.UUID.ToString());
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("[EMAIL] DefaultEmailModule Exception: "+e.Message); m_log.Error("[EMAIL] DefaultEmailModule Exception: "+e.Message);
return; return;
} }
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="objectID"></param> /// <param name="objectID"></param>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="subject"></param> /// <param name="subject"></param>
/// <returns></returns> /// <returns></returns>
public Email GetNextEmail(LLUUID objectID, string sender, string subject) public Email GetNextEmail(LLUUID objectID, string sender, string subject)
{ {
return null; return null;
} }
} }
} }

View File

@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
/// </summary> /// </summary>
public class AssetsArchiver public class AssetsArchiver
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// Archive assets /// Archive assets

View File

@ -52,7 +52,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
//SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant) //SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
uint sun = 0; uint sun = 0;
if(!m_scene.RegionInfo.EstateSettings.UseGlobalTime) if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime)
sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800; sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800;
remote_client.SendDetailedEstateData(invoice, remote_client.SendDetailedEstateData(invoice,
m_scene.RegionInfo.EstateSettings.EstateName, m_scene.RegionInfo.EstateSettings.EstateName,
@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
m_scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; m_scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor;
if(matureLevel <= 13) if (matureLevel <= 13)
m_scene.RegionInfo.RegionSettings.Maturity = 0; m_scene.RegionInfo.RegionSettings.Maturity = 0;
else else
m_scene.RegionInfo.RegionSettings.Maturity = 1; m_scene.RegionInfo.RegionSettings.Maturity = 1;
@ -245,7 +245,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
ScenePresence s = m_scene.GetScenePresence(user); ScenePresence s = m_scene.GetScenePresence(user);
if (s != null) if (s != null)
{ {
if(!s.IsChildAgent) if (!s.IsChildAgent)
m_scene.TeleportClientHome(user, s.ControllingClient); m_scene.TeleportClientHome(user, s.ControllingClient);
} }
@ -395,7 +395,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
args.redirectGridY = m_scene.RegionInfo.EstateSettings.RedirectGridY; args.redirectGridY = m_scene.RegionInfo.EstateSettings.RedirectGridY;
args.regionFlags = GetRegionFlags(); args.regionFlags = GetRegionFlags();
byte mature = 13; byte mature = 13;
if(m_scene.RegionInfo.RegionSettings.Maturity == 1) if (m_scene.RegionInfo.RegionSettings.Maturity == 1)
mature = 21; mature = 21;
args.simAccess = mature; args.simAccess = mature;
@ -550,7 +550,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
args.terrainStartHeight3 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NE; args.terrainStartHeight3 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NE;
args.terrainHeightRange3 = (float)m_scene.RegionInfo.RegionSettings.Elevation2NE; args.terrainHeightRange3 = (float)m_scene.RegionInfo.RegionSettings.Elevation2NE;
byte mature = 13; byte mature = 13;
if(m_scene.RegionInfo.RegionSettings.Maturity == 1) if (m_scene.RegionInfo.RegionSettings.Maturity == 1)
mature = 21; mature = 21;
args.simAccess = mature; args.simAccess = mature;
args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
@ -579,7 +579,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
public void handleEstateChangeInfo(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, UInt32 parms1, UInt32 parms2) public void handleEstateChangeInfo(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, UInt32 parms1, UInt32 parms2)
{ {
if(parms2 == 0) if (parms2 == 0)
{ {
m_scene.RegionInfo.EstateSettings.UseGlobalTime = true; m_scene.RegionInfo.EstateSettings.UseGlobalTime = true;
m_scene.RegionInfo.EstateSettings.SunPosition = 0.0; m_scene.RegionInfo.EstateSettings.SunPosition = 0.0;
@ -590,37 +590,37 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
m_scene.RegionInfo.EstateSettings.SunPosition = (double)(parms2 - 0x1800)/1024.0; m_scene.RegionInfo.EstateSettings.SunPosition = (double)(parms2 - 0x1800)/1024.0;
} }
if((parms1 & 0x00000010) != 0) if ((parms1 & 0x00000010) != 0)
m_scene.RegionInfo.EstateSettings.FixedSun = true; m_scene.RegionInfo.EstateSettings.FixedSun = true;
else else
m_scene.RegionInfo.EstateSettings.FixedSun = false; m_scene.RegionInfo.EstateSettings.FixedSun = false;
if((parms1 & 0x00008000) != 0) if ((parms1 & 0x00008000) != 0)
m_scene.RegionInfo.EstateSettings.PublicAccess = true; m_scene.RegionInfo.EstateSettings.PublicAccess = true;
else else
m_scene.RegionInfo.EstateSettings.PublicAccess = false; m_scene.RegionInfo.EstateSettings.PublicAccess = false;
if((parms1 & 0x10000000) != 0) if ((parms1 & 0x10000000) != 0)
m_scene.RegionInfo.EstateSettings.AllowVoice = true; m_scene.RegionInfo.EstateSettings.AllowVoice = true;
else else
m_scene.RegionInfo.EstateSettings.AllowVoice = false; m_scene.RegionInfo.EstateSettings.AllowVoice = false;
if((parms1 & 0x00100000) != 0) if ((parms1 & 0x00100000) != 0)
m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = true; m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = true;
else else
m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = false; m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = false;
if((parms1 & 0x00800000) != 0) if ((parms1 & 0x00800000) != 0)
m_scene.RegionInfo.EstateSettings.DenyAnonymous = true; m_scene.RegionInfo.EstateSettings.DenyAnonymous = true;
else else
m_scene.RegionInfo.EstateSettings.DenyAnonymous = false; m_scene.RegionInfo.EstateSettings.DenyAnonymous = false;
if((parms1 & 0x01000000) != 0) if ((parms1 & 0x01000000) != 0)
m_scene.RegionInfo.EstateSettings.DenyIdentified = true; m_scene.RegionInfo.EstateSettings.DenyIdentified = true;
else else
m_scene.RegionInfo.EstateSettings.DenyIdentified = false; m_scene.RegionInfo.EstateSettings.DenyIdentified = false;
if((parms1 & 0x02000000) != 0) if ((parms1 & 0x02000000) != 0)
m_scene.RegionInfo.EstateSettings.DenyTransacted = true; m_scene.RegionInfo.EstateSettings.DenyTransacted = true;
else else
m_scene.RegionInfo.EstateSettings.DenyTransacted = false; m_scene.RegionInfo.EstateSettings.DenyTransacted = false;
@ -628,10 +628,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
m_scene.RegionInfo.EstateSettings.Save(); m_scene.RegionInfo.EstateSettings.Save();
float sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition; float sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition;
if(m_scene.RegionInfo.RegionSettings.UseEstateSun) if (m_scene.RegionInfo.RegionSettings.UseEstateSun)
{ {
sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition; sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition;
if(m_scene.RegionInfo.EstateSettings.UseGlobalTime) if (m_scene.RegionInfo.EstateSettings.UseGlobalTime)
sun = m_scene.EventManager.GetSunLindenHour(); sun = m_scene.EventManager.GetSunLindenHour();
} }
@ -726,30 +726,30 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
// Fully implemented // Fully implemented
// //
if(m_scene.RegionInfo.RegionSettings.AllowDamage) if (m_scene.RegionInfo.RegionSettings.AllowDamage)
flags |= Simulator.RegionFlags.AllowDamage; flags |= Simulator.RegionFlags.AllowDamage;
if(m_scene.RegionInfo.RegionSettings.BlockTerraform) if (m_scene.RegionInfo.RegionSettings.BlockTerraform)
flags |= Simulator.RegionFlags.BlockTerraform; flags |= Simulator.RegionFlags.BlockTerraform;
if(!m_scene.RegionInfo.RegionSettings.AllowLandResell) if (!m_scene.RegionInfo.RegionSettings.AllowLandResell)
flags |= Simulator.RegionFlags.BlockLandResell; flags |= Simulator.RegionFlags.BlockLandResell;
if(m_scene.RegionInfo.RegionSettings.DisableCollisions) if (m_scene.RegionInfo.RegionSettings.DisableCollisions)
flags |= Simulator.RegionFlags.SkipCollisions; flags |= Simulator.RegionFlags.SkipCollisions;
if(m_scene.RegionInfo.RegionSettings.DisableScripts) if (m_scene.RegionInfo.RegionSettings.DisableScripts)
flags |= Simulator.RegionFlags.SkipScripts; flags |= Simulator.RegionFlags.SkipScripts;
if(m_scene.RegionInfo.RegionSettings.DisablePhysics) if (m_scene.RegionInfo.RegionSettings.DisablePhysics)
flags |= Simulator.RegionFlags.SkipPhysics; flags |= Simulator.RegionFlags.SkipPhysics;
if(m_scene.RegionInfo.RegionSettings.BlockFly) if (m_scene.RegionInfo.RegionSettings.BlockFly)
flags |= Simulator.RegionFlags.NoFly; flags |= Simulator.RegionFlags.NoFly;
if(m_scene.RegionInfo.RegionSettings.RestrictPushing) if (m_scene.RegionInfo.RegionSettings.RestrictPushing)
flags |= Simulator.RegionFlags.RestrictPushObject; flags |= Simulator.RegionFlags.RestrictPushObject;
if(m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide) if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide)
flags |= Simulator.RegionFlags.AllowParcelChanges; flags |= Simulator.RegionFlags.AllowParcelChanges;
if(m_scene.RegionInfo.RegionSettings.BlockShowInSearch) if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch)
flags |= (Simulator.RegionFlags)(1 << 29); flags |= (Simulator.RegionFlags)(1 << 29);
if(m_scene.RegionInfo.RegionSettings.FixedSun) if (m_scene.RegionInfo.RegionSettings.FixedSun)
flags |= Simulator.RegionFlags.SunFixed; flags |= Simulator.RegionFlags.SunFixed;
if(m_scene.RegionInfo.RegionSettings.Sandbox) if (m_scene.RegionInfo.RegionSettings.Sandbox)
flags |= Simulator.RegionFlags.Sandbox; flags |= Simulator.RegionFlags.Sandbox;
// Handled in LandObject.cs: AllowLandmark // Handled in LandObject.cs: AllowLandmark
@ -769,30 +769,30 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
{ {
Simulator.RegionFlags flags = Simulator.RegionFlags.None; Simulator.RegionFlags flags = Simulator.RegionFlags.None;
if(m_scene.RegionInfo.EstateSettings.FixedSun) if (m_scene.RegionInfo.EstateSettings.FixedSun)
flags |= Simulator.RegionFlags.SunFixed; flags |= Simulator.RegionFlags.SunFixed;
if(m_scene.RegionInfo.EstateSettings.PublicAccess) if (m_scene.RegionInfo.EstateSettings.PublicAccess)
flags |= (Simulator.RegionFlags.PublicAllowed | flags |= (Simulator.RegionFlags.PublicAllowed |
Simulator.RegionFlags.ExternallyVisible); Simulator.RegionFlags.ExternallyVisible);
if(m_scene.RegionInfo.EstateSettings.AllowVoice) if (m_scene.RegionInfo.EstateSettings.AllowVoice)
flags |= Simulator.RegionFlags.AllowVoice; flags |= Simulator.RegionFlags.AllowVoice;
if(m_scene.RegionInfo.EstateSettings.AllowDirectTeleport) if (m_scene.RegionInfo.EstateSettings.AllowDirectTeleport)
flags |= Simulator.RegionFlags.AllowDirectTeleport; flags |= Simulator.RegionFlags.AllowDirectTeleport;
if(m_scene.RegionInfo.EstateSettings.DenyAnonymous) if (m_scene.RegionInfo.EstateSettings.DenyAnonymous)
flags |= Simulator.RegionFlags.DenyAnonymous; flags |= Simulator.RegionFlags.DenyAnonymous;
if(m_scene.RegionInfo.EstateSettings.DenyIdentified) if (m_scene.RegionInfo.EstateSettings.DenyIdentified)
flags |= Simulator.RegionFlags.DenyIdentified; flags |= Simulator.RegionFlags.DenyIdentified;
if(m_scene.RegionInfo.EstateSettings.DenyTransacted) if (m_scene.RegionInfo.EstateSettings.DenyTransacted)
flags |= Simulator.RegionFlags.DenyTransacted; flags |= Simulator.RegionFlags.DenyTransacted;
if(m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner) if (m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner)
flags |= Simulator.RegionFlags.AbuseEmailToEstateOwner; flags |= Simulator.RegionFlags.AbuseEmailToEstateOwner;
if(m_scene.RegionInfo.EstateSettings.BlockDwell) if (m_scene.RegionInfo.EstateSettings.BlockDwell)
flags |= Simulator.RegionFlags.BlockDwell; flags |= Simulator.RegionFlags.BlockDwell;
if(m_scene.RegionInfo.EstateSettings.EstateSkipScripts) if (m_scene.RegionInfo.EstateSettings.EstateSkipScripts)
flags |= Simulator.RegionFlags.EstateSkipScripts; flags |= Simulator.RegionFlags.EstateSkipScripts;
if(m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport) if (m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
flags |= Simulator.RegionFlags.ResetHomeOnTeleport; flags |= Simulator.RegionFlags.ResetHomeOnTeleport;
if(m_scene.RegionInfo.EstateSettings.TaxFree) if (m_scene.RegionInfo.EstateSettings.TaxFree)
flags |= Simulator.RegionFlags.TaxFree; flags |= Simulator.RegionFlags.TaxFree;
return (uint)flags; return (uint)flags;
@ -804,7 +804,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
return true; return true;
List<LLUUID> ems = new List<LLUUID>(m_scene.RegionInfo.EstateSettings.EstateManagers); List<LLUUID> ems = new List<LLUUID>(m_scene.RegionInfo.EstateSettings.EstateManagers);
if(ems.Contains(avatarID)) if (ems.Contains(avatarID))
return true; return true;
return false; return false;

View File

@ -163,11 +163,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{ {
IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
uint regionFlags = 336723974 & ~((uint)(Simulator.RegionFlags.AllowLandmark | Simulator.RegionFlags.AllowSetHome)); uint regionFlags = 336723974 & ~((uint)(Simulator.RegionFlags.AllowLandmark | Simulator.RegionFlags.AllowSetHome));
if(estateModule != null) if (estateModule != null)
regionFlags = estateModule.GetRegionFlags(); regionFlags = estateModule.GetRegionFlags();
if((landData.landFlags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0) if ((landData.landFlags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0)
regionFlags |= (uint)Simulator.RegionFlags.AllowLandmark; regionFlags |= (uint)Simulator.RegionFlags.AllowLandmark;
if(landData.ownerID == remote_client.AgentId) if (landData.ownerID == remote_client.AgentId)
regionFlags |= (uint)Simulator.RegionFlags.AllowSetHome; regionFlags |= (uint)Simulator.RegionFlags.AllowSetHome;
remote_client.SendLandProperties(remote_client, sequence_id, remote_client.SendLandProperties(remote_client, sequence_id,
snap_selection, request_result, landData, snap_selection, request_result, landData,

View File

@ -1365,7 +1365,7 @@ namespace OpenSim.Region.Environment.Scenes
// We need to explicitly resend the newly link prim's object properties since no other actions // We need to explicitly resend the newly link prim's object properties since no other actions
// occur on link to invoke this elsewhere (such as object selection) // occur on link to invoke this elsewhere (such as object selection)
parenPrim.TriggerScriptChangedEvent(Changed.LINK); parenPrim.TriggerScriptChangedEvent(Changed.LINK);
if(client != null) if (client != null)
parenPrim.GetProperties(client); parenPrim.GetProperties(client);
else else
{ {
@ -1426,13 +1426,13 @@ namespace OpenSim.Region.Environment.Scenes
parenPrim.DelinkFromGroup(childPrimId, sendEvents); parenPrim.DelinkFromGroup(childPrimId, sendEvents);
} }
if(parenPrim.Children.Count == 1) if (parenPrim.Children.Count == 1)
{ {
// The link set has been completely torn down // The link set has been completely torn down
// This is the case if you select a link set and delink // This is the case if you select a link set and delink
// //
parenPrim.RootPart.LinkNum = 1; parenPrim.RootPart.LinkNum = 1;
if(sendEvents) if (sendEvents)
parenPrim.TriggerScriptChangedEvent(Changed.LINK); parenPrim.TriggerScriptChangedEvent(Changed.LINK);
} }
else else
@ -1449,7 +1449,7 @@ namespace OpenSim.Region.Environment.Scenes
// Tear down the remaining link set // Tear down the remaining link set
// //
if(unlink_ids.Count == 2) if (unlink_ids.Count == 2)
{ {
DelinkObjects(unlink_ids, true); DelinkObjects(unlink_ids, true);
return; return;
@ -1494,7 +1494,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
grp.DelinkFromGroup(primIds[i]); grp.DelinkFromGroup(primIds[i]);
delinkedSomething = true; delinkedSomething = true;
if(!parents.Contains(grp)) if (!parents.Contains(grp))
parents.Add(grp); parents.Add(grp);
} }

View File

@ -1693,7 +1693,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
// Finally remove the item, for reals this time. // Finally remove the item, for reals this time.
if(permissionToDelete) if (permissionToDelete)
DeleteSceneObject(objectGroup); DeleteSceneObject(objectGroup);
} }

View File

@ -88,8 +88,8 @@ namespace OpenSim.Region.Environment.Scenes
/// Are we applying physics to any of the prims in this scene? /// Are we applying physics to any of the prims in this scene?
/// </summary> /// </summary>
public bool m_physicalPrim; public bool m_physicalPrim;
public float m_maxNonphys = 65536; public float m_maxNonphys = 65536;
public float m_maxPhys = 10; public float m_maxPhys = 10;
public bool m_seeIntoRegionFromNeighbor; public bool m_seeIntoRegionFromNeighbor;
public int MaxUndoCount = 5; public int MaxUndoCount = 5;
@ -272,7 +272,7 @@ namespace OpenSim.Region.Environment.Scenes
// Load region settings // Load region settings
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
if(m_storageManager.EstateDataStore != null) if (m_storageManager.EstateDataStore != null)
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID);
@ -311,16 +311,16 @@ namespace OpenSim.Region.Environment.Scenes
+ " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString() + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
+ " PhysPrim:" + m_physicalPrim.ToString(); + " PhysPrim:" + m_physicalPrim.ToString();
try try
{ {
IConfig startupConfig = m_config.Configs["Startup"]; IConfig startupConfig = m_config.Configs["Startup"];
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f); m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f);
m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f); m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f);
} }
catch (Exception) catch (Exception)
{ {
m_log.Warn("Failed to load StartupConfig"); m_log.Warn("Failed to load StartupConfig");
} }
} }
@ -2505,8 +2505,8 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="capsObjectPath"></param> /// <param name="capsObjectPath"></param>
public void AddCapsHandler(LLUUID agentId) public void AddCapsHandler(LLUUID agentId)
{ {
if(RegionInfo.EstateSettings.IsBanned(agentId)) if (RegionInfo.EstateSettings.IsBanned(agentId))
return; return;
String capsObjectPath = GetCapsPath(agentId); String capsObjectPath = GetCapsPath(agentId);
m_log.DebugFormat( m_log.DebugFormat(

View File

@ -427,7 +427,7 @@ namespace OpenSim.Region.Environment.Scenes
if (reader.Name == "SceneObjectPart") if (reader.Name == "SceneObjectPart")
{ {
SceneObjectPart Part = SceneObjectPart.FromXml(reader); SceneObjectPart Part = SceneObjectPart.FromXml(reader);
if(m_rootPart.LinkNum == 0) if (m_rootPart.LinkNum == 0)
m_rootPart.LinkNum++; m_rootPart.LinkNum++;
AddPart(Part); AddPart(Part);
Part.LinkNum = m_parts.Count; Part.LinkNum = m_parts.Count;
@ -833,7 +833,7 @@ namespace OpenSim.Region.Environment.Scenes
part.LinkNum = m_parts.Count; part.LinkNum = m_parts.Count;
if(part.LinkNum == 2 && RootPart != null) if (part.LinkNum == 2 && RootPart != null)
RootPart.LinkNum = 1; RootPart.LinkNum = 1;
} }
} }
@ -1745,7 +1745,7 @@ namespace OpenSim.Region.Environment.Scenes
linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
linkPart.ParentID = m_rootPart.LocalId; linkPart.ParentID = m_rootPart.LocalId;
if(m_rootPart.LinkNum == 0) if (m_rootPart.LinkNum == 0)
m_rootPart.LinkNum = 1; m_rootPart.LinkNum = 1;
lock (m_parts) lock (m_parts)
@ -1815,13 +1815,15 @@ namespace OpenSim.Region.Environment.Scenes
m_parts.Remove(linkPart.UUID); m_parts.Remove(linkPart.UUID);
} }
if(m_parts.Count == 1 && RootPart != null) //Single prim is left if (m_parts.Count == 1 && RootPart != null) //Single prim is left
RootPart.LinkNum = 0; RootPart.LinkNum = 0;
else else
{ {
foreach (SceneObjectPart p in m_parts.Values) foreach (SceneObjectPart p in m_parts.Values)
if(p.LinkNum > linkPart.LinkNum) {
if (p.LinkNum > linkPart.LinkNum)
p.LinkNum--; p.LinkNum--;
}
} }
linkPart.ParentID = 0; linkPart.ParentID = 0;
@ -1858,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes
m_scene.AddNewSceneObject(objectGroup, true); m_scene.AddNewSceneObject(objectGroup, true);
if(sendEvents) if (sendEvents)
linkPart.TriggerScriptChangedEvent(Changed.LINK); linkPart.TriggerScriptChangedEvent(Changed.LINK);
HasGroupChanged = true; HasGroupChanged = true;
@ -2131,11 +2133,11 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="localID"></param> /// <param name="localID"></param>
public void Resize(LLVector3 scale, uint localID) public void Resize(LLVector3 scale, uint localID)
{ {
if(scale.X > m_scene.m_maxNonphys) if (scale.X > m_scene.m_maxNonphys)
scale.X = m_scene.m_maxNonphys; scale.X = m_scene.m_maxNonphys;
if(scale.Y > m_scene.m_maxNonphys) if (scale.Y > m_scene.m_maxNonphys)
scale.Y = m_scene.m_maxNonphys; scale.Y = m_scene.m_maxNonphys;
if(scale.Z > m_scene.m_maxNonphys) if (scale.Z > m_scene.m_maxNonphys)
scale.Z = m_scene.m_maxNonphys; scale.Z = m_scene.m_maxNonphys;
SceneObjectPart part = GetChildPart(localID); SceneObjectPart part = GetChildPart(localID);
@ -2144,13 +2146,13 @@ namespace OpenSim.Region.Environment.Scenes
part.Resize(scale); part.Resize(scale);
if (part.PhysActor != null) if (part.PhysActor != null)
{ {
if(part.PhysActor.IsPhysical) if (part.PhysActor.IsPhysical)
{ {
if(scale.X > m_scene.m_maxPhys) if (scale.X > m_scene.m_maxPhys)
scale.X = m_scene.m_maxPhys; scale.X = m_scene.m_maxPhys;
if(scale.Y > m_scene.m_maxPhys) if (scale.Y > m_scene.m_maxPhys)
scale.Y = m_scene.m_maxPhys; scale.Y = m_scene.m_maxPhys;
if(scale.Z > m_scene.m_maxPhys) if (scale.Z > m_scene.m_maxPhys)
scale.Z = m_scene.m_maxPhys; scale.Z = m_scene.m_maxPhys;
} }
part.PhysActor.Size = part.PhysActor.Size =
@ -2179,19 +2181,19 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectPart part = GetChildPart(localID); SceneObjectPart part = GetChildPart(localID);
if (part != null) if (part != null)
{ {
if(scale.X > m_scene.m_maxNonphys) if (scale.X > m_scene.m_maxNonphys)
scale.X = m_scene.m_maxNonphys; scale.X = m_scene.m_maxNonphys;
if(scale.Y > m_scene.m_maxNonphys) if (scale.Y > m_scene.m_maxNonphys)
scale.Y = m_scene.m_maxNonphys; scale.Y = m_scene.m_maxNonphys;
if(scale.Z > m_scene.m_maxNonphys) if (scale.Z > m_scene.m_maxNonphys)
scale.Z = m_scene.m_maxNonphys; scale.Z = m_scene.m_maxNonphys;
if(part.PhysActor != null && part.PhysActor.IsPhysical) if (part.PhysActor != null && part.PhysActor.IsPhysical)
{ {
if(scale.X > m_scene.m_maxPhys) if (scale.X > m_scene.m_maxPhys)
scale.X = m_scene.m_maxPhys; scale.X = m_scene.m_maxPhys;
if(scale.Y > m_scene.m_maxPhys) if (scale.Y > m_scene.m_maxPhys)
scale.Y = m_scene.m_maxPhys; scale.Y = m_scene.m_maxPhys;
if(scale.Z > m_scene.m_maxPhys) if (scale.Z > m_scene.m_maxPhys)
scale.Z = m_scene.m_maxPhys; scale.Z = m_scene.m_maxPhys;
} }
float x = (scale.X / part.Scale.X); float x = (scale.X / part.Scale.X);
@ -2200,7 +2202,7 @@ namespace OpenSim.Region.Environment.Scenes
lock (m_parts) lock (m_parts)
{ {
if(x > 1.0f || y > 1.0f || z > 1.0f) if (x > 1.0f || y > 1.0f || z > 1.0f)
{ {
foreach (SceneObjectPart obPart in m_parts.Values) foreach (SceneObjectPart obPart in m_parts.Values)
{ {
@ -2211,9 +2213,9 @@ namespace OpenSim.Region.Environment.Scenes
float f = 1.0f; float f = 1.0f;
float a = 1.0f; float a = 1.0f;
if(part.PhysActor != null && part.PhysActor.IsPhysical) if (part.PhysActor != null && part.PhysActor.IsPhysical)
{ {
if(oldSize.X*x > m_scene.m_maxPhys) if (oldSize.X*x > m_scene.m_maxPhys)
{ {
f = m_scene.m_maxPhys / oldSize.X; f = m_scene.m_maxPhys / oldSize.X;
a = f / x; a = f / x;
@ -2221,7 +2223,7 @@ namespace OpenSim.Region.Environment.Scenes
y *= a; y *= a;
z *= a; z *= a;
} }
if(oldSize.Y*y > m_scene.m_maxPhys) if (oldSize.Y*y > m_scene.m_maxPhys)
{ {
f = m_scene.m_maxPhys / oldSize.Y; f = m_scene.m_maxPhys / oldSize.Y;
a = f / y; a = f / y;
@ -2229,7 +2231,7 @@ namespace OpenSim.Region.Environment.Scenes
y *= a; y *= a;
z *= a; z *= a;
} }
if(oldSize.Z*z > m_scene.m_maxPhys) if (oldSize.Z*z > m_scene.m_maxPhys)
{ {
f = m_scene.m_maxPhys / oldSize.Z; f = m_scene.m_maxPhys / oldSize.Z;
a = f / z; a = f / z;
@ -2240,7 +2242,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
else else
{ {
if(oldSize.X*x > m_scene.m_maxNonphys) if (oldSize.X*x > m_scene.m_maxNonphys)
{ {
f = m_scene.m_maxNonphys / oldSize.X; f = m_scene.m_maxNonphys / oldSize.X;
a = f / x; a = f / x;
@ -2248,7 +2250,7 @@ namespace OpenSim.Region.Environment.Scenes
y *= a; y *= a;
z *= a; z *= a;
} }
if(oldSize.Y*y > m_scene.m_maxNonphys) if (oldSize.Y*y > m_scene.m_maxNonphys)
{ {
f = m_scene.m_maxNonphys / oldSize.Y; f = m_scene.m_maxNonphys / oldSize.Y;
a = f / y; a = f / y;
@ -2256,7 +2258,7 @@ namespace OpenSim.Region.Environment.Scenes
y *= a; y *= a;
z *= a; z *= a;
} }
if(oldSize.Z*z > m_scene.m_maxNonphys) if (oldSize.Z*z > m_scene.m_maxNonphys)
{ {
f = m_scene.m_maxNonphys / oldSize.Z; f = m_scene.m_maxNonphys / oldSize.Z;
a = f / z; a = f / z;

View File

@ -2245,7 +2245,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetAvatarOnSitTarget(LLUUID avatarID) public void SetAvatarOnSitTarget(LLUUID avatarID)
{ {
m_sitTargetAvatar = avatarID; m_sitTargetAvatar = avatarID;
if(ParentGroup != null) if (ParentGroup != null)
ParentGroup.TriggerScriptChangedEvent(Changed.LINK); ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
} }

View File

@ -79,7 +79,7 @@ namespace OpenSim.Region.Environment
typeInterface = pluginType.GetInterface("IEstateDataStore", true); typeInterface = pluginType.GetInterface("IEstateDataStore", true);
if(typeInterface != null) if (typeInterface != null)
{ {
IEstateDataStore estPlug = IEstateDataStore estPlug =
(IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); (IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));

View File

@ -212,11 +212,12 @@ namespace OpenSim.Region.Modules.SvnSerialiser
{ {
m_scenes.Add(scene); m_scenes.Add(scene);
} }
//Only register it once, to prevend command being executed x*region times //Only register it once, to prevent command being executed x*region times
if(m_scenes.Count ==1) { if (m_scenes.Count == 1)
scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; {
} scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
} }
}
public void PostInitialise() public void PostInitialise()
{ {
@ -341,7 +342,6 @@ namespace OpenSim.Region.Modules.SvnSerialiser
} }
} }
public void LoadAllScenes(int revision) public void LoadAllScenes(int revision)
{ {
CheckoutSvn(new SvnRevision(revision)); CheckoutSvn(new SvnRevision(revision));

View File

@ -425,8 +425,8 @@ namespace OpenSim.Region.ScriptEngine.Common
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
double x,y,z,s; double x,y,z,s;
int f=0; int f=0;
// Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s>
// Computing quaternion x,y,z,s values // Computing quaternion x,y,z,s values
x = ((fwd.x - left.y - up.z + 1) / 4); x = ((fwd.x - left.y - up.z + 1) / 4);
x *= x; x *= x;
x = Math.Sqrt(Math.Sqrt(x)); x = Math.Sqrt(Math.Sqrt(x));
@ -440,11 +440,11 @@ namespace OpenSim.Region.ScriptEngine.Common
s *= s; s *= s;
s = Math.Sqrt(Math.Sqrt(s)); s = Math.Sqrt(Math.Sqrt(s));
// Set f for signs detection // Set f for signs detection
if (fwd.y+left.x >= 0){f+=1;} if (fwd.y+left.x >= 0){f+=1;}
if (fwd.z+up.x >= 0){f+=2;} if (fwd.z+up.x >= 0){f+=2;}
if (left.z-up.y >= 0){f+=4;} if (left.z-up.y >= 0){f+=4;}
// Set correct quaternion signs based on f value // Set correct quaternion signs based on f value
if (f == 0) { x = -x; } if (f == 0) { x = -x; }
if (f == 1) { x = -x; y = -y; } if (f == 1) { x = -x; y = -y; }
if (f == 2) { x = -x; z = -z; } if (f == 2) { x = -x; z = -z; }
@ -459,7 +459,7 @@ namespace OpenSim.Region.ScriptEngine.Common
if (llVecDist(llRot2Fwd(result), fwd) > 0.001 || llVecDist(llRot2Left(result), left) > 0.001) if (llVecDist(llRot2Fwd(result), fwd) > 0.001 || llVecDist(llRot2Left(result), left) > 0.001)
result.s = -s; result.s = -s;
return result; return result;
} }
public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r)
@ -950,19 +950,19 @@ namespace OpenSim.Region.ScriptEngine.Common
if (value == 1) if (value == 1)
{ {
SceneObjectGroup group = m_host.ParentGroup; SceneObjectGroup group = m_host.ParentGroup;
if(group == null) if (group == null)
return; return;
bool allow = true; bool allow = true;
foreach(SceneObjectPart part in group.Children.Values) foreach (SceneObjectPart part in group.Children.Values)
{ {
if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys)
{ {
allow = false; allow = false;
break; break;
} }
} }
if(!allow) if (!allow)
return; return;
m_host.ScriptSetPhysicsStatus(true); m_host.ScriptSetPhysicsStatus(true);
} }
@ -1083,23 +1083,23 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
// TODO: this needs to trigger a persistance save as well // TODO: this needs to trigger a persistance save as well
if(part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) if (part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null)
return; return;
if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
{ {
if(scale.x > World.m_maxPhys) if (scale.x > World.m_maxPhys)
scale.x = World.m_maxPhys; scale.x = World.m_maxPhys;
if(scale.y > World.m_maxPhys) if (scale.y > World.m_maxPhys)
scale.y = World.m_maxPhys; scale.y = World.m_maxPhys;
if(scale.z > World.m_maxPhys) if (scale.z > World.m_maxPhys)
scale.z = World.m_maxPhys; scale.z = World.m_maxPhys;
} }
if(scale.x > World.m_maxNonphys) if (scale.x > World.m_maxNonphys)
scale.x = World.m_maxNonphys; scale.x = World.m_maxNonphys;
if(scale.y > World.m_maxNonphys) if (scale.y > World.m_maxNonphys)
scale.y = World.m_maxNonphys; scale.y = World.m_maxNonphys;
if(scale.z > World.m_maxNonphys) if (scale.z > World.m_maxNonphys)
scale.z = World.m_maxNonphys; scale.z = World.m_maxNonphys;
LLVector3 tmp = part.Scale; LLVector3 tmp = part.Scale;
tmp.X = (float)scale.x; tmp.X = (float)scale.x;
@ -6776,7 +6776,7 @@ namespace OpenSim.Region.ScriptEngine.Common
public LSL_Types.Vector3 llGetCameraPos() public LSL_Types.Vector3 llGetCameraPos()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LLUUID invItemID=InventorySelf(); LLUUID invItemID=InventorySelf();
if (invItemID == LLUUID.Zero) if (invItemID == LLUUID.Zero)
return new LSL_Types.Vector3(); return new LSL_Types.Vector3();
@ -6784,16 +6784,16 @@ namespace OpenSim.Region.ScriptEngine.Common
return new LSL_Types.Vector3(); return new LSL_Types.Vector3();
if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA) == 0) if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA) == 0)
{ {
ShoutError("No permissions to track the camera"); ShoutError("No permissions to track the camera");
return new LSL_Types.Vector3(); return new LSL_Types.Vector3();
} }
ScenePresence presence = World.GetScenePresence(m_host.OwnerID); ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
if(presence != null) if (presence != null)
{ {
LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z);
return pos; return pos;
} }
return new LSL_Types.Vector3(); return new LSL_Types.Vector3();
} }
public LSL_Types.Quaternion llGetCameraRot() public LSL_Types.Quaternion llGetCameraRot()
@ -6968,7 +6968,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IEstateModule estate = World.RequestModuleInterface<IEstateModule>(); IEstateModule estate = World.RequestModuleInterface<IEstateModule>();
if(estate == null) if (estate == null)
return 67108864; return 67108864;
return estate.GetRegionFlags(); return estate.GetRegionFlags();
} }

View File

@ -2108,7 +2108,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
string results = ""; string results = "";
for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch())
{ {
//Console.WriteLine( m ); //Console.WriteLine( m );
results += presep+ m + postsep; results += presep+ m + postsep;
} }
return results; return results;

View File

@ -790,19 +790,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (value == 1) if (value == 1)
{ {
SceneObjectGroup group = m_host.ParentGroup; SceneObjectGroup group = m_host.ParentGroup;
if(group == null) if (group == null)
return; return;
bool allow = true; bool allow = true;
foreach(SceneObjectPart part in group.Children.Values) foreach (SceneObjectPart part in group.Children.Values)
{ {
if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys)
{ {
allow = false; allow = false;
break; break;
} }
} }
if(!allow) if (!allow)
return; return;
m_host.ScriptSetPhysicsStatus(true); m_host.ScriptSetPhysicsStatus(true);
} }
@ -937,23 +937,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
// TODO: this needs to trigger a persistance save as well // TODO: this needs to trigger a persistance save as well
if(part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) if (part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null)
return; return;
if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
{ {
if(scale.x > World.m_maxPhys) if (scale.x > World.m_maxPhys)
scale.x = World.m_maxPhys; scale.x = World.m_maxPhys;
if(scale.y > World.m_maxPhys) if (scale.y > World.m_maxPhys)
scale.y = World.m_maxPhys; scale.y = World.m_maxPhys;
if(scale.z > World.m_maxPhys) if (scale.z > World.m_maxPhys)
scale.z = World.m_maxPhys; scale.z = World.m_maxPhys;
} }
if(scale.x > World.m_maxNonphys) if (scale.x > World.m_maxNonphys)
scale.x = World.m_maxNonphys; scale.x = World.m_maxNonphys;
if(scale.y > World.m_maxNonphys) if (scale.y > World.m_maxNonphys)
scale.y = World.m_maxNonphys; scale.y = World.m_maxNonphys;
if(scale.z > World.m_maxNonphys) if (scale.z > World.m_maxNonphys)
scale.z = World.m_maxNonphys; scale.z = World.m_maxNonphys;
LLVector3 tmp = part.Scale; LLVector3 tmp = part.Scale;
tmp.X = (float)scale.x; tmp.X = (float)scale.x;
@ -6748,7 +6748,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IEstateModule estate = World.RequestModuleInterface<IEstateModule>(); IEstateModule estate = World.RequestModuleInterface<IEstateModule>();
if(estate == null) if (estate == null)
return 67108864; return 67108864;
return (int)estate.GetRegionFlags(); return (int)estate.GetRegionFlags();
} }

View File

@ -2108,7 +2108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
string results = ""; string results = "";
for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch())
{ {
//Console.WriteLine( m ); //Console.WriteLine( m );
results += presep+ m + postsep; results += presep+ m + postsep;
} }
return results; return results;

View File

@ -327,7 +327,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
{ {
// Its LSL, convert it to C# // Its LSL, convert it to C#
//compileScript = LSL_Converter.Convert(Script); //compileScript = LSL_Converter.Convert(Script);
if(m_UseCompiler) if (m_UseCompiler)
LSL_Converter = (ICodeConverter)new CSCodeGenerator(); LSL_Converter = (ICodeConverter)new CSCodeGenerator();
else else
LSL_Converter = (ICodeConverter)new LSL2CSConverter(); LSL_Converter = (ICodeConverter)new LSL2CSConverter();

View File

@ -30,8 +30,8 @@ using System;
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
{ {
public interface ICodeConverter public interface ICodeConverter
{ {
string Convert(string script); string Convert(string script);
} }
} }

View File

@ -1191,8 +1191,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (result == null) if (result == null)
return true; return true;
if(!m_InSelfDelete) if (!m_InSelfDelete)
result.Abort(); result.Abort();
lock (m_EventQueue) lock (m_EventQueue)
{ {
@ -1342,10 +1342,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
e.ToString()); e.ToString());
} }
} }
else if((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException))
{ {
m_InSelfDelete = true; m_InSelfDelete = true;
if(part != null && part.ParentGroup != null) if (part != null && part.ParentGroup != null)
m_Engine.World.DeleteSceneObject(part.ParentGroup); m_Engine.World.DeleteSceneObject(part.ParentGroup);
} }
} }