aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-18 12:08:34 +0000
committerTeravus Ovares2007-12-18 12:08:34 +0000
commitccc8ffaaec915f0561d9aded6cc4b32b911f473c (patch)
treee07135474e1986cd09177db8e62787b4f74c114a /OpenSim/Region
parent* Removed redundant code in RestService.cs (diff)
downloadopensim-SC-ccc8ffaaec915f0561d9aded6cc4b32b911f473c.zip
opensim-SC-ccc8ffaaec915f0561d9aded6cc4b32b911f473c.tar.gz
opensim-SC-ccc8ffaaec915f0561d9aded6cc4b32b911f473c.tar.bz2
opensim-SC-ccc8ffaaec915f0561d9aded6cc4b32b911f473c.tar.xz
* Added Incomplete Handling of the RegionInfoRequest packet
* Added Incomplete Handling of the EstateCovenantRequest packet * Added Incomplete Handling of the EstateOwnerMessageRequest.ChangeEstateCovenantid method * Fixed a race condition with avatar animations
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs28
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs52
-rw-r--r--OpenSim/Region/Environment/Scenes/AvatarAnimations.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs7
5 files changed, 85 insertions, 13 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index df52745..3c35270 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -529,6 +529,9 @@ namespace OpenSim.Region.ClientStack
529 public event ParcelSelectObjects OnParcelSelectObjects; 529 public event ParcelSelectObjects OnParcelSelectObjects;
530 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; 530 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
531 public event EstateOwnerMessageRequest OnEstateOwnerMessage; 531 public event EstateOwnerMessageRequest OnEstateOwnerMessage;
532 public event RegionInfoRequest OnRegionInfoRequest;
533 public event EstateCovenantRequest OnEstateCovenantRequest;
534
532 535
533 #region Scene/Avatar to Client 536 #region Scene/Avatar to Client
534 537
@@ -3216,7 +3219,21 @@ namespace OpenSim.Region.ClientStack
3216 OnEstateOwnerMessage(messagePacket, this); 3219 OnEstateOwnerMessage(messagePacket, this);
3217 } 3220 }
3218 break; 3221 break;
3219 3222 case PacketType.RequestRegionInfo:
3223 RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData;
3224 if (OnRegionInfoRequest != null)
3225 {
3226 OnRegionInfoRequest(this, mPacket.SessionID);
3227 }
3228 break;
3229 case PacketType.EstateCovenantRequest:
3230 // TODO: handle this packet
3231 EstateCovenantRequestPacket.AgentDataBlock epack = ((EstateCovenantRequestPacket)Pack).AgentData;
3232 if (OnEstateCovenantRequest != null)
3233 {
3234 OnEstateCovenantRequest(this, epack.SessionID);
3235 }
3236 break;
3220 case PacketType.AgentThrottle: 3237 case PacketType.AgentThrottle:
3221 AgentThrottlePacket atpack = (AgentThrottlePacket)Pack; 3238 AgentThrottlePacket atpack = (AgentThrottlePacket)Pack;
3222 m_packetQueue.SetThrottleFromClient(atpack.Throttle.Throttles); 3239 m_packetQueue.SetThrottleFromClient(atpack.Throttle.Throttles);
@@ -3278,10 +3295,7 @@ namespace OpenSim.Region.ClientStack
3278 // TODO: handle this packet 3295 // TODO: handle this packet
3279 MainLog.Instance.Warn("CLIENT", "unhandled ViewerStats packet"); 3296 MainLog.Instance.Warn("CLIENT", "unhandled ViewerStats packet");
3280 break; 3297 break;
3281 case PacketType.EstateCovenantRequest: 3298
3282 // TODO: handle this packet
3283 MainLog.Instance.Warn("CLIENT", "unhandled EstateCovenantRequest packet");
3284 break;
3285 case PacketType.CreateGroupRequest: 3299 case PacketType.CreateGroupRequest:
3286 // TODO: handle this packet 3300 // TODO: handle this packet
3287 MainLog.Instance.Warn("CLIENT", "unhandled CreateGroupRequest packet"); 3301 MainLog.Instance.Warn("CLIENT", "unhandled CreateGroupRequest packet");
@@ -3343,10 +3357,6 @@ namespace OpenSim.Region.ClientStack
3343 // TODO: handle this packet 3357 // TODO: handle this packet
3344 MainLog.Instance.Warn("CLIENT", "unhandled UserInfoRequest packet"); 3358 MainLog.Instance.Warn("CLIENT", "unhandled UserInfoRequest packet");
3345 break; 3359 break;
3346 case PacketType.RequestRegionInfo:
3347 // TODO: handle this packet
3348 MainLog.Instance.Warn("CLIENT", "unhandled RequestRegionInfo packet");
3349 break;
3350 case PacketType.InventoryDescendents: 3360 case PacketType.InventoryDescendents:
3351 // TODO: handle this packet 3361 // TODO: handle this packet
3352 MainLog.Instance.Warn("CLIENT", "unhandled InventoryDescent packet"); 3362 MainLog.Instance.Warn("CLIENT", "unhandled InventoryDescent packet");
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index e1bb4d8..081a8cd 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -177,6 +177,12 @@ namespace OpenSim.Region.Environment
177 estateRestartSim(packet); 177 estateRestartSim(packet);
178 } 178 }
179 break; 179 break;
180 case "estatechangecovenantid":
181 if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId))
182 {
183 EstateChangeCovenant(packet);
184 }
185 break;
180 default: 186 default:
181 MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); 187 MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
182 break; 188 break;
@@ -340,8 +346,54 @@ namespace OpenSim.Region.Environment
340 346
341 } 347 }
342 } 348 }
349 private void EstateChangeCovenant(EstateOwnerMessagePacket packet)
350 {
351 foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
352 {
353 LLUUID newCovenantID = new LLUUID(Helpers.FieldToUTF8String(block.Parameter));
354 m_regInfo.CovenantID = newCovenantID;
343 355
356 }
357
358 }
359 public void HandleRegionInfoRequest(IClientAPI client, LLUUID sessionID)
360 {
361 RegionInfoPacket rinfopack = new RegionInfoPacket();
362 RegionInfoPacket.RegionInfoBlock rinfoblk = new RegionInfoPacket.RegionInfoBlock();
363
364 rinfoblk.BillableFactor = 0;
365 rinfoblk.EstateID = 02;
366 rinfoblk.MaxAgents = 100;
367 rinfoblk.ObjectBonusFactor = 1.0f;
368 rinfoblk.ParentEstateID = 0;
369 rinfoblk.PricePerMeter = 0;
370 rinfoblk.RedirectGridX = 0;
371 rinfoblk.RedirectGridY = 0;
372 rinfoblk.RegionFlags = (uint)m_regInfo.EstateSettings.regionFlags;
373 rinfoblk.SimAccess = (byte)m_regInfo.EstateSettings.simAccess;
374 rinfoblk.SunHour = m_regInfo.EstateSettings.sunHour;
375 rinfoblk.TerrainLowerLimit = 20;
376 rinfoblk.TerrainRaiseLimit = 20;
377 rinfoblk.UseEstateSun = true;
378 rinfoblk.WaterHeight = m_regInfo.EstateSettings.waterHeight;
379 rinfoblk.SimName = Helpers.StringToField(m_regInfo.RegionName);
380
381 rinfopack.RegionInfo = rinfoblk;
382
383 client.OutPacket(rinfopack, ThrottleOutPacketType.Task);
344 384
385 }
386 public void HandleEstateCovenantRequest(IClientAPI client, LLUUID sessionID)
387 {
388 EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket();
389 EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
390 edata.CovenantID = m_regInfo.CovenantID;
391 edata.CovenantTimestamp = 0;
392 edata.EstateOwnerID = m_regInfo.MasterAvatarAssignedUUID;
393 edata.EstateName = Helpers.StringToField(m_regInfo.MasterAvatarFirstName + " " + m_regInfo.MasterAvatarLastName);
394 einfopack.Data = edata;
395 client.OutPacket(einfopack, ThrottleOutPacketType.Task);
396 }
345 #endregion 397 #endregion
346 398
347 #region Outgoing Packets 399 #region Outgoing Packets
diff --git a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
index d508c9e..82ecda8 100644
--- a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
+++ b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
@@ -59,10 +59,13 @@ namespace OpenSim.Region.Environment.Scenes
59 } 59 }
60 60
61 // MainLog.Instance.Verbose("CLIENT", "Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)"); 61 // MainLog.Instance.Verbose("CLIENT", "Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)");
62 62
63 foreach (KeyValuePair<string, LLUUID> kp in ScenePresence.Animations.AnimsLLUUID) 63 lock (ScenePresence.Animations.AnimsLLUUID)
64 { 64 {
65 AnimsNames.Add(kp.Value, kp.Key); 65 foreach (KeyValuePair<string, LLUUID> kp in ScenePresence.Animations.AnimsLLUUID)
66 {
67 AnimsNames.Add(kp.Value, kp.Key);
68 }
66 } 69 }
67 } 70 }
68 } 71 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 9ca23d5..eec07fc 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1122,6 +1122,8 @@ namespace OpenSim.Region.Environment.Scenes
1122 client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(m_LandManager.handleParcelAccessUpdateRequest); 1122 client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(m_LandManager.handleParcelAccessUpdateRequest);
1123 1123
1124 client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); 1124 client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
1125 client.OnRegionInfoRequest += m_estateManager.HandleRegionInfoRequest;
1126 client.OnEstateCovenantRequest += m_estateManager.HandleEstateCovenantRequest;
1125 client.OnRequestGodlikePowers += handleRequestGodlikePowers; 1127 client.OnRequestGodlikePowers += handleRequestGodlikePowers;
1126 client.OnGodKickUser += handleGodlikeKickUser; 1128 client.OnGodKickUser += handleGodlikeKickUser;
1127 client.OnObjectPermissions += HandleObjectPermissionsUpdate; 1129 client.OnObjectPermissions += HandleObjectPermissionsUpdate;
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 505d0bb..a59e7d6 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -137,6 +137,9 @@ namespace SimpleApp
137 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; 137 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
138 public event ObjectDeselect OnObjectDeselect; 138 public event ObjectDeselect OnObjectDeselect;
139 public event EstateOwnerMessageRequest OnEstateOwnerMessage; 139 public event EstateOwnerMessageRequest OnEstateOwnerMessage;
140 public event RegionInfoRequest OnRegionInfoRequest;
141 public event EstateCovenantRequest OnEstateCovenantRequest;
142
140 143
141#pragma warning restore 67 144#pragma warning restore 67
142 145
@@ -364,7 +367,9 @@ namespace SimpleApp
364 public void SendAgentAlertMessage(string message, bool modal) 367 public void SendAgentAlertMessage(string message, bool modal)
365 { 368 {
366 } 369 }
367 370 public void SendSystemAlertMessage(string message)
371 {
372 }
368 public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, 373 public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message,
369 string url) 374 string url)
370 { 375 {