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);
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;
}
}
private string[] FieldList
@ -171,14 +173,14 @@ namespace OpenSim.Data.MySQL
IDataReader r = cmd.ExecuteReader();
if(r.Read())
if (r.Read())
{
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]);
if(v != 0)
if (v != 0)
m_FieldMap[name].SetValue(es, true);
else
m_FieldMap[name].SetValue(es, false);
@ -207,9 +209,9 @@ namespace OpenSim.Data.MySQL
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");
else
cmd.Parameters.AddWithValue("?"+name, "0");
@ -283,9 +285,9 @@ namespace OpenSim.Data.MySQL
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");
else
cmd.Parameters.AddWithValue("?"+name, "0");
@ -317,7 +319,7 @@ namespace OpenSim.Data.MySQL
IDataReader r = cmd.ExecuteReader();
while(r.Read())
while (r.Read())
{
EstateBan eb = new EstateBan();
@ -347,7 +349,7 @@ namespace OpenSim.Data.MySQL
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("?bannedUUID", b.bannedUUID.ToString());
@ -372,7 +374,7 @@ namespace OpenSim.Data.MySQL
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("?uuid", uuid.ToString());
@ -395,7 +397,7 @@ namespace OpenSim.Data.MySQL
IDataReader r = cmd.ExecuteReader();
while(r.Read())
while (r.Read())
{
// EstateBan eb = new EstateBan();

View File

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

View File

@ -74,7 +74,7 @@ namespace OpenSim.Data.SQLite
BindingFlags.DeclaredOnly);
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;
}
@ -97,14 +97,14 @@ namespace OpenSim.Data.SQLite
IDataReader r = cmd.ExecuteReader();
if(r.Read())
if (r.Read())
{
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]);
if(v != 0)
if (v != 0)
m_FieldMap[name].SetValue(es, true);
else
m_FieldMap[name].SetValue(es, false);
@ -133,9 +133,9 @@ namespace OpenSim.Data.SQLite
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");
else
cmd.Parameters.Add(":"+name, "0");
@ -215,9 +215,9 @@ namespace OpenSim.Data.SQLite
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");
else
cmd.Parameters.Add(":"+name, "0");
@ -247,7 +247,7 @@ namespace OpenSim.Data.SQLite
IDataReader r = cmd.ExecuteReader();
while(r.Read())
while (r.Read())
{
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, '', '', '' )";
foreach(EstateBan b in es.EstateBans)
foreach (EstateBan b in es.EstateBans)
{
cmd.Parameters.Add(":EstateID", es.EstateID.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 )";
foreach(LLUUID uuid in data)
foreach (LLUUID uuid in data)
{
cmd.Parameters.Add(":EstateID", EstateID.ToString());
cmd.Parameters.Add(":uuid", uuid.ToString());
@ -319,7 +319,7 @@ namespace OpenSim.Data.SQLite
IDataReader r = cmd.ExecuteReader();
while(r.Read())
while (r.Read())
{
// EstateBan eb = new EstateBan();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
/// </summary>
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>
/// 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)
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;
remote_client.SendDetailedEstateData(invoice,
m_scene.RegionInfo.EstateSettings.EstateName,
@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
m_scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor;
if(matureLevel <= 13)
if (matureLevel <= 13)
m_scene.RegionInfo.RegionSettings.Maturity = 0;
else
m_scene.RegionInfo.RegionSettings.Maturity = 1;
@ -245,7 +245,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
ScenePresence s = m_scene.GetScenePresence(user);
if (s != null)
{
if(!s.IsChildAgent)
if (!s.IsChildAgent)
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.regionFlags = GetRegionFlags();
byte mature = 13;
if(m_scene.RegionInfo.RegionSettings.Maturity == 1)
if (m_scene.RegionInfo.RegionSettings.Maturity == 1)
mature = 21;
args.simAccess = mature;
@ -550,7 +550,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
args.terrainStartHeight3 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NE;
args.terrainHeightRange3 = (float)m_scene.RegionInfo.RegionSettings.Elevation2NE;
byte mature = 13;
if(m_scene.RegionInfo.RegionSettings.Maturity == 1)
if (m_scene.RegionInfo.RegionSettings.Maturity == 1)
mature = 21;
args.simAccess = mature;
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)
{
if(parms2 == 0)
if (parms2 == 0)
{
m_scene.RegionInfo.EstateSettings.UseGlobalTime = true;
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;
}
if((parms1 & 0x00000010) != 0)
if ((parms1 & 0x00000010) != 0)
m_scene.RegionInfo.EstateSettings.FixedSun = true;
else
m_scene.RegionInfo.EstateSettings.FixedSun = false;
if((parms1 & 0x00008000) != 0)
if ((parms1 & 0x00008000) != 0)
m_scene.RegionInfo.EstateSettings.PublicAccess = true;
else
m_scene.RegionInfo.EstateSettings.PublicAccess = false;
if((parms1 & 0x10000000) != 0)
if ((parms1 & 0x10000000) != 0)
m_scene.RegionInfo.EstateSettings.AllowVoice = true;
else
m_scene.RegionInfo.EstateSettings.AllowVoice = false;
if((parms1 & 0x00100000) != 0)
if ((parms1 & 0x00100000) != 0)
m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = true;
else
m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = false;
if((parms1 & 0x00800000) != 0)
if ((parms1 & 0x00800000) != 0)
m_scene.RegionInfo.EstateSettings.DenyAnonymous = true;
else
m_scene.RegionInfo.EstateSettings.DenyAnonymous = false;
if((parms1 & 0x01000000) != 0)
if ((parms1 & 0x01000000) != 0)
m_scene.RegionInfo.EstateSettings.DenyIdentified = true;
else
m_scene.RegionInfo.EstateSettings.DenyIdentified = false;
if((parms1 & 0x02000000) != 0)
if ((parms1 & 0x02000000) != 0)
m_scene.RegionInfo.EstateSettings.DenyTransacted = true;
else
m_scene.RegionInfo.EstateSettings.DenyTransacted = false;
@ -628,10 +628,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
m_scene.RegionInfo.EstateSettings.Save();
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;
if(m_scene.RegionInfo.EstateSettings.UseGlobalTime)
if (m_scene.RegionInfo.EstateSettings.UseGlobalTime)
sun = m_scene.EventManager.GetSunLindenHour();
}
@ -726,30 +726,30 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
// Fully implemented
//
if(m_scene.RegionInfo.RegionSettings.AllowDamage)
if (m_scene.RegionInfo.RegionSettings.AllowDamage)
flags |= Simulator.RegionFlags.AllowDamage;
if(m_scene.RegionInfo.RegionSettings.BlockTerraform)
if (m_scene.RegionInfo.RegionSettings.BlockTerraform)
flags |= Simulator.RegionFlags.BlockTerraform;
if(!m_scene.RegionInfo.RegionSettings.AllowLandResell)
if (!m_scene.RegionInfo.RegionSettings.AllowLandResell)
flags |= Simulator.RegionFlags.BlockLandResell;
if(m_scene.RegionInfo.RegionSettings.DisableCollisions)
if (m_scene.RegionInfo.RegionSettings.DisableCollisions)
flags |= Simulator.RegionFlags.SkipCollisions;
if(m_scene.RegionInfo.RegionSettings.DisableScripts)
if (m_scene.RegionInfo.RegionSettings.DisableScripts)
flags |= Simulator.RegionFlags.SkipScripts;
if(m_scene.RegionInfo.RegionSettings.DisablePhysics)
if (m_scene.RegionInfo.RegionSettings.DisablePhysics)
flags |= Simulator.RegionFlags.SkipPhysics;
if(m_scene.RegionInfo.RegionSettings.BlockFly)
if (m_scene.RegionInfo.RegionSettings.BlockFly)
flags |= Simulator.RegionFlags.NoFly;
if(m_scene.RegionInfo.RegionSettings.RestrictPushing)
if (m_scene.RegionInfo.RegionSettings.RestrictPushing)
flags |= Simulator.RegionFlags.RestrictPushObject;
if(m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide)
if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide)
flags |= Simulator.RegionFlags.AllowParcelChanges;
if(m_scene.RegionInfo.RegionSettings.BlockShowInSearch)
if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch)
flags |= (Simulator.RegionFlags)(1 << 29);
if(m_scene.RegionInfo.RegionSettings.FixedSun)
if (m_scene.RegionInfo.RegionSettings.FixedSun)
flags |= Simulator.RegionFlags.SunFixed;
if(m_scene.RegionInfo.RegionSettings.Sandbox)
if (m_scene.RegionInfo.RegionSettings.Sandbox)
flags |= Simulator.RegionFlags.Sandbox;
// Handled in LandObject.cs: AllowLandmark
@ -769,30 +769,30 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
{
Simulator.RegionFlags flags = Simulator.RegionFlags.None;
if(m_scene.RegionInfo.EstateSettings.FixedSun)
if (m_scene.RegionInfo.EstateSettings.FixedSun)
flags |= Simulator.RegionFlags.SunFixed;
if(m_scene.RegionInfo.EstateSettings.PublicAccess)
if (m_scene.RegionInfo.EstateSettings.PublicAccess)
flags |= (Simulator.RegionFlags.PublicAllowed |
Simulator.RegionFlags.ExternallyVisible);
if(m_scene.RegionInfo.EstateSettings.AllowVoice)
if (m_scene.RegionInfo.EstateSettings.AllowVoice)
flags |= Simulator.RegionFlags.AllowVoice;
if(m_scene.RegionInfo.EstateSettings.AllowDirectTeleport)
if (m_scene.RegionInfo.EstateSettings.AllowDirectTeleport)
flags |= Simulator.RegionFlags.AllowDirectTeleport;
if(m_scene.RegionInfo.EstateSettings.DenyAnonymous)
if (m_scene.RegionInfo.EstateSettings.DenyAnonymous)
flags |= Simulator.RegionFlags.DenyAnonymous;
if(m_scene.RegionInfo.EstateSettings.DenyIdentified)
if (m_scene.RegionInfo.EstateSettings.DenyIdentified)
flags |= Simulator.RegionFlags.DenyIdentified;
if(m_scene.RegionInfo.EstateSettings.DenyTransacted)
if (m_scene.RegionInfo.EstateSettings.DenyTransacted)
flags |= Simulator.RegionFlags.DenyTransacted;
if(m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner)
if (m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner)
flags |= Simulator.RegionFlags.AbuseEmailToEstateOwner;
if(m_scene.RegionInfo.EstateSettings.BlockDwell)
if (m_scene.RegionInfo.EstateSettings.BlockDwell)
flags |= Simulator.RegionFlags.BlockDwell;
if(m_scene.RegionInfo.EstateSettings.EstateSkipScripts)
if (m_scene.RegionInfo.EstateSettings.EstateSkipScripts)
flags |= Simulator.RegionFlags.EstateSkipScripts;
if(m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
if (m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
flags |= Simulator.RegionFlags.ResetHomeOnTeleport;
if(m_scene.RegionInfo.EstateSettings.TaxFree)
if (m_scene.RegionInfo.EstateSettings.TaxFree)
flags |= Simulator.RegionFlags.TaxFree;
return (uint)flags;
@ -804,7 +804,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
return true;
List<LLUUID> ems = new List<LLUUID>(m_scene.RegionInfo.EstateSettings.EstateManagers);
if(ems.Contains(avatarID))
if (ems.Contains(avatarID))
return true;
return false;

View File

@ -163,11 +163,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{
IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
uint regionFlags = 336723974 & ~((uint)(Simulator.RegionFlags.AllowLandmark | Simulator.RegionFlags.AllowSetHome));
if(estateModule != null)
if (estateModule != null)
regionFlags = estateModule.GetRegionFlags();
if((landData.landFlags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0)
if ((landData.landFlags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0)
regionFlags |= (uint)Simulator.RegionFlags.AllowLandmark;
if(landData.ownerID == remote_client.AgentId)
if (landData.ownerID == remote_client.AgentId)
regionFlags |= (uint)Simulator.RegionFlags.AllowSetHome;
remote_client.SendLandProperties(remote_client, sequence_id,
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
// occur on link to invoke this elsewhere (such as object selection)
parenPrim.TriggerScriptChangedEvent(Changed.LINK);
if(client != null)
if (client != null)
parenPrim.GetProperties(client);
else
{
@ -1426,13 +1426,13 @@ namespace OpenSim.Region.Environment.Scenes
parenPrim.DelinkFromGroup(childPrimId, sendEvents);
}
if(parenPrim.Children.Count == 1)
if (parenPrim.Children.Count == 1)
{
// The link set has been completely torn down
// This is the case if you select a link set and delink
//
parenPrim.RootPart.LinkNum = 1;
if(sendEvents)
if (sendEvents)
parenPrim.TriggerScriptChangedEvent(Changed.LINK);
}
else
@ -1449,7 +1449,7 @@ namespace OpenSim.Region.Environment.Scenes
// Tear down the remaining link set
//
if(unlink_ids.Count == 2)
if (unlink_ids.Count == 2)
{
DelinkObjects(unlink_ids, true);
return;
@ -1494,7 +1494,7 @@ namespace OpenSim.Region.Environment.Scenes
{
grp.DelinkFromGroup(primIds[i]);
delinkedSomething = true;
if(!parents.Contains(grp))
if (!parents.Contains(grp))
parents.Add(grp);
}

View File

@ -1693,7 +1693,7 @@ namespace OpenSim.Region.Environment.Scenes
}
// Finally remove the item, for reals this time.
if(permissionToDelete)
if (permissionToDelete)
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?
/// </summary>
public bool m_physicalPrim;
public float m_maxNonphys = 65536;
public float m_maxPhys = 10;
public float m_maxNonphys = 65536;
public float m_maxPhys = 10;
public bool m_seeIntoRegionFromNeighbor;
public int MaxUndoCount = 5;
@ -272,7 +272,7 @@ namespace OpenSim.Region.Environment.Scenes
// Load region settings
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);
@ -311,16 +311,16 @@ namespace OpenSim.Region.Environment.Scenes
+ " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
+ " PhysPrim:" + m_physicalPrim.ToString();
try
{
IConfig startupConfig = m_config.Configs["Startup"];
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f);
m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f);
}
catch (Exception)
{
m_log.Warn("Failed to load StartupConfig");
}
try
{
IConfig startupConfig = m_config.Configs["Startup"];
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f);
m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f);
}
catch (Exception)
{
m_log.Warn("Failed to load StartupConfig");
}
}
@ -2505,8 +2505,8 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="capsObjectPath"></param>
public void AddCapsHandler(LLUUID agentId)
{
if(RegionInfo.EstateSettings.IsBanned(agentId))
return;
if (RegionInfo.EstateSettings.IsBanned(agentId))
return;
String capsObjectPath = GetCapsPath(agentId);
m_log.DebugFormat(

View File

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

View File

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

View File

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

View File

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

View File

@ -425,8 +425,8 @@ namespace OpenSim.Region.ScriptEngine.Common
m_host.AddScriptLPS(1);
double x,y,z,s;
int f=0;
// Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s>
// Computing quaternion x,y,z,s values
// Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s>
// Computing quaternion x,y,z,s values
x = ((fwd.x - left.y - up.z + 1) / 4);
x *= x;
x = Math.Sqrt(Math.Sqrt(x));
@ -440,11 +440,11 @@ namespace OpenSim.Region.ScriptEngine.Common
s *= s;
s = Math.Sqrt(Math.Sqrt(s));
// Set f for signs detection
if (fwd.y+left.x >= 0){f+=1;}
if (fwd.z+up.x >= 0){f+=2;}
if (left.z-up.y >= 0){f+=4;}
// Set correct quaternion signs based on f value
// Set f for signs detection
if (fwd.y+left.x >= 0){f+=1;}
if (fwd.z+up.x >= 0){f+=2;}
if (left.z-up.y >= 0){f+=4;}
// Set correct quaternion signs based on f value
if (f == 0) { x = -x; }
if (f == 1) { x = -x; y = -y; }
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)
result.s = -s;
return result;
return result;
}
public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r)
@ -950,19 +950,19 @@ namespace OpenSim.Region.ScriptEngine.Common
if (value == 1)
{
SceneObjectGroup group = m_host.ParentGroup;
if(group == null)
if (group == null)
return;
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;
break;
}
}
if(!allow)
if (!allow)
return;
m_host.ScriptSetPhysicsStatus(true);
}
@ -1083,23 +1083,23 @@ namespace OpenSim.Region.ScriptEngine.Common
{
// 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;
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;
if(scale.y > World.m_maxPhys)
if (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;
}
if(scale.x > World.m_maxNonphys)
if (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;
if(scale.z > World.m_maxNonphys)
if (scale.z > World.m_maxNonphys)
scale.z = World.m_maxNonphys;
LLVector3 tmp = part.Scale;
tmp.X = (float)scale.x;
@ -6776,7 +6776,7 @@ namespace OpenSim.Region.ScriptEngine.Common
public LSL_Types.Vector3 llGetCameraPos()
{
m_host.AddScriptLPS(1);
m_host.AddScriptLPS(1);
LLUUID invItemID=InventorySelf();
if (invItemID == LLUUID.Zero)
return new LSL_Types.Vector3();
@ -6784,16 +6784,16 @@ namespace OpenSim.Region.ScriptEngine.Common
return new LSL_Types.Vector3();
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();
}
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
if(presence != null)
{
LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z);
return pos;
}
return new LSL_Types.Vector3();
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
if (presence != null)
{
LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z);
return pos;
}
return new LSL_Types.Vector3();
}
public LSL_Types.Quaternion llGetCameraRot()
@ -6968,7 +6968,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
m_host.AddScriptLPS(1);
IEstateModule estate = World.RequestModuleInterface<IEstateModule>();
if(estate == null)
if (estate == null)
return 67108864;
return estate.GetRegionFlags();
}

View File

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

View File

@ -790,19 +790,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (value == 1)
{
SceneObjectGroup group = m_host.ParentGroup;
if(group == null)
if (group == null)
return;
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;
break;
}
}
if(!allow)
if (!allow)
return;
m_host.ScriptSetPhysicsStatus(true);
}
@ -937,23 +937,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
// 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;
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;
if(scale.y > World.m_maxPhys)
if (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;
}
if(scale.x > World.m_maxNonphys)
if (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;
if(scale.z > World.m_maxNonphys)
if (scale.z > World.m_maxNonphys)
scale.z = World.m_maxNonphys;
LLVector3 tmp = part.Scale;
tmp.X = (float)scale.x;
@ -6748,7 +6748,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
IEstateModule estate = World.RequestModuleInterface<IEstateModule>();
if(estate == null)
if (estate == null)
return 67108864;
return (int)estate.GetRegionFlags();
}

View File

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

View File

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

View File

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

View File

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