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

View File

@@ -731,6 +731,9 @@
;; Allow banning via hashed MAC must be set in both [GatekeeperService] and [LoginService] ;; Allow banning via hashed MAC must be set in both [GatekeeperService] and [LoginService]
;DeniedMacs = "YOURLONGMACTRSING ANOTHERMAC" ;DeniedMacs = "YOURLONGMACTRSING ANOTHERMAC"
;; What to show to a denied avatar wanting to visit:
;DeniedMessage = "Destination does not allow visitors from your world"
[UserAgentService] [UserAgentService]
LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService" LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService"
;; for the service ;; for the service