diff options
author | morphw | 2007-05-20 02:37:18 +0000 |
---|---|---|
committer | morphw | 2007-05-20 02:37:18 +0000 |
commit | e0b845f4d3760732f75f4dd2e8097850b57b4e6f (patch) | |
tree | 99ba97e3f55784d1286af171428b774373d0e5c6 | |
parent | Add RequestMapBlocks to local and remote interfaces (diff) | |
download | opensim-SC-e0b845f4d3760732f75f4dd2e8097850b57b4e6f.zip opensim-SC-e0b845f4d3760732f75f4dd2e8097850b57b4e6f.tar.gz opensim-SC-e0b845f4d3760732f75f4dd2e8097850b57b4e6f.tar.bz2 opensim-SC-e0b845f4d3760732f75f4dd2e8097850b57b4e6f.tar.xz |
Add method to process for MapBlockRequest packets
-rw-r--r-- | OpenSim.RegionServer/SimClient.PacketHandlers.cs | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/OpenSim.RegionServer/SimClient.PacketHandlers.cs b/OpenSim.RegionServer/SimClient.PacketHandlers.cs index bc49898..62919ba 100644 --- a/OpenSim.RegionServer/SimClient.PacketHandlers.cs +++ b/OpenSim.RegionServer/SimClient.PacketHandlers.cs | |||
@@ -152,12 +152,33 @@ namespace OpenSim | |||
152 | this.OutPacket(mapReply); | 152 | this.OutPacket(mapReply); |
153 | } | 153 | } |
154 | 154 | ||
155 | public void RequestMapBlock(int minX, int minY, int maxX, int maxY) | 155 | public void RequestMapBlocks(int minX, int minY, int maxX, int maxY) |
156 | { | 156 | { |
157 | //check if our own map was requested | 157 | IList simMapProfiles = m_gridServer.RequestMapBlocks(minX, minY, maxX, maxY); |
158 | this.m_world.RequestMapBlock(this, minX, minY, maxX, maxY); | 158 | MapBlockReplyPacket mbReply = new MapBlockReplyPacket(); |
159 | mbReply.AgentData.AgentID = this.AgentID; | ||
160 | int len; | ||
161 | if (simMapProfiles == null) | ||
162 | len = 0; | ||
163 | else | ||
164 | len = simMapProfiles.Count; | ||
159 | 165 | ||
160 | //now should get other regions maps from gridserver | 166 | mbReply.Data = new MapBlockReplyPacket.DataBlock[len]; |
167 | int iii; | ||
168 | for (iii = 0; iii < len; iii++) | ||
169 | { | ||
170 | Hashtable mp = (Hashtable)simMapProfiles[iii]; | ||
171 | mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock(); | ||
172 | mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]); | ||
173 | mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]); | ||
174 | mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]); | ||
175 | mbReply.Data[iii].MapImageID = new LLUUID((string)mp["map-image-id"]); | ||
176 | mbReply.Data[iii].RegionFlags = System.Convert.ToUInt32(mp["region-flags"]); | ||
177 | mbReply.Data[iii].WaterHeight = System.Convert.ToByte(mp["water-height"]); | ||
178 | mbReply.Data[iii].X = System.Convert.ToUInt16(mp["x"]); | ||
179 | mbReply.Data[iii].Y = System.Convert.ToUInt16(mp["y"]); | ||
180 | } | ||
181 | this.OutPacket(mbReply); | ||
161 | } | 182 | } |
162 | } | 183 | } |
163 | } | 184 | } |