Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hex
ygopro2
Commits
0cf202a5
Commit
0cf202a5
authored
Jul 05, 2025
by
hex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugss and add https support
parent
ee0428d5
Pipeline
#38539
failed
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
115 additions
and
41 deletions
+115
-41
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
+12
-9
Assets/Plugins/x64/ocgcore.dll
Assets/Plugins/x64/ocgcore.dll
+0
-0
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
+5
-4
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+3
-3
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
+0
-6
Assets/SibylSystem/ResourceManagers/GlobalCertificateManager.cs
.../SibylSystem/ResourceManagers/GlobalCertificateManager.cs
+67
-0
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
+5
-5
Assets/SibylSystem/coreWrapper.cs
Assets/SibylSystem/coreWrapper.cs
+5
-4
Assets/SibylSystem/deckManager/DeckManager.cs
Assets/SibylSystem/deckManager/DeckManager.cs
+3
-3
Assets/SibylSystem/selectReplay/selectReplay.cs
Assets/SibylSystem/selectReplay/selectReplay.cs
+15
-7
No files found.
Assets/ArtSystem/deckManager/MonoCardInDeckManager.cs
View file @
0cf202a5
...
@@ -211,6 +211,17 @@ public class MonoCardInDeckManager : MonoBehaviour
...
@@ -211,6 +211,17 @@ public class MonoCardInDeckManager : MonoBehaviour
rigidbody
.
useGravity
=
false
;
rigidbody
.
useGravity
=
false
;
}
}
public
bool
IsInDeckArea
()
{
// 此逻辑专门用于检查卡片是否在物理上位于有效的卡组区域内。
Vector3
to_ltemp
=
refLectPosition
(
gameObject
.
transform
.
position
);
if
(
to_ltemp
.
x
<
-
15.2f
||
to_ltemp
.
x
>
15.2f
)
{
return
false
;
}
return
true
;
}
public
bool
getIfAlive
()
public
bool
getIfAlive
()
{
{
// 步骤 1: 检查不可逆的“死亡”状态,这在任何模式下都适用。
// 步骤 1: 检查不可逆的“死亡”状态,这在任何模式下都适用。
...
@@ -226,16 +237,8 @@ public class MonoCardInDeckManager : MonoBehaviour
...
@@ -226,16 +237,8 @@ public class MonoCardInDeckManager : MonoBehaviour
}
}
else
// (condition == DeckManager.Condition.editDeck)
else
// (condition == DeckManager.Condition.editDeck)
{
{
// 在“编辑卡组”模式下,我们执行原有的严格边界检查。
return
IsInDeckArea
();
// 将卡片拖到边界外意味着“丢弃”。
Vector3
to_ltemp
=
refLectPosition
(
gameObject
.
transform
.
position
);
if
(
to_ltemp
.
x
<
-
15.2f
||
to_ltemp
.
x
>
15.2f
)
{
return
false
;
}
}
}
// 如果通过了所有检查,则卡片是存活的。
return
true
;
}
}
public
static
Vector3
refLectPosition
(
Vector3
pos
)
public
static
Vector3
refLectPosition
(
Vector3
pos
)
...
...
Assets/Plugins/x64/ocgcore.dll
View file @
0cf202a5
No preview for this file type
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
View file @
0cf202a5
...
@@ -140,11 +140,11 @@ public static class TcpHelper
...
@@ -140,11 +140,11 @@ public static class TcpHelper
break
;
break
;
case
StocMessage
.
ChangeSide
:
case
StocMessage
.
ChangeSide
:
Program
.
I
().
room
.
StocMessage_ChangeSide
(
r
);
Program
.
I
().
room
.
StocMessage_ChangeSide
(
r
);
TcpHelper
.
SaveRecord
();
//
TcpHelper.SaveRecord();
break
;
break
;
case
StocMessage
.
WaitingSide
:
case
StocMessage
.
WaitingSide
:
Program
.
I
().
room
.
StocMessage_WaitingSide
(
r
);
Program
.
I
().
room
.
StocMessage_WaitingSide
(
r
);
TcpHelper
.
SaveRecord
();
//
TcpHelper.SaveRecord();
break
;
break
;
case
StocMessage
.
DeckCount
:
case
StocMessage
.
DeckCount
:
Program
.
I
().
room
.
StocMessage_DeckCount
(
r
);
Program
.
I
().
room
.
StocMessage_DeckCount
(
r
);
...
@@ -166,11 +166,11 @@ public static class TcpHelper
...
@@ -166,11 +166,11 @@ public static class TcpHelper
break
;
break
;
case
StocMessage
.
DuelEnd
:
case
StocMessage
.
DuelEnd
:
Program
.
I
().
room
.
StocMessage_DuelEnd
(
r
);
Program
.
I
().
room
.
StocMessage_DuelEnd
(
r
);
TcpHelper
.
SaveRecord
();
//
TcpHelper.SaveRecord();
break
;
break
;
case
StocMessage
.
Replay
:
case
StocMessage
.
Replay
:
Program
.
I
().
room
.
StocMessage_Replay
(
r
);
Program
.
I
().
room
.
StocMessage_Replay
(
r
);
TcpHelper
.
SaveRecord
();
//
TcpHelper.SaveRecord();
break
;
break
;
case
StocMessage
.
TimeLimit
:
case
StocMessage
.
TimeLimit
:
Program
.
I
().
ocgcore
.
StocMessage_TimeLimit
(
r
);
Program
.
I
().
ocgcore
.
StocMessage_TimeLimit
(
r
);
...
@@ -475,6 +475,7 @@ public static class TcpHelper
...
@@ -475,6 +475,7 @@ public static class TcpHelper
public
static
List
<
Package
>
readPackagesInRecord
(
string
path
)
public
static
List
<
Package
>
readPackagesInRecord
(
string
path
)
{
{
UnityEngine
.
Debug
.
Log
(
path
);
List
<
Package
>
re
=
null
;
List
<
Package
>
re
=
null
;
try
try
{
{
...
...
Assets/SibylSystem/Program.cs
View file @
0cf202a5
...
@@ -541,7 +541,7 @@ public class Program : MonoBehaviour
...
@@ -541,7 +541,7 @@ public class Program : MonoBehaviour
bool
lflistUpdated
=
false
;
bool
lflistUpdated
=
false
;
bool
stringsUpdated
=
false
;
bool
stringsUpdated
=
false
;
// 1. 下载 cards.cdb
// 1. 下载 cards.cdb
string
cardsUrl
=
"http
://cdn01.moestart.com
/koishipro/ygopro-database/zh-CN/cards.cdb"
;
string
cardsUrl
=
"http
s://cdn02.moecube.com:444
/koishipro/ygopro-database/zh-CN/cards.cdb"
;
string
cardsPath
=
Path
.
Combine
(
dbDir
,
"cards.cdb"
);
string
cardsPath
=
Path
.
Combine
(
dbDir
,
"cards.cdb"
);
yield
return
StartCoroutine
(
yield
return
StartCoroutine
(
UnityFileDownloader
.
DownloadFileAsync
(
UnityFileDownloader
.
DownloadFileAsync
(
...
@@ -559,7 +559,7 @@ public class Program : MonoBehaviour
...
@@ -559,7 +559,7 @@ public class Program : MonoBehaviour
);
);
// 2. 下载 lflist.conf
// 2. 下载 lflist.conf
string
lflistUrl
=
"http
://cdn01.moestart.com
/koishipro/ygopro-database/zh-CN/lflist.conf"
;
string
lflistUrl
=
"http
s://cdn02.moecube.com:444
/koishipro/ygopro-database/zh-CN/lflist.conf"
;
string
lflistPath
=
Path
.
Combine
(
dbDir
,
"lflist.conf"
);
string
lflistPath
=
Path
.
Combine
(
dbDir
,
"lflist.conf"
);
yield
return
StartCoroutine
(
yield
return
StartCoroutine
(
UnityFileDownloader
.
DownloadFileAsync
(
UnityFileDownloader
.
DownloadFileAsync
(
...
@@ -577,7 +577,7 @@ public class Program : MonoBehaviour
...
@@ -577,7 +577,7 @@ public class Program : MonoBehaviour
);
);
// 3. 下载 strings.conf
// 3. 下载 strings.conf
string
stringsUrl
=
string
stringsUrl
=
"http
://cdn01.moestart.com
/koishipro/ygopro-database/zh-CN/strings.conf"
;
"http
s://cdn02.moecube.com:444
/koishipro/ygopro-database/zh-CN/strings.conf"
;
string
stringsPath
=
Path
.
Combine
(
dbDir
,
"strings.conf"
);
string
stringsPath
=
Path
.
Combine
(
dbDir
,
"strings.conf"
);
yield
return
StartCoroutine
(
yield
return
StartCoroutine
(
UnityFileDownloader
.
DownloadFileAsync
(
UnityFileDownloader
.
DownloadFileAsync
(
...
...
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
View file @
0cf202a5
...
@@ -857,12 +857,6 @@ public class GameTextureManager
...
@@ -857,12 +857,6 @@ public class GameTextureManager
);
);
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
path
=
"picture/card/"
+
pic
.
code
.
ToString
()
+
".jpg"
;
}
}
/*if (!File.Exists(path) && pic.code != 0 && AutoPicDownload)
{
//先行卡 (177x254)
df.Download("http://download.ygo2019.xyz/ygopro2-data/expansions/pics/" + pic.code.ToString() + ".jpg", "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg");
path = "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg";
}*/
LoadCardPicture
(
pic
,
path
);
LoadCardPicture
(
pic
,
path
);
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
...
...
Assets/SibylSystem/ResourceManagers/GlobalCertificateManager.cs
0 → 100644
View file @
0cf202a5
using
System.Net
;
using
System.Net.Security
;
using
System.Security.Cryptography.X509Certificates
;
using
UnityEngine
;
public
static
class
GlobalCertificateManager
{
[
RuntimeInitializeOnLoadMethod
(
RuntimeInitializeLoadType
.
BeforeSceneLoad
)]
public
static
void
Initialize
()
{
// 注册全局的证书验证回调
ServicePointManager
.
ServerCertificateValidationCallback
=
MyRemoteCertificateValidationCallback
;
Debug
.
Log
(
"全局证书验证回调已注册,将接受所有HTTPS证书。"
);
}
/// <summary>
/// 自定义的证书验证回调方法。
/// </summary>
/// <param name="sender">请求发送者</param>
/// <param name="certificate">服务器提供的证书</param>
/// <param name="chain">证书链</param>
/// <param name="sslPolicyErrors">SSL策略错误</param>
/// <returns>始终返回true,表示接受该证书</returns>
public
static
bool
MyRemoteCertificateValidationCallback
(
object
sender
,
X509Certificate
certificate
,
X509Chain
chain
,
SslPolicyErrors
sslPolicyErrors
)
{
// 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颁发的,可以去掉这句。
// 使用 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
;
}
}
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
View file @
0cf202a5
...
@@ -80,15 +80,15 @@ public class UnityFileDownloader
...
@@ -80,15 +80,15 @@ public class UnityFileDownloader
switch
(
extension
)
switch
(
extension
)
{
{
case
".png"
:
case
".png"
:
return
7
;
return
20
;
case
".jpg"
:
case
".jpg"
:
return
4
;
return
20
;
case
".cdb"
:
case
".cdb"
:
return
3
0
;
return
5
0
;
case
".conf"
:
case
".conf"
:
return
3
;
return
20
;
default
:
default
:
return
1
0
;
return
2
0
;
}
}
}
}
}
}
Assets/SibylSystem/coreWrapper.cs
View file @
0cf202a5
...
@@ -677,9 +677,9 @@ namespace Percy
...
@@ -677,9 +677,9 @@ namespace Percy
int
len
=
result
&
0xFFFF
;
int
len
=
result
&
0xFFFF
;
if
(
len
>
0
)
if
(
len
>
0
)
{
{
byte
[]
arr
=
new
byte
[
4096
];
var
arr
=
new
byte
[
0x2000
];
dll
.
get_message
(
duel
,
_buffer
);
dll
.
get_message
(
duel
,
_buffer
);
Marshal
.
Copy
(
_buffer
,
arr
,
0
,
4096
);
Marshal
.
Copy
(
_buffer
,
arr
,
0
,
0x2000
);
bool
breakOut
=
false
;
bool
breakOut
=
false
;
MemoryStream
stream
=
new
MemoryStream
(
arr
);
MemoryStream
stream
=
new
MemoryStream
(
arr
);
BinaryReader
reader
=
new
BinaryReader
(
stream
);
BinaryReader
reader
=
new
BinaryReader
(
stream
);
...
@@ -1051,11 +1051,11 @@ namespace Percy
...
@@ -1051,11 +1051,11 @@ namespace Percy
move
(
1
);
move
(
1
);
count
=
move
(
1
);
count
=
move
(
1
);
move
(
1
);
move
(
1
);
move
(
1
);
move
(
4
);
move
(
4
);
move
(
4
);
move
(
4
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
{
move
(
1
);
move
(
1
);
move
(
1
);
move
(
4
);
move
(
4
);
move
(
4
);
move
(
4
);
...
@@ -1091,6 +1091,7 @@ namespace Percy
...
@@ -1091,6 +1091,7 @@ namespace Percy
move
(
move
(
1
)
*
7
);
move
(
move
(
1
)
*
7
);
break
;
break
;
case
GameMessage
.
ConfirmCards
:
case
GameMessage
.
ConfirmCards
:
move
(
1
);
move
(
1
);
move
(
1
);
move
(
move
(
1
)
*
7
);
move
(
move
(
1
)
*
7
);
break
;
break
;
...
...
Assets/SibylSystem/deckManager/DeckManager.cs
View file @
0cf202a5
...
@@ -1636,12 +1636,12 @@ public class DeckManager : ServantWithCardDescription
...
@@ -1636,12 +1636,12 @@ public class DeckManager : ServantWithCardDescription
cardInDragging
.
endDrag
();
cardInDragging
.
endDrag
();
// 第二步:逻辑判断是否仍应纳入卡组
// 第二步:逻辑判断是否仍应纳入卡组
if
(
cardInDragging
.
getIfAlive
())
if
(
condition
==
Condition
.
changeSide
&&
!
cardInDragging
.
IsInDeckArea
())
{
}
else
if
(
cardInDragging
.
getIfAlive
())
{
{
deckDirty
=
true
;
deckDirty
=
true
;
}
}
// 第三步:整理数据结构(IMain、ISide等)
// 第三步:整理数据结构(IMain、ISide等)
ArrangeObjectDeck
(
true
);
ArrangeObjectDeck
(
true
);
// 第四步:更新卡片在场景中的位置与角度(含Tween)
// 第四步:更新卡片在场景中的位置与角度(含Tween)
...
...
Assets/SibylSystem/selectReplay/selectReplay.cs
View file @
0cf202a5
...
@@ -144,6 +144,7 @@ public class selectReplay : WindowServantSP
...
@@ -144,6 +144,7 @@ public class selectReplay : WindowServantSP
var
collection
=
TcpHelper
.
readPackagesInRecord
(
path
);
var
collection
=
TcpHelper
.
readPackagesInRecord
(
path
);
foreach
(
var
item
in
collection
)
foreach
(
var
item
in
collection
)
{
{
Debug
.
Log
(
item
.
Fuction
);
if
(
item
.
Fuction
==
(
int
)
YGOSharp
.
OCGWrapper
.
Enums
.
GameMessage
.
sibyl_replay
)
if
(
item
.
Fuction
==
(
int
)
YGOSharp
.
OCGWrapper
.
Enums
.
GameMessage
.
sibyl_replay
)
{
{
returnValue
=
item
.
Data
.
reader
.
ReadToEnd
();
returnValue
=
item
.
Data
.
reader
.
ReadToEnd
();
...
@@ -155,13 +156,7 @@ public class selectReplay : WindowServantSP
...
@@ -155,13 +156,7 @@ public class selectReplay : WindowServantSP
{
{
Debug
.
Log
(
e
);
Debug
.
Log
(
e
);
}
}
if
(
returnValue
!=
null
)
Debug
.
Log
(
returnValue
);
{
if
(
returnValue
.
Length
<
50
)
{
returnValue
=
null
;
}
}
return
returnValue
;
return
returnValue
;
}
}
...
@@ -178,6 +173,19 @@ public class selectReplay : WindowServantSP
...
@@ -178,6 +173,19 @@ public class selectReplay : WindowServantSP
returnValue
.
DataSize
=
reader
.
ReadInt32
();
returnValue
.
DataSize
=
reader
.
ReadInt32
();
returnValue
.
Hash
=
reader
.
ReadInt32
();
returnValue
.
Hash
=
reader
.
ReadInt32
();
returnValue
.
Props
=
reader
.
ReadBytes
(
8
);
returnValue
.
Props
=
reader
.
ReadBytes
(
8
);
if
(
returnValue
.
ID
==
0x32707279
)
// REPLAY_ID_YRP2
{
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
reader
.
ReadUInt32
();
// returnValue.SeedsV2[i] = reader.ReadUInt32();
}
for
(
int
i
=
0
;
i
<
4
;
i
++)
// other flags, unused for now
{
reader
.
ReadUInt32
();
}
}
byte
[]
raw
=
reader
.
ReadToEnd
();
byte
[]
raw
=
reader
.
ReadToEnd
();
if
((
returnValue
.
Flag
&
0x1
)
>
0
)
if
((
returnValue
.
Flag
&
0x1
)
>
0
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment