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
REIKAI
ygopro
Commits
39327771
Commit
39327771
authored
Dec 13, 2017
by
edo9300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Custom compressing size and single mode cleanup
parent
d1c4b218
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
264 deletions
+43
-264
gframe/replay.cpp
gframe/replay.cpp
+2
-2
gframe/replay.h
gframe/replay.h
+1
-1
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-1
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+36
-254
gframe/single_mode.h
gframe/single_mode.h
+1
-4
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-1
No files found.
gframe/replay.cpp
View file @
39327771
...
...
@@ -129,7 +129,7 @@ void Replay::Flush() {
fflush
(
fp
);
#endif
}
void
Replay
::
EndRecord
()
{
void
Replay
::
EndRecord
(
size_t
size
)
{
if
(
!
is_recording
)
return
;
if
(
is_writing
)
...
...
@@ -141,7 +141,7 @@ void Replay::EndRecord() {
pheader
.
datasize
=
pdata
-
replay_data
;
pheader
.
flag
|=
REPLAY_COMPRESSED
;
size_t
propsize
=
5
;
comp_size
=
0x20000
;
comp_size
=
size
;
LzmaCompress
(
comp_data
,
&
comp_size
,
replay_data
,
pdata
-
replay_data
,
pheader
.
props
,
&
propsize
,
5
,
1
<<
24
,
3
,
0
,
2
,
32
,
1
);
is_recording
=
false
;
}
...
...
gframe/replay.h
View file @
39327771
...
...
@@ -35,7 +35,7 @@ public:
void
WriteInt16
(
short
data
,
bool
flush
=
true
);
void
WriteInt8
(
char
data
,
bool
flush
=
true
);
void
Flush
();
void
EndRecord
();
void
EndRecord
(
size_t
size
=
0x20000
);
void
SaveReplay
(
const
wchar_t
*
name
);
bool
OpenReplay
(
const
wchar_t
*
name
);
static
bool
CheckReplay
(
const
wchar_t
*
name
);
...
...
gframe/replay_mode.cpp
View file @
39327771
...
...
@@ -246,7 +246,7 @@ bool ReplayMode::ReplayAnalyze(BufferIO::ReplayPacket p) {
break
;
}
case
OLD_REPLAY_MODE
:
break
;
return
true
;
}
DuelClient
::
ClientAnalyze
((
char
*
)
p
.
data
,
p
.
length
);
if
(
pauseable
)
{
...
...
gframe/single_duel.cpp
View file @
39327771
...
...
@@ -1489,7 +1489,7 @@ void SingleDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) {
void
SingleDuel
::
EndDuel
()
{
if
(
!
pduel
)
return
;
last_replay
.
EndRecord
();
last_replay
.
EndRecord
(
0x1000
);
char
replaybuf
[
0x2000
],
*
pbuf
=
replaybuf
;
memcpy
(
pbuf
,
&
last_replay
.
pheader
,
sizeof
(
ReplayHeader
));
pbuf
+=
sizeof
(
ReplayHeader
);
...
...
gframe/single_mode.cpp
View file @
39327771
...
...
@@ -144,7 +144,7 @@ int SingleMode::SinglePlayThread(void* param) {
is_continuing
=
SinglePlayAnalyze
(
engineBuffer
,
len
);
}
}
last_replay
.
EndRecord
();
last_replay
.
EndRecord
(
0x1000
);
char
replaybuf
[
0x2000
],
*
pbuf
=
replaybuf
;
memcpy
(
pbuf
,
&
last_replay
.
pheader
,
sizeof
(
ReplayHeader
));
pbuf
+=
sizeof
(
ReplayHeader
);
...
...
@@ -416,7 +416,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case
MSG_SHUFFLE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
SinglePlayRefresh
Deck
(
player
);
SinglePlayRefresh
(
player
,
LOCATION_DECK
,
0x181fff
);
break
;
}
case
MSG_SHUFFLE_HAND
:
{
...
...
@@ -441,13 +441,13 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case
MSG_SWAP_GRAVE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
SinglePlayRefresh
Grave
(
player
);
SinglePlayRefresh
(
player
,
LOCATION_GRAVE
,
0x181fff
);
break
;
}
case
MSG_REVERSE_DECK
:
{
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
SinglePlayRefresh
Deck
(
0
);
SinglePlayRefresh
Deck
(
1
);
SinglePlayRefresh
(
0
,
LOCATION_DECK
,
0x181fff
);
SinglePlayRefresh
(
1
,
LOCATION_DECK
,
0x181fff
);
break
;
}
case
MSG_DECK_TOP
:
{
...
...
@@ -562,8 +562,8 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case
MSG_CHAIN_END
:
{
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
SinglePlayRefresh
();
SinglePlayRefresh
Deck
(
0
);
SinglePlayRefresh
Deck
(
1
);
SinglePlayRefresh
(
0
,
LOCATION_DECK
,
0x181fff
);
SinglePlayRefresh
(
1
,
LOCATION_DECK
,
0x181fff
);
break
;
}
case
MSG_CHAIN_NEGATED
:
{
...
...
@@ -760,8 +760,8 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
player
=
pbuf
[
0
];
pbuf
+=
pbuf
[
2
]
*
4
+
pbuf
[
4
]
*
4
+
9
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
SinglePlayRefresh
Deck
(
player
);
SinglePlayRefresh
Extra
(
player
);
SinglePlayRefresh
(
player
,
LOCATION_DECK
,
0x181fff
);
SinglePlayRefresh
(
player
,
LOCATION_EXTRA
,
0x181fff
);
break
;
}
case
MSG_MATCH_KILL
:
{
...
...
@@ -877,116 +877,17 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
}
return
is_continuing
;
}
void
SingleMode
::
SinglePlayRefresh
(
int
flag
)
{
void
SingleMode
::
SinglePlayRefresh
(
int
player
,
int
location
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
char
queryBuffer2
[
0x2000
];
char
*
qbuf
=
queryBuffer2
;
BufferIO
::
ReplayPacket
p
;
int
len
=
query_field_card
(
pduel
,
0
,
LOCATION_MZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_MZONE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_MZONE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_MZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_MZONE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_MZONE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
0
,
LOCATION_SZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_SZONE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_SZONE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_SZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_SZONE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_SZONE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
0
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_HAND
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_HAND
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
}
void
SingleMode
::
SinglePlayRefreshHand
(
int
player
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
char
queryBuffer2
[
0x2000
];
char
*
qbuf
=
queryBuffer2
;
int
len
=
query_field_card
(
pduel
,
player
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
int
len
=
query_field_card
(
pduel
,
player
,
location
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
location
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_HAND
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
BufferIO
::
ReplayPacket
p
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
}
void
SingleMode
::
SinglePlayRefreshGrave
(
int
player
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
char
queryBuffer2
[
0x2000
];
char
*
qbuf
=
queryBuffer2
;
int
len
=
query_field_card
(
pduel
,
player
,
LOCATION_GRAVE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
LOCATION_GRAVE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_GRAVE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
BufferIO
::
ReplayPacket
p
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
}
void
SingleMode
::
SinglePlayRefreshDeck
(
int
player
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
char
queryBuffer2
[
0x2000
];
char
*
qbuf
=
queryBuffer2
;
int
len
=
query_field_card
(
pduel
,
player
,
LOCATION_DECK
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
LOCATION_DECK
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_DECK
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
BufferIO
::
ReplayPacket
p
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
}
void
SingleMode
::
SinglePlayRefreshExtra
(
int
player
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
char
queryBuffer2
[
0x2000
];
char
*
qbuf
=
queryBuffer2
;
int
len
=
query_field_card
(
pduel
,
player
,
LOCATION_EXTRA
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
LOCATION_EXTRA
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_EXTRA
);
BufferIO
::
WriteInt8
(
qbuf
,
location
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
BufferIO
::
ReplayPacket
p
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
replay_stream
.
push_back
(
BufferIO
::
ReplayPacket
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
));
}
void
SingleMode
::
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
...
...
@@ -1001,149 +902,30 @@ void SingleMode::SinglePlayRefreshSingle(int player, int location, int sequence,
BufferIO
::
ReplayPacket
p
(
MSG_UPDATE_CARD
,
queryBuffer2
,
len
+
3
);
replay_stream
.
push_back
(
p
);
}
void
SingleMode
::
SinglePlayRefresh
(
int
flag
)
{
SinglePlayRefresh
(
0
,
LOCATION_MZONE
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_MZONE
,
flag
);
SinglePlayRefresh
(
0
,
LOCATION_SZONE
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_SZONE
,
flag
);
SinglePlayRefresh
(
0
,
LOCATION_HAND
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_HAND
,
flag
);
}
void
SingleMode
::
SinglePlayReload
()
{
unsigned
char
queryBuffer
[
0x2000
];
char
queryBuffer2
[
0x2000
];
char
*
qbuf
=
queryBuffer2
;
unsigned
int
flag
=
0xffdfff
;
BufferIO
::
ReplayPacket
p
;
int
len
=
query_field_card
(
pduel
,
0
,
LOCATION_MZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_MZONE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_MZONE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_MZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_MZONE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_MZONE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
0
,
LOCATION_SZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_SZONE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_SZONE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_SZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_SZONE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_SZONE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
0
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_HAND
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_HAND
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
0
,
LOCATION_DECK
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_DECK
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_DECK
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_DECK
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_DECK
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_DECK
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
0
,
LOCATION_EXTRA
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_EXTRA
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_EXTRA
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_EXTRA
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_EXTRA
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_EXTRA
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
0
,
LOCATION_GRAVE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_GRAVE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_GRAVE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_GRAVE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_GRAVE
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_GRAVE
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
0
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
0
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_REMOVED
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
qbuf
=
queryBuffer2
;
len
=
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
BufferIO
::
WriteInt8
(
qbuf
,
1
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_REMOVED
);
memcpy
(
qbuf
,
(
char
*
)
queryBuffer
,
len
);
p
.
Set
(
MSG_UPDATE_DATA
,
queryBuffer2
,
len
+
2
);
replay_stream
.
push_back
(
p
);
SinglePlayRefresh
(
0
,
LOCATION_MZONE
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_MZONE
,
flag
);
SinglePlayRefresh
(
0
,
LOCATION_SZONE
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_SZONE
,
flag
);
SinglePlayRefresh
(
0
,
LOCATION_HAND
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_HAND
,
flag
);
SinglePlayRefresh
(
0
,
LOCATION_DECK
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_DECK
,
flag
);
SinglePlayRefresh
(
0
,
LOCATION_EXTRA
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_EXTRA
,
flag
);
SinglePlayRefresh
(
0
,
LOCATION_GRAVE
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_GRAVE
,
flag
);
SinglePlayRefresh
(
0
,
LOCATION_REMOVED
,
flag
);
SinglePlayRefresh
(
1
,
LOCATION_REMOVED
,
flag
);
}
byte
*
SingleMode
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
FILE
*
fp
;
...
...
gframe/single_mode.h
View file @
39327771
...
...
@@ -18,11 +18,8 @@ public:
static
int
SinglePlayThread
(
void
*
param
);
static
bool
SinglePlayAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
void
SinglePlayRefresh
(
int
player
,
int
location
,
int
flag
=
0xf81fff
);
static
void
SinglePlayRefresh
(
int
flag
=
0xf81fff
);
static
void
SinglePlayRefreshHand
(
int
player
,
int
flag
=
0x781fff
);
static
void
SinglePlayRefreshGrave
(
int
player
,
int
flag
=
0x181fff
);
static
void
SinglePlayRefreshDeck
(
int
player
,
int
flag
=
0x181fff
);
static
void
SinglePlayRefreshExtra
(
int
player
,
int
flag
=
0x181fff
);
static
void
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
SinglePlayReload
();
...
...
gframe/tag_duel.cpp
View file @
39327771
...
...
@@ -1572,7 +1572,7 @@ void TagDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) {
void
TagDuel
::
EndDuel
()
{
if
(
!
pduel
)
return
;
last_replay
.
EndRecord
();
last_replay
.
EndRecord
(
0x1000
);
char
replaybuf
[
0x2000
],
*
pbuf
=
replaybuf
;
memcpy
(
pbuf
,
&
last_replay
.
pheader
,
sizeof
(
ReplayHeader
));
pbuf
+=
sizeof
(
ReplayHeader
);
...
...
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