public string Connect(string server, string login, string pass, int port) { string s; string mes = string.Empty; client = new TcpClient(server, port); client.ReceiveTimeout = 5000; try { networkStream = client.GetStream(); streamReader = new StreamReader(networkStream); state = connectState.AUTHORISATION; mes += streamReader.ReadLine() + CRLF; s = send("USER " + login); mes += s + " login ok" + CRLF; s = send("PASS " + pass); mes += s + " pasy ok" + CRLF; s = send("STAT"); mes += s + CRLF; state = connectState.TRANSACTION; return(mes); } catch (Exception err) { return("Error: " + err.ToString()); } }
// Update is called once per frame void Update() { if (thisConnectState == connectState.ConnectionMade) { Debug.Log (this + " is connected"); thisConnectState = SimpleDragDrop.connectState.Connected; renderer.material.SetTextureOffset("_MainTex", new Vector2(0.5f,0f)); } }