Ejemplo n.º 1
0
        //??
        Stream WriteConnectCommand(string debuggerAddress, Int32 debuggerPort, string clientName)
        {
            try
            {
                Stream       stream = new MemoryStream();
                BinaryWriter writer = NetServiceConnection.GetBinaryWriter(stream);

                CTSPacketHeader header = new CTSPacketHeader(writer, (byte)ServiceListPacketTypes.cCommand);

                writer.Write((int)ListCommands.cConnect);
                writer.Write(clientName);
                writer.Write(debuggerAddress);
                writer.Write(debuggerPort);

                //-- get the size
                header.writeSize(writer);

                return(stream);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                return(null);
            }
        }
Ejemplo n.º 2
0
        // write
        public DettachDebugger(Stream stream)
        {
            try
            {
                //BinaryWriter writer = new BinaryWriter(stream, System.Text.Encoding.Unicode);
                BinaryWriter writer = NetServiceConnection.GetBinaryWriter(stream);


                CTSPacketHeader header = new CTSPacketHeader(writer, (byte)GameAppDebuggerPacketTypes.cDebuggerDettach);

                //-- get the size
                header.writeSize(writer);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Ejemplo n.º 3
0
        // read
        //public void ParseServiceCommand(BinaryReader reader)
        //{
        //   try
        //   {
        //      ListCommands command = (ListCommands)reader.ReadInt32();

        //      if (command == ListCommands.cConnect)
        //      {


        //         //mClientName = reader.ReadString();
        //         //mDebuggerAddress = reader.ReadString();
        //         //mDebuggerPort = reader.ReadInt32();
        //      }
        //   }
        //   catch (Exception e)
        //   {
        //      Console.WriteLine(e.ToString());
        //   }
        //}

        Stream WriteListCommand()
        {
            try
            {
                Stream       stream = new MemoryStream();
                BinaryWriter writer = NetServiceConnection.GetBinaryWriter(stream);

                CTSPacketHeader header = new CTSPacketHeader(writer, (byte)ServiceListPacketTypes.cCommand);

                writer.Write((int)ListCommands.cGetList);

                //-- get the size
                header.writeSize(writer);
                return(stream);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                return(null);
            }
        }