This commit is contained in:
Adil El Farissi
2024-08-20 23:52:45 +00:00
14 changed files with 201 additions and 136 deletions

View File

@@ -150,7 +150,7 @@ namespace OpenSim.Framework.Serialization.External
settings.TerrainPBR3 = UUID.Parse(xtr.ReadElementContentAsString());
break;
case "PBR4":
settings.TerrainPBR3 = UUID.Parse(xtr.ReadElementContentAsString());
settings.TerrainPBR4 = UUID.Parse(xtr.ReadElementContentAsString());
break;
case "ElevationLowSW":
settings.Elevation1SW = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);

View File

@@ -355,7 +355,7 @@ namespace OpenSim
// Sure is not the right place for this but do the job...
// Must always be called before (all) / the HTTP servers starting for the Certs creation or renewals.
if(startupConfig.GetBoolean("EnableSelfsignedCertSupport"))
if(startupConfig.GetBoolean("EnableSelfsignedCertSupport", false))
{
if(!File.Exists("SSL\\ssl\\"+ startupConfig.GetString("CertFileName") +".p12") || startupConfig.GetBoolean("CertRenewOnStartup"))
{

View File

@@ -541,7 +541,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (texture.IsZero())
return;
if((remoteClient.ViewerFlags & ViewerFlags.TPBR) != 0)
if(remoteClient is not null && (remoteClient.ViewerFlags & ViewerFlags.TPBR) != 0)
{
switch (level)
{

View File

@@ -5150,31 +5150,41 @@ namespace OpenSim.Region.Framework.Scenes
if (engines.Length == 0) // No engine at all
return 0.0f;
float time = 0.0f;
// get all the scripts in all parts
SceneObjectPart[] parts = m_parts.GetArray();
List<TaskInventoryItem> scripts = new();
for (int i = 0; i < parts.Length; i++)
try
{
scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL));
}
// extract the UUIDs
HashSet<UUID> unique = new();
foreach (TaskInventoryItem script in scripts)
unique.Add(script.ItemID);
float time = 0.0f;
List<UUID> ids = unique.ToList();
// Offer the list of script UUIDs to each engine found and accumulate the time
foreach (IScriptModule e in engines)
{
if (e is not null)
// get all the scripts in all parts
SceneObjectPart[] parts = m_parts.GetArray();
List<TaskInventoryItem> scripts = new();
for (int i = 0; i < parts.Length; i++)
{
time += e.GetScriptExecutionTime(ids);
IEntityInventory inv = parts[i].Inventory;
if (inv is not null)
scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL));
}
// extract the UUIDs
HashSet<UUID> unique = new();
foreach (TaskInventoryItem script in scripts)
unique.Add(script.ItemID);
List<UUID> ids = unique.ToList();
// Offer the list of script UUIDs to each engine found and accumulate the time
foreach (IScriptModule e in engines)
{
if (e is not null)
{
time += e.GetScriptExecutionTime(ids);
}
}
return time;
}
catch
{
return 0.0f;
}
return time;
}
public bool ScriptsMemory(out int memory)
@@ -5184,32 +5194,42 @@ namespace OpenSim.Region.Framework.Scenes
if (engines.Length == 0) // No engine at all
return false;
// get all the scripts in all parts
SceneObjectPart[] parts = m_parts.GetArray();
List<TaskInventoryItem> scripts = new();
for (int i = 0; i < parts.Length; i++)
try
{
scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL));
}
if (scripts.Count == 0)
return false;
// extract the UUIDs
HashSet<UUID> unique = new();
foreach (TaskInventoryItem script in scripts)
unique.Add(script.ItemID);
List<UUID> ids = unique.ToList();
// Offer the list of script UUIDs to each engine found and accumulate the memory
foreach (IScriptModule e in engines)
{
if (e is not null)
// get all the scripts in all parts
SceneObjectPart[] parts = m_parts.GetArray();
List<TaskInventoryItem> scripts = new();
for (int i = 0; i < parts.Length; i++)
{
memory += e.GetScriptsMemory(ids);
IEntityInventory inv = parts[i].Inventory;
if(inv is not null)
scripts.AddRange(inv.GetInventoryItems(InventoryType.LSL));
}
if (scripts.Count == 0)
return false;
// extract the UUIDs
HashSet<UUID> unique = new();
foreach (TaskInventoryItem script in scripts)
unique.Add(script.ItemID);
List<UUID> ids = unique.ToList();
// Offer the list of script UUIDs to each engine found and accumulate the memory
foreach (IScriptModule e in engines)
{
if (e is not null)
{
memory += e.GetScriptsMemory(ids);
}
}
return true;
}
return true;
catch
{
return false;
}
}
/// <summary>

View File

@@ -66,7 +66,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
//private static readonly string m_chatSessionRequestPath = "0209/";
// Control info
private static bool m_Enabled = false;
private static bool m_Enabled = false;
// FreeSwitch server is going to contact us and ask us all
// sorts of things.
@@ -111,8 +111,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
try
{
string serviceDll = m_Config.GetString("LocalServiceModule",
String.Empty);
string serviceDll = m_Config.GetString("LocalServiceModule", String.Empty);
if (serviceDll.Length == 0)
{
@@ -325,6 +324,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
m_log.DebugFormat(
"[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request for {0}", agentID.ToString());
Stream inputStream = request.InputStream;
if (inputStream.Length > 0)
{
OSD tmp = OSDParser.DeserializeLLSDXml(inputStream);
request.InputStream.Dispose();
if (tmp is OSDMap map)
{
if (map.TryGetValue("voice_server_type", out OSD vstosd))
{
if (vstosd is OSDString vst && !((string)vst).Equals("vivox", StringComparison.OrdinalIgnoreCase))
{
response.RawBuffer = Util.UTF8.GetBytes("<llsd><undef /></llsd>");
return;
}
}
}
}
response.StatusCode = (int)HttpStatusCode.OK;
ScenePresence avatar = scene.GetScenePresence(agentID);

View File

@@ -459,6 +459,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
response.StatusCode = (int)HttpStatusCode.OK;
try
{
Stream inputStream = request.InputStream;
if (inputStream.Length > 0)
{
OSD tmp = OSDParser.DeserializeLLSDXml(inputStream);
request.InputStream.Dispose();
if (tmp is OSDMap map)
{
if (map.TryGetValue("voice_server_type", out OSD vstosd))
{
if (vstosd is OSDString vst && !((string)vst).Equals("vivox", StringComparison.OrdinalIgnoreCase))
{
response.RawBuffer = Util.UTF8.GetBytes("<llsd><undef /></llsd>");
return;
}
}
}
}
ScenePresence avatar = null;
string avatarName = null;

View File

@@ -13660,7 +13660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScenePresence presence = World.GetScenePresence(agentID);
// we are not interested in child-agents
if (presence.IsChildAgent)
if (presence is null || presence.IsChildAgent)
return;
presence.ControllingClient.SendClearFollowCamProperties(objectID);

View File

@@ -138,7 +138,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
// guards m_DetachQuantum, m_EventQueue, m_EventCounts, m_Running, m_Suspended
public Object m_QueueLock = new Object();
// true iff allowed to accept new events
// true if allowed to accept new events
public bool m_Running = true;
// queue of events that haven't been acted upon yet

View File

@@ -396,10 +396,10 @@ namespace OpenSim.Region.ScriptEngine.Yengine
e = StartEventHandler(evc, evt.Params);
}
//m_RunOnePhase = "done running";
m_CPUTime += DateTime.UtcNow.Subtract(now).TotalMilliseconds;
m_CPUTime += Util.GetTimeStampMS() - m_SliceStart;
// Maybe it puqued.
if(e is not null)
// Maybe it puqued.
if (e is not null)
{
//m_RunOnePhase = "handling exception " + e.Message;
HandleScriptException(e);

View File

@@ -134,7 +134,7 @@ namespace OpenSim.Server.Base
prompt = startupConfig.GetString("Prompt", prompt);
if(startupConfig.GetBoolean("EnableRobustSelfsignedCertSupport"))
if(startupConfig.GetBoolean("EnableRobustSelfsignedCertSupport", false))
{
if(!File.Exists("SSL\\ssl\\"+ startupConfig.GetString("RobustCertFileName") +".p12") || startupConfig.GetBoolean("RobustCertRenewOnStartup"))
{

View File

@@ -311,30 +311,32 @@
;; SSL selfsigned certificate settings.
;; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\. Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder. Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
;# {EnbleSelfsignedCertSupport} {} {Enable selfsigned certificate creation and renew} {true false} false
EnableSelfsignedCertSupport = false
;; Is free... so why not :). Renew the selfsigned certificate on every server startup ?
;# {CertRenewOnStartup} {} {renew the selfsigned certificate on the server startup} {true false} true
CertRenewOnStartup = true
;; Certificate options:
;; Set the certificate file name. the output files extensions are CertFileName.p12 and CertFileName.pfx.
;# {CertFileName} {} {set the certificate file name} {} "OpenSim"
CertFileName = "OpenSim"
;; Set the certificate password.
;# {CertPassword} {} {set the certificate password} {} ""
CertPassword = "mycertpass"
;; The certificate host name (domain or IP of this machine CN). Must be the same as "ExternalHostName" in Regions.ini
;# {CertHostName} {} {set the certificate host name} {} "myRegionsExternalHostName"
CertHostName = "myRegionsExternalHostName"
;; The certificate host IP (IP of this machine).
;# {CertHostIp} {} {set the certificate host IP} {}
CertHostIp = "127.0.0.1"
;; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\.
;; Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder.
;;Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
;# {EnbleSelfsignedCertSupport} {} {Enable selfsigned certificate creation and renew} {true false} false
EnableSelfsignedCertSupport = false
;; Renew the selfsigned certificate on every server startup ?
;# {CertRenewOnStartup} {} {renew the selfsigned certificate on the server startup} {true false} true
CertRenewOnStartup = false
;; Certificate options:
;; Set the certificate file name. the output files extensions are CertFileName.p12 and CertFileName.pfx.
;# {CertFileName} {} {set the certificate file name} {} "OpenSim"
CertFileName = "OpenSim"
;; Set the certificate password.
;# {CertPassword} {} {set the certificate password} {} ""
CertPassword = "mycertpass"
;; The certificate host name (domain or IP of this machine CN). Must be the same as "ExternalHostName" in Regions.ini
;# {CertHostName} {} {set the certificate host name} {} "myRegionsExternalHostName"
CertHostName = "myRegionsExternalHostName"
;; The certificate host IP (IP of this machine).
;# {CertHostIp} {} {set the certificate host IP} {}
CertHostIp = "127.0.0.1"
;; SSL certificate validation options

View File

@@ -404,24 +404,26 @@
; # SSL selfsigned certificate settings.
; #
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\. Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder. Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableSelfsignedCertSupport = false
; Is free... so why not :). Renew the selfsigned certificate on every server startup ?
CertRenewOnStartup = true
; # Certificate options:
; Set the certificate file name. the output files extensions are CertFileName.p12 and CertFileName.pfx.
CertFileName = "OpenSim"
; Set the certificate password.
CertPassword = "mycertpass"
; The certificate host name (domain or IP of this machine CN). Must be the same as "ExternalHostName" in Regions.ini
CertHostName = "myRegionsExternalHostName"
; The certificate host IP (IP of this machine).
CertHostIp = "127.0.0.1"
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\.
; Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder.
; Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableSelfsignedCertSupport = false
;Renew the selfsigned certificate on every server startup ?
CertRenewOnStartup = false
; # Certificate options:
; Set the certificate file name. the output files extensions are CertFileName.p12 and CertFileName.pfx.
CertFileName = "OpenSim"
; Set the certificate password.
CertPassword = "mycertpass"
; The certificate host name (domain or IP of this machine CN). Must be the same as "ExternalHostName" in Regions.ini
CertHostName = "myRegionsExternalHostName"
; The certificate host IP (IP of this machine).
CertHostIp = "127.0.0.1"
; #
; # SSL certificates validation options

View File

@@ -80,30 +80,32 @@
; ConsoleHistoryTimeStamp = false
;; SSL selfsigned certificate settings.
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\. Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder. Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableRobustSelfsignedCertSupport = false
; Is free... so why not :). Renew the selfsigned certificate on every server startup ?
RobustCertRenewOnStartup = true
;; Certificate options:
; Set the certificate file name. the output files extensions are CertFileName.p12 and RobustCertFileName.pfx. This must be different than CertFileName in OpenSim.ini
RobustCertFileName = "Robust"
; Set the certificate password.
RobustCertPassword = "mycertpass"
; The certificate host name (CN).
RobustCertHostName = ${Const|BaseHostname}
; The certificate host IP.
RobustCertHostIp = "127.0.0.1"
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\.
; Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder.
; Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableRobustSelfsignedCertSupport = false
;Renew the selfsigned certificate on every server startup ?
RobustCertRenewOnStartup = false
;; Certificate options:
; Set the certificate file name. the output files extensions are CertFileName.p12 and RobustCertFileName.pfx. This must be different than CertFileName in OpenSim.ini
RobustCertFileName = "Robust"
; Set the certificate password.
RobustCertPassword = "mycertpass"
; The certificate host name (CN).
RobustCertHostName = ${Const|BaseHostname}
; The certificate host IP.
RobustCertHostIp = "127.0.0.1"
; peers SSL certificate validation options
; you can allow selfsigned certificates or no official CA with next option set to true
NoVerifyCertChain = true
; you can also bypass the hostname or domain verification
NoVerifyCertHostname = false
NoVerifyCertHostname = true
; having both options true does provide encryption but with low security
; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it.

View File

@@ -73,30 +73,32 @@
; ConsoleHistoryTimeStamp = false
;; SSL selfsigned certificate settings.
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\. Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder. Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableRobustSelfsignedCertSupport = false
; Is free... so why not :). Renew the selfsigned certificate on every server startup ?
RobustCertRenewOnStartup = true
;; Certificate options:
; Set the certificate file name. the output files extensions are RobustCertFileName.p12 and RobustCertFileName.pfx.
RobustCertFileName = "Robust"
; Set the certificate password.
RobustCertPassword = "mycertpass"
; The certificate host name (CN).
RobustCertHostName = ${Const|BaseHostname}
; The certificate host IP.
RobustCertHostIp = "127.0.0.1"
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\.
; Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder.
; Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableRobustSelfsignedCertSupport = false
; Renew the selfsigned certificate on every server startup ?
RobustCertRenewOnStartup = false
;; Certificate options:
; Set the certificate file name. the output files extensions are RobustCertFileName.p12 and RobustCertFileName.pfx.
RobustCertFileName = "Robust"
; Set the certificate password.
RobustCertPassword = "mycertpass"
; The certificate host name (CN).
RobustCertHostName = ${Const|BaseHostname}
; The certificate host IP.
RobustCertHostIp = "127.0.0.1"
; peers SSL certificate validation options
; you can allow selfsigned certificates or no official CA with next option set to true
NoVerifyCertChain = true
; you can also bypass the hostname or domain verification
NoVerifyCertHostname = false
NoVerifyCertHostname = true
; having both options true does provide encryption but with low security
; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it.