AnimatorClient.AnimatorClient.GetAnimations C# (CSharp) Method

GetAnimations() public method

Downloads the list of animations from the server. It will not send any animations that have the an MD5 hash given.
public GetAnimations ( List currentAnimations ) : List
currentAnimations List A list of animations that have already been downloaded
return List
        public List<Animation> GetAnimations(List<Animation> currentAnimations)
        {
            TcpClient tcpClient = new TcpClient();
            try
            {
                // Try to connect to the server
                tcpClient.Connect(this.ServerAddress, this.ServerPort);

                // Send the get uploaded animations command
                CommandHandler.SendCommand(tcpClient.GetStream(), Command.GetUploadedAnimations);

                // Get the animations from the server
                BinaryFormatter binaryFormatter = new BinaryFormatter();
                List<Animation> animations = (List<Animation>)binaryFormatter.Deserialize(tcpClient.GetStream());

                // Close the connection
                tcpClient.Close();

                return new List<Animation>(animations);
            }
            catch (SocketException se)
            {
                throw new InvalidOperationException("Could not connect to server", se);
            }
        }