aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
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
parentFixed SimpleApp - aka thankgoditssundaycommit (diff)
downloadopensim-SC-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.zip
opensim-SC-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.gz
opensim-SC-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.bz2
opensim-SC-06a8c132005b4ab804f25d54c0c0f899fc98e3a1.tar.xz
MAJOR IP RESTRUCTURING
* moving towards IPEndPoints all over the place * trying to make the internal/external division
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs18
-rw-r--r--OpenSim/Region/ClientStack/PacketServer.cs4
-rw-r--r--OpenSim/Region/ClientStack/UDPServer.cs2
3 files changed, 13 insertions, 11 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);
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs
index ffd254e..6f20413 100644
--- a/OpenSim/Region/ClientStack/PacketServer.cs
+++ b/OpenSim/Region/ClientStack/PacketServer.cs
@@ -44,12 +44,10 @@ namespace OpenSim.Region.ClientStack
44 private IWorld _localWorld; 44 private IWorld _localWorld;
45 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); 45 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
46 public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>(); 46 public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>();
47 protected uint serverPort;
48 47
49 public PacketServer(ClientStackNetworkHandler networkHandler, uint port) 48 public PacketServer(ClientStackNetworkHandler networkHandler)
50 { 49 {
51 _networkHandler = networkHandler; 50 _networkHandler = networkHandler;
52 this.serverPort = port;
53 _networkHandler.RegisterPacketServer(this); 51 _networkHandler.RegisterPacketServer(this);
54 } 52 }
55 53
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs
index b764519..8ad5332 100644
--- a/OpenSim/Region/ClientStack/UDPServer.cs
+++ b/OpenSim/Region/ClientStack/UDPServer.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.ClientStack
107 107
108 protected virtual void CreatePacketServer() 108 protected virtual void CreatePacketServer()
109 { 109 {
110 PacketServer packetServer = new PacketServer(this, (uint) listenPort); 110 PacketServer packetServer = new PacketServer(this);
111 } 111 }
112 112
113 protected virtual void OnReceivedData(IAsyncResult result) 113 protected virtual void OnReceivedData(IAsyncResult result)