Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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
fallenstardust
YGOMobile-Cn-Ko-En
Commits
5f7038fd
Commit
5f7038fd
authored
Mar 30, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update gframe
parent
5949ac30
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
45 deletions
+47
-45
Classes/gframe/deck_manager.cpp
Classes/gframe/deck_manager.cpp
+26
-26
Classes/gframe/deck_manager.h
Classes/gframe/deck_manager.h
+14
-12
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+1
-1
Classes/gframe/menu_handler.cpp
Classes/gframe/menu_handler.cpp
+1
-1
Classes/gframe/network.h
Classes/gframe/network.h
+1
-1
Classes/gframe/single_duel.cpp
Classes/gframe/single_duel.cpp
+2
-2
Classes/gframe/tag_duel.cpp
Classes/gframe/tag_duel.cpp
+1
-1
mobile/assets/changelog.html
mobile/assets/changelog.html
+1
-1
No files found.
Classes/gframe/deck_manager.cpp
View file @
5f7038fd
...
...
@@ -13,6 +13,7 @@ void DeckManager::LoadLFListSingle(const char* path) {
FILE
*
fp
=
std
::
fopen
(
path
,
"r"
);
char
linebuf
[
256
]{};
wchar_t
strBuffer
[
256
]{};
char
str1
[
16
]{};
if
(
fp
)
{
while
(
std
::
fgets
(
linebuf
,
sizeof
linebuf
,
fp
))
{
if
(
linebuf
[
0
]
==
'#'
)
...
...
@@ -32,10 +33,11 @@ void DeckManager::LoadLFListSingle(const char* path) {
continue
;
unsigned
int
code
=
0
;
int
count
=
-
1
;
if
(
std
::
sscanf
(
linebuf
,
"%
9u%*[ ]%9d"
,
&
code
,
&
count
)
!=
2
)
if
(
std
::
sscanf
(
linebuf
,
"%
10s%*[ ]%1d"
,
str1
,
&
count
)
!=
2
)
continue
;
if
(
count
<
0
||
count
>
2
)
continue
;
code
=
std
::
strtoul
(
str1
,
nullptr
,
10
);
cur
->
content
[
code
]
=
count
;
cur
->
hash
=
cur
->
hash
^
((
code
<<
18
)
|
(
code
>>
14
))
^
((
code
<<
(
27
+
count
))
|
(
code
>>
(
5
-
count
)));
}
...
...
@@ -140,13 +142,12 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
}
return
0
;
}
int
DeckManager
::
LoadDeck
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
,
bool
is_packlist
)
{
uint32_t
DeckManager
::
LoadDeck
(
Deck
&
deck
,
uint32_t
dbuf
[]
,
int
mainc
,
int
sidec
,
bool
is_packlist
)
{
deck
.
clear
();
int
code
;
int
errorcode
=
0
;
uint32_t
errorcode
=
0
;
CardData
cd
;
for
(
int
i
=
0
;
i
<
mainc
;
++
i
)
{
code
=
dbuf
[
i
];
auto
code
=
dbuf
[
i
];
if
(
!
dataManager
.
GetData
(
code
,
&
cd
))
{
errorcode
=
code
;
continue
;
...
...
@@ -169,7 +170,7 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec, bool is_p
}
}
for
(
int
i
=
0
;
i
<
sidec
;
++
i
)
{
code
=
dbuf
[
mainc
+
i
];
auto
code
=
dbuf
[
mainc
+
i
];
if
(
!
dataManager
.
GetData
(
code
,
&
cd
))
{
errorcode
=
code
;
continue
;
...
...
@@ -183,22 +184,21 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec, bool is_p
}
return
errorcode
;
}
int
DeckManager
::
LoadDeck
(
Deck
&
deck
,
std
::
istringstream
&
deckStream
,
bool
is_packlist
)
{
size_
t
ct
=
0
;
int
mainc
=
0
,
sidec
=
0
,
code
=
0
;
in
t
cardlist
[
PACK_MAX_SIZE
]{};
uint32_t
DeckManager
::
LoadDeckFromStream
(
Deck
&
deck
,
std
::
istringstream
&
deckStream
,
bool
is_packlist
)
{
in
t
ct
=
0
;
int
mainc
=
0
,
sidec
=
0
;
uint32_
t
cardlist
[
PACK_MAX_SIZE
]{};
bool
is_side
=
false
;
std
::
string
linebuf
;
while
(
std
::
getline
(
deckStream
,
linebuf
,
'\n'
)
&&
ct
<
(
sizeof
cardlist
/
sizeof
cardlist
[
0
])
)
{
while
(
std
::
getline
(
deckStream
,
linebuf
,
'\n'
)
&&
ct
<
PACK_MAX_SIZE
)
{
if
(
linebuf
[
0
]
==
'!'
)
{
is_side
=
true
;
continue
;
}
if
(
linebuf
[
0
]
<
'0'
||
linebuf
[
0
]
>
'9'
)
continue
;
errno
=
0
;
code
=
std
::
strtol
(
linebuf
.
c_str
(),
nullptr
,
10
);
if
(
errno
==
ERANGE
)
auto
code
=
std
::
strtoul
(
linebuf
.
c_str
(),
nullptr
,
10
);
if
(
code
>=
UINT32_MAX
)
continue
;
cardlist
[
ct
++
]
=
code
;
if
(
is_side
)
...
...
@@ -208,32 +208,32 @@ int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_pa
}
return
LoadDeck
(
deck
,
cardlist
,
mainc
,
sidec
,
is_packlist
);
}
bool
DeckManager
::
LoadSide
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
)
{
std
::
unordered_map
<
in
t
,
int
>
pcount
;
std
::
unordered_map
<
in
t
,
int
>
ncount
;
bool
DeckManager
::
LoadSide
(
Deck
&
deck
,
uint32_t
dbuf
[]
,
int
mainc
,
int
sidec
)
{
std
::
unordered_map
<
uint32_
t
,
int
>
pcount
;
std
::
unordered_map
<
uint32_
t
,
int
>
ncount
;
for
(
size_t
i
=
0
;
i
<
deck
.
main
.
size
();
++
i
)
++
pcount
[
deck
.
main
[
i
]
->
first
]
;
pcount
[
deck
.
main
[
i
]
->
first
]
++
;
for
(
size_t
i
=
0
;
i
<
deck
.
extra
.
size
();
++
i
)
++
pcount
[
deck
.
extra
[
i
]
->
first
]
;
pcount
[
deck
.
extra
[
i
]
->
first
]
++
;
for
(
size_t
i
=
0
;
i
<
deck
.
side
.
size
();
++
i
)
++
pcount
[
deck
.
side
[
i
]
->
first
]
;
pcount
[
deck
.
side
[
i
]
->
first
]
++
;
Deck
ndeck
;
LoadDeck
(
ndeck
,
dbuf
,
mainc
,
sidec
);
if
(
ndeck
.
main
.
size
()
!=
deck
.
main
.
size
()
||
ndeck
.
extra
.
size
()
!=
deck
.
extra
.
size
()
||
ndeck
.
side
.
size
()
!=
deck
.
side
.
size
())
return
false
;
for
(
size_t
i
=
0
;
i
<
ndeck
.
main
.
size
();
++
i
)
++
ncount
[
ndeck
.
main
[
i
]
->
first
]
;
ncount
[
ndeck
.
main
[
i
]
->
first
]
++
;
for
(
size_t
i
=
0
;
i
<
ndeck
.
extra
.
size
();
++
i
)
++
ncount
[
ndeck
.
extra
[
i
]
->
first
]
;
ncount
[
ndeck
.
extra
[
i
]
->
first
]
++
;
for
(
size_t
i
=
0
;
i
<
ndeck
.
side
.
size
();
++
i
)
++
ncount
[
ndeck
.
side
[
i
]
->
first
]
;
ncount
[
ndeck
.
side
[
i
]
->
first
]
++
;
for
(
auto
&
cdit
:
ncount
)
if
(
cdit
.
second
!=
pcount
[
cdit
.
first
])
return
false
;
deck
=
ndeck
;
return
true
;
}
void
DeckManager
::
GetCategoryPath
(
wchar_t
*
ret
,
int
index
,
const
wchar_t
*
text
,
bool
showPack
)
{
void
DeckManager
::
GetCategoryPath
(
wchar_t
*
ret
,
int
index
,
const
wchar_t
*
text
,
bool
showPack
)
{
//hide packlist if showing on duelling ready
wchar_t
catepath
[
256
];
switch
(
index
)
{
case
0
:
...
...
@@ -309,8 +309,8 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
return
false
;
}
std
::
istringstream
deckStream
(
deckBuffer
);
LoadDeck
(
current_deck
,
deckStream
,
is_packlist
);
return
true
;
// the above
LoadDeck
has return value but we ignore it here for now
LoadDeck
FromStream
(
current_deck
,
deckStream
,
is_packlist
);
return
true
;
// the above
function
has return value but we ignore it here for now
}
bool
DeckManager
::
LoadCurrentDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
wchar_t
filepath
[
256
];
...
...
Classes/gframe/deck_manager.h
View file @
5f7038fd
...
...
@@ -48,21 +48,23 @@ public:
const
wchar_t
*
GetLFListName
(
unsigned
int
lfhash
);
const
LFList
*
GetLFList
(
unsigned
int
lfhash
);
unsigned
int
CheckDeck
(
const
Deck
&
deck
,
unsigned
int
lfhash
,
int
rule
);
int
LoadDeck
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
,
bool
is_packlist
=
false
);
int
LoadDeck
(
Deck
&
deck
,
std
::
istringstream
&
deckStream
,
bool
is_packlist
=
false
);
bool
LoadSide
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
void
GetCategoryPath
(
wchar_t
*
ret
,
int
index
,
const
wchar_t
*
text
,
bool
showPack
);
//
void
GetDeckFile
(
wchar_t
*
ret
,
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
FILE
*
OpenDeckFile
(
const
wchar_t
*
file
,
const
char
*
mode
);
irr
::
io
::
IReadFile
*
OpenDeckReader
(
const
wchar_t
*
file
);
bool
LoadCurrentDeck
(
const
wchar_t
*
file
,
bool
is_packlist
=
false
);
bool
LoadCurrentDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
bool
SaveDeck
(
Deck
&
deck
,
const
wchar_t
*
file
);
bool
DeleteDeck
(
const
wchar_t
*
file
);
bool
CreateCategory
(
const
wchar_t
*
name
);
bool
RenameCategory
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
bool
DeleteCategory
(
const
wchar_t
*
name
);
bool
SaveDeckBuffer
(
const
int
deckbuf
[],
const
wchar_t
*
name
);
static
uint32_t
LoadDeck
(
Deck
&
deck
,
uint32_t
dbuf
[],
int
mainc
,
int
sidec
,
bool
is_packlist
=
false
);
static
uint32_t
LoadDeckFromStream
(
Deck
&
deck
,
std
::
istringstream
&
deckStream
,
bool
is_packlist
=
false
);
static
bool
LoadSide
(
Deck
&
deck
,
uint32_t
dbuf
[],
int
mainc
,
int
sidec
);
static
void
GetCategoryPath
(
wchar_t
*
ret
,
int
index
,
const
wchar_t
*
text
,
bool
showPack
);
//
static
void
GetDeckFile
(
wchar_t
*
ret
,
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
static
FILE
*
OpenDeckFile
(
const
wchar_t
*
file
,
const
char
*
mode
);
static
irr
::
io
::
IReadFile
*
OpenDeckReader
(
const
wchar_t
*
file
);
static
bool
SaveDeck
(
Deck
&
deck
,
const
wchar_t
*
file
);
static
bool
DeleteDeck
(
const
wchar_t
*
file
);
static
bool
CreateCategory
(
const
wchar_t
*
name
);
static
bool
RenameCategory
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
bool
DeleteCategory
(
const
wchar_t
*
name
);
int
TypeCount
(
std
::
vector
<
code_pointer
>
list
,
unsigned
int
ctype
);
};
...
...
Classes/gframe/game.cpp
View file @
5f7038fd
...
...
@@ -1695,7 +1695,7 @@ void Game::RefreshDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBo
}
}
wchar_t
catepath
[
256
];
deckManager
.
GetCategoryPath
(
catepath
,
cbCategory
->
getSelected
(),
cbCategory
->
getText
(),
cbCategory
==
mainGame
->
cbDBCategory
);
DeckManager
::
GetCategoryPath
(
catepath
,
cbCategory
->
getSelected
(),
cbCategory
->
getText
(),
cbCategory
==
mainGame
->
cbDBCategory
);
cbDeck
->
clear
();
RefreshDeck
(
catepath
,
[
cbDeck
](
const
wchar_t
*
item
)
{
cbDeck
->
addItem
(
item
);
});
}
...
...
Classes/gframe/menu_handler.cpp
View file @
5f7038fd
...
...
@@ -464,7 +464,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
wchar_t
warg1
[
512
];
if
(
mainGame
->
botInfo
[
sel
].
select_deckfile
)
{
wchar_t
botdeck
[
256
];
deckManager
.
GetDeckFile
(
botdeck
,
mainGame
->
cbBotDeckCategory
,
mainGame
->
cbBotDeck
);
DeckManager
::
GetDeckFile
(
botdeck
,
mainGame
->
cbBotDeckCategory
,
mainGame
->
cbBotDeck
);
myswprintf
(
warg1
,
L"%ls DeckFile='%ls'"
,
mainGame
->
botInfo
[
sel
].
command
,
botdeck
);
}
else
...
...
Classes/gframe/network.h
View file @
5f7038fd
...
...
@@ -57,7 +57,7 @@ static_assert(sizeof(HostRequest) == 2, "size mismatch: HostRequest");
struct
CTOS_DeckData
{
int32_t
mainc
{};
int32_t
sidec
{};
int32_t
list
[
MAINC_MAX
+
SIDEC_MAX
]{};
u
int32_t
list
[
MAINC_MAX
+
SIDEC_MAX
]{};
};
check_trivially_copyable
(
CTOS_DeckData
);
...
...
Classes/gframe/single_duel.cpp
View file @
5f7038fd
...
...
@@ -297,9 +297,9 @@ void SingleDuel::UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) {
return
;
}
if
(
duel_count
==
0
)
{
deck_error
[
dp
->
type
]
=
deckManager
.
LoadDeck
(
pdeck
[
dp
->
type
],
deckbuf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
);
deck_error
[
dp
->
type
]
=
DeckManager
::
LoadDeck
(
pdeck
[
dp
->
type
],
deckbuf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
);
}
else
{
if
(
deckManager
.
LoadSide
(
pdeck
[
dp
->
type
],
deckbuf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
))
{
if
(
DeckManager
::
LoadSide
(
pdeck
[
dp
->
type
],
deckbuf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
))
{
ready
[
dp
->
type
]
=
true
;
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_DUEL_START
);
if
(
ready
[
0
]
&&
ready
[
1
])
{
...
...
Classes/gframe/tag_duel.cpp
View file @
5f7038fd
...
...
@@ -279,7 +279,7 @@ void TagDuel::UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) {
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_ERROR_MSG
,
scem
);
return
;
}
deck_error
[
dp
->
type
]
=
deckManager
.
LoadDeck
(
pdeck
[
dp
->
type
],
deckbuf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
);
deck_error
[
dp
->
type
]
=
DeckManager
::
LoadDeck
(
pdeck
[
dp
->
type
],
deckbuf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
);
}
void
TagDuel
::
StartDuel
(
DuelPlayer
*
dp
)
{
if
(
dp
!=
host_player
)
...
...
mobile/assets/changelog.html
View file @
5f7038fd
...
...
@@ -21,7 +21,7 @@
<pre>
更新:
1.更新ygopro内核;
2.新卡DBJH+VJ;
2.新卡DBJH+V
X05+V
J;
3.2025.4 OCG禁卡表;
变更:
1.优化部分场景下超量素材显示到超量怪兽上方的问题;
...
...
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