aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/CheckSumServer.cs100
1 files changed, 0 insertions, 100 deletions
diff --git a/OpenSim/Framework/Servers/CheckSumServer.cs b/OpenSim/Framework/Servers/CheckSumServer.cs
index 86bdfba..63059f0 100644
--- a/OpenSim/Framework/Servers/CheckSumServer.cs
+++ b/OpenSim/Framework/Servers/CheckSumServer.cs
@@ -24,103 +24,3 @@
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27
28namespace OpenSim.Framework.Servers
29{
30 /*
31 public class CheckSumServer : UDPServerBase
32 {
33 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
34
35 public CheckSumServer(int port)
36 : base(port)
37 {
38 }
39
40 protected override void OnReceivedData(IAsyncResult result)
41 {
42 ipeSender = new IPEndPoint(IPAddress.Any, 0);
43 epSender = (EndPoint)ipeSender;
44 Packet packet = null;
45 int numBytes = Server.EndReceiveFrom(result, ref epSender);
46 int packetEnd = numBytes - 1;
47
48 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
49
50 if (packet.Type == PacketType.SecuredTemplateChecksumRequest)
51 {
52 SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet;
53 TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket();
54 checkreply.DataBlock.Checksum = 3220703154;//180572585;
55 checkreply.DataBlock.Flags = 0;
56 checkreply.DataBlock.MajorVersion = 1;
57 checkreply.DataBlock.MinorVersion = 15;
58 checkreply.DataBlock.PatchVersion = 0;
59 checkreply.DataBlock.ServerVersion = 0;
60 checkreply.TokenBlock.Token = checksum.TokenBlock.Token;
61 this.SendPacket(checkreply, epSender);
62
63 /*
64 //if we wanted to echo the the checksum/ version from the client (so that any client worked)
65 SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket();
66 checkrequest.TokenBlock.Token = checksum.TokenBlock.Token;
67 this.SendPacket(checkrequest, epSender);
68
69 }
70 else if (packet.Type == PacketType.TemplateChecksumReply)
71 {
72 //echo back the client checksum reply (Hegemon's method)
73 TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet;
74 TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket();
75 checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum;
76 checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags;
77 checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion;
78 checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion;
79 checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion;
80 checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion;
81 checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token;
82 this.SendPacket(checkreply2, epSender);
83 }
84 else
85 {
86 }
87
88 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
89 }
90
91 private void SendPacket(Packet Pack, EndPoint endp)
92 {
93 if (!Pack.Header.Resent)
94 {
95 Pack.Header.Sequence = 1;
96 }
97
98 byte[] ZeroOutBuffer = new byte[4096];
99 byte[] sendbuffer;
100 sendbuffer = Pack.ToBytes();
101
102 try
103 {
104 if (Pack.Header.Zerocoded)
105 {
106 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
107 this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp);
108 }
109 else
110 {
111 this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp);
112 }
113 }
114 catch (Exception)
115 {
116 m_log.Warn("CheckSumServer.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection ");
117 }
118 }
119
120 private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp)
121 {
122 this.Server.SendTo(buffer, size, flags, endp);
123 }
124 * }
125 */
126}