Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
MDPro3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
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
SK
MDPro3
Commits
b1a6acbf
Commit
b1a6acbf
authored
Aug 02, 2025
by
SherryChaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add warning for unsafe download & online deck bug fix
parent
95e816c0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
4 deletions
+86
-4
Assets/Fonts/RenderFontEnglish.asset
Assets/Fonts/RenderFontEnglish.asset
+1
-1
Assets/Scenes/Main.unity
Assets/Scenes/Main.unity
+1
-0
Assets/Scripts/MDPro3/Net/OnlineDeck.cs
Assets/Scripts/MDPro3/Net/OnlineDeck.cs
+7
-1
Assets/Scripts/MDPro3/Servant/SettingServant.cs
Assets/Scripts/MDPro3/Servant/SettingServant.cs
+76
-1
Assets/Scripts/MDPro3/UI/ServantUI/OnlineDeckViewerUI.cs
Assets/Scripts/MDPro3/UI/ServantUI/OnlineDeckViewerUI.cs
+1
-1
No files found.
Assets/Fonts/RenderFontEnglish.asset
View file @
b1a6acbf
This diff is collapsed.
Click to expand it.
Assets/Scenes/Main.unity
View file @
b1a6acbf
...
@@ -6758,6 +6758,7 @@ MonoBehaviour:
...
@@ -6758,6 +6758,7 @@ MonoBehaviour:
ES_sortSum
:
0
ES_sortSum
:
0
ES_turnString
:
ES_turnString
:
duelEnded
:
0
duelEnded
:
0
nextNegateAction_AdditionalTime
:
0
nextNegateAction_AdditionalManager
:
{
fileID
:
0
}
nextNegateAction_AdditionalManager
:
{
fileID
:
0
}
lastSelectedCard
:
0
lastSelectedCard
:
0
nextMoveManager
:
{
fileID
:
0
}
nextMoveManager
:
{
fileID
:
0
}
...
...
Assets/Scripts/MDPro3/Net/OnlineDeck.cs
View file @
b1a6acbf
...
@@ -471,7 +471,7 @@ namespace MDPro3.Net
...
@@ -471,7 +471,7 @@ namespace MDPro3.Net
public
bool
isDelete
;
public
bool
isDelete
;
//List Only
//List Only
public
stri
ng
lastDate
;
public
lo
ng
lastDate
;
public
OnlineDeckData
()
{
}
public
OnlineDeckData
()
{
}
...
@@ -480,6 +480,12 @@ namespace MDPro3.Net
...
@@ -480,6 +480,12 @@ namespace MDPro3.Net
var
dataTimeOffset
=
DateTimeOffset
.
FromUnixTimeSeconds
(
deckUpdateDate
/
1000
);
var
dataTimeOffset
=
DateTimeOffset
.
FromUnixTimeSeconds
(
deckUpdateDate
/
1000
);
return
dataTimeOffset
.
UtcDateTime
;
return
dataTimeOffset
.
UtcDateTime
;
}
}
public
DateTime
GetOnlineDeckLocalTime
()
{
var
dataTimeOffset
=
DateTimeOffset
.
FromUnixTimeSeconds
(
lastDate
/
1000
);
return
dataTimeOffset
.
LocalDateTime
;
}
}
}
[
Serializable
]
[
Serializable
]
...
...
Assets/Scripts/MDPro3/Servant/SettingServant.cs
View file @
b1a6acbf
...
@@ -26,6 +26,8 @@ namespace MDPro3.Servant
...
@@ -26,6 +26,8 @@ namespace MDPro3.Servant
[
HideInInspector
]
public
SelectionToggle_Setting
lastSelectedToggle
;
[
HideInInspector
]
public
SelectionToggle_Setting
lastSelectedToggle
;
[
HideInInspector
]
public
SelectionButton_Setting
lastSelectedButton
;
[
HideInInspector
]
public
SelectionButton_Setting
lastSelectedButton
;
private
string
unsafeDownloadUrl
;
#
region
Servant
#
region
Servant
public
override
int
Depth
=>
1
;
public
override
int
Depth
=>
1
;
...
@@ -240,6 +242,80 @@ namespace MDPro3.Servant
...
@@ -240,6 +242,80 @@ namespace MDPro3.Servant
private
IEnumerator
DownloadYpkAsync
(
string
url
)
private
IEnumerator
DownloadYpkAsync
(
string
url
)
{
downloadingYPK
=
true
;
using
var
request
=
UnityWebRequest
.
Get
(
url
);
request
.
SendWebRequest
();
while
(!
request
.
isDone
)
{
GetUI
<
SettingServantUI
>().
ButtonDownloadYPK
.
SetModeText
((
request
.
downloadProgress
*
100f
).
ToString
(
"0.##"
)
+
"%"
);
yield
return
new
WaitForSeconds
(
0.3f
);
}
if
(
request
.
result
==
UnityWebRequest
.
Result
.
Success
)
{
var
filePath
=
Path
.
Combine
(
Program
.
PATH_EXPANSIONS
,
Path
.
GetFileName
(
url
));
if
(!
Directory
.
Exists
(
Program
.
PATH_EXPANSIONS
))
Directory
.
CreateDirectory
(
Program
.
PATH_EXPANSIONS
);
File
.
WriteAllBytes
(
filePath
,
request
.
downloadHandler
.
data
);
MessageManager
.
Cast
(
InterString
.
Get
(
"下载成功。"
));
Program
.
instance
.
InitializeForDataChange
();
}
else
{
//MessageManager.Cast(InterString.Get("下载失败。"));
string
errorMessage
=
string
.
Empty
;
// 1. 证书安全问题(SSL错误)
if
(
request
.
result
==
UnityWebRequest
.
Result
.
ConnectionError
&&
(
request
.
error
.
Contains
(
"SSL"
)
||
request
.
error
.
Contains
(
"certificate"
)))
{
List
<
string
>
selections
=
new
()
{
InterString
.
Get
(
"下载链接不安全"
),
InterString
.
Get
(
"安全证书验证失败!连接可能不安全。@n是否继续下载?"
),
InterString
.
Get
(
"确认"
),
InterString
.
Get
(
"取消"
),
Config
.
STRING_YES
};
unsafeDownloadUrl
=
url
;
UIManager
.
ShowPopupYesOrNo
(
selections
,
DownloadYpkUnsafe
,
null
);
}
// 2. 网络连接错误
else
if
(
request
.
result
==
UnityWebRequest
.
Result
.
ConnectionError
)
{
errorMessage
=
InterString
.
Get
(
"网络连接失败:"
)
+
request
.
error
;
}
// 3. HTTP协议错误(404, 500等)
else
if
(
request
.
result
==
UnityWebRequest
.
Result
.
ProtocolError
)
{
errorMessage
=
InterString
.
Get
(
"服务器返回错误:"
)
+
request
.
responseCode
;
}
// 4. 数据处理错误
else
if
(
request
.
result
==
UnityWebRequest
.
Result
.
DataProcessingError
)
{
errorMessage
=
InterString
.
Get
(
"数据处理错误:"
)
+
request
.
error
;
}
// 5. 其他未知错误
else
{
errorMessage
=
InterString
.
Get
(
"未知错误:"
)
+
request
.
error
;
}
if
(
errorMessage
!=
string
.
Empty
)
MessageManager
.
Cast
(
errorMessage
);
}
GetUI
<
SettingServantUI
>().
ButtonDownloadYPK
.
SetModeText
(
string
.
Empty
);
downloadingYPK
=
false
;
}
private
void
DownloadYpkUnsafe
()
{
StartCoroutine
(
DownloadYpkUnsafeAsync
(
unsafeDownloadUrl
));
}
private
IEnumerator
DownloadYpkUnsafeAsync
(
string
url
)
{
{
downloadingYPK
=
true
;
downloadingYPK
=
true
;
using
var
request
=
UnityWebRequest
.
Get
(
url
);
using
var
request
=
UnityWebRequest
.
Get
(
url
);
...
@@ -265,6 +341,5 @@ namespace MDPro3.Servant
...
@@ -265,6 +341,5 @@ namespace MDPro3.Servant
GetUI
<
SettingServantUI
>().
ButtonDownloadYPK
.
SetModeText
(
string
.
Empty
);
GetUI
<
SettingServantUI
>().
ButtonDownloadYPK
.
SetModeText
(
string
.
Empty
);
downloadingYPK
=
false
;
downloadingYPK
=
false
;
}
}
}
}
}
}
Assets/Scripts/MDPro3/UI/ServantUI/OnlineDeckViewerUI.cs
View file @
b1a6acbf
...
@@ -90,7 +90,7 @@ namespace MDPro3.UI.ServantUI
...
@@ -90,7 +90,7 @@ namespace MDPro3.UI.ServantUI
deck
.
deckCoverCard3
.
ToString
(),
deck
.
deckCoverCard3
.
ToString
(),
deck
.
deckProtector
==
0
?
"1070001"
:
deck
.
deckProtector
.
ToString
(),
deck
.
deckProtector
==
0
?
"1070001"
:
deck
.
deckProtector
.
ToString
(),
deck
.
deckLike
.
ToString
(),
deck
.
deckLike
.
ToString
(),
deck
.
lastDate
deck
.
GetOnlineDeckLocalTime
().
ToString
()
};
};
tasks
.
Add
(
task
);
tasks
.
Add
(
task
);
}
}
...
...
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