Skip to content

Commit

Permalink
3.0.5470.15461
Browse files Browse the repository at this point in the history
  • Loading branch information
Icehunter committed Dec 23, 2014
1 parent 166b4e3 commit 4adf758
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 25 deletions.
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Memory/PlayerInfoWorker.cs
Expand Up @@ -129,7 +129,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
var address = enmityStructure + (i * 72);
var enmityEntry = new EnmityEntry
{
ID = (uint)MemoryHandler.Instance.GetInt32(address),
ID = (uint) MemoryHandler.Instance.GetInt32(address),
Name = MemoryHandler.Instance.GetString(address + 4),
Enmity = (uint) MemoryHandler.Instance.GetInt16(address + 68)
};
Expand Down
4 changes: 2 additions & 2 deletions FFXIVAPP.Client/Models/PluginDownloadItem.cs
Expand Up @@ -36,11 +36,11 @@ namespace FFXIVAPP.Client.Models
public class PluginDownloadItem : INotifyPropertyChanged
{
private string _currentVersion;
private string _description;
private List<PluginFile> _files;
private string _friendlyName;
private string _latestVersion;
private string _name;
private string _friendlyName;
private string _description;
private string _sourceUri;
private PluginStatus _status;

Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Models/PluginFile.cs
Expand Up @@ -34,9 +34,9 @@ namespace FFXIVAPP.Client.Models
{
public class PluginFile : INotifyPropertyChanged
{
private string _checksum;
private string _location;
private string _name;
private string _checksum;

public string Name
{
Expand Down
68 changes: 47 additions & 21 deletions FFXIVAPP.Client/Utilities/UpdateUtilities.cs
@@ -1,4 +1,33 @@
using System;
// FFXIVAPP.Client
// UpdateUtilities.cs
//
// Copyright © 2007 - 2014 Ryan Wilson - All Rights Reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of SyndicatedLife nor the names of its contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
Expand All @@ -8,53 +37,50 @@ namespace FFXIVAPP.Client.Utilities
public static class UpdateUtilities
{
/// <summary>
/// Compares a file against an expected checksum.
/// Compares a file against an expected checksum.
/// </summary>
/// <param name="FilePath">Path to file</param>
/// <param name="Checksum">Expected MD5 checksum</param>
/// <param name="filePath">Path to file</param>
/// <param name="checksum">Expected MD5 checksum</param>
/// <returns>True if the file matches. False if the file doesn't match OR doesn't exist.</returns>
public static bool VerifyFile(string FilePath, string Checksum)
public static bool VerifyFile(string filePath, string checksum)
{
if (!File.Exists(FilePath))
if (!File.Exists(filePath))
{
return false;
}

return GetFileHash(FilePath).Equals(Checksum, StringComparison.OrdinalIgnoreCase);
return GetFileHash(filePath)
.Equals(checksum, StringComparison.OrdinalIgnoreCase);
}

/// <summary>
/// Computes a file's checksum
/// Computes a file's checksum
/// </summary>
/// <param name="FilePath">Path to file</param>
/// <param name="filePath">Path to file</param>
/// <returns>MD5 checksum for the file, or an empty string if the file doesn't exist.</returns>
public static string GetFileHash(string FilePath)
public static string GetFileHash(string filePath)
{
string FileHash = "";
var FileHash = "";

if (!File.Exists(FilePath))
if (!File.Exists(filePath))
{
return FileHash;
}

using (FileStream file = new FileStream(FilePath, FileMode.Open, FileAccess.Read))
using (var file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
{
using (MD5 md5 = new MD5CryptoServiceProvider())
{
byte[] retVal = md5.ComputeHash(file);
var retVal = md5.ComputeHash(file);
file.Close();

StringBuilder sb = new StringBuilder();
for (int i = 0; i < retVal.Length; i++)
var sb = new StringBuilder();
foreach (var t in retVal)
{
sb.Append(retVal[i].ToString("x2"));
sb.Append(t.ToString("x2"));
}
FileHash = sb.ToString();
}
}

return FileHash;
}

}
}
Binary file modified distribution/FFXIVAPP.Client.exe
Binary file not shown.
Binary file modified distribution/FFXIVAPP.Common.dll
Binary file not shown.
Binary file modified distribution/FFXIVAPP.IPluginInterface.dll
Binary file not shown.
Binary file modified distribution/FFXIVAPP.Localization.dll
Binary file not shown.
Binary file modified distribution/FFXIVAPP.Updater.exe
Binary file not shown.
Binary file modified distribution/MahApps.Metro.dll
Binary file not shown.

0 comments on commit 4adf758

Please sign in to comment.