Exemplo n.º 1
0
        void network_OnTextRecieved(string input, byte[] byteInput, System.Net.Sockets.Socket client)
        {
            Translator tr = new Translator();
            Command com = tr.getCommand(byteInput);

            if (com.command == "response")
            {
                int UID = (int)com.Arguments[0];
                response.Add(UID, com);
            }
        }
Exemplo n.º 2
0
        public void TCP_TextRecieved(string input, byte[] byteInput, System.Net.Sockets.TcpClient client)
        {
            Translator tr = new Translator();
            Command com = tr.getCommand(byteInput);

            string arguments = "";
            foreach (Object ob in com.Arguments)
            {
                arguments += ob.ToString() + ", ";
            }

            log("Command Recieved: " + com.command + " (" + arguments + ")");

            if (com.command == "response")
            {
                int UID = (int)com.Arguments[0];
                response.Add(UID, com);
            }
            else
            {
                Command response = handleRequest(com, client);

                network.TCP_SendByteStream(tr.writeCommand(response), client);
            }
        }