diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim.Servers/CheckSumServer.cs | 34 |
1 files changed, 13 insertions, 21 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(); |