* some if inversions and added {}'s for readability

0.6.0-stable
lbsa71 2008-09-08 14:30:35 +00:00
parent f2de15bffc
commit 8388fe0669
7 changed files with 92 additions and 61 deletions

View File

@ -71,8 +71,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_configSource = openSim.ConfigSource.Source; m_configSource = openSim.ConfigSource.Source;
try try
{ {
if (m_configSource.Configs["RemoteAdmin"] != null && if (m_configSource.Configs["RemoteAdmin"] == null ||
m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false)) !m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false))
{
// No config or disabled
}
else
{ {
m_config = m_configSource.Configs["RemoteAdmin"]; m_config = m_configSource.Configs["RemoteAdmin"];
m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); m_log.Info("[RADMIN]: Remote Admin Plugin Enabled");
@ -110,8 +114,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
checkStringParameters(request, new string[] { "password", "regionID" }); checkStringParameters(request, new string[] { "password", "regionID" });
if (requiredPassword != String.Empty && if (requiredPassword != String.Empty &&
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword))
{
throw new Exception("wrong password"); throw new Exception("wrong password");
}
UUID regionID = new UUID((string) requestData["regionID"]); UUID regionID = new UUID((string) requestData["regionID"]);

View File

@ -117,7 +117,9 @@ namespace OpenSim
msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n"; msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n";
Exception ex = (Exception)e.ExceptionObject; Exception ex = (Exception)e.ExceptionObject;
if (ex.InnerException != null) if (ex.InnerException != null)
{
msg += "InnerException: " + ex.InnerException.ToString() + "\r\n"; msg += "InnerException: " + ex.InnerException.ToString() + "\r\n";
}
msg += "\r\n"; msg += "\r\n";
msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n"; msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n";

View File

@ -77,6 +77,7 @@ namespace OpenSim
m_timedScript = startupConfig.GetString("timer_Script", "disabled"); m_timedScript = startupConfig.GetString("timer_Script", "disabled");
} }
base.ReadConfigSettings(); base.ReadConfigSettings();
} }
@ -96,13 +97,13 @@ namespace OpenSim
base.Startup(); base.Startup();
//Run Startup Commands //Run Startup Commands
if (m_startupCommandsFile != String.Empty) if (String.IsNullOrEmpty( m_startupCommandsFile ))
{ {
RunCommandScript(m_startupCommandsFile); m_log.Info("[STARTUP]: No startup command script specified. Moving on...");
} }
else else
{ {
m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); RunCommandScript(m_startupCommandsFile);
} }
// Start timer script (run a script every xx seconds) // Start timer script (run a script every xx seconds)
@ -365,6 +366,7 @@ namespace OpenSim
{ {
m_sceneManager.TrySetCurrentScene(".."); m_sceneManager.TrySetCurrentScene("..");
} }
m_regionData.Remove(killScene.RegionInfo); m_regionData.Remove(killScene.RegionInfo);
m_sceneManager.CloseScene(killScene); m_sceneManager.CloseScene(killScene);
} }

View File

@ -205,7 +205,10 @@ namespace OpenSim
{ {
IConfigSource DefaultConfig = new IniConfigSource(); IConfigSource DefaultConfig = new IniConfigSource();
if (DefaultConfig.Configs["Startup"] == null) if (DefaultConfig.Configs["Startup"] == null)
{
DefaultConfig.AddConfig("Startup"); DefaultConfig.AddConfig("Startup");
}
IConfig config = DefaultConfig.Configs["Startup"]; IConfig config = DefaultConfig.Configs["Startup"];
if (config != null) if (config != null)
{ {
@ -225,7 +228,9 @@ namespace OpenSim
} }
if (DefaultConfig.Configs["StandAlone"] == null) if (DefaultConfig.Configs["StandAlone"] == null)
{
DefaultConfig.AddConfig("StandAlone"); DefaultConfig.AddConfig("StandAlone");
}
config = DefaultConfig.Configs["StandAlone"]; config = DefaultConfig.Configs["StandAlone"];
if (config != null) if (config != null)
@ -242,7 +247,10 @@ namespace OpenSim
} }
if (DefaultConfig.Configs["Network"] == null) if (DefaultConfig.Configs["Network"] == null)
{
DefaultConfig.AddConfig("Network"); DefaultConfig.AddConfig("Network");
}
config = DefaultConfig.Configs["Network"]; config = DefaultConfig.Configs["Network"];
if (config != null) if (config != null)
{ {
@ -262,7 +270,10 @@ namespace OpenSim
} }
if (DefaultConfig.Configs["RemoteAdmin"] == null) if (DefaultConfig.Configs["RemoteAdmin"] == null)
{
DefaultConfig.AddConfig("RemoteAdmin"); DefaultConfig.AddConfig("RemoteAdmin");
}
config = DefaultConfig.Configs["RemoteAdmin"]; config = DefaultConfig.Configs["RemoteAdmin"];
if (config != null) if (config != null)
{ {
@ -270,12 +281,16 @@ namespace OpenSim
} }
if (DefaultConfig.Configs["Voice"] == null) if (DefaultConfig.Configs["Voice"] == null)
{
DefaultConfig.AddConfig("Voice"); DefaultConfig.AddConfig("Voice");
}
config = DefaultConfig.Configs["Voice"]; config = DefaultConfig.Configs["Voice"];
if (config != null) if (config != null)
{ {
config.Set("enabled", "false"); config.Set("enabled", "false");
} }
return DefaultConfig; return DefaultConfig;
} }
@ -741,18 +756,23 @@ namespace OpenSim
return; return;
} }
if (null != inventoryFolder) if (null == inventoryFolder)
{ {
m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); if (null == inventoryItem)
} {
else if (null != inventoryItem) m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath);
{ return;
m_log.InfoFormat("[CONSOLE]: Found item {0} {1} at {2}", inventoryItem.Name, inventoryItem.ID, invPath); }
else
{
m_log.InfoFormat("[CONSOLE]: Found item {0} {1} at {2}", inventoryItem.Name, inventoryItem.ID,
invPath);
}
} }
else else
{ {
m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID,
return; invPath);
} }
} }

