Example #1
0
        //public static int SendReceiveTest1(Socket client)
        //{
        //    Socket socketSender = new Socket(AddressFamily.InterNetwork,
        //        SocketType.Stream, ProtocolType.Tcp);
        //    byte[] msg = System.Text.Encoding.ASCII.GetBytes("This is a test");
        //    int bytesSent = socketSender.Send(msg);
        //
        //    return 0;
        //}


        public void HandleIncomingCtrlLvlPacket(PacketHeader header, Connection connection, string incomingString)
        {
            /*if (checkBox1.Checked == true)
             * {
             *
             * }*/
            //NetManager propTest = new NetManager();
            MessagesClass propTest = new MessagesClass();

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


            if (incomingString == "GET_CTRL_LEVEL")
            {
                //if (_checkSwitch == true)
                if (checkBox1.Checked == true)
                {
                    propTest.sendMessages("CTRL_LEVEL_NORMAL", "CtrlLvl");
                }
                else
                {
                    //MessagesClass propTest = new MessagesClass();

                    propTest.sendMessages("CTRL_LEVEL_VIEWONLY", "CtrlLvl");
                }
            }
        }
Example #2
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            //_checkSwitch = !_checkSwitch;

            MessagesClass propTest = new MessagesClass();

            if (_networkConnection == true)
            {
                //if (_checkSwitch == true)
                if (checkBox1.Checked == true)
                {
                    propTest.sendMessages("CTRL_LEVEL_NORMAL", "CtrlLvl");
                }
                else
                {
                    //MessagesClass propTest = new MessagesClass();

                    propTest.sendMessages("CTRL_LEVEL_VIEWONLY", "CtrlLvl");
                }
            }
        }
Example #3
0
        public void GetCtrlLvl()
        {
            MessagesClass propTest = new MessagesClass();

            propTest.sendMessages("GET_CTRL_LEVEL", "CtrlLvl");
        }