aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs48
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs12
2 files changed, 37 insertions, 23 deletions
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs b/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
index 75fcf18..9233dd0 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
@@ -123,41 +123,47 @@ namespace OpenSim
123 mapReply.AgentData.Flags = 0; 123 mapReply.AgentData.Flags = 0;
124 mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1]; 124 mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1];
125 mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock(); 125 mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock();
126 mapReply.LayerData[0].Bottom = 800; 126 mapReply.LayerData[0].Bottom = this.m_regionData.RegionLocY - 50;
127 mapReply.LayerData[0].Left = 800; 127 mapReply.LayerData[0].Left = this.m_regionData.RegionLocX - 50;
128 mapReply.LayerData[0].Top = 1200; 128 mapReply.LayerData[0].Top = this.m_regionData.RegionLocY + 50;
129 mapReply.LayerData[0].Right = 1200; 129 mapReply.LayerData[0].Right = this.m_regionData.RegionLocX + 50;
130 mapReply.LayerData[0].ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); 130 mapReply.LayerData[0].ImageID = new LLUUID("00000000-0000-0000-9999-000000000005");
131 this.OutPacket(mapReply); 131 this.OutPacket(mapReply);
132 } 132 }
133 133
134 public void RequestMapBlocks(int minX, int minY, int maxX, int maxY) 134 public void RequestMapBlocks(int minX, int minY, int maxX, int maxY)
135 { 135 {
136 IList simMapProfiles = m_gridServer.RequestMapBlocks(minX, minY, maxX, maxY); 136 IList simMapProfiles = m_gridServer.RequestMapBlocks(minX, minY, maxX, maxY);
137 MapBlockReplyPacket mbReply = new MapBlockReplyPacket();
138 mbReply.AgentData.AgentID = this.AgentID;
139 int len; 137 int len;
140 if (simMapProfiles == null) 138 if (simMapProfiles == null)
141 len = 0; 139 len = 0;
142 else 140 else
143 len = simMapProfiles.Count; 141 len = simMapProfiles.Count;
144 142
145 mbReply.Data = new MapBlockReplyPacket.DataBlock[len]; 143 int i;
146 int iii; 144 int mtu = 8; // Number of regions to send per packet. Will be more precise in future. ( TODO )
147 for (iii = 0; iii < len; iii++) 145 for (i = 0; i < len; i += mtu)
148 { 146 {
149 Hashtable mp = (Hashtable)simMapProfiles[iii]; 147 MapBlockReplyPacket mbReply = new MapBlockReplyPacket();
150 mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock(); 148 mbReply.AgentData.AgentID = this.AgentID;
151 mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]); 149
152 mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]); 150 mbReply.Data = new MapBlockReplyPacket.DataBlock[len];
153 mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]); 151 int iii;
154 mbReply.Data[iii].MapImageID = new LLUUID((string)mp["map-image-id"]); 152 for (iii = i; iii < (i + mtu); iii++)
155 mbReply.Data[iii].RegionFlags = System.Convert.ToUInt32(mp["region-flags"]); 153 {
156 mbReply.Data[iii].WaterHeight = System.Convert.ToByte(mp["water-height"]); 154 Hashtable mp = (Hashtable)simMapProfiles[iii];
157 mbReply.Data[iii].X = System.Convert.ToUInt16(mp["x"]); 155 mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock();
158 mbReply.Data[iii].Y = System.Convert.ToUInt16(mp["y"]); 156 mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]);
157 mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]);
158 mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]);
159 mbReply.Data[iii].MapImageID = new LLUUID((string)mp["map-image-id"]);
160 mbReply.Data[iii].RegionFlags = System.Convert.ToUInt32(mp["region-flags"]);
161 mbReply.Data[iii].WaterHeight = System.Convert.ToByte(mp["water-height"]);
162 mbReply.Data[iii].X = System.Convert.ToUInt16(mp["x"]);
163 mbReply.Data[iii].Y = System.Convert.ToUInt16(mp["y"]);
164 }
165 this.OutPacket(mbReply);
159 } 166 }
160 this.OutPacket(mbReply);
161 } 167 }
162 } 168 }
163} 169}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
index ed3355f..0d4e42e 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
@@ -350,13 +350,21 @@ namespace OpenSim
350 } 350 }
351 break; 351 break;
352 case PacketType.MapLayerRequest: 352 case PacketType.MapLayerRequest:
353 // This be busted.
354 MapLayerRequestPacket MapRequest = (MapLayerRequestPacket)Pack;
353 this.RequestMapLayer(); 355 this.RequestMapLayer();
356 this.RequestMapBlocks((int)this.m_regionData.RegionLocX - 50, (int)this.m_regionData.RegionLocY - 50, (int)this.m_regionData.RegionLocX + 50, (int)this.m_regionData.RegionLocY + 50);
354 break; 357 break;
358
355 case PacketType.MapBlockRequest: 359 case PacketType.MapBlockRequest:
356 MapBlockRequestPacket MapRequest = (MapBlockRequestPacket)Pack; 360 MapBlockRequestPacket MapBRequest = (MapBlockRequestPacket)Pack;
361 this.RequestMapBlocks(MapBRequest.PositionData.MinX, MapBRequest.PositionData.MinY, MapBRequest.PositionData.MaxX, MapBRequest.PositionData.MaxY);
362 break;
357 363
358 this.RequestMapBlocks(MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY); 364 case PacketType.MapNameRequest:
365 // TODO.
359 break; 366 break;
367
360 case PacketType.TeleportLandmarkRequest: 368 case PacketType.TeleportLandmarkRequest:
361 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; 369 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack;
362 370