* some if inversions and added {}'s for readability
parent
f2de15bffc
commit
8388fe0669
|
@ -71,8 +71,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
|||
m_configSource = openSim.ConfigSource.Source;
|
||||
try
|
||||
{
|
||||
if (m_configSource.Configs["RemoteAdmin"] != null &&
|
||||
m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false))
|
||||
if (m_configSource.Configs["RemoteAdmin"] == null ||
|
||||
!m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false))
|
||||
{
|
||||
// No config or disabled
|
||||
}
|
||||
else
|
||||
{
|
||||
m_config = m_configSource.Configs["RemoteAdmin"];
|
||||
m_log.Info("[RADMIN]: Remote Admin Plugin Enabled");
|
||||
|
@ -110,8 +114,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
|||
checkStringParameters(request, new string[] { "password", "regionID" });
|
||||
|
||||
if (requiredPassword != String.Empty &&
|
||||
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
|
||||
(!requestData.Contains("password") || (string)requestData["password"] != requiredPassword))
|
||||
{
|
||||
throw new Exception("wrong password");
|
||||
}
|
||||
|
||||
UUID regionID = new UUID((string) requestData["regionID"]);
|
||||
|
||||
|
|
|
@ -117,7 +117,9 @@ namespace OpenSim
|
|||
msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n";
|
||||
Exception ex = (Exception)e.ExceptionObject;
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
msg += "InnerException: " + ex.InnerException.ToString() + "\r\n";
|
||||
}
|
||||
|
||||
msg += "\r\n";
|
||||
msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n";
|
||||
|
|
|
@ -77,6 +77,7 @@ namespace OpenSim
|
|||
|
||||
m_timedScript = startupConfig.GetString("timer_Script", "disabled");
|
||||
}
|
||||
|
||||
base.ReadConfigSettings();
|
||||
}
|
||||
|
||||
|
@ -96,13 +97,13 @@ namespace OpenSim
|
|||
base.Startup();
|
||||
|
||||
//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
|
||||
{
|
||||
m_log.Info("[STARTUP]: No startup command script specified. Moving on...");
|
||||
RunCommandScript(m_startupCommandsFile);
|
||||
}
|
||||
|
||||
// Start timer script (run a script every xx seconds)
|
||||
|
@ -365,6 +366,7 @@ namespace OpenSim
|
|||
{
|
||||
m_sceneManager.TrySetCurrentScene("..");
|
||||
}
|
||||
|
||||
m_regionData.Remove(killScene.RegionInfo);
|
||||
m_sceneManager.CloseScene(killScene);
|
||||
}
|
||||
|
|
|
@ -205,7 +205,10 @@ namespace OpenSim
|
|||
{
|
||||
IConfigSource DefaultConfig = new IniConfigSource();
|
||||
if (DefaultConfig.Configs["Startup"] == null)
|
||||
{
|
||||
DefaultConfig.AddConfig("Startup");
|
||||
}
|
||||
|
||||
IConfig config = DefaultConfig.Configs["Startup"];
|
||||
if (config != null)
|
||||
{
|
||||
|
@ -225,7 +228,9 @@ namespace OpenSim
|
|||
}
|
||||
|
||||
if (DefaultConfig.Configs["StandAlone"] == null)
|
||||
{
|
||||
DefaultConfig.AddConfig("StandAlone");
|
||||
}
|
||||
|
||||
config = DefaultConfig.Configs["StandAlone"];
|
||||
if (config != null)
|
||||
|
@ -242,7 +247,10 @@ namespace OpenSim
|
|||
}
|
||||
|
||||
if (DefaultConfig.Configs["Network"] == null)
|
||||
{
|
||||
DefaultConfig.AddConfig("Network");
|
||||
}
|
||||
|
||||
config = DefaultConfig.Configs["Network"];
|
||||
if (config != null)
|
||||
{
|
||||
|
@ -262,7 +270,10 @@ namespace OpenSim
|
|||
}
|
||||
|
||||
if (DefaultConfig.Configs["RemoteAdmin"] == null)
|
||||
{
|
||||
DefaultConfig.AddConfig("RemoteAdmin");
|
||||
}
|
||||
|
||||
config = DefaultConfig.Configs["RemoteAdmin"];
|
||||
if (config != null)
|
||||
{
|
||||
|
@ -270,12 +281,16 @@ namespace OpenSim
|
|||
}
|
||||
|
||||
if (DefaultConfig.Configs["Voice"] == null)
|
||||
{
|
||||
DefaultConfig.AddConfig("Voice");
|
||||
}
|
||||
|
||||
config = DefaultConfig.Configs["Voice"];
|
||||
if (config != null)
|
||||
{
|
||||
config.Set("enabled", "false");
|
||||
}
|
||||
|
||||
return DefaultConfig;
|
||||
|
||||
}
|
||||
|
@ -741,18 +756,23 @@ namespace OpenSim
|
|||
return;
|
||||
}
|
||||
|
||||
if (null != inventoryFolder)
|
||||
if (null == inventoryFolder)
|
||||
{
|
||||
m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath);
|
||||
}
|
||||
else if (null != inventoryItem)
|
||||
{
|
||||
m_log.InfoFormat("[CONSOLE]: Found item {0} {1} at {2}", inventoryItem.Name, inventoryItem.ID, invPath);
|
||||
if (null == inventoryItem)
|
||||
{
|
||||
m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.InfoFormat("[CONSOLE]: Found item {0} {1} at {2}", inventoryItem.Name, inventoryItem.ID,
|
||||
invPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath);
|
||||
return;
|
||||
m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID,
|
||||
invPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -138,30 +138,31 @@ namespace OpenSim.Region.ClientStack
|
|||
// TODO: Remove this cruft once MasterAvatar is fully deprecated
|
||||
//Master Avatar Setup
|
||||
UserProfileData masterAvatar;
|
||||
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
|
||||
if (scene.RegionInfo.MasterAvatarAssignedUUID == UUID.Zero)
|
||||
{
|
||||
masterAvatar =
|
||||
m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
|
||||
scene.RegionInfo.MasterAvatarLastName,
|
||||
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
|
||||
{
|
||||
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.");
|
||||
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.StartTimer();
|
||||
|
|
|
@ -159,14 +159,14 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
|
|||
|
||||
state.ms_ptr.Seek(0, SeekOrigin.End);
|
||||
// call loadbarancer function
|
||||
if (PacketHandler != null)
|
||||
if (PacketHandler == null)
|
||||
{
|
||||
//MainLog.Instance.Verbose("TCPSERVER", "calling PacketHandler");
|
||||
PacketHandler(state.header, packet);
|
||||
//MainLog.Instance.Verbose("TCPSERVER", "PacketHandler not found");
|
||||
}
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
EndPoint client = proxy_map.GetClient(senderEP);
|
||||
|
||||
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
|
||||
if (client == null)
|
||||
{
|
||||
// This message comes from a client object, forward it to the the region(s)
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue