Make denied message customizable

This commit is contained in:
lickx
2026-02-22 05:05:51 +01:00
parent e838953db8
commit b72fda435b
2 changed files with 7 additions and 1 deletions

View File

@@ -65,6 +65,7 @@ namespace OpenSim.Services.HypergridService
private static bool m_ForeignAgentsAllowed = true;
private static readonly List<string> m_ForeignsAllowedExceptions = new();
private static readonly List<string> m_ForeignsDisallowedExceptions = new();
private static string m_DeniedMessage = "Destination does not allow visitors from your world";
private static UUID m_ScopeID;
private static bool m_AllowTeleportsToAnyRegion;
@@ -187,6 +188,8 @@ namespace OpenSim.Services.HypergridService
LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_ForeignsAllowedExceptions);
LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_ForeignsDisallowedExceptions);
m_DeniedMessage = serverConfig.GetString("DeniedMessage", m_DeniedMessage);
if (m_GridService is null || m_PresenceService is null || m_SimulationService is null)
throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function.");
@@ -443,7 +446,7 @@ namespace OpenSim.Services.HypergridService
if (!allowed)
{
reason = "Destination does not allow visitors from your world";
reason = m_DeniedMessage;
m_log.InfoFormat("[GATEKEEPER SERVICE]: Foreign agents are not permitted {0} {1} @ {2}. Refusing service.",
aCircuit.firstname, aCircuit.lastname, aCircuit.ServiceURLs["HomeURI"]);
return false;