Пример #1
0
        public static void StartListen()
        {
            Console.WriteLine("Listening...");
            listener.Start();
            isListening = true;

            while (isListening)
            {
                TcpClient client = listener.AcceptTcpClient();

                NetworkStream nwStream = client.GetStream();
                byte[]        buffer   = new byte[client.ReceiveBufferSize];

                int bytesRead = nwStream.Read(buffer, 0, client.ReceiveBufferSize);

                string dataReceived = Encoding.ASCII.GetString(buffer, 0, bytesRead);
                var    args         = dataReceived.Split('-');
                Console.WriteLine("Received: " + dataReceived);

                DestinyAPI.TransferItem(args[0], args[1], "true");
                DestinyAPI.TransferItem(args[0], args[2], "false");

                Reply("Item transfered", ref nwStream);
            }
            listener.Stop();
        }
Пример #2
0
 static DestinyAPI()
 {
     DestinyAPI.GetId();
     DestinyAPI.GetCharacterId();
 }