aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.API.cs
diff options
context:
space:
mode:
authorlbsa712007-07-01 16:07:41 +0000
committerlbsa712007-07-01 16:07:41 +0000
commit06a8c132005b4ab804f25d54c0c0f899fc98e3a1 (patch)
tree2210d9426050c11035453631735fb1f324a070a7 /OpenSim/Region/ClientStack/ClientView.API.cs
parentFixed SimpleApp - aka thankgoditssundaycommit (diff)
downloadopensim-SC_OLD-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.zip
opensim-SC_OLD-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.gz
opensim-SC_OLD-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.bz2
opensim-SC_OLD-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.xz
MAJOR IP RESTRUCTURING
* moving towards IPEndPoints all over the place * trying to make the internal/external division
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.API.cs')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs18
1 files changed, 11 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 9650b42..e683db2 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -34,6 +34,7 @@ using OpenSim.Framework.Types;
34 34
35using libsecondlife; 35using libsecondlife;
36using libsecondlife.Packets; 36using libsecondlife.Packets;
37using System.Net;
37 38
38namespace OpenSim.Region.ClientStack 39namespace OpenSim.Region.ClientStack
39{ 40{
@@ -293,8 +294,11 @@ namespace OpenSim.Region.ClientStack
293 /// <param name="neighbourHandle"></param> 294 /// <param name="neighbourHandle"></param>
294 /// <param name="neighbourIP"></param> 295 /// <param name="neighbourIP"></param>
295 /// <param name="neighbourPort"></param> 296 /// <param name="neighbourPort"></param>
296 public void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort) 297 public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint )
297 { 298 {
299 System.Net.IPAddress neighbourIP = neighbourEndPoint.Address;
300 ushort neighbourPort = (ushort) neighbourEndPoint.Port;
301
298 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); 302 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
299 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); 303 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
300 enablesimpacket.SimulatorInfo.Handle = neighbourHandle; 304 enablesimpacket.SimulatorInfo.Handle = neighbourHandle;
@@ -326,7 +330,7 @@ namespace OpenSim.Region.ClientStack
326 return agentData; 330 return agentData;
327 } 331 }
328 332
329 public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort) 333 public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint externalIPEndPoint)
330 { 334 {
331 LLVector3 look = new LLVector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10); 335 LLVector3 look = new LLVector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10);
332 336
@@ -339,12 +343,12 @@ namespace OpenSim.Region.ClientStack
339 newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! 343 newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!!
340 newSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock(); 344 newSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock();
341 newSimPack.RegionData.RegionHandle = newRegionHandle; 345 newSimPack.RegionData.RegionHandle = newRegionHandle;
342 byte[] byteIP = newRegionIP.GetAddressBytes(); 346 byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes();
343 newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; 347 newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24;
344 newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16; 348 newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16;
345 newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; 349 newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8;
346 newSimPack.RegionData.SimIP += (uint)byteIP[0]; 350 newSimPack.RegionData.SimIP += (uint)byteIP[0];
347 newSimPack.RegionData.SimPort = newRegionPort; 351 newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port;
348 newSimPack.RegionData.SeedCapability = new byte[0]; 352 newSimPack.RegionData.SeedCapability = new byte[0];
349 353
350 this.OutPacket(newSimPack); 354 this.OutPacket(newSimPack);
@@ -386,7 +390,7 @@ namespace OpenSim.Region.ClientStack
386 OutPacket(tpLocal); 390 OutPacket(tpLocal);
387 } 391 }
388 392
389 public void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags) 393 public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags)
390 { 394 {
391 TeleportFinishPacket teleport = new TeleportFinishPacket(); 395 TeleportFinishPacket teleport = new TeleportFinishPacket();
392 teleport.Info.AgentID = this.AgentID; 396 teleport.Info.AgentID = this.AgentID;
@@ -394,7 +398,7 @@ namespace OpenSim.Region.ClientStack
394 teleport.Info.SimAccess = simAccess; 398 teleport.Info.SimAccess = simAccess;
395 teleport.Info.SeedCapability = new byte[0]; 399 teleport.Info.SeedCapability = new byte[0];
396 400
397 System.Net.IPAddress oIP = System.Net.IPAddress.Parse(ipAddress); 401 IPAddress oIP = newRegionEndPoint.Address;
398 byte[] byteIP = oIP.GetAddressBytes(); 402 byte[] byteIP = oIP.GetAddressBytes();
399 uint ip = (uint)byteIP[3] << 24; 403 uint ip = (uint)byteIP[3] << 24;
400 ip += (uint)byteIP[2] << 16; 404 ip += (uint)byteIP[2] << 16;
@@ -402,7 +406,7 @@ namespace OpenSim.Region.ClientStack
402 ip += (uint)byteIP[0]; 406 ip += (uint)byteIP[0];
403 407
404 teleport.Info.SimIP = ip; 408 teleport.Info.SimIP = ip;
405 teleport.Info.SimPort = ipPort; 409 teleport.Info.SimPort = (ushort)newRegionEndPoint.Port;
406 teleport.Info.LocationID = 4; 410 teleport.Info.LocationID = 4;
407 teleport.Info.TeleportFlags = 1 << 4; 411 teleport.Info.TeleportFlags = 1 << 4;
408 OutPacket(teleport); 412 OutPacket(teleport);