diff options
author | Snoopy Pfeffer | 2012-03-27 22:09:58 +0200 |
---|---|---|
committer | Snoopy Pfeffer | 2012-03-27 22:09:58 +0200 |
commit | 7223b63563f28f6fe8044bdabcd1b9900d28c54a (patch) | |
tree | 7bf1df67f9a1388b940b386e64e239f52f986a4b /OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs | |
parent | HG: beginning of a more restrictive inventory access procedure (optional). Ex... (diff) | |
download | opensim-SC-7223b63563f28f6fe8044bdabcd1b9900d28c54a.zip opensim-SC-7223b63563f28f6fe8044bdabcd1b9900d28c54a.tar.gz opensim-SC-7223b63563f28f6fe8044bdabcd1b9900d28c54a.tar.bz2 opensim-SC-7223b63563f28f6fe8044bdabcd1b9900d28c54a.tar.xz |
User level based restrictions for HyperGrid teleports, asset uploads, group creations and getting contacted from other grids. Incoming HyperGrid teleports can also be restricted to local users.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs index 1117f2a..91872c5 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs | |||
@@ -56,6 +56,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
56 | // private IAssetService m_assetService; | 56 | // private IAssetService m_assetService; |
57 | private bool m_dumpAssetsToFile = false; | 57 | private bool m_dumpAssetsToFile = false; |
58 | private bool m_enabled = true; | 58 | private bool m_enabled = true; |
59 | private int m_levelUpload = 0; | ||
59 | 60 | ||
60 | #region IRegionModuleBase Members | 61 | #region IRegionModuleBase Members |
61 | 62 | ||
@@ -72,6 +73,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
72 | return; | 73 | return; |
73 | 74 | ||
74 | m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true); | 75 | m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true); |
76 | m_levelUpload = meshConfig.GetInt("LevelUpload", 0); | ||
75 | } | 77 | } |
76 | 78 | ||
77 | public void AddRegion(Scene pScene) | 79 | public void AddRegion(Scene pScene) |
@@ -137,25 +139,41 @@ namespace OpenSim.Region.ClientStack.Linden | |||
137 | // llsdRequest.asset_type == "animation" || | 139 | // llsdRequest.asset_type == "animation" || |
138 | // llsdRequest.asset_type == "sound") | 140 | // llsdRequest.asset_type == "sound") |
139 | // { | 141 | // { |
142 | // check user level | ||
143 | ScenePresence avatar = null; | ||
140 | IClientAPI client = null; | 144 | IClientAPI client = null; |
145 | m_scene.TryGetScenePresence(agentID, out avatar); | ||
141 | 146 | ||
142 | 147 | if (avatar != null) | |
148 | { | ||
149 | client = avatar.ControllingClient; | ||
150 | |||
151 | if (avatar.UserLevel < m_levelUpload) | ||
152 | { | ||
153 | if (client != null) | ||
154 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false); | ||
155 | |||
156 | LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); | ||
157 | errorResponse.rsvp = ""; | ||
158 | errorResponse.state = "error"; | ||
159 | return errorResponse; | ||
160 | } | ||
161 | } | ||
162 | |||
163 | // check funds | ||
143 | IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>(); | 164 | IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>(); |
144 | 165 | ||
145 | if (mm != null) | 166 | if (mm != null) |
146 | { | 167 | { |
147 | if (m_scene.TryGetClient(agentID, out client)) | 168 | if (!mm.UploadCovered(agentID, mm.UploadCharge)) |
148 | { | 169 | { |
149 | if (!mm.UploadCovered(client.AgentId, mm.UploadCharge)) | 170 | if (client != null) |
150 | { | 171 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
151 | if (client != null) | 172 | |
152 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 173 | LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); |
153 | 174 | errorResponse.rsvp = ""; | |
154 | LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); | 175 | errorResponse.state = "error"; |
155 | errorResponse.rsvp = ""; | 176 | return errorResponse; |
156 | errorResponse.state = "error"; | ||
157 | return errorResponse; | ||
158 | } | ||
159 | } | 177 | } |
160 | } | 178 | } |
161 | // } | 179 | // } |