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
5ec93fca
Commit
5ec93fca
authored
Feb 08, 2026
by
hex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in-app game data reload and manager reset support
parent
2a4c8eae
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
263 additions
and
95 deletions
+263
-95
Assets/SibylSystem/Menu/Menu.cs
Assets/SibylSystem/Menu/Menu.cs
+24
-2
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+95
-0
Assets/SibylSystem/ResourceManagers/GameStringManager.cs
Assets/SibylSystem/ResourceManagers/GameStringManager.cs
+6
-0
Assets/SibylSystem/selectServer/SelectServer.cs
Assets/SibylSystem/selectServer/SelectServer.cs
+1
-1
Assets/YGOSharp/BanlistManager.cs
Assets/YGOSharp/BanlistManager.cs
+5
-0
Assets/YGOSharp/CardsManager.cs
Assets/YGOSharp/CardsManager.cs
+132
-92
No files found.
Assets/SibylSystem/Menu/Menu.cs
View file @
5ec93fca
...
@@ -55,6 +55,9 @@ public class Menu : WindowServantSP
...
@@ -55,6 +55,9 @@ public class Menu : WindowServantSP
{
{
base
.
show
();
base
.
show
();
Program
.
charge
();
Program
.
charge
();
// 如有资源更新完成,回到主菜单后自动重载数据(无需重启 App)
Program
.
I
().
ApplyPendingReloadGameDatabases
();
// 自动检查超先行卡更新
// 自动检查超先行卡更新
if
(!
_isCheckingUpdate
&&
!
isPreDownloading
)
if
(!
_isCheckingUpdate
&&
!
isPreDownloading
)
...
@@ -679,7 +682,17 @@ public class Menu : WindowServantSP
...
@@ -679,7 +682,17 @@ public class Menu : WindowServantSP
{
{
byte
[]
ypkData
=
File
.
ReadAllBytes
(
ypkFilePathInDownloads
);
byte
[]
ypkData
=
File
.
ReadAllBytes
(
ypkFilePathInDownloads
);
Program
.
I
().
ExtractZipFile
(
ypkData
,
expansionsDir
);
Program
.
I
().
ExtractZipFile
(
ypkData
,
expansionsDir
);
Program
.
PrintToChat
(
"更新成功!请【重启游戏】以使改动完全生效。"
);
Program
.
PrintToChat
(
"超先行卡包安装完成,正在重载数据..."
);
Program
.
I
().
RequestReloadGameDatabases
();
if
(
isShowed
)
{
Program
.
I
().
ApplyPendingReloadGameDatabases
();
}
else
{
Program
.
PrintToChat
(
"更新成功!请返回主菜单以自动生效(无需重启)。"
);
}
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
...
@@ -785,7 +798,16 @@ public class Menu : WindowServantSP
...
@@ -785,7 +798,16 @@ public class Menu : WindowServantSP
// 同步操作,如果失败会抛出异常
// 同步操作,如果失败会抛出异常
Program
.
I
().
ExtractZipFile
(
ypkData
,
expansionsDir
);
Program
.
I
().
ExtractZipFile
(
ypkData
,
expansionsDir
);
Program
.
PrintToChat
(
"更新成功!请【重启游戏】以使改动完全生效。"
);
Program
.
PrintToChat
(
"超先行卡包安装完成,正在重载数据..."
);
Program
.
I
().
RequestReloadGameDatabases
();
if
(
isShowed
)
{
Program
.
I
().
ApplyPendingReloadGameDatabases
();
}
else
{
Program
.
PrintToChat
(
"更新成功!请返回主菜单以自动生效(无需重启)。"
);
}
}
}
else
else
{
{
...
...
Assets/SibylSystem/Program.cs
View file @
5ec93fca
...
@@ -584,6 +584,101 @@ public class Program : MonoBehaviour
...
@@ -584,6 +584,101 @@ public class Program : MonoBehaviour
return
false
;
return
false
;
}
}
private
bool
_pendingReloadGameDatabases
=
false
;
public
void
RequestReloadGameDatabases
()
{
_pendingReloadGameDatabases
=
true
;
}
public
bool
ApplyPendingReloadGameDatabases
()
{
if
(!
_pendingReloadGameDatabases
)
{
return
false
;
}
_pendingReloadGameDatabases
=
false
;
return
ReloadGameDatabases
();
}
public
bool
ReloadGameDatabases
()
{
PrintToChat
(
InterString
.
Get
(
"正在重新加载本地数据..."
));
try
{
GameStringManager
.
Reset
();
YGOSharp
.
CardsManager
.
Reset
();
YGOSharp
.
PacksManager
.
Reset
();
YGOSharp
.
BanlistManager
.
Reset
();
bool
cardsLoaded
=
LoadDatabaseFile
(
"cards.cdb"
,
(
path
)
=>
YGOSharp
.
CardsManager
.
initialize
(
path
)
);
bool
stringsLoaded
=
LoadDatabaseFile
(
"strings.conf"
,
(
path
)
=>
GameStringManager
.
initialize
(
path
)
);
if
(
File
.
Exists
(
"expansions/lflist.conf"
))
{
YGOSharp
.
BanlistManager
.
initialize
(
"expansions/lflist.conf"
);
}
else
{
LoadDatabaseFile
(
"lflist.conf"
,
(
path
)
=>
YGOSharp
.
BanlistManager
.
initialize
(
path
)
);
}
YGOSharp
.
BanlistManager
.
initializeComplete
();
if
(
File
.
Exists
(
"expansions/strings.conf"
))
{
GameStringManager
.
initialize
(
"expansions/strings.conf"
);
}
if
(
Directory
.
Exists
(
"expansions"
))
{
FileInfo
[]
fileInfos
=
(
new
DirectoryInfo
(
"expansions"
))
.
GetFiles
(
"*.cdb"
)
.
OrderByDescending
(
x
=>
x
.
Name
)
.
ToArray
();
foreach
(
var
fileInfo
in
fileInfos
)
{
YGOSharp
.
CardsManager
.
initialize
(
fileInfo
.
FullName
,
false
,
true
);
}
}
YGOSharp
.
CardsManager
.
updateSetNames
();
if
(
Directory
.
Exists
(
"pack"
))
{
FileInfo
[]
fileInfos
=
(
new
DirectoryInfo
(
"pack"
)).
GetFiles
(
"*.db"
);
foreach
(
var
fileInfo
in
fileInfos
)
{
YGOSharp
.
PacksManager
.
initialize
(
fileInfo
.
FullName
);
}
YGOSharp
.
PacksManager
.
initializeSec
();
}
if
(!
cardsLoaded
||
!
stringsLoaded
)
{
PrintToChat
(
InterString
.
Get
(
"本地数据部分重载失败,建议【重启游戏】以确保完整生效。"
));
return
false
;
}
PrintToChat
(
InterString
.
Get
(
"本地数据已重新加载,无需重启。"
));
return
true
;
}
catch
(
Exception
e
)
{
DEBUGLOG
(
e
);
PrintToChat
(
InterString
.
Get
(
"本地数据重载失败,请【重启游戏】后重试。"
));
return
false
;
}
}
// [修改] 使用 UnityFileDownloader 完全重写后台更新协程
// [修改] 使用 UnityFileDownloader 完全重写后台更新协程
private
IEnumerator
UpdateClientCoroutine
()
private
IEnumerator
UpdateClientCoroutine
()
{
{
...
...
Assets/SibylSystem/ResourceManagers/GameStringManager.cs
View file @
5ec93fca
...
@@ -15,6 +15,12 @@ public static class GameStringManager
...
@@ -15,6 +15,12 @@ public static class GameStringManager
public
static
List
<
hashedString
>
xilies
=
new
List
<
hashedString
>();
public
static
List
<
hashedString
>
xilies
=
new
List
<
hashedString
>();
public
static
void
Reset
()
{
hashedStrings
.
Clear
();
xilies
.
Clear
();
}
public
static
int
helper_stringToInt
(
string
str
)
public
static
int
helper_stringToInt
(
string
str
)
{
{
int
return_value
=
0
;
int
return_value
=
0
;
...
...
Assets/SibylSystem/selectServer/SelectServer.cs
View file @
5ec93fca
...
@@ -95,7 +95,7 @@ public class SelectServer : WindowServantSP
...
@@ -95,7 +95,7 @@ public class SelectServer : WindowServantSP
}
}
case
"[OCG]EXP"
:
case
"[OCG]EXP"
:
{
{
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"ip_"
).
value
=
"e
xp.baldlee.top
"
;
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"ip_"
).
value
=
"e
.ygo.pro
"
;
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"port_"
).
value
=
"23333"
;
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"port_"
).
value
=
"23333"
;
Config
.
Set
(
"serversPicker"
,
"[OCG]EXP"
);
Config
.
Set
(
"serversPicker"
,
"[OCG]EXP"
);
...
...
Assets/YGOSharp/BanlistManager.cs
View file @
5ec93fca
...
@@ -8,6 +8,11 @@ namespace YGOSharp
...
@@ -8,6 +8,11 @@ namespace YGOSharp
{
{
public
static
List
<
Banlist
>
Banlists
{
get
;
private
set
;
}
public
static
List
<
Banlist
>
Banlists
{
get
;
private
set
;
}
public
static
void
Reset
()
{
Banlists
=
new
List
<
Banlist
>();
}
public
static
bool
initialize
(
string
fileName
,
bool
test
=
false
)
public
static
bool
initialize
(
string
fileName
,
bool
test
=
false
)
{
{
List
<
Banlist
>
new_list
=
new
List
<
Banlist
>();
List
<
Banlist
>
new_list
=
new
List
<
Banlist
>();
...
...
Assets/YGOSharp/CardsManager.cs
View file @
5ec93fca
This diff is collapsed.
Click to expand it.
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