diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 4c107c9..66dee4b 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -334,6 +334,11 @@ namespace OpenSim.Framework | |||
334 | get { return m_objectCapacity; } | 334 | get { return m_objectCapacity; } |
335 | } | 335 | } |
336 | 336 | ||
337 | public byte AccessLevel | ||
338 | { | ||
339 | get { return (byte)Util.ConvertMaturityToAccessLevel((uint)m_regionSettings.Maturity); } | ||
340 | } | ||
341 | |||
337 | public void SetEndPoint(string ipaddr, int port) | 342 | public void SetEndPoint(string ipaddr, int port) |
338 | { | 343 | { |
339 | IPAddress tmpIP = IPAddress.Parse(ipaddr); | 344 | IPAddress tmpIP = IPAddress.Parse(ipaddr); |
@@ -691,5 +696,6 @@ namespace OpenSim.Framework | |||
691 | regionInfo.ServerURI = serverURI; | 696 | regionInfo.ServerURI = serverURI; |
692 | return regionInfo; | 697 | return regionInfo; |
693 | } | 698 | } |
699 | |||
694 | } | 700 | } |
695 | } | 701 | } |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index cad259d..35efa02 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1045,5 +1045,29 @@ namespace OpenSim.Framework | |||
1045 | 1045 | ||
1046 | return guid; | 1046 | return guid; |
1047 | } | 1047 | } |
1048 | |||
1049 | public static byte ConvertMaturityToAccessLevel(uint maturity) | ||
1050 | { | ||
1051 | byte retVal = 0; | ||
1052 | switch (maturity) | ||
1053 | { | ||
1054 | case 0: //PG | ||
1055 | retVal = 13; | ||
1056 | break; | ||
1057 | case 1: //Mature | ||
1058 | retVal = 21; | ||
1059 | break; | ||
1060 | case 2: // Adult | ||
1061 | retVal = 42; | ||
1062 | break; | ||
1063 | } | ||
1064 | |||
1065 | return retVal; | ||
1066 | |||
1067 | } | ||
1068 | |||
1069 | |||
1070 | |||
1071 | |||
1048 | } | 1072 | } |
1049 | } | 1073 | } |