예제 #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);
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: MRH4287/GameServer
        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);
            }
        }