diff options
Added very basic support for maps (likely to only work in sandbox mode due to the non functioning remote asset server), also currently just uses textures that we already had added to the asset server (this is the first thing that needs fixing)
Diffstat (limited to '')
-rw-r--r-- | OpenSim.RegionServer/world/WorldPacketHandlers.cs | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/OpenSim.RegionServer/world/WorldPacketHandlers.cs b/OpenSim.RegionServer/world/WorldPacketHandlers.cs index 9e1f9a1..d479c85 100644 --- a/OpenSim.RegionServer/world/WorldPacketHandlers.cs +++ b/OpenSim.RegionServer/world/WorldPacketHandlers.cs | |||
@@ -65,28 +65,28 @@ namespace OpenSim.world | |||
65 | switch (inchatpack.ChatData.Type) | 65 | switch (inchatpack.ChatData.Type) |
66 | { | 66 | { |
67 | case 0: | 67 | case 0: |
68 | int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X),(int)( client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); | 68 | int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); |
69 | if ((dis < 10) && (dis > -10)) | 69 | if ((dis < 10) && (dis > -10)) |
70 | { | 70 | { |
71 | client.OutPacket(reply); | 71 | client.OutPacket(reply); |
72 | } | 72 | } |
73 | break; | 73 | break; |
74 | case 1: | 74 | case 1: |
75 | dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); | 75 | dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); |
76 | if ((dis < 30) && (dis > -30)) | 76 | if ((dis < 30) && (dis > -30)) |
77 | { | 77 | { |
78 | client.OutPacket(reply); | 78 | client.OutPacket(reply); |
79 | } | 79 | } |
80 | break; | 80 | break; |
81 | case 2: | 81 | case 2: |
82 | dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X),(int)( client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); | 82 | dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); |
83 | if ((dis < 100) && (dis > -100)) | 83 | if ((dis < 100) && (dis > -100)) |
84 | { | 84 | { |
85 | client.OutPacket(reply); | 85 | client.OutPacket(reply); |
86 | } | 86 | } |
87 | break; | 87 | break; |
88 | } | 88 | } |
89 | 89 | ||
90 | } | 90 | } |
91 | return true; | 91 | return true; |
92 | } | 92 | } |
@@ -203,5 +203,27 @@ namespace OpenSim.world | |||
203 | return true; | 203 | return true; |
204 | } | 204 | } |
205 | 205 | ||
206 | public void RequestMapBlock(SimClient simClient, int minX, int minY, int maxX, int maxY) | ||
207 | { | ||
208 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | ||
209 | if (((m_regInfo.RegionLocX > minX) && (m_regInfo.RegionLocX < maxX)) && ((m_regInfo.RegionLocY > minY) && (m_regInfo.RegionLocY < maxY))) | ||
210 | { | ||
211 | MapBlockReplyPacket mapReply = new MapBlockReplyPacket(); | ||
212 | mapReply.AgentData.AgentID = simClient.AgentID; | ||
213 | mapReply.AgentData.Flags = 0; | ||
214 | mapReply.Data = new MapBlockReplyPacket.DataBlock[1]; | ||
215 | mapReply.Data[0] = new MapBlockReplyPacket.DataBlock(); | ||
216 | mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000002"); | ||
217 | mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX; | ||
218 | mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY; | ||
219 | mapReply.Data[0].WaterHeight =(byte) m_regInfo.RegionWaterHeight; | ||
220 | mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName); | ||
221 | mapReply.Data[0].RegionFlags = 72458694; | ||
222 | mapReply.Data[0].Access = 13; | ||
223 | mapReply.Data[0].Agents = 1; //should send number of clients connected | ||
224 | simClient.OutPacket(mapReply); | ||
225 | } | ||
226 | } | ||
227 | |||
206 | } | 228 | } |
207 | } | 229 | } |