Exemplo n.º 1
0
 public void Write(string message)
 {
     try
     {
         XSocket.Write(message);
     }
     catch (Exception)
     {
         Console.WriteLine("Error writing to BOT (Helper)");
     }
 }
Exemplo n.º 2
0
        private void XSocketOnReceive(object sender, EventArgs eventArgs)
        {
            var stringArgs = (StringArgs)eventArgs;
            var packet     = stringArgs.Packet;

            const string policyPacket = "<?xml version=\"1.0\"?>\r\n" +
                                        "<!DOCTYPE cross-domain-policy SYSTEM \"/xml/dtds/cross-domain-policy.dtd\">\r\n" +
                                        "<cross-domain-policy>\r\n" +
                                        "<allow-access-from domain=\"*\" to-ports=\"*\" />\r\n" +
                                        "</cross-domain-policy>";

            if (packet.StartsWith("<policy-file-request/>"))
            {
                XSocket.Write(policyPacket);
            }
            else
            {
                Packet.Handler.Handle(this, packet);
            }
        }
Exemplo n.º 3
0
        private void XSocketOnOnReceive(object sender, EventArgs eventArgs)
        {
            var packet = ((StringArgs)eventArgs).Packet;

            const string policyPacket = "<?xml version=\"1.0\"?>\r\n" +
                                        "<!DOCTYPE cross-domain-policy SYSTEM \"/xml/dtds/cross-domain-policy.dtd\">\r\n" +
                                        "<cross-domain-policy>\r\n" +
                                        "<allow-access-from domain=\"*\" to-ports=\"*\" />\r\n" +
                                        "</cross-domain-policy>";

            if (packet.StartsWith("<policy-file-request/>"))
            {
                XSocket.Write(policyPacket);
            }
            else
            {
                var ip = XSocket.IpEndPoint.Address.ToString();
                Out.QuickLog("Error with policy request: " + packet + " [" + ip + "]");
                Console.WriteLine("Errorino with policy request: {0}, [{1}]", packet, ip);
            }
        }