Commit e4c4c727 authored by hex's avatar hex

fix and update

parent c8a0c92b
Pipeline #39949 failed
......@@ -176,7 +176,7 @@ public class Menu : WindowServantSP
{
isDownloadingSuperPre = true;
// 定义常量和路径
const string downloadUrl = "https://cdn02.moecube.com:444/ygopro-super-pre/archive/ygopro-super-pre.ypk";
const string downloadUrl = "https://cdntx.moecube.com/ygopro-super-pre/archive/ygopro-super-pre.ypk";
string expansionsDir = "expansions";
string ypkFileName = "ygopro-super-pre.ypk";
string zipFileName = "ygopro-super-pre.zip";
......
......@@ -576,7 +576,7 @@ public class Program : MonoBehaviour
bool lflistUpdated = false;
bool stringsUpdated = false;
// 1. 下载 cards.cdb
string cardsUrl = "https://cdn02.moecube.com:444/koishipro/ygopro-database/zh-CN/cards.cdb";
string cardsUrl = "https://cdntx.moecube.com/koishipro/ygopro-database/zh-CN/cards.cdb";
string cardsPath = Path.Combine(dbDir, "cards.cdb");
yield return StartCoroutine(
UnityFileDownloader.DownloadFileWithHeadCheck(
......@@ -594,7 +594,7 @@ public class Program : MonoBehaviour
);
// 2. 下载 lflist.conf
string lflistUrl = "https://cdn02.moecube.com:444/koishipro/ygopro-database/zh-CN/lflist.conf";
string lflistUrl = "https://cdntx.moecube.com/koishipro/ygopro-database/zh-CN/lflist.conf";
string lflistPath = Path.Combine(dbDir, "lflist.conf");
yield return StartCoroutine(
UnityFileDownloader.DownloadFileWithHeadCheck(
......@@ -612,7 +612,7 @@ public class Program : MonoBehaviour
);
// 3. 下载 strings.conf
string stringsUrl =
"https://cdn02.moecube.com:444/koishipro/ygopro-database/zh-CN/strings.conf";
"https://cdntx.moecube.com/koishipro/ygopro-database/zh-CN/strings.conf";
string stringsPath = Path.Combine(dbDir, "strings.conf");
yield return StartCoroutine(
UnityFileDownloader.DownloadFileWithHeadCheck(
......
......@@ -246,7 +246,7 @@ public class GameTextureManager
else if (pic.type == GameTextureType.card_picture && pic.code != 0 && AutoPicDownload)
{
// 文件不存在,且是卡图,则尝试下载
string url = "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/" + pic.code.ToString() + ".jpg";
string url = "https://cdntx.moecube.com/images/ygopro-images-zh-CN/" + pic.code.ToString() + ".jpg";
string finalPath = "picture/card/" + pic.code.ToString() + ".jpg";
lock (_lock)
......
......@@ -29,40 +29,40 @@ public static class GlobalCertificateManager
SslPolicyErrors sslPolicyErrors
)
{
// 都是从 cdn02 的官方资源下载,hook 掉不验证证书可以提高下载速度,但是有一定的安全风险
return true;
// // Case 1: 证书本身没有问题,直接通过
// if (sslPolicyErrors == SslPolicyErrors.None)
// {
// return true;
// }
// // Case 2: 如果错误是 RemoteCertificateChainErrors,
// // 这通常意味着证书链有问题,比如找不到吊销列表或者根证书不受信任。
// // 我们将尝试进行一次忽略吊销检查的自定义验证。
// if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateChainErrors) != 0)
// {
// // 创建一个新的证书链对象
// X509Chain customChain = new X509Chain();
// 都是从的官方资源下载,hook 掉不验证证书可以提高下载速度,但是有一定的安全风险
// return true;
// Case 1: 证书本身没有问题,直接通过
if (sslPolicyErrors == SslPolicyErrors.None)
{
return true;
}
// Case 2: 如果错误是 RemoteCertificateChainErrors,
// 这通常意味着证书链有问题,比如找不到吊销列表或者根证书不受信任。
// 我们将尝试进行一次忽略吊销检查的自定义验证。
if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateChainErrors) != 0)
{
// 创建一个新的证书链对象
X509Chain customChain = new X509Chain();
// // 设置自定义验证策略
// customChain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; // <-- 核心:不检查证书吊销
// customChain.ChainPolicy.VerificationFlags =
// X509VerificationFlags.AllowUnknownCertificateAuthority; // 可选:如果你的服务器是自签名证书,需要加上这句。如果服务器证书是由受信任的公共CA颁发的,可以去掉这句。
// 设置自定义验证策略
customChain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; // <-- 核心:不检查证书吊销
customChain.ChainPolicy.VerificationFlags =
X509VerificationFlags.AllowUnknownCertificateAuthority; // 可选:如果你的服务器是自签名证书,需要加上这句。如果服务器证书是由受信任的公共CA颁发的,可以去掉这句。
// // 使用 X509Certificate2,因为它包含更完整的信息
// X509Certificate2 cert2 = new X509Certificate2(certificate);
// // 使用自定义策略进行验证
// bool isChainValid = customChain.Build(cert2);
// // 如果自定义验证构建成功,说明在忽略吊销检查的前提下,证书是可信的
// if (isChainValid)
// {
// return true;
// }
// }
// 使用 X509Certificate2,因为它包含更完整的信息
X509Certificate2 cert2 = new X509Certificate2(certificate);
// 使用自定义策略进行验证
bool isChainValid = customChain.Build(cert2);
// 如果自定义验证构建成功,说明在忽略吊销检查的前提下,证书是可信的
if (isChainValid)
{
return true;
}
}
// // Case 3: 对于其他错误(如名称不匹配 RemoteCertificateNameMismatch)或自定义验证失败,
// // 我们认为证书无效。
// Debug.LogErrorFormat("证书验证失败. SslPolicyErrors: {0}", sslPolicyErrors);
// return false;
// Case 3: 对于其他错误(如名称不匹配 RemoteCertificateNameMismatch)或自定义验证失败,
// 我们认为证书无效。
Debug.LogErrorFormat("证书验证失败. SslPolicyErrors: {0}", sslPolicyErrors);
return false;
}
}
......@@ -53,13 +53,13 @@ public class SelectServer : WindowServantSP
set_version("0x" + String.Format("{0:X}", Config.ClientVersion));
//方便免修改 [selectServerWithRoomlist.prefab]
serversList.items.Add("[OCG]MYGO");
serversList.items.Add("[OCG]MYGO 2");
serversList.items.Add("[OCG]EXP");
serversList.items.Add("[OCG]Koishi");
serversList.items.Add("[OCG]233 1");
serversList.items.Add("[OCG]233 2");
serversList.items.Add("[OCG]233 约战");
serversList.items.Add("[OCG]Koishi");
serversList.items.Add("[OCG]MYGO");
serversList.items.Add("[OCG]MYGO 2");
serversList.items.Add("[OCG]EXP");
serversList.items.Add("决斗编年史");
serversList.items.Add("2Pick轮抽");
if (
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment