aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.RegionServer')
-rw-r--r--OpenSim/OpenSim.RegionServer/Client/ClientView.cs1
-rw-r--r--OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs271
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj20
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build8
-rw-r--r--OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs8
-rw-r--r--OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs61
-rw-r--r--OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs10
-rw-r--r--OpenSim/OpenSim.RegionServer/Simulator/World.cs19
8 files changed, 293 insertions, 105 deletions
diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientView.cs b/OpenSim/OpenSim.RegionServer/Client/ClientView.cs
index 6d7c3f2..f6d672c 100644
--- a/OpenSim/OpenSim.RegionServer/Client/ClientView.cs
+++ b/OpenSim/OpenSim.RegionServer/Client/ClientView.cs
@@ -144,6 +144,7 @@ namespace OpenSim.RegionServer.Client
144 144
145 145
146 m_world.parcelManager.sendParcelOverlay(this); 146 m_world.parcelManager.sendParcelOverlay(this);
147 m_world.estateManager.sendRegionInfoPacket(this);
147 148
148 ClientThread = new Thread(new ThreadStart(AuthUser)); 149 ClientThread = new Thread(new ThreadStart(AuthUser));
149 ClientThread.IsBackground = true; 150 ClientThread.IsBackground = true;
diff --git a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs
index 33996d0..7a34334 100644
--- a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs
+++ b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs
@@ -24,6 +24,16 @@ namespace OpenSim.RegionServer.Estate
24 m_world = world; //Estate settings found at world.m_regInfo.estateSettings 24 m_world = world; //Estate settings found at world.m_regInfo.estateSettings
25 } 25 }
26 26
27 private bool convertParamStringToBool(byte[] field)
28 {
29 string s = Helpers.FieldToUTF8String(field);
30 if (s == "1" || s.ToLower() == "y" || s.ToLower() == "yes" || s.ToLower() == "t" || s.ToLower() == "true")
31 {
32 return true;
33 }
34 return false;
35 }
36
27 public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, ClientView remote_client) 37 public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, ClientView remote_client)
28 { 38 {
29 if (remote_client.AgentID == m_world.m_regInfo.MasterAvatarAssignedUUID) 39 if (remote_client.AgentID == m_world.m_regInfo.MasterAvatarAssignedUUID)
@@ -32,27 +42,168 @@ namespace OpenSim.RegionServer.Estate
32 { 42 {
33 case "getinfo": 43 case "getinfo":
34 Console.WriteLine("GETINFO Requested"); 44 Console.WriteLine("GETINFO Requested");
35 RegionInfoPacket regionInfoPacket = new RegionInfoPacket(); 45 this.sendRegionInfoPacketToAll();
36 regionInfoPacket.AgentData.AgentID = remote_client.AgentID; 46
37 regionInfoPacket.AgentData.SessionID = remote_client.SessionID; 47 break;
38 regionInfoPacket.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor; 48 case "setregioninfo":
39 regionInfoPacket.RegionInfo.EstateID = m_world.m_regInfo.estateSettings.estateID; 49 if (packet.ParamList.Length != 9)
40 regionInfoPacket.RegionInfo.MaxAgents = m_world.m_regInfo.estateSettings.maxAgents; 50 {
41 regionInfoPacket.RegionInfo.ObjectBonusFactor = m_world.m_regInfo.estateSettings.objectBonusFactor; 51 OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: SetRegionInfo method has a ParamList of invalid length");
42 regionInfoPacket.RegionInfo.ParentEstateID = m_world.m_regInfo.estateSettings.parentEstateID; 52 }
43 regionInfoPacket.RegionInfo.PricePerMeter = m_world.m_regInfo.estateSettings.pricePerMeter; 53 else
44 regionInfoPacket.RegionInfo.RedirectGridX = m_world.m_regInfo.estateSettings.redirectGridX; 54 {
45 regionInfoPacket.RegionInfo.RedirectGridY = m_world.m_regInfo.estateSettings.redirectGridY; 55 m_world.m_regInfo.estateSettings.regionFlags = libsecondlife.Simulator.RegionFlags.None;
46 regionInfoPacket.RegionInfo.RegionFlags = m_world.m_regInfo.estateSettings.regionFlags; 56
47 regionInfoPacket.RegionInfo.SimAccess = m_world.m_regInfo.estateSettings.simAccess; 57 if (convertParamStringToBool(packet.ParamList[0].Parameter))
48 regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_world.m_regInfo.RegionName); 58 {
49 regionInfoPacket.RegionInfo.SunHour = m_world.m_regInfo.estateSettings.sunHour; 59 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockTerraform;
50 regionInfoPacket.RegionInfo.TerrainLowerLimit = m_world.m_regInfo.estateSettings.terrainLowerLimit; 60 }
51 regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_world.m_regInfo.estateSettings.terrainRaiseLimit; 61
52 regionInfoPacket.RegionInfo.UseEstateSun = m_world.m_regInfo.estateSettings.useEstateSun; 62 if (convertParamStringToBool(packet.ParamList[1].Parameter))
53 regionInfoPacket.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight; 63 {
54 64 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.NoFly;
55 remote_client.OutPacket(regionInfoPacket); 65 }
66
67 if (convertParamStringToBool(packet.ParamList[2].Parameter))
68 {
69 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowDamage;
70 }
71
72 if (convertParamStringToBool(packet.ParamList[3].Parameter) == false)
73 {
74 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockLandResell;
75 }
76
77
78 int tempMaxAgents = Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter)));
79 m_world.m_regInfo.estateSettings.maxAgents = (byte)tempMaxAgents;
80
81 float tempObjectBonusFactor = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
82 m_world.m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor;
83
84 int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter));
85 m_world.m_regInfo.estateSettings.simAccess = (libsecondlife.Simulator.SimAccess)tempMatureLevel;
86
87
88 if (convertParamStringToBool(packet.ParamList[7].Parameter))
89 {
90 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.RestrictPushObject;
91 }
92
93 if (convertParamStringToBool(packet.ParamList[8].Parameter))
94 {
95 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowParcelChanges;
96 }
97
98 sendRegionInfoPacketToAll();
99
100 }
101 break;
102 case "texturebase":
103 foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
104 {
105 string s = Helpers.FieldToUTF8String(block.Parameter);
106 string[] splitField = s.Split(' ');
107 if (splitField.Length == 2)
108 {
109 LLUUID tempUUID = new LLUUID(splitField[1]);
110 switch (Convert.ToInt16(splitField[0]))
111 {
112 case 0:
113 m_world.m_regInfo.estateSettings.terrainBase0 = tempUUID;
114 break;
115 case 1:
116 m_world.m_regInfo.estateSettings.terrainBase1 = tempUUID;
117 break;
118 case 2:
119 m_world.m_regInfo.estateSettings.terrainBase2 = tempUUID;
120 break;
121 case 3:
122 m_world.m_regInfo.estateSettings.terrainBase3 = tempUUID;
123 break;
124 }
125 }
126 }
127 break;
128 case "texturedetail":
129 foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
130 {
131
132 string s = Helpers.FieldToUTF8String(block.Parameter);
133 string[] splitField = s.Split(' ');
134 if (splitField.Length == 2)
135 {
136 LLUUID tempUUID = new LLUUID(splitField[1]);
137 switch (Convert.ToInt16(splitField[0]))
138 {
139 case 0:
140 m_world.m_regInfo.estateSettings.terrainDetail0 = tempUUID;
141 break;
142 case 1:
143 m_world.m_regInfo.estateSettings.terrainDetail1 = tempUUID;
144 break;
145 case 2:
146 m_world.m_regInfo.estateSettings.terrainDetail2 = tempUUID;
147 break;
148 case 3:
149 m_world.m_regInfo.estateSettings.terrainDetail3 = tempUUID;
150 break;
151 }
152 }
153 }
154 break;
155 case "textureheights":
156 foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
157 {
158
159 string s = Helpers.FieldToUTF8String(block.Parameter);
160 string[] splitField = s.Split(' ');
161 if (splitField.Length == 3)
162 {
163
164 float tempHeightLow = (float)Convert.ToDecimal(splitField[1]);
165 float tempHeightHigh = (float)Convert.ToDecimal(splitField[2]);
166
167 switch (Convert.ToInt16(splitField[0]))
168 {
169 case 0:
170 m_world.m_regInfo.estateSettings.terrainStartHeight0 = tempHeightLow;
171 m_world.m_regInfo.estateSettings.terrainHeightRange0 = tempHeightHigh;
172 break;
173 case 1:
174 m_world.m_regInfo.estateSettings.terrainStartHeight1 = tempHeightLow;
175 m_world.m_regInfo.estateSettings.terrainHeightRange1 = tempHeightHigh;
176 break;
177 case 2:
178 m_world.m_regInfo.estateSettings.terrainStartHeight2 = tempHeightLow;
179 m_world.m_regInfo.estateSettings.terrainHeightRange2 = tempHeightHigh;
180 break;
181 case 3:
182 m_world.m_regInfo.estateSettings.terrainStartHeight3 = tempHeightLow;
183 m_world.m_regInfo.estateSettings.terrainHeightRange3 = tempHeightHigh;
184 break;
185 }
186 }
187 }
188 break;
189 case "texturecommit":
190 sendRegionHandshakeToAll();
191 break;
192 case "setregionterrain":
193 if (packet.ParamList.Length != 9)
194 {
195 OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length");
196 }
197 else
198 {
199 m_world.m_regInfo.estateSettings.waterHeight = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter));
200 m_world.m_regInfo.estateSettings.terrainRaiseLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter));
201 m_world.m_regInfo.estateSettings.terrainLowerLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter));
202 m_world.m_regInfo.estateSettings.useFixedSun = this.convertParamStringToBool(packet.ParamList[4].Parameter);
203 m_world.m_regInfo.estateSettings.sunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
204
205 sendRegionInfoPacketToAll();
206 }
56 break; 207 break;
57 default: 208 default:
58 OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); 209 OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
@@ -60,5 +211,83 @@ namespace OpenSim.RegionServer.Estate
60 } 211 }
61 } 212 }
62 } 213 }
214
215 public void sendRegionInfoPacketToAll()
216 {
217 foreach (OpenSim.RegionServer.Simulator.Avatar av in m_world.Avatars.Values)
218 {
219 this.sendRegionInfoPacket(av.ControllingClient);
220 }
221 }
222
223 public void sendRegionHandshakeToAll()
224 {
225 foreach (OpenSim.RegionServer.Simulator.Avatar av in m_world.Avatars.Values)
226 {
227 this.sendRegionHandshake(av.ControllingClient);
228 }
229 }
230
231 public void sendRegionInfoPacket(ClientView remote_client)
232 {
233
234 RegionInfoPacket regionInfoPacket = new RegionInfoPacket();
235 regionInfoPacket.AgentData.AgentID = remote_client.AgentID;
236 regionInfoPacket.AgentData.SessionID = remote_client.SessionID;
237 regionInfoPacket.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor;
238 regionInfoPacket.RegionInfo.EstateID = m_world.m_regInfo.estateSettings.estateID;
239 regionInfoPacket.RegionInfo.MaxAgents = m_world.m_regInfo.estateSettings.maxAgents;
240 regionInfoPacket.RegionInfo.ObjectBonusFactor = m_world.m_regInfo.estateSettings.objectBonusFactor;
241 regionInfoPacket.RegionInfo.ParentEstateID = m_world.m_regInfo.estateSettings.parentEstateID;
242 regionInfoPacket.RegionInfo.PricePerMeter = m_world.m_regInfo.estateSettings.pricePerMeter;
243 regionInfoPacket.RegionInfo.RedirectGridX = m_world.m_regInfo.estateSettings.redirectGridX;
244 regionInfoPacket.RegionInfo.RedirectGridY = m_world.m_regInfo.estateSettings.redirectGridY;
245 regionInfoPacket.RegionInfo.RegionFlags = (uint)m_world.m_regInfo.estateSettings.regionFlags;
246 regionInfoPacket.RegionInfo.SimAccess = (byte)m_world.m_regInfo.estateSettings.simAccess;
247 regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_world.m_regInfo.RegionName);
248 regionInfoPacket.RegionInfo.SunHour = m_world.m_regInfo.estateSettings.sunHour;
249 regionInfoPacket.RegionInfo.TerrainLowerLimit = m_world.m_regInfo.estateSettings.terrainLowerLimit;
250 regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_world.m_regInfo.estateSettings.terrainRaiseLimit;
251 regionInfoPacket.RegionInfo.UseEstateSun = !m_world.m_regInfo.estateSettings.useFixedSun;
252 regionInfoPacket.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight;
253
254 remote_client.OutPacket(regionInfoPacket);
255 }
256
257 public void sendRegionHandshake(ClientView remote_client)
258 {
259 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
260 RegionHandshakePacket handshake = new RegionHandshakePacket();
261
262 handshake.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor;
263 handshake.RegionInfo.IsEstateManager = false;
264 handshake.RegionInfo.TerrainHeightRange00 = m_world.m_regInfo.estateSettings.terrainHeightRange0;
265 handshake.RegionInfo.TerrainHeightRange01 = m_world.m_regInfo.estateSettings.terrainHeightRange1;
266 handshake.RegionInfo.TerrainHeightRange10 = m_world.m_regInfo.estateSettings.terrainHeightRange2;
267 handshake.RegionInfo.TerrainHeightRange11 = m_world.m_regInfo.estateSettings.terrainHeightRange3;
268 handshake.RegionInfo.TerrainStartHeight00 = m_world.m_regInfo.estateSettings.terrainStartHeight0;
269 handshake.RegionInfo.TerrainStartHeight01 = m_world.m_regInfo.estateSettings.terrainStartHeight1;
270 handshake.RegionInfo.TerrainStartHeight10 = m_world.m_regInfo.estateSettings.terrainStartHeight2;
271 handshake.RegionInfo.TerrainStartHeight11 = m_world.m_regInfo.estateSettings.terrainStartHeight3;
272 handshake.RegionInfo.SimAccess = (byte)m_world.m_regInfo.estateSettings.simAccess;
273 handshake.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight;
274
275
276 handshake.RegionInfo.RegionFlags = (uint)m_world.m_regInfo.estateSettings.regionFlags;
277
278 handshake.RegionInfo.SimName = _enc.GetBytes(m_world.m_regInfo.estateSettings.waterHeight + "\0");
279 handshake.RegionInfo.SimOwner = m_world.m_regInfo.MasterAvatarAssignedUUID;
280 handshake.RegionInfo.TerrainBase0 = m_world.m_regInfo.estateSettings.terrainBase0;
281 handshake.RegionInfo.TerrainBase1 = m_world.m_regInfo.estateSettings.terrainBase1;
282 handshake.RegionInfo.TerrainBase2 = m_world.m_regInfo.estateSettings.terrainBase2;
283 handshake.RegionInfo.TerrainBase3 = m_world.m_regInfo.estateSettings.terrainBase3;
284 handshake.RegionInfo.TerrainDetail0 = m_world.m_regInfo.estateSettings.terrainDetail0;
285 handshake.RegionInfo.TerrainDetail1 = m_world.m_regInfo.estateSettings.terrainDetail1;
286 handshake.RegionInfo.TerrainDetail2 = m_world.m_regInfo.estateSettings.terrainDetail2;
287 handshake.RegionInfo.TerrainDetail3 = m_world.m_regInfo.estateSettings.terrainDetail3;
288 handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting?
289
290 remote_client.OutPacket(handshake);
291 }
63 } 292 }
64} 293}
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index 4f16f2c..12c0645 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -154,15 +154,15 @@
154 <Compile Include="AgentAssetUpload.cs"> 154 <Compile Include="AgentAssetUpload.cs">
155 <SubType>Code</SubType> 155 <SubType>Code</SubType>
156 </Compile> 156 </Compile>
157 <Compile Include="RegionServerBase.cs">
158 <SubType>Code</SubType>
159 </Compile>
160 <Compile Include="RegionInfoBase.cs"> 157 <Compile Include="RegionInfoBase.cs">
161 <SubType>Code</SubType> 158 <SubType>Code</SubType>
162 </Compile> 159 </Compile>
163 <Compile Include="RegionInfo.cs"> 160 <Compile Include="RegionInfo.cs">
164 <SubType>Code</SubType> 161 <SubType>Code</SubType>
165 </Compile> 162 </Compile>
163 <Compile Include="RegionServerBase.cs">
164 <SubType>Code</SubType>
165 </Compile>
166 <Compile Include="Simulator\Avatar.Client.cs"> 166 <Compile Include="Simulator\Avatar.Client.cs">
167 <SubType>Code</SubType> 167 <SubType>Code</SubType>
168 </Compile> 168 </Compile>
@@ -172,9 +172,6 @@
172 <Compile Include="Simulator\World.PacketHandlers.cs"> 172 <Compile Include="Simulator\World.PacketHandlers.cs">
173 <SubType>Code</SubType> 173 <SubType>Code</SubType>
174 </Compile> 174 </Compile>
175 <Compile Include="Simulator\Avatar.Update.cs">
176 <SubType>Code</SubType>
177 </Compile>
178 <Compile Include="Simulator\AvatarAnimations.cs"> 175 <Compile Include="Simulator\AvatarAnimations.cs">
179 <SubType>Code</SubType> 176 <SubType>Code</SubType>
180 </Compile> 177 </Compile>
@@ -190,13 +187,16 @@
190 <Compile Include="Simulator\Primitive2.cs"> 187 <Compile Include="Simulator\Primitive2.cs">
191 <SubType>Code</SubType> 188 <SubType>Code</SubType>
192 </Compile> 189 </Compile>
190 <Compile Include="Simulator\SceneObject.cs">
191 <SubType>Code</SubType>
192 </Compile>
193 <Compile Include="Simulator\Avatar.cs"> 193 <Compile Include="Simulator\Avatar.cs">
194 <SubType>Code</SubType> 194 <SubType>Code</SubType>
195 </Compile> 195 </Compile>
196 <Compile Include="Simulator\World.cs"> 196 <Compile Include="Simulator\Avatar.Update.cs">
197 <SubType>Code</SubType> 197 <SubType>Code</SubType>
198 </Compile> 198 </Compile>
199 <Compile Include="Simulator\SceneObject.cs"> 199 <Compile Include="Simulator\World.cs">
200 <SubType>Code</SubType> 200 <SubType>Code</SubType>
201 </Compile> 201 </Compile>
202 <Compile Include="Simulator\ParcelManager.cs"> 202 <Compile Include="Simulator\ParcelManager.cs">
@@ -244,10 +244,10 @@
244 <Compile Include="Client\ClientView.PacketHandlers.cs"> 244 <Compile Include="Client\ClientView.PacketHandlers.cs">
245 <SubType>Code</SubType> 245 <SubType>Code</SubType>
246 </Compile> 246 </Compile>
247 <Compile Include="Client\ClientView.ProcessPackets.cs"> 247 <Compile Include="Client\ClientViewBase.cs">
248 <SubType>Code</SubType> 248 <SubType>Code</SubType>
249 </Compile> 249 </Compile>
250 <Compile Include="Client\ClientViewBase.cs"> 250 <Compile Include="Client\ClientView.ProcessPackets.cs">
251 <SubType>Code</SubType> 251 <SubType>Code</SubType>
252 </Compile> 252 </Compile>
253 <Compile Include="Client\ClientView.cs"> 253 <Compile Include="Client\ClientView.cs">
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
index 702c90c..5f33913 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
@@ -21,21 +21,21 @@
21 <include name="AuthenticateSessionsBase.cs" /> 21 <include name="AuthenticateSessionsBase.cs" />
22 <include name="VersionInfo.cs" /> 22 <include name="VersionInfo.cs" />
23 <include name="AgentAssetUpload.cs" /> 23 <include name="AgentAssetUpload.cs" />
24 <include name="RegionServerBase.cs" />
25 <include name="RegionInfoBase.cs" /> 24 <include name="RegionInfoBase.cs" />
26 <include name="RegionInfo.cs" /> 25 <include name="RegionInfo.cs" />
26 <include name="RegionServerBase.cs" />
27 <include name="Simulator/Avatar.Client.cs" /> 27 <include name="Simulator/Avatar.Client.cs" />
28 <include name="Simulator/Entity.cs" /> 28 <include name="Simulator/Entity.cs" />
29 <include name="Simulator/World.PacketHandlers.cs" /> 29 <include name="Simulator/World.PacketHandlers.cs" />
30 <include name="Simulator/Avatar.Update.cs" />
31 <include name="Simulator/AvatarAnimations.cs" /> 30 <include name="Simulator/AvatarAnimations.cs" />
32 <include name="Simulator/WorldBase.cs" /> 31 <include name="Simulator/WorldBase.cs" />
33 <include name="Simulator/Primitive.cs" /> 32 <include name="Simulator/Primitive.cs" />
34 <include name="Simulator/World.Scripting.cs" /> 33 <include name="Simulator/World.Scripting.cs" />
35 <include name="Simulator/Primitive2.cs" /> 34 <include name="Simulator/Primitive2.cs" />
35 <include name="Simulator/SceneObject.cs" />
36 <include name="Simulator/Avatar.cs" /> 36 <include name="Simulator/Avatar.cs" />
37 <include name="Simulator/Avatar.Update.cs" />
37 <include name="Simulator/World.cs" /> 38 <include name="Simulator/World.cs" />
38 <include name="Simulator/SceneObject.cs" />
39 <include name="Simulator/ParcelManager.cs" /> 39 <include name="Simulator/ParcelManager.cs" />
40 <include name="Estate/EstateManager.cs" /> 40 <include name="Estate/EstateManager.cs" />
41 <include name="CAPS/AdminWebFront.cs" /> 41 <include name="CAPS/AdminWebFront.cs" />
@@ -51,8 +51,8 @@
51 <include name="Types/Triangle.cs" /> 51 <include name="Types/Triangle.cs" />
52 <include name="Client/ClientView.Grid.cs" /> 52 <include name="Client/ClientView.Grid.cs" />
53 <include name="Client/ClientView.PacketHandlers.cs" /> 53 <include name="Client/ClientView.PacketHandlers.cs" />
54 <include name="Client/ClientView.ProcessPackets.cs" />
55 <include name="Client/ClientViewBase.cs" /> 54 <include name="Client/ClientViewBase.cs" />
55 <include name="Client/ClientView.ProcessPackets.cs" />
56 <include name="Client/ClientView.cs" /> 56 <include name="Client/ClientView.cs" />
57 </sources> 57 </sources>
58 <references basedir="${project::get-base-directory()}"> 58 <references basedir="${project::get-base-directory()}">
diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs
index 6f32c85..03da861 100644
--- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs
+++ b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs
@@ -54,7 +54,7 @@ namespace OpenSim.RegionServer.Simulator
54 //use CreateTerseBlock() 54 //use CreateTerseBlock()
55 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 55 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
56 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 56 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
57 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 57 terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
58 terse.RegionData.TimeDilation = 64096; 58 terse.RegionData.TimeDilation = 64096;
59 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 59 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
60 terse.ObjectData[0] = terseBlock; 60 terse.ObjectData[0] = terseBlock;
@@ -78,7 +78,7 @@ namespace OpenSim.RegionServer.Simulator
78 //It has been a while since last update was sent so lets send one. 78 //It has been a while since last update was sent so lets send one.
79 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 79 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
80 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 80 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
81 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 81 terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
82 terse.RegionData.TimeDilation = 64096; 82 terse.RegionData.TimeDilation = 64096;
83 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 83 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
84 terse.ObjectData[0] = terseBlock; 84 terse.ObjectData[0] = terseBlock;
@@ -158,7 +158,7 @@ namespace OpenSim.RegionServer.Simulator
158 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 158 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
159 //send a objectupdate packet with information about the clients avatar 159 //send a objectupdate packet with information about the clients avatar
160 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 160 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
161 objupdate.RegionData.RegionHandle = m_regionHandle; 161 objupdate.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
162 objupdate.RegionData.TimeDilation = 64096; 162 objupdate.RegionData.TimeDilation = 64096;
163 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 163 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
164 164
@@ -182,7 +182,7 @@ namespace OpenSim.RegionServer.Simulator
182 //send a objectupdate packet with information about the clients avatar 182 //send a objectupdate packet with information about the clients avatar
183 183
184 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 184 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
185 objupdate.RegionData.RegionHandle = m_regionHandle; 185 objupdate.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
186 objupdate.RegionData.TimeDilation = 64096; 186 objupdate.RegionData.TimeDilation = 64096;
187 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 187 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
188 objupdate.ObjectData[0] = AvatarTemplate; 188 objupdate.ObjectData[0] = AvatarTemplate;
diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs
index 65a9a63..a64ee9e 100644
--- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs
+++ b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs
@@ -66,24 +66,15 @@ namespace OpenSim.RegionServer.Simulator
66 66
67 private int positionParcelHoverLocalID = -1; //Local ID of the last parcel they were over 67 private int positionParcelHoverLocalID = -1; //Local ID of the last parcel they were over
68 private int parcelUpdateSequenceIncrement = 1; 68 private int parcelUpdateSequenceIncrement = 1;
69 private ulong m_regionHandle; 69
70 //private Dictionary<uint, ClientView> m_clientThreads;
71 private string m_regionName;
72 private ushort m_regionWaterHeight;
73 private bool m_regionTerraform;
74 private bool childAvatar = false; 70 private bool childAvatar = false;
75 71
76 public Avatar(ClientView TheClient, World world, string regionName, Dictionary<uint, ClientView> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater) 72 public Avatar(ClientView TheClient, World world)
77 { 73 {
78 m_world = world; 74 m_world = world;
79 // m_clientThreads = clientThreads; 75 ControllingClient = TheClient;
80 m_regionName = regionName;
81 m_regionHandle = regionHandle;
82 m_regionTerraform = regionTerraform;
83 m_regionWaterHeight = regionWater;
84 76
85 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs - Loading details from grid (DUMMY)"); 77 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs - Loading details from grid (DUMMY)");
86 ControllingClient = TheClient;
87 localid = 8880000 + (this.m_world._localNumber++); 78 localid = 8880000 + (this.m_world._localNumber++);
88 Pos = ControllingClient.startpos; 79 Pos = ControllingClient.startpos;
89 visualParams = new byte[218]; 80 visualParams = new byte[218];
@@ -133,7 +124,7 @@ namespace OpenSim.RegionServer.Simulator
133 this._physActor.Velocity = new PhysicsVector(0, 0, 0); 124 this._physActor.Velocity = new PhysicsVector(0, 0, 0);
134 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 125 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
135 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 126 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
136 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 127 terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
137 terse.RegionData.TimeDilation = 64096; 128 terse.RegionData.TimeDilation = 64096;
138 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 129 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
139 terse.ObjectData[0] = terseBlock; 130 terse.ObjectData[0] = terseBlock;
@@ -251,7 +242,7 @@ namespace OpenSim.RegionServer.Simulator
251 AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); 242 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
252 mov.AgentData.SessionID = this.ControllingClient.SessionID; 243 mov.AgentData.SessionID = this.ControllingClient.SessionID;
253 mov.AgentData.AgentID = this.ControllingClient.AgentID; 244 mov.AgentData.AgentID = this.ControllingClient.AgentID;
254 mov.Data.RegionHandle = this.m_regionHandle; 245 mov.Data.RegionHandle = this.m_world.m_regInfo.RegionHandle;
255 // TODO - dynamicalise this stuff 246 // TODO - dynamicalise this stuff
256 mov.Data.Timestamp = 1172750370; 247 mov.Data.Timestamp = 1172750370;
257 mov.Data.Position = this.ControllingClient.startpos; 248 mov.Data.Position = this.ControllingClient.startpos;
@@ -415,47 +406,7 @@ namespace OpenSim.RegionServer.Simulator
415 } 406 }
416 } 407 }
417 408
418 //really really should be moved somewhere else (RegionInfo.cs ?) 409
419 public void SendRegionHandshake(World regionInfo)
420 {
421 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
422 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
423 RegionHandshakePacket handshake = new RegionHandshakePacket();
424
425 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
426 handshake.RegionInfo.BillableFactor = 0;
427 handshake.RegionInfo.IsEstateManager = false;
428 handshake.RegionInfo.TerrainHeightRange00 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeNW;
429 handshake.RegionInfo.TerrainHeightRange01 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeNE;
430 handshake.RegionInfo.TerrainHeightRange10 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeSW;
431 handshake.RegionInfo.TerrainHeightRange11 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeSE;
432 handshake.RegionInfo.TerrainStartHeight00 = regionInfo.m_regInfo.estateSettings.terrainStartHeightNW;
433 handshake.RegionInfo.TerrainStartHeight01 = regionInfo.m_regInfo.estateSettings.terrainStartHeightNE;
434 handshake.RegionInfo.TerrainStartHeight10 = regionInfo.m_regInfo.estateSettings.terrainStartHeightSW;
435 handshake.RegionInfo.TerrainStartHeight11 = regionInfo.m_regInfo.estateSettings.terrainStartHeightSE;
436 handshake.RegionInfo.SimAccess = 13;
437 handshake.RegionInfo.WaterHeight = m_regionWaterHeight;
438 uint regionFlags = 72458694;
439 if (this.m_regionTerraform)
440 {
441 regionFlags -= 64;
442 }
443 handshake.RegionInfo.RegionFlags = regionFlags;
444 handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0");
445 handshake.RegionInfo.SimOwner = regionInfo.m_regInfo.MasterAvatarAssignedUUID;
446 handshake.RegionInfo.TerrainBase0 = regionInfo.m_regInfo.estateSettings.terrainBase0;
447 handshake.RegionInfo.TerrainBase1 = regionInfo.m_regInfo.estateSettings.terrainBase1;
448 handshake.RegionInfo.TerrainBase2 = regionInfo.m_regInfo.estateSettings.terrainBase2;
449 handshake.RegionInfo.TerrainBase3 = regionInfo.m_regInfo.estateSettings.terrainBase3;
450 handshake.RegionInfo.TerrainDetail0 = regionInfo.m_regInfo.estateSettings.terrainDetail0;
451 handshake.RegionInfo.TerrainDetail1 = regionInfo.m_regInfo.estateSettings.terrainDetail1;
452 handshake.RegionInfo.TerrainDetail2 = regionInfo.m_regInfo.estateSettings.terrainDetail2;
453 handshake.RegionInfo.TerrainDetail3 = regionInfo.m_regInfo.estateSettings.terrainDetail3;
454 handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
455
456 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet");
457 this.ControllingClient.OutPacket(handshake);
458 }
459 410
460 public static void LoadAnims() 411 public static void LoadAnims()
461 { 412 {
diff --git a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs
index 6d432f1..8620e8c 100644
--- a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs
+++ b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs
@@ -562,7 +562,6 @@ namespace OpenSim.RegionServer.Simulator
562 updatePacket.ParcelData.TotalPrims = 0; //unemplemented 562 updatePacket.ParcelData.TotalPrims = 0; //unemplemented
563 updatePacket.ParcelData.UserLocation = parcelData.userLocation; 563 updatePacket.ParcelData.UserLocation = parcelData.userLocation;
564 updatePacket.ParcelData.UserLookAt = parcelData.userLookAt; 564 updatePacket.ParcelData.UserLookAt = parcelData.userLookAt;
565
566 remote_client.OutPacket((Packet)updatePacket); 565 remote_client.OutPacket((Packet)updatePacket);
567 } 566 }
568 567
@@ -588,6 +587,15 @@ namespace OpenSim.RegionServer.Simulator
588 parcelData.snapshotID = packet.ParcelData.SnapshotID; 587 parcelData.snapshotID = packet.ParcelData.SnapshotID;
589 parcelData.userLocation = packet.ParcelData.UserLocation; 588 parcelData.userLocation = packet.ParcelData.UserLocation;
590 parcelData.userLookAt = packet.ParcelData.UserLookAt; 589 parcelData.userLookAt = packet.ParcelData.UserLookAt;
590
591 foreach (Avatar av in m_world.Avatars.Values)
592 {
593 Parcel over = m_world.parcelManager.getParcel((int)Math.Round(av.Pos.X), (int)Math.Round(av.Pos.Y));
594 if (over == this)
595 {
596 sendParcelProperties(0, false, 0, av.ControllingClient);
597 }
598 }
591 } 599 }
592 } 600 }
593 #endregion 601 #endregion
diff --git a/OpenSim/OpenSim.RegionServer/Simulator/World.cs b/OpenSim/OpenSim.RegionServer/Simulator/World.cs
index dda8ac4..765c74e 100644
--- a/OpenSim/OpenSim.RegionServer/Simulator/World.cs
+++ b/OpenSim/OpenSim.RegionServer/Simulator/World.cs
@@ -627,19 +627,18 @@ namespace OpenSim.RegionServer.Simulator
627 try 627 try
628 { 628 {
629 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); 629 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
630 newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20); 630 newAvatar = new Avatar(agentClient, this);
631 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Adding new avatar to world"); 631 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Adding new avatar to world");
632 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Starting RegionHandshake "); 632 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Starting RegionHandshake ");
633 newAvatar.SendRegionHandshake(this); 633 estateManager.sendRegionHandshake(newAvatar.ControllingClient);
634 //if (!agentClient.m_child)
635 //{
636 634
637 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); 635 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
638 lock (this.LockPhysicsEngine) 636 lock (this.LockPhysicsEngine)
639 { 637 {
640 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); 638 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec);
641 } 639 }
642 // } 640
641
643 lock (Entities) 642 lock (Entities)
644 { 643 {
645 if (!Entities.ContainsKey(agentClient.AgentID)) 644 if (!Entities.ContainsKey(agentClient.AgentID))