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
YGOPRO-520DIY
ygopro
Commits
a5dce932
Commit
a5dce932
authored
Jun 18, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refa pre_seed to base64
parent
be81756e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
8 deletions
+24
-8
gframe/game.cpp
gframe/game.cpp
+2
-1
gframe/game.h
gframe/game.h
+4
-1
gframe/gframe.cpp
gframe/gframe.cpp
+16
-4
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+2
-2
No files found.
gframe/game.cpp
View file @
a5dce932
...
...
@@ -71,7 +71,8 @@ void DuelInfo::Clear() {
#ifdef YGOPRO_SERVER_MODE
unsigned
short
server_port
;
unsigned
short
replay_mode
;
unsigned
int
pre_seed
[
3
];
uint32_t
pre_seed
[
MAX_MATCH_COUNT
][
SEED_COUNT
];
uint8_t
pre_seed_specified
[
MAX_MATCH_COUNT
];
HostInfo
game_info
;
void
Game
::
MainServerLoop
()
{
...
...
gframe/game.h
View file @
a5dce932
...
...
@@ -654,10 +654,13 @@ public:
extern
Game
*
mainGame
;
#ifdef YGOPRO_SERVER_MODE
#define MAX_MATCH_COUNT 3
extern
unsigned
short
server_port
;
extern
unsigned
short
replay_mode
;
extern
HostInfo
game_info
;
extern
unsigned
int
pre_seed
[
3
];
extern
uint32_t
pre_seed
[
MAX_MATCH_COUNT
][
SEED_COUNT
];
extern
uint8_t
pre_seed_specified
[
MAX_MATCH_COUNT
];
#endif
}
...
...
gframe/gframe.cpp
View file @
a5dce932
...
...
@@ -7,6 +7,9 @@
#ifdef __APPLE__
#import <CoreFoundation/CoreFoundation.h>
#endif
#ifdef YGOPRO_SERVER_MODE
#include "base64.h"
#endif
unsigned
int
enable_log
=
0x3
;
#ifndef YGOPRO_SERVER_MODE
...
...
@@ -82,8 +85,8 @@ int main(int argc, char* argv[]) {
ygo
::
game_info
.
no_shuffle_deck
=
false
;
ygo
::
game_info
.
duel_rule
=
DEFAULT_DUEL_RULE
;
ygo
::
game_info
.
time_limit
=
180
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
ygo
::
pre_seed
[
i
]
=
(
unsigned
int
)
0
;
std
::
memset
(
ygo
::
pre_seed
,
0
,
sizeof
(
ygo
::
pre_seed
));
std
::
memset
(
ygo
::
pre_seed_specified
,
0
,
sizeof
(
ygo
::
pre_seed_specified
))
;
if
(
argc
>
1
)
{
ygo
::
server_port
=
atoi
(
argv
[
1
]);
int
lflist
=
atoi
(
argv
[
2
]);
...
...
@@ -119,9 +122,18 @@ int main(int argc, char* argv[]) {
ygo
::
game_info
.
draw_count
=
atoi
(
argv
[
10
]);
ygo
::
game_info
.
time_limit
=
atoi
(
argv
[
11
]);
ygo
::
replay_mode
=
atoi
(
argv
[
12
]);
for
(
int
i
=
13
;
(
i
<
argc
&&
i
<
=
15
)
;
++
i
)
for
(
int
i
=
13
;
(
i
<
argc
&&
i
<
(
13
+
MAX_MATCH_COUNT
)
)
;
++
i
)
{
ygo
::
pre_seed
[
i
-
13
]
=
(
unsigned
int
)
atol
(
argv
[
i
]);
auto
ok
=
Base64
::
Decode
(
reinterpret_cast
<
const
unsigned
char
*>
(
argv
[
i
]),
strlen
(
argv
[
i
]),
reinterpret_cast
<
unsigned
char
*>
(
ygo
::
pre_seed
[
i
-
13
]),
SEED_COUNT
*
sizeof
(
uint32_t
)
);
if
(
ok
)
ygo
::
pre_seed_specified
[
i
-
13
]
=
1
;
else
std
::
fprintf
(
stderr
,
"Failed to decode seed %d: %s
\n
"
,
i
-
13
,
argv
[
i
]);
}
}
ygo
::
mainGame
=
&
_game
;
...
...
gframe/tag_duel.cpp
View file @
a5dce932
...
...
@@ -517,8 +517,8 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
rh
.
base
.
flag
=
REPLAY_UNIFORM
|
REPLAY_TAG
;
rh
.
base
.
start_time
=
(
uint32_t
)
std
::
time
(
nullptr
);
#ifdef YGOPRO_SERVER_MODE
if
(
pre_seed_specified
[
duel_count
])
memcpy
(
rh
.
seed_sequence
,
pre_seed
[
duel_count
],
SEED_COUNT
*
sizeof
(
uint32_t
));
if
(
pre_seed_specified
[
0
])
memcpy
(
rh
.
seed_sequence
,
pre_seed
[
0
],
SEED_COUNT
*
sizeof
(
uint32_t
));
else
#endif
for
(
auto
&
x
:
rh
.
seed_sequence
)
...
...
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