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
31c24e53
Commit
31c24e53
authored
Mar 18, 2026
by
SherryChaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate a specific file for ocgcore to load all lflist
Just change the path in ocgcore to load it.
parent
e83a047d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
144 deletions
+45
-144
.gitignore
.gitignore
+1
-0
Assets/Scripts/MDPro3/Duel/YGOSharp/BanlistManager.cs
Assets/Scripts/MDPro3/Duel/YGOSharp/BanlistManager.cs
+33
-118
Assets/Scripts/MDPro3/Duel/YGOSharp/CardsManager.cs
Assets/Scripts/MDPro3/Duel/YGOSharp/CardsManager.cs
+1
-1
Assets/Scripts/MDPro3/Duel/YgoServer.cs
Assets/Scripts/MDPro3/Duel/YgoServer.cs
+3
-17
Assets/Scripts/MDPro3/Game/Program.cs
Assets/Scripts/MDPro3/Game/Program.cs
+1
-1
Assets/Scripts/MDPro3/Helper/StringHelper.cs
Assets/Scripts/MDPro3/Helper/StringHelper.cs
+3
-3
Assets/Scripts/MDPro3/Helper/ZipHelper.cs
Assets/Scripts/MDPro3/Helper/ZipHelper.cs
+1
-1
Assets/Scripts/MDPro3/Servant/OnlineServant.cs
Assets/Scripts/MDPro3/Servant/OnlineServant.cs
+0
-1
Assets/Scripts/MDPro3/UI/ServantUI/DeckEditorUI.cs
Assets/Scripts/MDPro3/UI/ServantUI/DeckEditorUI.cs
+1
-1
Assets/Scripts/MDPro3/Utility/CardImageLoader.cs
Assets/Scripts/MDPro3/Utility/CardImageLoader.cs
+1
-1
No files found.
.gitignore
View file @
31c24e53
...
@@ -66,3 +66,4 @@ Data/mycard_apps.json
...
@@ -66,3 +66,4 @@ Data/mycard_apps.json
Data/Rarity.json
Data/Rarity.json
Data/SpecialCards.json
Data/SpecialCards.json
Data/lflist_merged.conf
Assets/Scripts/MDPro3/Duel/YGOSharp/BanlistManager.cs
View file @
31c24e53
...
@@ -10,19 +10,21 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -10,19 +10,21 @@ namespace MDPro3.Duel.YGOSharp
public
static
class
BanlistManager
public
static
class
BanlistManager
{
{
public
static
List
<
Banlist
>
Banlists
{
get
;
private
set
;
}
public
static
List
<
Banlist
>
Banlists
{
get
;
private
set
;
}
public
static
string
EmptyBanlistName
=
"N/A"
;
public
static
string
PATH
=>
Program
.
PATH_DATA
+
FILE_NAME
;
private
static
bool
localServerLflistInjected
;
public
const
string
EMPTY_LIST_NAME
=
"N/A"
;
private
static
string
localServerLflistBackupContent
;
public
const
string
FILE_NAME
=
"lflist.conf"
;
private
const
string
LfListFileName
=
"lflist.conf"
;
private
const
string
MERGED_FILE_NAME
=
"lflist_merged.conf"
;
private
static
readonly
StringBuilder
builder
=
new
();
public
static
void
Initialize
()
public
static
void
Initialize
()
{
{
Banlists
=
new
List
<
Banlist
>();
Banlists
=
new
List
<
Banlist
>();
StreamReader
reader
=
null
;
builder
.
Clear
();
StreamReader
reader
;
if
(
Config
.
GetBool
(
"Expansions"
,
true
))
if
(
Config
.
GetBool
(
"Expansions"
,
true
))
{
{
var
confPath
=
Program
.
PATH_EXPANSIONS
+
"lflist.conf"
;
var
confPath
=
Program
.
PATH_EXPANSIONS
+
FILE_NAME
;
if
(
File
.
Exists
(
confPath
))
if
(
File
.
Exists
(
confPath
))
{
{
reader
=
new
StreamReader
(
confPath
);
reader
=
new
StreamReader
(
confPath
);
InitializeFromReader
(
reader
);
InitializeFromReader
(
reader
);
...
@@ -30,11 +32,11 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -30,11 +32,11 @@ namespace MDPro3.Duel.YGOSharp
}
}
foreach
(
var
zip
in
ZipHelper
.
zips
)
foreach
(
var
zip
in
ZipHelper
.
zips
)
{
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
Program
.
SCRIPT_ZIP
))
continue
;
continue
;
foreach
(
var
file
in
zip
.
EntryFileNames
)
foreach
(
var
file
in
zip
.
EntryFileNames
)
{
{
if
(
file
.
ToLower
().
EndsWith
(
"lflist.conf"
))
if
(
file
.
ToLower
().
EndsWith
(
FILE_NAME
))
{
{
var
e
=
zip
[
file
];
var
e
=
zip
[
file
];
if
(!
Directory
.
Exists
(
Program
.
PATH_TEMP_FOLDER
))
if
(!
Directory
.
Exists
(
Program
.
PATH_TEMP_FOLDER
))
...
@@ -50,117 +52,17 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -50,117 +52,17 @@ namespace MDPro3.Duel.YGOSharp
}
}
}
}
Banlist
current
=
null
;
reader
=
new
StreamReader
(
PATH
);
reader
=
new
StreamReader
(
Program
.
PATH_LFLIST
);
InitializeFromReader
(
reader
);
InitializeFromReader
(
reader
);
reader
.
Close
();
reader
.
Close
();
current
=
new
();
current
.
Name
=
EmptyBanlistName
;
Banlists
.
Add
(
current
);
}
public
static
void
PrepareLocalServerLflist
()
{
if
(
localServerLflistInjected
)
return
;
if
(!
Config
.
GetBool
(
"Expansions"
,
true
))
return
;
try
{
if
(!
File
.
Exists
(
Program
.
PATH_LFLIST
))
return
;
localServerLflistBackupContent
=
File
.
ReadAllText
(
Program
.
PATH_LFLIST
);
var
mergedContent
=
BuildMergedLflistContent
();
if
(
string
.
IsNullOrEmpty
(
mergedContent
)
||
mergedContent
==
localServerLflistBackupContent
)
{
localServerLflistBackupContent
=
null
;
return
;
}
File
.
WriteAllText
(
Program
.
PATH_LFLIST
,
mergedContent
);
localServerLflistInjected
=
true
;
}
catch
(
Exception
e
)
{
localServerLflistBackupContent
=
null
;
localServerLflistInjected
=
false
;
UnityEngine
.
Debug
.
LogError
(
"Failed to prepare LAN lflist.conf."
);
UnityEngine
.
Debug
.
LogException
(
e
);
}
}
public
static
void
RestoreLocalServerLflist
()
{
if
(!
localServerLflistInjected
)
return
;
try
{
if
(
localServerLflistBackupContent
!=
null
)
File
.
WriteAllText
(
Program
.
PATH_LFLIST
,
localServerLflistBackupContent
);
}
catch
(
Exception
e
)
{
UnityEngine
.
Debug
.
LogError
(
"Failed to restore original lflist.conf."
);
UnityEngine
.
Debug
.
LogException
(
e
);
}
finally
{
localServerLflistBackupContent
=
null
;
localServerLflistInjected
=
false
;
}
}
private
static
string
BuildMergedLflistContent
()
File
.
WriteAllText
(
Path
.
Combine
(
Program
.
PATH_DATA
,
MERGED_FILE_NAME
),
builder
.
ToString
(),
Encoding
.
UTF8
);
{
StringBuilder
builder
=
new
StringBuilder
();
var
confPath
=
Program
.
PATH_EXPANSIONS
+
LfListFileName
;
AppendLflistFromFile
(
builder
,
confPath
);
foreach
(
var
zip
in
ZipHelper
.
zips
)
Banlist
current
=
new
(
)
{
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
Name
=
EMPTY_LIST_NAME
continue
;
};
foreach
(
var
file
in
zip
.
EntryFileNames
)
Banlists
.
Add
(
current
);
{
if
(!
file
.
ToLower
().
EndsWith
(
LfListFileName
))
continue
;
var
entry
=
zip
[
file
];
using
(
var
memoryStream
=
new
MemoryStream
())
{
entry
.
Extract
(
memoryStream
);
memoryStream
.
Position
=
0
;
using
(
var
reader
=
new
StreamReader
(
memoryStream
))
AppendLflistText
(
builder
,
reader
.
ReadToEnd
());
}
}
}
AppendLflistFromFile
(
builder
,
Program
.
PATH_LFLIST
);
return
builder
.
ToString
();
}
private
static
void
AppendLflistFromFile
(
StringBuilder
builder
,
string
path
)
{
if
(!
File
.
Exists
(
path
))
return
;
AppendLflistText
(
builder
,
File
.
ReadAllText
(
path
));
}
private
static
void
AppendLflistText
(
StringBuilder
builder
,
string
text
)
{
if
(
string
.
IsNullOrWhiteSpace
(
text
))
return
;
if
(
builder
.
Length
>
0
&&
builder
[
builder
.
Length
-
1
]
!=
'\n'
)
builder
.
AppendLine
();
builder
.
Append
(
text
);
if
(
builder
.
Length
>
0
&&
builder
[
builder
.
Length
-
1
]
!=
'\n'
)
builder
.
AppendLine
();
}
}
public
static
void
InitializeFromReader
(
StreamReader
reader
)
public
static
void
InitializeFromReader
(
StreamReader
reader
)
...
@@ -169,6 +71,7 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -169,6 +71,7 @@ namespace MDPro3.Duel.YGOSharp
while
(!
reader
.
EndOfStream
)
while
(!
reader
.
EndOfStream
)
{
{
string
line
=
reader
.
ReadLine
();
string
line
=
reader
.
ReadLine
();
AppendLflistText
(
builder
,
line
);
try
try
{
{
if
(
line
==
null
)
if
(
line
==
null
)
...
@@ -205,6 +108,17 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -205,6 +108,17 @@ namespace MDPro3.Duel.YGOSharp
}
}
}
}
private
static
void
AppendLflistText
(
StringBuilder
builder
,
string
text
)
{
if
(
string
.
IsNullOrWhiteSpace
(
text
))
return
;
if
(
builder
.
Length
>
0
&&
builder
[^
1
]
!=
'\n'
)
builder
.
AppendLine
();
builder
.
Append
(
text
);
}
public
static
int
GetIndex
(
uint
hash
)
public
static
int
GetIndex
(
uint
hash
)
{
{
for
(
int
i
=
0
;
i
<
Banlists
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
Banlists
.
Count
;
i
++)
...
@@ -212,6 +126,7 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -212,6 +126,7 @@ namespace MDPro3.Duel.YGOSharp
return
i
;
return
i
;
return
0
;
return
0
;
}
}
public
static
int
GetIndexByName
(
string
name
)
public
static
int
GetIndexByName
(
string
name
)
{
{
for
(
int
i
=
0
;
i
<
Banlists
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
Banlists
.
Count
;
i
++)
...
@@ -230,7 +145,7 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -230,7 +145,7 @@ namespace MDPro3.Duel.YGOSharp
public
static
List
<
string
>
GetAllName
()
public
static
List
<
string
>
GetAllName
()
{
{
List
<
string
>
returnValue
=
new
List
<
string
>
();
List
<
string
>
returnValue
=
new
();
foreach
(
var
item
in
Banlists
)
foreach
(
var
item
in
Banlists
)
{
{
returnValue
.
Add
(
item
.
Name
);
returnValue
.
Add
(
item
.
Name
);
...
@@ -240,7 +155,7 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -240,7 +155,7 @@ namespace MDPro3.Duel.YGOSharp
public
static
Banlist
GetByName
(
string
name
)
public
static
Banlist
GetByName
(
string
name
)
{
{
Banlist
returnValue
=
Banlists
[
Banlists
.
Count
-
1
];
Banlist
returnValue
=
Banlists
[
^
1
];
foreach
(
var
item
in
Banlists
)
foreach
(
var
item
in
Banlists
)
{
{
if
(
item
.
Name
==
name
)
if
(
item
.
Name
==
name
)
...
@@ -253,7 +168,7 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -253,7 +168,7 @@ namespace MDPro3.Duel.YGOSharp
public
static
Banlist
GetByHash
(
uint
hash
)
public
static
Banlist
GetByHash
(
uint
hash
)
{
{
Banlist
returnValue
=
Banlists
[
Banlists
.
Count
-
1
];
Banlist
returnValue
=
Banlists
[
^
1
];
foreach
(
var
item
in
Banlists
)
foreach
(
var
item
in
Banlists
)
{
{
if
(
item
.
Hash
==
hash
)
if
(
item
.
Hash
==
hash
)
...
...
Assets/Scripts/MDPro3/Duel/YGOSharp/CardsManager.cs
View file @
31c24e53
...
@@ -202,7 +202,7 @@ namespace MDPro3.Duel.YGOSharp
...
@@ -202,7 +202,7 @@ namespace MDPro3.Duel.YGOSharp
foreach
(
var
zip
in
ZipHelper
.
zips
)
foreach
(
var
zip
in
ZipHelper
.
zips
)
{
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
Program
.
SCRIPT_ZIP
))
continue
;
continue
;
foreach
(
var
file
in
zip
.
EntryFileNames
)
foreach
(
var
file
in
zip
.
EntryFileNames
)
...
...
Assets/Scripts/MDPro3/Duel/YgoServer.cs
View file @
31c24e53
...
@@ -22,29 +22,15 @@ namespace MDPro3.Net
...
@@ -22,29 +22,15 @@ namespace MDPro3.Net
serverThread
=
new
Thread
(()
=>
serverThread
=
new
Thread
(()
=>
{
{
try
Dll
.
start_server
(
args
);
{
Dll
.
start_server
(
args
);
}
finally
{
BanlistManager
.
RestoreLocalServerLflist
();
}
});
});
serverThread
.
Start
();
serverThread
.
Start
();
}
}
public
static
void
StopServer
()
public
static
void
StopServer
()
{
{
try
Dll
.
stop_server
();
{
serverThread
?.
Abort
();
Dll
.
stop_server
();
}
finally
{
serverThread
?.
Abort
();
BanlistManager
.
RestoreLocalServerLflist
();
}
}
}
public
static
bool
ServerRunning
()
public
static
bool
ServerRunning
()
...
...
Assets/Scripts/MDPro3/Game/Program.cs
View file @
31c24e53
...
@@ -75,7 +75,6 @@ namespace MDPro3
...
@@ -75,7 +75,6 @@ namespace MDPro3
public
const
string
PATH_DATA
=
"Data/"
;
public
const
string
PATH_DATA
=
"Data/"
;
public
const
string
PATH_LOCALES
=
"Data/locales/"
;
public
const
string
PATH_LOCALES
=
"Data/locales/"
;
public
const
string
PATH_CONFIG
=
"Data/config.conf"
;
public
const
string
PATH_CONFIG
=
"Data/config.conf"
;
public
const
string
PATH_LFLIST
=
"Data/lflist.conf"
;
public
const
string
PATH_DECK
=
"Deck/"
;
public
const
string
PATH_DECK
=
"Deck/"
;
public
const
string
PATH_EXPANSIONS
=
"Expansions/"
;
public
const
string
PATH_EXPANSIONS
=
"Expansions/"
;
public
const
string
PATH_PUZZLE
=
"Puzzle/"
;
public
const
string
PATH_PUZZLE
=
"Puzzle/"
;
...
@@ -93,6 +92,7 @@ namespace MDPro3
...
@@ -93,6 +92,7 @@ namespace MDPro3
public
const
string
EXPANSION_MP4
=
".mp4"
;
public
const
string
EXPANSION_MP4
=
".mp4"
;
public
const
string
STRING_SLASH
=
"/"
;
public
const
string
STRING_SLASH
=
"/"
;
public
const
string
STRING_LINE_BREAK
=
"\r\n"
;
public
const
string
STRING_LINE_BREAK
=
"\r\n"
;
public
const
string
SCRIPT_ZIP
=
"script.zip"
;
#
endregion
#
endregion
...
...
Assets/Scripts/MDPro3/Helper/StringHelper.cs
View file @
31c24e53
...
@@ -48,16 +48,16 @@ namespace MDPro3
...
@@ -48,16 +48,16 @@ namespace MDPro3
if
(
Config
.
GetBool
(
"Expansions"
,
true
))
if
(
Config
.
GetBool
(
"Expansions"
,
true
))
{
{
foreach
(
var
conf
in
Directory
.
GetFiles
(
Program
.
PATH_EXPANSIONS
,
"*.conf"
))
foreach
(
var
conf
in
Directory
.
GetFiles
(
Program
.
PATH_EXPANSIONS
,
"*.conf"
))
if
(!
conf
.
ToLower
().
EndsWith
(
"lflist.conf"
))
if
(!
conf
.
ToLower
().
EndsWith
(
BanlistManager
.
FILE_NAME
))
text
+=
Program
.
STRING_LINE_BREAK
+
File
.
ReadAllText
(
conf
);
text
+=
Program
.
STRING_LINE_BREAK
+
File
.
ReadAllText
(
conf
);
foreach
(
var
zip
in
ZipHelper
.
zips
)
foreach
(
var
zip
in
ZipHelper
.
zips
)
{
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
Program
.
SCRIPT_ZIP
))
continue
;
continue
;
foreach
(
var
file
in
zip
.
EntryFileNames
)
foreach
(
var
file
in
zip
.
EntryFileNames
)
{
{
if
(
file
.
ToLower
().
EndsWith
(
Program
.
EXPANSION_CONF
)
if
(
file
.
ToLower
().
EndsWith
(
Program
.
EXPANSION_CONF
)
&&
!
file
.
ToLower
().
EndsWith
(
"lflist.conf"
))
&&
!
file
.
ToLower
().
EndsWith
(
BanlistManager
.
FILE_NAME
))
{
{
var
ms
=
new
MemoryStream
();
var
ms
=
new
MemoryStream
();
var
e
=
zip
[
file
];
var
e
=
zip
[
file
];
...
...
Assets/Scripts/MDPro3/Helper/ZipHelper.cs
View file @
31c24e53
...
@@ -34,7 +34,7 @@ namespace MDPro3
...
@@ -34,7 +34,7 @@ namespace MDPro3
var
returnValue
=
new
List
<
string
>();
var
returnValue
=
new
List
<
string
>();
foreach
(
var
zip
in
zips
)
foreach
(
var
zip
in
zips
)
{
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
Program
.
SCRIPT_ZIP
))
continue
;
continue
;
foreach
(
var
file
in
zip
.
EntryFileNames
)
foreach
(
var
file
in
zip
.
EntryFileNames
)
{
{
...
...
Assets/Scripts/MDPro3/Servant/OnlineServant.cs
View file @
31c24e53
...
@@ -145,7 +145,6 @@ namespace MDPro3.Servant
...
@@ -145,7 +145,6 @@ namespace MDPro3.Servant
RoomServant
.
FromLocalHost
=
true
;
RoomServant
.
FromLocalHost
=
true
;
RoomServant
.
FromHandTest
=
false
;
RoomServant
.
FromHandTest
=
false
;
BanlistManager
.
PrepareLocalServerLflist
();
YgoServer
.
StartServer
(
args
);
YgoServer
.
StartServer
(
args
);
TcpHelper
.
LinkStart
(
"127.0.0.1"
,
Config
.
Get
(
"DuelPlayerName0"
,
Config
.
EMPTY_STRING
),
port
.
ToString
(),
string
.
Empty
,
true
,
null
);
TcpHelper
.
LinkStart
(
"127.0.0.1"
,
Config
.
Get
(
"DuelPlayerName0"
,
Config
.
EMPTY_STRING
),
port
.
ToString
(),
string
.
Empty
,
true
,
null
);
}
}
...
...
Assets/Scripts/MDPro3/UI/ServantUI/DeckEditorUI.cs
View file @
31c24e53
...
@@ -850,7 +850,7 @@ namespace MDPro3.UI.ServantUI
...
@@ -850,7 +850,7 @@ namespace MDPro3.UI.ServantUI
if
(
DeckIsFromLocal
&&
!
DeckView
.
GetDirty
())
return
;
if
(
DeckIsFromLocal
&&
!
DeckView
.
GetDirty
())
return
;
if
(
DeckIsFromLocal
)
if
(
DeckIsFromLocal
)
if
(
banlist
.
Name
!=
BanlistManager
.
E
mptyBanlistName
)
if
(
banlist
.
Name
!=
BanlistManager
.
E
MPTY_LIST_NAME
)
{
{
if
(
DeckView
.
mainCount
>
60
||
DeckView
.
extraCount
>
15
||
DeckView
.
sideCount
>
15
)
if
(
DeckView
.
mainCount
>
60
||
DeckView
.
extraCount
>
15
||
DeckView
.
sideCount
>
15
)
{
{
...
...
Assets/Scripts/MDPro3/Utility/CardImageLoader.cs
View file @
31c24e53
...
@@ -508,7 +508,7 @@ namespace MDPro3.Utility
...
@@ -508,7 +508,7 @@ namespace MDPro3.Utility
{
{
foreach
(
var
zip
in
ZipHelper
.
zips
)
foreach
(
var
zip
in
ZipHelper
.
zips
)
{
{
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
"script.zip"
))
if
(
zip
.
Name
.
ToLower
().
EndsWith
(
Program
.
SCRIPT_ZIP
))
continue
;
continue
;
foreach
(
var
file
in
zip
.
EntryFileNames
)
foreach
(
var
file
in
zip
.
EntryFileNames
)
{
{
...
...
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