Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
xiaoye
ygopro
Commits
61972cb8
Commit
61972cb8
authored
May 16, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert changes from duplicate
parent
3fe83039
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
36 deletions
+38
-36
gframe/config.h
gframe/config.h
+0
-2
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+3
-3
gframe/deck_manager.h
gframe/deck_manager.h
+19
-15
gframe/single_duel.cpp
gframe/single_duel.cpp
+8
-8
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+8
-8
No files found.
gframe/config.h
View file @
61972cb8
...
@@ -106,6 +106,4 @@ extern bool open_file;
...
@@ -106,6 +106,4 @@ extern bool open_file;
extern
wchar_t
open_file_name
[
256
];
extern
wchar_t
open_file_name
[
256
];
extern
bool
bot_mode
;
extern
bool
bot_mode
;
#define IMATATOR_CODE 4392470
#endif
#endif
gframe/deck_manager.cpp
View file @
61972cb8
...
@@ -118,7 +118,7 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
...
@@ -118,7 +118,7 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
int
code
=
cit
->
second
.
alias
?
cit
->
second
.
alias
:
cit
->
first
;
int
code
=
cit
->
second
.
alias
?
cit
->
second
.
alias
:
cit
->
first
;
ccount
[
code
]
++
;
ccount
[
code
]
++
;
int
dc
=
ccount
[
code
];
int
dc
=
ccount
[
code
];
if
(
dc
>
1
)
if
(
dc
>
3
)
return
(
DECKERROR_CARDCOUNT
<<
28
)
|
cit
->
first
;
return
(
DECKERROR_CARDCOUNT
<<
28
)
|
cit
->
first
;
auto
it
=
list
.
find
(
code
);
auto
it
=
list
.
find
(
code
);
if
(
it
!=
list
.
end
()
&&
dc
>
it
->
second
)
if
(
it
!=
list
.
end
()
&&
dc
>
it
->
second
)
...
@@ -133,7 +133,7 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
...
@@ -133,7 +133,7 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
int
code
=
cit
->
second
.
alias
?
cit
->
second
.
alias
:
cit
->
first
;
int
code
=
cit
->
second
.
alias
?
cit
->
second
.
alias
:
cit
->
first
;
ccount
[
code
]
++
;
ccount
[
code
]
++
;
int
dc
=
ccount
[
code
];
int
dc
=
ccount
[
code
];
if
(
dc
>
1
)
if
(
dc
>
3
)
return
(
DECKERROR_CARDCOUNT
<<
28
)
|
cit
->
first
;
return
(
DECKERROR_CARDCOUNT
<<
28
)
|
cit
->
first
;
auto
it
=
list
.
find
(
code
);
auto
it
=
list
.
find
(
code
);
if
(
it
!=
list
.
end
()
&&
dc
>
it
->
second
)
if
(
it
!=
list
.
end
()
&&
dc
>
it
->
second
)
...
@@ -148,7 +148,7 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
...
@@ -148,7 +148,7 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
int
code
=
cit
->
second
.
alias
?
cit
->
second
.
alias
:
cit
->
first
;
int
code
=
cit
->
second
.
alias
?
cit
->
second
.
alias
:
cit
->
first
;
ccount
[
code
]
++
;
ccount
[
code
]
++
;
int
dc
=
ccount
[
code
];
int
dc
=
ccount
[
code
];
if
(
dc
>
1
)
if
(
dc
>
3
)
return
(
DECKERROR_CARDCOUNT
<<
28
)
|
cit
->
first
;
return
(
DECKERROR_CARDCOUNT
<<
28
)
|
cit
->
first
;
auto
it
=
list
.
find
(
code
);
auto
it
=
list
.
find
(
code
);
if
(
it
!=
list
.
end
()
&&
dc
>
it
->
second
)
if
(
it
!=
list
.
end
()
&&
dc
>
it
->
second
)
...
...
gframe/deck_manager.h
View file @
61972cb8
...
@@ -7,21 +7,23 @@
...
@@ -7,21 +7,23 @@
#include "data_manager.h"
#include "data_manager.h"
#ifndef YGOPRO_MAX_DECK
#ifndef YGOPRO_MAX_DECK
#define YGOPRO_MAX_DECK 6
#define YGOPRO_MAX_DECK 6
0
#endif
#endif
#ifndef YGOPRO_MIN_DECK
#ifndef YGOPRO_MIN_DECK
#define YGOPRO_MIN_DECK 4
#define YGOPRO_MIN_DECK 4
0
#endif
#endif
#ifndef YGOPRO_MAX_EXTRA
#ifndef YGOPRO_MAX_EXTRA
#define YGOPRO_MAX_EXTRA
3
#define YGOPRO_MAX_EXTRA
15
#endif
#endif
#ifndef YGOPRO_MAX_SIDE
#ifndef YGOPRO_MAX_SIDE
#define YGOPRO_MAX_SIDE
3
#define YGOPRO_MAX_SIDE
15
#endif
#endif
#define IMITATOR_CODE 4392470
namespace
ygo
{
namespace
ygo
{
constexpr
int
DECK_MAX_SIZE
=
YGOPRO_MAX_DECK
;
constexpr
int
DECK_MAX_SIZE
=
YGOPRO_MAX_DECK
;
constexpr
int
DECK_MIN_SIZE
=
YGOPRO_MIN_DECK
;
constexpr
int
DECK_MIN_SIZE
=
YGOPRO_MIN_DECK
;
...
@@ -80,20 +82,22 @@ public:
...
@@ -80,20 +82,22 @@ public:
int
SaveDeckToCode
(
Deck
&
deck
,
unsigned
char
*
code
);
int
SaveDeckToCode
(
Deck
&
deck
,
unsigned
char
*
code
);
#endif // YGOPRO_SERVER_MODE
#endif // YGOPRO_SERVER_MODE
template
<
typename
T
>
std
::
vector
<
T
>
MutateVector
(
std
::
vector
<
T
>
vector
,
int32_t
count
)
{
std
::
vector
<
T
>
result
;
for
(
auto
it
:
vector
)
for
(
int32_t
i
=
0
;
i
<
count
;
++
i
)
result
.
push_back
(
it
);
return
result
;
}
Deck
MutateDeck
(
Deck
deck
)
{
Deck
MutateDeck
(
Deck
deck
)
{
Deck
result
;
Deck
result
;
result
.
main
=
MutateVector
(
deck
.
main
,
10
);
uint32_t
imitating_code
=
0
;
result
.
extra
=
MutateVector
(
deck
.
extra
,
5
);
for
(
auto
card
:
deck
.
main
)
{
result
.
side
=
MutateVector
(
deck
.
side
,
5
);
auto
use_card
=
card
;
auto
code
=
card
->
first
;
if
(
code
==
IMITATOR_CODE
)
{
if
(
imitating_code
)
use_card
=
dataManager
.
GetCodePointer
(
imitating_code
);
}
else
imitating_code
=
code
;
result
.
main
.
push_back
(
use_card
);
}
result
.
extra
=
deck
.
extra
;
result
.
side
=
deck
.
side
;
return
result
;
return
result
;
}
}
...
...
gframe/single_duel.cpp
View file @
61972cb8
...
@@ -469,18 +469,18 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
...
@@ -469,18 +469,18 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
if
(
cit
->
second
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
if
(
cit
->
second
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
++
extra_size
[
i
];
++
extra_size
[
i
];
}
}
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
()
*
10
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
extra_size
[
0
]
*
5
);
BufferIO
::
WriteInt16
(
pbuf
,
extra_size
[
0
]);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
main
.
size
()
*
10
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
extra_size
[
1
]
*
5
);
BufferIO
::
WriteInt16
(
pbuf
,
extra_size
[
1
]);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
side
.
size
());
#else
#else
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
()
*
10
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
extra
.
size
()
*
5
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
main
.
size
()
*
10
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
extra
.
size
()
*
5
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
side
.
size
());
#endif
#endif
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
...
...
gframe/tag_duel.cpp
View file @
61972cb8
...
@@ -438,18 +438,18 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
...
@@ -438,18 +438,18 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
if
(
cit
->
second
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
if
(
cit
->
second
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
++
extra_size
[
i
];
++
extra_size
[
i
];
}
}
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
()
*
10
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
extra_size
[
0
]
*
5
);
BufferIO
::
WriteInt16
(
pbuf
,
extra_size
[
0
]);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
main
.
size
()
*
10
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
extra_size
[
1
]
*
5
);
BufferIO
::
WriteInt16
(
pbuf
,
extra_size
[
1
]);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
side
.
size
());
#else
#else
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
()
*
10
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
extra
.
size
()
*
5
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
main
.
size
()
*
10
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
extra
.
size
()
*
5
);
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
side
.
size
());
#endif
#endif
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
...
...
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