View File

@ -138,30 +138,31 @@ namespace OpenSim.Region.ClientStack
// TODO: Remove this cruft once MasterAvatar is fully deprecated // TODO: Remove this cruft once MasterAvatar is fully deprecated
//Master Avatar Setup //Master Avatar Setup
UserProfileData masterAvatar; UserProfileData masterAvatar;
if (scene.RegionInfo.MasterAvatarAssignedUUID != UUID.Zero) if (scene.RegionInfo.MasterAvatarAssignedUUID == UUID.Zero)
{
masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID);
scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName;
scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName;
}
else
{ {
masterAvatar = masterAvatar =
m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarLastName,
scene.RegionInfo.MasterAvatarSandboxPassword); scene.RegionInfo.MasterAvatarSandboxPassword);
} }
if (masterAvatar != null)
{
m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]", scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName);
scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID;
}
else else
{
masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID);
scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName;
scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName;
}
if (masterAvatar == null)
{ {
m_log.Info("[PARCEL]: No master avatar found, using null."); m_log.Info("[PARCEL]: No master avatar found, using null.");
scene.RegionInfo.MasterAvatarAssignedUUID = UUID.Zero; scene.RegionInfo.MasterAvatarAssignedUUID = UUID.Zero;
} }
else
{
m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]",
scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName);
scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID;
}
scene.LoadPrimsFromStorage(regionInfo.originRegionID); scene.LoadPrimsFromStorage(regionInfo.originRegionID);
scene.StartTimer(); scene.StartTimer();

View File

@ -159,14 +159,14 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
state.ms_ptr.Seek(0, SeekOrigin.End); state.ms_ptr.Seek(0, SeekOrigin.End);
// call loadbarancer function // call loadbarancer function
if (PacketHandler != null) if (PacketHandler == null)
{ {
//MainLog.Instance.Verbose("TCPSERVER", "calling PacketHandler"); //MainLog.Instance.Verbose("TCPSERVER", "PacketHandler not found");
PacketHandler(state.header, packet);
} }
else else
{ {
//MainLog.Instance.Verbose("TCPSERVER", "PacketHandler not found"); //MainLog.Instance.Verbose("TCPSERVER", "calling PacketHandler");
PacketHandler(state.header, packet);
} }
int read_size = state.header.numbytes + TcpClient.internalPacketHeaderSize; int read_size = state.header.numbytes + TcpClient.internalPacketHeaderSize;

View File

@ -396,36 +396,7 @@ namespace OpenSim.ApplicationPlugins.RegionProxy
//m_log.ErrorFormat("[PROXY] Got message from {0} in thread {1}, size {2}", senderEP, sd.clientEP, numBytes); //m_log.ErrorFormat("[PROXY] Got message from {0} in thread {1}, size {2}", senderEP, sd.clientEP, numBytes);
EndPoint client = proxy_map.GetClient(senderEP); EndPoint client = proxy_map.GetClient(senderEP);
if (client != null) if (client == null)
{
try
{
client = ProxyCodec.DecodeProxyMessage(buffer, ref numBytes);
try
{
// This message comes from a region object, forward it to the its client
sd.server.SendTo(buffer, numBytes, SocketFlags.None, client);
//m_log.InfoFormat("[PROXY] Sending region message from {0} to {1}, size {2}", senderEP, client, numBytes);
}
catch (Exception e)
{
OpenPort(sd); // reopen the port just in case
m_log.ErrorFormat("[PROXY] Failed sending region message from {0} to {1}", senderEP, client);
m_log.Error("[PROXY]" + e.Message);
m_log.Error("[PROXY]" + e.StackTrace);
return;
}
}
catch (Exception e)
{
OpenPort(sd); // reopen the port just in case
m_log.ErrorFormat("[PROXY] Failed decoding region message from {0}", senderEP);
m_log.Error("[PROXY]" + e.Message);
m_log.Error("[PROXY]" + e.StackTrace);
return;
}
}
else
{ {
// This message comes from a client object, forward it to the the region(s) // This message comes from a client object, forward it to the the region(s)
ProxyCodec.EncodeProxyMessage(buffer, ref numBytes, senderEP); ProxyCodec.EncodeProxyMessage(buffer, ref numBytes, senderEP);
@ -454,6 +425,35 @@ namespace OpenSim.ApplicationPlugins.RegionProxy
} }
} }
} }
else
{
try
{
client = ProxyCodec.DecodeProxyMessage(buffer, ref numBytes);
try
{
// This message comes from a region object, forward it to the its client
sd.server.SendTo(buffer, numBytes, SocketFlags.None, client);
//m_log.InfoFormat("[PROXY] Sending region message from {0} to {1}, size {2}", senderEP, client, numBytes);
}
catch (Exception e)
{
OpenPort(sd); // reopen the port just in case
m_log.ErrorFormat("[PROXY] Failed sending region message from {0} to {1}", senderEP, client);
m_log.Error("[PROXY]" + e.Message);
m_log.Error("[PROXY]" + e.StackTrace);
return;
}
}
catch (Exception e)
{
OpenPort(sd); // reopen the port just in case
m_log.ErrorFormat("[PROXY] Failed decoding region message from {0}", senderEP);
m_log.Error("[PROXY]" + e.Message);
m_log.Error("[PROXY]" + e.StackTrace);
return;
}
}
} }
#region Nested type: ProxyMap #region Nested type: ProxyMap