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
nanahira
ygopro
Commits
cdf9f488
Commit
cdf9f488
authored
May 07, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set seed from argv
parent
e7257b53
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
3 deletions
+20
-3
gframe/game.cpp
gframe/game.cpp
+1
-0
gframe/game.h
gframe/game.h
+1
-1
gframe/gframe.cpp
gframe/gframe.cpp
+7
-1
gframe/single_duel.cpp
gframe/single_duel.cpp
+5
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+5
-0
ocgcore
ocgcore
+1
-1
No files found.
gframe/game.cpp
View file @
cdf9f488
...
@@ -25,6 +25,7 @@ Game* mainGame;
...
@@ -25,6 +25,7 @@ Game* mainGame;
#ifdef YGOPRO_SERVER_MODE
#ifdef YGOPRO_SERVER_MODE
unsigned
short
aServerPort
;
unsigned
short
aServerPort
;
unsigned
short
replay_mode
;
unsigned
short
replay_mode
;
time_t
pre_seed
[
3
];
HostInfo
game_info
;
HostInfo
game_info
;
void
Game
::
MainServerLoop
()
{
void
Game
::
MainServerLoop
()
{
...
...
gframe/game.h
View file @
cdf9f488
...
@@ -557,8 +557,8 @@ extern Game* mainGame;
...
@@ -557,8 +557,8 @@ extern Game* mainGame;
extern
unsigned
short
aServerPort
;
extern
unsigned
short
aServerPort
;
extern
unsigned
short
replay_mode
;
extern
unsigned
short
replay_mode
;
extern
HostInfo
game_info
;
extern
HostInfo
game_info
;
extern
time_t
pre_seed
[
3
];
#endif
#endif
}
}
#define CARD_IMG_WIDTH 177
#define CARD_IMG_WIDTH 177
...
...
gframe/gframe.cpp
View file @
cdf9f488
...
@@ -73,7 +73,9 @@ int main(int argc, char* argv[]) {
...
@@ -73,7 +73,9 @@ int main(int argc, char* argv[]) {
ygo
::
game_info
.
no_shuffle_deck
=
false
;
ygo
::
game_info
.
no_shuffle_deck
=
false
;
ygo
::
game_info
.
duel_rule
=
DEFAULT_DUEL_RULE
;
ygo
::
game_info
.
duel_rule
=
DEFAULT_DUEL_RULE
;
ygo
::
game_info
.
time_limit
=
180
;
ygo
::
game_info
.
time_limit
=
180
;
if
(
argc
>
1
)
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
ygo
::
pre_seed
[
i
]
=
(
time_t
)
0
;
if
(
argc
>
1
)
{
ygo
::
aServerPort
=
atoi
(
argv
[
1
]);
ygo
::
aServerPort
=
atoi
(
argv
[
1
]);
int
lflist
=
atoi
(
argv
[
2
]);
int
lflist
=
atoi
(
argv
[
2
]);
if
(
lflist
<
0
)
if
(
lflist
<
0
)
...
@@ -108,6 +110,10 @@ int main(int argc, char* argv[]) {
...
@@ -108,6 +110,10 @@ int main(int argc, char* argv[]) {
ygo
::
game_info
.
draw_count
=
atoi
(
argv
[
10
]);
ygo
::
game_info
.
draw_count
=
atoi
(
argv
[
10
]);
ygo
::
game_info
.
time_limit
=
atoi
(
argv
[
11
]);
ygo
::
game_info
.
time_limit
=
atoi
(
argv
[
11
]);
ygo
::
replay_mode
=
atoi
(
argv
[
12
]);
ygo
::
replay_mode
=
atoi
(
argv
[
12
]);
for
(
int
i
=
13
;
(
i
<
argc
&&
i
<=
15
)
;
++
i
)
{
ygo
::
pre_seed
[
i
-
13
]
=
(
time_t
)
atoi
(
argv
[
i
]);
}
}
}
ygo
::
mainGame
=
&
_game
;
ygo
::
mainGame
=
&
_game
;
ygo
::
mainGame
->
MainServerLoop
();
ygo
::
mainGame
->
MainServerLoop
();
...
...
gframe/single_duel.cpp
View file @
cdf9f488
...
@@ -535,6 +535,11 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -535,6 +535,11 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
rh
.
version
=
PRO_VERSION
;
rh
.
version
=
PRO_VERSION
;
rh
.
flag
=
0
;
rh
.
flag
=
0
;
time_t
seed
=
time
(
0
);
time_t
seed
=
time
(
0
);
#ifdef YGOPRO_SERVER_MODE
if
(
pre_seed
[
duel_count
]
>
0
)
{
seed
=
pre_seed
[
duel_count
];
}
#endif
rh
.
seed
=
seed
;
rh
.
seed
=
seed
;
last_replay
.
BeginRecord
();
last_replay
.
BeginRecord
();
last_replay
.
WriteHeader
(
rh
);
last_replay
.
WriteHeader
(
rh
);
...
...
gframe/tag_duel.cpp
View file @
cdf9f488
...
@@ -504,6 +504,11 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -504,6 +504,11 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
rh
.
flag
=
REPLAY_TAG
;
rh
.
flag
=
REPLAY_TAG
;
time_t
seed
=
time
(
0
);
time_t
seed
=
time
(
0
);
rh
.
seed
=
seed
;
rh
.
seed
=
seed
;
#ifdef YGOPRO_SERVER_MODE
if
(
pre_seed
[
0
]
>
0
)
{
seed
=
pre_seed
[
0
];
}
#endif
last_replay
.
BeginRecord
();
last_replay
.
BeginRecord
();
last_replay
.
WriteHeader
(
rh
);
last_replay
.
WriteHeader
(
rh
);
rnd
.
reset
(
seed
);
rnd
.
reset
(
seed
);
...
...
ocgcore
@
d8ee6207
Subproject commit
80f1ced5a185d25d6a421f71a28caacc04e564f2
Subproject commit
d8ee620789d02a1a540f5bd788971268870a72ab
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