aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authormingchen2007-06-08 21:30:51 +0000
committermingchen2007-06-08 21:30:51 +0000
commit2c04171990df9e01cd4c5aa600a6eaa1487f9605 (patch)
treec5664038ce624fb0f6edb63db6c62587e45518a3 /OpenSim
parent*Moved SendRegionHandshake back to IClientAPI and modded sendRegionHandshakeT... (diff)
downloadopensim-SC_OLD-2c04171990df9e01cd4c5aa600a6eaa1487f9605.zip
opensim-SC_OLD-2c04171990df9e01cd4c5aa600a6eaa1487f9605.tar.gz
opensim-SC_OLD-2c04171990df9e01cd4c5aa600a6eaa1487f9605.tar.bz2
opensim-SC_OLD-2c04171990df9e01cd4c5aa600a6eaa1487f9605.tar.xz
*Added delegates and events for parcel and estate management
*Only thing left is to get the master user setup in both sandbox and grid mode
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.API.cs8
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs25
-rw-r--r--OpenSim/OpenSim.World/Avatar.cs7
-rw-r--r--OpenSim/OpenSim.World/ParcelManager.cs58
-rw-r--r--OpenSim/OpenSim.World/World.cs10
-rw-r--r--OpenSim/OpenSim/OpenSimMain.cs9
6 files changed, 112 insertions, 5 deletions
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index dd9adac..a6e5317 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -4,6 +4,7 @@ using System.Text;
4using OpenSim.Framework.Interfaces; 4using OpenSim.Framework.Interfaces;
5using OpenSim.Framework.Inventory; 5using OpenSim.Framework.Inventory;
6using OpenSim.Framework.Types; 6using OpenSim.Framework.Types;
7
7using libsecondlife; 8using libsecondlife;
8using libsecondlife.Packets; 9using libsecondlife.Packets;
9 10
@@ -36,6 +37,13 @@ namespace OpenSim
36 public event NewAvatar OnNewAvatar; 37 public event NewAvatar OnNewAvatar;
37 public event GenericCall6 OnRemoveAvatar; 38 public event GenericCall6 OnRemoveAvatar;
38 39
40 public event ParcelPropertiesRequest OnParcelPropertiesRequest;
41 public event ParcelDivideRequest OnParcelDivideRequest;
42 public event ParcelJoinRequest OnParcelJoinRequest;
43 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
44
45 public event EstateOwnerMessageRequest OnEstateOwnerMessage;
46
39 /// <summary> 47 /// <summary>
40 /// 48 ///
41 /// </summary> 49 /// </summary>
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
index d215a23..8b94a82 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
@@ -454,6 +454,31 @@ namespace OpenSim
454 break; 454 break;
455 #endregion 455 #endregion
456 456
457 #region Parcel related packets
458 case PacketType.ParcelPropertiesRequest:
459 ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack;
460 OnParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), (int)Math.Round(propertiesRequest.ParcelData.South), (int)Math.Round(propertiesRequest.ParcelData.East), (int)Math.Round(propertiesRequest.ParcelData.North), propertiesRequest.ParcelData.SequenceID, propertiesRequest.ParcelData.SnapSelection, this);
461 break;
462 case PacketType.ParcelDivide:
463 ParcelDividePacket parcelDivide = (ParcelDividePacket)Pack;
464 OnParcelDivideRequest((int)Math.Round(parcelDivide.ParcelData.West), (int)Math.Round(parcelDivide.ParcelData.South), (int)Math.Round(parcelDivide.ParcelData.East), (int)Math.Round(parcelDivide.ParcelData.North), this);
465 break;
466 case PacketType.ParcelJoin:
467 ParcelJoinPacket parcelJoin = (ParcelJoinPacket)Pack;
468 OnParcelJoinRequest((int)Math.Round(parcelJoin.ParcelData.West), (int)Math.Round(parcelJoin.ParcelData.South), (int)Math.Round(parcelJoin.ParcelData.East), (int)Math.Round(parcelJoin.ParcelData.North), this);
469 break;
470 case PacketType.ParcelPropertiesUpdate:
471 ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket)Pack;
472 OnParcelPropertiesUpdateRequest(updatePacket, this);
473 break;
474 #endregion
475
476 #region Estate Packets
477 case PacketType.EstateOwnerMessage:
478 EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack;
479 OnEstateOwnerMessage(messagePacket, this);
480 break;
481 #endregion
457 #region unimplemented handlers 482 #region unimplemented handlers
458 case PacketType.AgentIsNowWearing: 483 case PacketType.AgentIsNowWearing:
459 // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack; 484 // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack;
diff --git a/OpenSim/OpenSim.World/Avatar.cs b/OpenSim/OpenSim.World/Avatar.cs
index d597ca7..6a4c0f8 100644
--- a/OpenSim/OpenSim.World/Avatar.cs
+++ b/OpenSim/OpenSim.World/Avatar.cs
@@ -83,6 +83,13 @@ namespace OpenSim.world
83 ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); 83 ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
84 ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); 84 ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
85 * */ 85 * */
86
87 ControllingClient.OnParcelPropertiesRequest +=new ParcelPropertiesRequest(this.m_world.parcelManager.handleParcelPropertiesRequest);
88 ControllingClient.OnParcelDivideRequest += new ParcelDivideRequest(this.m_world.parcelManager.handleParcelDivideRequest);
89 ControllingClient.OnParcelJoinRequest += new ParcelJoinRequest(this.m_world.parcelManager.handleParcelJoinRequest);
90 ControllingClient.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(this.m_world.parcelManager.handleParcelPropertiesUpdateRequest);
91
92 ControllingClient.OnEstateOwnerMessage += new EstateOwnerMessageRequest(this.m_world.estateManager.handleEstateOwnerMessage);
86 } 93 }
87 94
88 /// <summary> 95 /// <summary>
diff --git a/OpenSim/OpenSim.World/ParcelManager.cs b/OpenSim/OpenSim.World/ParcelManager.cs
index 9fbacd6..4a9bfb1 100644
--- a/OpenSim/OpenSim.World/ParcelManager.cs
+++ b/OpenSim/OpenSim.World/ParcelManager.cs
@@ -166,7 +166,7 @@ namespace OpenSim.world
166 parcelList.Remove(local_id); 166 parcelList.Remove(local_id);
167 } 167 }
168 168
169 public void performFinalParcelJoin(Parcel master, Parcel slave) 169 private void performFinalParcelJoin(Parcel master, Parcel slave)
170 { 170 {
171 int x, y; 171 int x, y;
172 bool[,] parcelBitmapSlave = slave.getParcelBitmap(); 172 bool[,] parcelBitmapSlave = slave.getParcelBitmap();
@@ -212,7 +212,7 @@ namespace OpenSim.world
212 /// <param name="end_y">North Point</param> 212 /// <param name="end_y">North Point</param>
213 /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param> 213 /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param>
214 /// <returns>Returns true if successful</returns> 214 /// <returns>Returns true if successful</returns>
215 public bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) 215 private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id)
216 { 216 {
217 //First, lets loop through the points and make sure they are all in the same parcel 217 //First, lets loop through the points and make sure they are all in the same parcel
218 //Get the parcel at start 218 //Get the parcel at start
@@ -278,7 +278,7 @@ namespace OpenSim.world
278 /// <param name="end_y">y value in second parcel</param> 278 /// <param name="end_y">y value in second parcel</param>
279 /// <param name="attempting_user_id">LLUUID of the avatar trying to join the parcels</param> 279 /// <param name="attempting_user_id">LLUUID of the avatar trying to join the parcels</param>
280 /// <returns>Returns true if successful</returns> 280 /// <returns>Returns true if successful</returns>
281 public bool join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) 281 private bool join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id)
282 { 282 {
283 end_x -= 4; 283 end_x -= 4;
284 end_y -= 4; 284 end_y -= 4;
@@ -406,6 +406,58 @@ namespace OpenSim.world
406 packet.ParcelData.SequenceID = sequenceID; //Eh? 406 packet.ParcelData.SequenceID = sequenceID; //Eh?
407 remote_client.OutPacket((Packet)packet); 407 remote_client.OutPacket((Packet)packet);
408 } 408 }
409
410 public void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client)
411 {
412 //Get the parcels within the bounds
413 List<Parcel> temp = new List<Parcel>();
414 int x, y, i;
415 int inc_x = end_x - start_x;
416 int inc_y = end_y - start_y;
417 for (x = 0; x < inc_x; x++)
418 {
419 for (y = 0; y < inc_y; y++)
420 {
421 OpenSim.world.Parcel currentParcel = getParcel(start_x + x, start_y + y);
422 if (!temp.Contains(currentParcel))
423 {
424 currentParcel.forceUpdateParcelInfo();
425 temp.Add(currentParcel);
426 }
427 }
428 }
429
430 int requestResult = ParcelManager.PARCEL_RESULT_ONE_PARCEL;
431 if (temp.Count > 1)
432 {
433 requestResult = ParcelManager.PARCEL_RESULT_MULTIPLE_PARCELS;
434 }
435
436 for (i = 0; i < temp.Count; i++)
437 {
438 temp[i].sendParcelProperties(sequence_id, snap_selection, requestResult, remote_client);
439 }
440
441
442 sendParcelOverlay(remote_client);
443 }
444
445 public void handleParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client)
446 {
447 if (parcelList.ContainsKey(packet.ParcelData.LocalID))
448 {
449 parcelList[packet.ParcelData.LocalID].updateParcelProperties(packet, remote_client);
450 }
451 }
452 public void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client)
453 {
454 subdivide(west, south, east, north, remote_client.AgentId);
455 }
456 public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client)
457 {
458 join(west, south, east, north, remote_client.AgentId);
459
460 }
409 #endregion 461 #endregion
410 462
411 /// <summary> 463 /// <summary>
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs
index e51c983..dc9602e 100644
--- a/OpenSim/OpenSim.World/World.cs
+++ b/OpenSim/OpenSim.World/World.cs
@@ -217,6 +217,16 @@ namespace OpenSim.world
217 Entities[UUID].BackUp(); 217 Entities[UUID].BackUp();
218 } 218 }
219 219
220 //Parcel backup routines
221 ParcelData[] parcels = new ParcelData[parcelManager.parcelList.Count];
222 int i = 0;
223 foreach (OpenSim.world.Parcel parcel in parcelManager.parcelList.Values)
224 {
225 parcels[i] = parcel.parcelData;
226 i++;
227 }
228 localStorage.SaveParcels(parcels);
229
220 // Backup successful 230 // Backup successful
221 return true; 231 return true;
222 } 232 }
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
index cbcf3db..1864e06 100644
--- a/OpenSim/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -253,6 +253,8 @@ namespace OpenSim
253 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); 253 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
254 LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); 254 LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
255 LocalWorld.LoadPrimsFromStorage(); 255 LocalWorld.LoadPrimsFromStorage();
256 LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.parcelManager);
257
256 258
257 LocalWorld.StartTimer(); 259 LocalWorld.StartTimer();
258 } 260 }
@@ -417,11 +419,14 @@ namespace OpenSim
417 break; 419 break;
418 420
419 case "show": 421 case "show":
420 Show(cmdparams[0]); 422 if (cmdparams.Length > 0)
423 {
424 Show(cmdparams[0]);
425 }
421 break; 426 break;
422 427
423 case "terrain": 428 case "terrain":
424 string result = ""; 429 //string result = "";
425 /* if (!((World)m_localWorld).Terrain.RunTerrainCmd(cmdparams, ref result)) 430 /* if (!((World)m_localWorld).Terrain.RunTerrainCmd(cmdparams, ref result))
426 { 431 {
427 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result); 432 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result);