예제 #1
0
        public void HandleIncomingPacket_XMLFetch(PacketHeader header, Connection connection, string incomingString)
        {
            //NetManager propTest = new NetManager();
            MessagesClass propTest = new MessagesClass();

            //WinViewer.WinViewer winViewer = new WinViewer.WinViewer();
            Console.WriteLine("\n  ... Incoming message from " + connection.ToString() + " saying '" + incomingString + "'.");

            string passMessage = File.ReadLines("inv.xml").First();

            propTest.sendMessages(passMessage, "XMLInfo");
        }
예제 #2
0
        public void HandleIncomingPacket_DecAddFin(PacketHeader header, Connection connection, string incomingString)
        {
            //NetManager propTest = new NetManager();
            MessagesClass propTest = new MessagesClass();

            //WinViewer.WinViewer winViewer = new WinViewer.WinViewer();
            Console.WriteLine("\n  ... Incoming message from " + connection.ToString() + " saying '" + incomingString + "'.");


            TextWriter twMonPos = File.CreateText("monPosition.xml");

            twMonPos.Close();

            propTest.sendMessages("", "XMLFetch");
        }
예제 #3
0
        public void HandleIncomingPacket_XMLInfo(PacketHeader header, Connection connection, string incomingString)
        {
            //NetManager propTest = new NetManager();
            MessagesClass propTest = new MessagesClass();

            //WinViewer.WinViewer winViewer = new WinViewer.WinViewer();
            Console.WriteLine("\n  ... Incoming message from " + connection.ToString() + " saying '" + incomingString + "'.");

            /*TextWriter tw = File.CreateText("inv.xml");
             * tw.WriteLine(incomingString);
             * tw.Close();*/

            using (StreamWriter swXMLInfo = new StreamWriter("inv.xml", true))
            {
                swXMLInfo.WriteLine(incomingString);
            }

            propTest.sendMessages("", "MONFetch");
        }
예제 #4
0
        public void HandleIncomingPacket_MONFetch(PacketHeader header, Connection connection, string incomingString)
        {
            //NetManager propTest = new NetManager();
            MessagesClass propTest = new MessagesClass();

            //WinViewer.WinViewer winViewer = new WinViewer.WinViewer();
            Console.WriteLine("\n  ... Incoming message from " + connection.ToString() + " saying '" + incomingString + "'.");

            string monPos = System.Windows.Forms.Screen.AllScreens.ToString();

            //TextWriter tw = File.CreateText("monPos.txt");
            //tw.WriteLine(monPos);

            foreach (var screen in System.Windows.Forms.Screen.AllScreens)
            {
                //tw2.WriteLine(screen.Bounds.ToString());
                monPos = screen.Bounds.ToString();
                propTest.sendMessages(monPos, "MONPos");
            }

            //tw.Close();
        }
예제 #5
0
        public void HandleIncomingPacket_DecAdd(PacketHeader header, Connection connection, string incomingString)
        {
            //NetManager propTest = new NetManager();
            MessagesClass propTest = new MessagesClass();

            //WinViewer.WinViewer winViewer = new WinViewer.WinViewer();
            Console.WriteLine("\n  ... Incoming message from " + connection.ToString() + " saying '" + incomingString + "'.");

            string[] splitAddress       = connection.ToString().Split('>');
            string   halfDecodedAddress = splitAddress[1];

            string[] splitAddress1  = halfDecodedAddress.ToString().Split('(');
            string   decodedAddress = splitAddress1[0];
            string   peerAddress    = decodedAddress.Replace(" ", "");

            TextWriter tw = File.CreateText("peerAddress.txt");

            tw.WriteLine(peerAddress);
            tw.Close();

            Console.WriteLine("decodeAddress");
            propTest.sendMessages("", "DecAddFin");
        }