aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-05-30 03:58:27 +0000
committerAdam Frisby2007-05-30 03:58:27 +0000
commit6f9aba58ee2590d2594e365789c92da58923d3fc (patch)
treeef7e797966f1e99cebfada59aabbfa3e58b1f7da /OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
parentand log mode reconnect added. (diff)
downloadopensim-SC_OLD-6f9aba58ee2590d2594e365789c92da58923d3fc.zip
opensim-SC_OLD-6f9aba58ee2590d2594e365789c92da58923d3fc.tar.gz
opensim-SC_OLD-6f9aba58ee2590d2594e365789c92da58923d3fc.tar.bz2
opensim-SC_OLD-6f9aba58ee2590d2594e365789c92da58923d3fc.tar.xz
* May have fixed issues with the world map.
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs')
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs48
1 files changed, 27 insertions, 21 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}