aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Servers
diff options
context:
space:
mode:
authorMW2007-05-19 18:32:01 +0000
committerMW2007-05-19 18:32:01 +0000
commit274ce6987e0b017800ddb62fe65143e0d5e1cae5 (patch)
tree4842cdbb9e209451136b1ab9149da5d5dd84db70 /OpenSim.Servers
parent(no commit message) (diff)
downloadopensim-SC-274ce6987e0b017800ddb62fe65143e0d5e1cae5.zip
opensim-SC-274ce6987e0b017800ddb62fe65143e0d5e1cae5.tar.gz
opensim-SC-274ce6987e0b017800ddb62fe65143e0d5e1cae5.tar.bz2
opensim-SC-274ce6987e0b017800ddb62fe65143e0d5e1cae5.tar.xz
Border crossing back to mostly working, still seems a problem in that you need to stop walking just after you cross the border for it to work properly (else you will continue moving into a negative position in the first sim)
Diffstat (limited to 'OpenSim.Servers')
-rw-r--r--OpenSim.Servers/CheckSumServer.cs34
-rw-r--r--OpenSim.Servers/UDPServerBase.cs9
2 files changed, 15 insertions, 28 deletions
diff --git a/OpenSim.Servers/CheckSumServer.cs b/OpenSim.Servers/CheckSumServer.cs
index f0b4124..ae1724f 100644
--- a/OpenSim.Servers/CheckSumServer.cs
+++ b/OpenSim.Servers/CheckSumServer.cs
@@ -17,12 +17,11 @@ namespace OpenSim.Servers
17{ 17{
18 public class CheckSumServer : UDPServerBase 18 public class CheckSumServer : UDPServerBase
19 { 19 {
20 protected ConsoleBase m_console; 20 //protected ConsoleBase m_console;
21 21
22 public CheckSumServer(int port, ConsoleBase console) 22 public CheckSumServer(int port)
23 : base(port)
23 { 24 {
24 listenPort = port;
25 this.m_console = console;
26 } 25 }
27 26
28 protected override void OnReceivedData(IAsyncResult result) 27 protected override void OnReceivedData(IAsyncResult result)
@@ -35,10 +34,8 @@ namespace OpenSim.Servers
35 34
36 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); 35 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
37 36
38 // do we already have a circuit for this endpoint
39 if (packet.Type == PacketType.SecuredTemplateChecksumRequest) 37 if (packet.Type == PacketType.SecuredTemplateChecksumRequest)
40 { 38 {
41
42 SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet; 39 SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet;
43 TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket(); 40 TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket();
44 checkreply.DataBlock.Checksum = 180572585; 41 checkreply.DataBlock.Checksum = 180572585;
@@ -55,23 +52,21 @@ namespace OpenSim.Servers
55 SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket(); 52 SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket();
56 checkrequest.TokenBlock.Token = checksum.TokenBlock.Token; 53 checkrequest.TokenBlock.Token = checksum.TokenBlock.Token;
57 this.SendPacket(checkrequest, epSender); 54 this.SendPacket(checkrequest, epSender);
58 */ 55 */
59
60 } 56 }
61 else if (packet.Type == PacketType.TemplateChecksumReply) 57 else if (packet.Type == PacketType.TemplateChecksumReply)
62 { 58 {
63 //echo back the client checksum reply (Hegemon's method) 59 //echo back the client checksum reply (Hegemon's method)
64 TemplateChecksumReplyPacket checksum = (TemplateChecksumReplyPacket)packet; 60 TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet;
65 TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket(); 61 TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket();
66 checkreply2.DataBlock.Checksum = checksum.DataBlock.Checksum; 62 checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum;
67 checkreply2.DataBlock.Flags = checksum.DataBlock.Flags; 63 checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags;
68 checkreply2.DataBlock.MajorVersion = checksum.DataBlock.MajorVersion; 64 checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion;
69 checkreply2.DataBlock.MinorVersion = checksum.DataBlock.MinorVersion; 65 checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion;
70 checkreply2.DataBlock.PatchVersion = checksum.DataBlock.PatchVersion; 66 checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion;
71 checkreply2.DataBlock.ServerVersion = checksum.DataBlock.ServerVersion; 67 checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion;
72 checkreply2.TokenBlock.Token = checksum.TokenBlock.Token; 68 checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token;
73 this.SendPacket(checkreply2, epSender); 69 this.SendPacket(checkreply2, epSender);
74
75 } 70 }
76 else 71 else
77 { 72 {
@@ -80,16 +75,13 @@ namespace OpenSim.Servers
80 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); 75 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
81 } 76 }
82 77
83
84 private void SendPacket(Packet Pack, EndPoint endp) 78 private void SendPacket(Packet Pack, EndPoint endp)
85 { 79 {
86 if (!Pack.Header.Resent) 80 if (!Pack.Header.Resent)
87 { 81 {
88 // Set the sequence number
89
90 Pack.Header.Sequence = 1; 82 Pack.Header.Sequence = 1;
91
92 } 83 }
84
93 byte[] ZeroOutBuffer = new byte[4096]; 85 byte[] ZeroOutBuffer = new byte[4096];
94 byte[] sendbuffer; 86 byte[] sendbuffer;
95 sendbuffer = Pack.ToBytes(); 87 sendbuffer = Pack.ToBytes();
diff --git a/OpenSim.Servers/UDPServerBase.cs b/OpenSim.Servers/UDPServerBase.cs
index e7feb01..a308052 100644
--- a/OpenSim.Servers/UDPServerBase.cs
+++ b/OpenSim.Servers/UDPServerBase.cs
@@ -24,8 +24,9 @@ namespace OpenSim.Servers
24 protected AsyncCallback ReceivedData; 24 protected AsyncCallback ReceivedData;
25 protected int listenPort; 25 protected int listenPort;
26 26
27 public UDPServerBase() 27 public UDPServerBase(int port)
28 { 28 {
29 listenPort = port;
29 } 30 }
30 31
31 protected virtual void OnReceivedData(IAsyncResult result) 32 protected virtual void OnReceivedData(IAsyncResult result)
@@ -38,8 +39,6 @@ namespace OpenSim.Servers
38 39
39 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); 40 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
40 41
41
42
43 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); 42 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
44 } 43 }
45 44
@@ -60,14 +59,10 @@ namespace OpenSim.Servers
60 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); 59 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
61 } 60 }
62 61
63
64 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) 62 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
65 { 63 {
66 // find the endpoint for this circuit
67 64
68 } 65 }
69
70
71 } 66 }
72} 67}
73 68