aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
authormingchen2008-05-13 16:22:57 +0000
committermingchen2008-05-13 16:22:57 +0000
commit32785921d0a4a074b92da0f4ec322cf451a4642f (patch)
treeae93cc8fb09a5d7b991e323617e3324042e30a8d /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
parent* Remove old historical grid inventory code (diff)
downloadopensim-SC-32785921d0a4a074b92da0f4ec322cf451a4642f.zip
opensim-SC-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.gz
opensim-SC-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.bz2
opensim-SC-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.xz
*Complete redo of the permissions module
*Removed hardcoded permissions checks *Added permissions checks where needed
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs81
1 files changed, 47 insertions, 34 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 4973c5d..eb415e4 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -217,6 +217,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
217 private ParcelPropertiesUpdateRequest handlerParcelPropertiesUpdateRequest = null; //OnParcelPropertiesUpdateRequest; 217 private ParcelPropertiesUpdateRequest handlerParcelPropertiesUpdateRequest = null; //OnParcelPropertiesUpdateRequest;
218 private ParcelSelectObjects handlerParcelSelectObjects = null; //OnParcelSelectObjects; 218 private ParcelSelectObjects handlerParcelSelectObjects = null; //OnParcelSelectObjects;
219 private ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest = null; //OnParcelObjectOwnerRequest; 219 private ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest = null; //OnParcelObjectOwnerRequest;
220 private ParcelAbandonRequest handlerParcelAbandonRequest = null;
220 private RegionInfoRequest handlerRegionInfoRequest = null; //OnRegionInfoRequest; 221 private RegionInfoRequest handlerRegionInfoRequest = null; //OnRegionInfoRequest;
221 private EstateCovenantRequest handlerEstateCovenantRequest = null; //OnEstateCovenantRequest; 222 private EstateCovenantRequest handlerEstateCovenantRequest = null; //OnEstateCovenantRequest;
222 private RequestGodlikePowers handlerReqGodlikePowers = null; //OnRequestGodlikePowers; 223 private RequestGodlikePowers handlerReqGodlikePowers = null; //OnRequestGodlikePowers;
@@ -790,7 +791,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
790 public event ParcelJoinRequest OnParcelJoinRequest; 791 public event ParcelJoinRequest OnParcelJoinRequest;
791 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; 792 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
792 public event ParcelSelectObjects OnParcelSelectObjects; 793 public event ParcelSelectObjects OnParcelSelectObjects;
793 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; 794 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
795 public event ParcelAbandonRequest OnParcelAbandonRequest;
794 public event RegionInfoRequest OnRegionInfoRequest; 796 public event RegionInfoRequest OnRegionInfoRequest;
795 public event EstateCovenantRequest OnEstateCovenantRequest; 797 public event EstateCovenantRequest OnEstateCovenantRequest;
796 798
@@ -945,25 +947,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
945 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, 947 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp,
946 byte[] binaryBucket) 948 byte[] binaryBucket)
947 { 949 {
948 ImprovedInstantMessagePacket msg 950 if (((Scene)(this.m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent))
949 = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage); 951 {
950 952 ImprovedInstantMessagePacket msg
951 msg.AgentData.AgentID = fromAgent; 953 = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage);
952 msg.AgentData.SessionID = fromAgentSession; 954
953 msg.MessageBlock.FromAgentName = Helpers.StringToField(fromName); 955 msg.AgentData.AgentID = fromAgent;
954 msg.MessageBlock.Dialog = dialog; 956 msg.AgentData.SessionID = fromAgentSession;
955 msg.MessageBlock.FromGroup = false; 957 msg.MessageBlock.FromAgentName = Helpers.StringToField(fromName);
956 msg.MessageBlock.ID = imSessionID; 958 msg.MessageBlock.Dialog = dialog;
957 msg.MessageBlock.Offline = 0; 959 msg.MessageBlock.FromGroup = false;
958 msg.MessageBlock.ParentEstateID = 0; 960 msg.MessageBlock.ID = imSessionID;
959 msg.MessageBlock.Position = new LLVector3(); 961 msg.MessageBlock.Offline = 0;
960 msg.MessageBlock.RegionID = LLUUID.Random(); 962 msg.MessageBlock.ParentEstateID = 0;
961 msg.MessageBlock.Timestamp = timeStamp; 963 msg.MessageBlock.Position = new LLVector3();
962 msg.MessageBlock.ToAgentID = toAgent; 964 msg.MessageBlock.RegionID = LLUUID.Random();
963 msg.MessageBlock.Message = Helpers.StringToField(message); 965 msg.MessageBlock.Timestamp = timeStamp;
964 msg.MessageBlock.BinaryBucket = binaryBucket; 966 msg.MessageBlock.ToAgentID = toAgent;
965 967 msg.MessageBlock.Message = Helpers.StringToField(message);
966 OutPacket(msg, ThrottleOutPacketType.Task); 968 msg.MessageBlock.BinaryBucket = binaryBucket;
969
970 OutPacket(msg, ThrottleOutPacketType.Task);
971 }
967 } 972 }
968 973
969 /// <summary> 974 /// <summary>
@@ -5254,7 +5259,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5254 handlerParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this); 5259 handlerParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this);
5255 } 5260 }
5256 break; 5261 break;
5257 5262 case PacketType.ParcelRelease:
5263 ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack;
5264
5265 handlerParcelAbandonRequest = OnParcelAbandonRequest;
5266 if (handlerParcelAbandonRequest != null)
5267 {
5268 handlerParcelAbandonRequest(releasePacket.Data.LocalID, this);
5269 }
5270 break;
5258 #endregion 5271 #endregion
5259 5272
5260 #region Estate Packets 5273 #region Estate Packets
@@ -5267,13 +5280,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5267 { 5280 {
5268 case "getinfo": 5281 case "getinfo":
5269 5282
5270 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanBeGodLike(this.AgentId)) 5283 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5271 { 5284 {
5272 OnDetailedEstateDataRequest(this, messagePacket.MethodData.Invoice); 5285 OnDetailedEstateDataRequest(this, messagePacket.MethodData.Invoice);
5273 } 5286 }
5274 break; 5287 break;
5275 case "setregioninfo": 5288 case "setregioninfo":
5276 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanEditEstateTerrain(this.AgentId)) 5289 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5277 { 5290 {
5278 OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter),convertParamStringToBool(messagePacket.ParamList[1].Parameter), 5291 OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter),convertParamStringToBool(messagePacket.ParamList[1].Parameter),
5279 convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter), 5292 convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter),
@@ -5286,7 +5299,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5286 5299
5287 break; 5300 break;
5288 case "texturebase": 5301 case "texturebase":
5289 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanEditEstateTerrain(this.AgentId)) 5302 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5290 { 5303 {
5291 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) 5304 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
5292 { 5305 {
@@ -5301,7 +5314,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5301 } 5314 }
5302 break; 5315 break;
5303 case "texturedetail": 5316 case "texturedetail":
5304 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanEditEstateTerrain(this.AgentId)) 5317 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5305 { 5318 {
5306 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) 5319 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
5307 { 5320 {
@@ -5319,7 +5332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5319 5332
5320 break; 5333 break;
5321 case "textureheights": 5334 case "textureheights":
5322 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanEditEstateTerrain(this.AgentId)) 5335 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5323 { 5336 {
5324 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) 5337 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
5325 { 5338 {
@@ -5340,7 +5353,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5340 OnCommitEstateTerrainTextureRequest(this); 5353 OnCommitEstateTerrainTextureRequest(this);
5341 break; 5354 break;
5342 case "setregionterrain": 5355 case "setregionterrain":
5343 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanEditEstateTerrain(this.AgentId)) 5356 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5344 { 5357 {
5345 if (messagePacket.ParamList.Length != 9) 5358 if (messagePacket.ParamList.Length != 9)
5346 { 5359 {
@@ -5375,7 +5388,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5375 5388
5376 break; 5389 break;
5377 case "restart": 5390 case "restart":
5378 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanRestartSim(this.AgentId)) 5391 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5379 { 5392 {
5380 // There's only 1 block in the estateResetSim.. and that's the number of seconds till restart. 5393 // There's only 1 block in the estateResetSim.. and that's the number of seconds till restart.
5381 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) 5394 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
@@ -5389,7 +5402,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5389 } 5402 }
5390 break; 5403 break;
5391 case "estatechangecovenantid": 5404 case "estatechangecovenantid":
5392 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanEditEstateTerrain(this.AgentId)) 5405 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5393 { 5406 {
5394 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) 5407 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
5395 { 5408 {
@@ -5399,7 +5412,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5399 } 5412 }
5400 break; 5413 break;
5401 case "estateaccessdelta": // Estate access delta manages the banlist and allow list too. 5414 case "estateaccessdelta": // Estate access delta manages the banlist and allow list too.
5402 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanBeGodLike(this.AgentId)) 5415 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5403 { 5416 {
5404 int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter)); 5417 int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter));
5405 OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice,estateAccessType,new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter))); 5418 OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice,estateAccessType,new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)));
@@ -5407,7 +5420,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5407 } 5420 }
5408 break; 5421 break;
5409 case "simulatormessage": 5422 case "simulatormessage":
5410 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanBeGodLike(this.AgentId)) 5423 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5411 { 5424 {
5412 LLUUID invoice = messagePacket.MethodData.Invoice; 5425 LLUUID invoice = messagePacket.MethodData.Invoice;
5413 LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)); 5426 LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
@@ -5418,7 +5431,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5418 } 5431 }
5419 break; 5432 break;
5420 case "instantmessage": 5433 case "instantmessage":
5421 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanBeGodLike(this.AgentId)) 5434 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5422 { 5435 {
5423 LLUUID invoice = messagePacket.MethodData.Invoice; 5436 LLUUID invoice = messagePacket.MethodData.Invoice;
5424 LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)); 5437 LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
@@ -5429,7 +5442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5429 } 5442 }
5430 break; 5443 break;
5431 case "setregiondebug": 5444 case "setregiondebug":
5432 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanBeGodLike(this.AgentId)) 5445 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5433 { 5446 {
5434 LLUUID invoice = messagePacket.MethodData.Invoice; 5447 LLUUID invoice = messagePacket.MethodData.Invoice;
5435 LLUUID SenderID = messagePacket.AgentData.AgentID; 5448 LLUUID SenderID = messagePacket.AgentData.AgentID;
@@ -5441,7 +5454,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5441 } 5454 }
5442 break; 5455 break;
5443 case "teleporthomeuser": 5456 case "teleporthomeuser":
5444 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanBeGodLike(this.AgentId)) 5457 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5445 { 5458 {
5446 LLUUID invoice = messagePacket.MethodData.Invoice; 5459 LLUUID invoice = messagePacket.MethodData.Invoice;
5447 LLUUID SenderID = messagePacket.AgentData.AgentID; 5460 LLUUID SenderID = messagePacket.AgentData.AgentID;