From e0b845f4d3760732f75f4dd2e8097850b57b4e6f Mon Sep 17 00:00:00 2001 From: morphw Date: Sun, 20 May 2007 02:37:18 +0000 Subject: [PATCH] Add method to process for MapBlockRequest packets --- .../SimClient.PacketHandlers.cs | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/OpenSim.RegionServer/SimClient.PacketHandlers.cs b/OpenSim.RegionServer/SimClient.PacketHandlers.cs index bc498984a4..62919bac2f 100644 --- a/OpenSim.RegionServer/SimClient.PacketHandlers.cs +++ b/OpenSim.RegionServer/SimClient.PacketHandlers.cs @@ -152,12 +152,33 @@ namespace OpenSim this.OutPacket(mapReply); } - public void RequestMapBlock(int minX, int minY, int maxX, int maxY) + public void RequestMapBlocks(int minX, int minY, int maxX, int maxY) { - //check if our own map was requested - this.m_world.RequestMapBlock(this, minX, minY, maxX, maxY); + IList simMapProfiles = m_gridServer.RequestMapBlocks(minX, minY, maxX, maxY); + MapBlockReplyPacket mbReply = new MapBlockReplyPacket(); + mbReply.AgentData.AgentID = this.AgentID; + int len; + if (simMapProfiles == null) + len = 0; + else + len = simMapProfiles.Count; - //now should get other regions maps from gridserver + mbReply.Data = new MapBlockReplyPacket.DataBlock[len]; + int iii; + for (iii = 0; iii < len; iii++) + { + Hashtable mp = (Hashtable)simMapProfiles[iii]; + mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock(); + mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]); + mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]); + mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]); + mbReply.Data[iii].MapImageID = new LLUUID((string)mp["map-image-id"]); + mbReply.Data[iii].RegionFlags = System.Convert.ToUInt32(mp["region-flags"]); + mbReply.Data[iii].WaterHeight = System.Convert.ToByte(mp["water-height"]); + mbReply.Data[iii].X = System.Convert.ToUInt16(mp["x"]); + mbReply.Data[iii].Y = System.Convert.ToUInt16(mp["y"]); + } + this.OutPacket(mbReply); } } }