Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
fe598f01
Commit
fe598f01
authored
Aug 09, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f67834ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
gframe/replay.cpp
gframe/replay.cpp
+10
-10
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-1
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-1
No files found.
gframe/replay.cpp
View file @
fe598f01
...
...
@@ -22,7 +22,7 @@ Replay::~Replay() {
}
void
Replay
::
BeginRecord
()
{
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
>
0
)
{
if
(
replay_mode
>
0
)
{
#endif
#ifdef _WIN32
if
(
is_recording
)
...
...
@@ -33,7 +33,7 @@ void Replay::BeginRecord() {
wchar_t
tmppath
[
80
];
wcsftime
(
tmppath
,
80
,
L"./replay/%Y-%m-%d %H-%M-%S %%u.yrp"
,
localedtime
);
wchar_t
path
[
80
];
myswprintf
(
path
,
tmppath
,
ygo
::
aServerPort
);
myswprintf
(
path
,
tmppath
,
aServerPort
);
recording_fp
=
CreateFileW
(
path
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_FLAG_WRITE_THROUGH
,
NULL
);
#else
recording_fp
=
CreateFileW
(
L"./replay/_LastReplay.yrp"
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_FLAG_WRITE_THROUGH
,
NULL
);
...
...
@@ -49,7 +49,7 @@ void Replay::BeginRecord() {
char
tmppath
[
40
];
strftime
(
tmppath
,
40
,
"./replay/%Y-%m-%d %H-%M-%S %%u.yrp"
,
localedtime
);
char
path
[
40
];
sprintf
(
path
,
tmppath
,
ygo
::
aServerPort
);
sprintf
(
path
,
tmppath
,
aServerPort
);
fp
=
fopen
(
path
,
"wb"
);
#else
fp
=
fopen
(
"./replay/_LastReplay.yrp"
,
"wb"
);
...
...
@@ -66,7 +66,7 @@ void Replay::BeginRecord() {
void
Replay
::
WriteHeader
(
ReplayHeader
&
header
)
{
pheader
=
header
;
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
==
0
)
return
;
if
(
replay_mode
==
0
)
return
;
#endif
#ifdef _WIN32
DWORD
size
;
...
...
@@ -82,7 +82,7 @@ void Replay::WriteData(const void* data, unsigned int length, bool flush) {
memcpy
(
pdata
,
data
,
length
);
pdata
+=
length
;
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
==
0
)
return
;
if
(
replay_mode
==
0
)
return
;
#endif
#ifdef _WIN32
DWORD
size
;
...
...
@@ -99,7 +99,7 @@ void Replay::WriteInt32(int data, bool flush) {
*
((
int
*
)(
pdata
))
=
data
;
pdata
+=
4
;
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
==
0
)
return
;
if
(
replay_mode
==
0
)
return
;
#endif
#ifdef _WIN32
DWORD
size
;
...
...
@@ -116,7 +116,7 @@ void Replay::WriteInt16(short data, bool flush) {
*
((
short
*
)(
pdata
))
=
data
;
pdata
+=
2
;
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
==
0
)
return
;
if
(
replay_mode
==
0
)
return
;
#endif
#ifdef _WIN32
DWORD
size
;
...
...
@@ -133,7 +133,7 @@ void Replay::WriteInt8(char data, bool flush) {
*
pdata
=
data
;
pdata
++
;
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
==
0
)
return
;
if
(
replay_mode
==
0
)
return
;
#endif
#ifdef _WIN32
DWORD
size
;
...
...
@@ -148,7 +148,7 @@ void Replay::Flush() {
if
(
!
is_recording
)
return
;
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
==
0
)
return
;
if
(
replay_mode
==
0
)
return
;
#endif
#ifdef _WIN32
#else
...
...
@@ -159,7 +159,7 @@ void Replay::EndRecord() {
if
(
!
is_recording
)
return
;
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
>
0
)
{
if
(
replay_mode
>
0
)
{
#endif
#ifdef _WIN32
CloseHandle
(
recording_fp
);
...
...
gframe/single_duel.cpp
View file @
fe598f01
...
...
@@ -1664,7 +1664,7 @@ void SingleDuel::EndDuel() {
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_REPLAY
,
replaybuf
,
sizeof
(
ReplayHeader
)
+
last_replay
.
comp_size
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
==
0
)
{
if
(
replay_mode
==
0
)
{
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
NetServer
::
ReSendToPlayers
(
cache_recorder
,
replay_recorder
);
...
...
gframe/tag_duel.cpp
View file @
fe598f01
...
...
@@ -1715,7 +1715,7 @@ void TagDuel::EndDuel() {
NetServer
::
ReSendToPlayer
(
players
[
2
]);
NetServer
::
ReSendToPlayer
(
players
[
3
]);
#ifdef YGOPRO_SERVER_MODE
if
(
ygo
::
replay_mode
==
0
)
{
if
(
replay_mode
==
0
)
{
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
NetServer
::
ReSendToPlayers
(
cache_recorder
,
replay_recorder
);
...
...
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