forked from sin365/AxibugEmuOnline
Compare commits
No commits in common. "e1fb708d6ee4ff841586988b577b69eb1087534c" and "c47b241e429436aa31b1b88165a973da5d98cab3" have entirely different histories.
e1fb708d6e
...
c47b241e42
@ -1,7 +1,6 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using AxibugEmuOnline.Client.Network;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
@ -32,11 +31,8 @@ namespace AxibugEmuOnline.Client.ClientCore
|
||||
private static CoroutineRunner coRunner;
|
||||
#endregion
|
||||
|
||||
#if UNITY_PSP2
|
||||
public static string PersistentDataPath => "ux0:data/AxibugEmu";
|
||||
#else
|
||||
|
||||
public static string PersistentDataPath => Application.persistentDataPath;
|
||||
#endif
|
||||
|
||||
[RuntimeInitializeOnLoadMethod]
|
||||
static void Init()
|
||||
@ -60,12 +56,6 @@ namespace AxibugEmuOnline.Client.ClientCore
|
||||
tickLoop = go.AddComponent<TickLoop>();
|
||||
coRunner = go.AddComponent<CoroutineRunner>();
|
||||
|
||||
if (UnityEngine.Application.platform == RuntimePlatform.PSP2)
|
||||
{
|
||||
//PSV 等平台需要手动创建目录
|
||||
PersistentDataPathDir();
|
||||
}
|
||||
|
||||
var importNode = GameObject.Find("IMPORTENT");
|
||||
if (importNode != null) GameObject.DontDestroyOnLoad(importNode);
|
||||
|
||||
@ -73,14 +63,6 @@ namespace AxibugEmuOnline.Client.ClientCore
|
||||
RePullNetInfo();
|
||||
}
|
||||
|
||||
private static void PersistentDataPathDir()
|
||||
{
|
||||
if (!Directory.Exists(PersistentDataPath))
|
||||
{
|
||||
Directory.CreateDirectory(PersistentDataPath);
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerator AppTickFlow()
|
||||
{
|
||||
while (true)
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace AxibugEmuOnline.Client.Common
|
||||
{
|
||||
@ -44,34 +42,5 @@ namespace AxibugEmuOnline.Client.Common
|
||||
return resultMemoryStream.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static string FileMD5Hash(string filePath)
|
||||
{
|
||||
using (var md5 = MD5.Create())
|
||||
{
|
||||
using (var stream = File.OpenRead(filePath))
|
||||
{
|
||||
var hash = md5.ComputeHash(stream);
|
||||
var sb = new StringBuilder(hash.Length * 2);
|
||||
foreach (var b in hash)
|
||||
sb.AppendFormat("{0:x2}", b);
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
public static string FileMD5Hash(byte[] data)
|
||||
{
|
||||
using (var md5 = MD5.Create())
|
||||
{
|
||||
using (var stream = new MemoryStream(data))
|
||||
{
|
||||
var hash = md5.ComputeHash(stream);
|
||||
var sb = new StringBuilder(hash.Length * 2);
|
||||
foreach (var b in hash)
|
||||
sb.AppendFormat("{0:x2}", b);
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using AxibugEmuOnline.Client.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -117,7 +116,15 @@ namespace AxibugEmuOnline.Client
|
||||
|
||||
public static string CalcHash(byte[] data)
|
||||
{
|
||||
return Helper.FileMD5Hash(data);
|
||||
return string.Empty; //todo : 等待远程仓库敲定hash算法
|
||||
//var hashBytes = MD5.Create().ComputeHash(data);
|
||||
//StringBuilder sb = new StringBuilder();
|
||||
//foreach (byte b in hashBytes)
|
||||
//{
|
||||
// sb.Append(b.ToString("x2"));
|
||||
//}
|
||||
|
||||
//return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user