Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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-core
Commits
2fbe3c02
Commit
2fbe3c02
authored
Jun 17, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make query_field_info return buffer length
parent
e89bd614
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
ocgapi.cpp
ocgapi.cpp
+10
-1
No files found.
ocgapi.cpp
View file @
2fbe3c02
...
@@ -291,18 +291,22 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
...
@@ -291,18 +291,22 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
*
buf
++
=
MSG_RELOAD_FIELD
;
*
buf
++
=
MSG_RELOAD_FIELD
;
*
buf
++
=
ptduel
->
game_field
->
core
.
duel_rule
;
*
buf
++
=
ptduel
->
game_field
->
core
.
duel_rule
;
int32
ct
=
0
;
for
(
int
playerid
=
0
;
playerid
<
2
;
++
playerid
)
{
for
(
int
playerid
=
0
;
playerid
<
2
;
++
playerid
)
{
auto
&
player
=
ptduel
->
game_field
->
player
[
playerid
];
auto
&
player
=
ptduel
->
game_field
->
player
[
playerid
];
*
((
int
*
)(
buf
))
=
player
.
lp
;
*
((
int
*
)(
buf
))
=
player
.
lp
;
buf
+=
4
;
buf
+=
4
;
ct
+=
4
;
for
(
auto
cit
=
player
.
list_mzone
.
begin
();
cit
!=
player
.
list_mzone
.
end
();
++
cit
)
{
for
(
auto
cit
=
player
.
list_mzone
.
begin
();
cit
!=
player
.
list_mzone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
)
{
if
(
pcard
)
{
*
buf
++
=
1
;
*
buf
++
=
1
;
*
buf
++
=
pcard
->
current
.
position
;
*
buf
++
=
pcard
->
current
.
position
;
*
buf
++
=
pcard
->
xyz_materials
.
size
();
*
buf
++
=
pcard
->
xyz_materials
.
size
();
ct
+=
3
;
}
else
{
}
else
{
*
buf
++
=
0
;
*
buf
++
=
0
;
ct
++
;
}
}
}
}
for
(
auto
cit
=
player
.
list_szone
.
begin
();
cit
!=
player
.
list_szone
.
end
();
++
cit
)
{
for
(
auto
cit
=
player
.
list_szone
.
begin
();
cit
!=
player
.
list_szone
.
end
();
++
cit
)
{
...
@@ -310,8 +314,10 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
...
@@ -310,8 +314,10 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
if
(
pcard
)
{
if
(
pcard
)
{
*
buf
++
=
1
;
*
buf
++
=
1
;
*
buf
++
=
pcard
->
current
.
position
;
*
buf
++
=
pcard
->
current
.
position
;
ct
+=
2
;
}
else
{
}
else
{
*
buf
++
=
0
;
*
buf
++
=
0
;
ct
++
;
}
}
}
}
*
buf
++
=
player
.
list_main
.
size
();
*
buf
++
=
player
.
list_main
.
size
();
...
@@ -320,8 +326,10 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
...
@@ -320,8 +326,10 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
*
buf
++
=
player
.
list_remove
.
size
();
*
buf
++
=
player
.
list_remove
.
size
();
*
buf
++
=
player
.
list_extra
.
size
();
*
buf
++
=
player
.
list_extra
.
size
();
*
buf
++
=
player
.
extra_p_count
;
*
buf
++
=
player
.
extra_p_count
;
ct
+=
6
;
}
}
*
buf
++
=
ptduel
->
game_field
->
core
.
current_chain
.
size
();
*
buf
++
=
ptduel
->
game_field
->
core
.
current_chain
.
size
();
ct
++
;
for
(
auto
chit
=
ptduel
->
game_field
->
core
.
current_chain
.
begin
();
chit
!=
ptduel
->
game_field
->
core
.
current_chain
.
end
();
++
chit
)
{
for
(
auto
chit
=
ptduel
->
game_field
->
core
.
current_chain
.
begin
();
chit
!=
ptduel
->
game_field
->
core
.
current_chain
.
end
();
++
chit
)
{
effect
*
peffect
=
chit
->
triggering_effect
;
effect
*
peffect
=
chit
->
triggering_effect
;
*
((
int
*
)(
buf
))
=
peffect
->
get_handler
()
->
data
.
code
;
*
((
int
*
)(
buf
))
=
peffect
->
get_handler
()
->
data
.
code
;
...
@@ -333,8 +341,9 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
...
@@ -333,8 +341,9 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
*
buf
++
=
chit
->
triggering_sequence
;
*
buf
++
=
chit
->
triggering_sequence
;
*
((
int
*
)(
buf
))
=
peffect
->
description
;
*
((
int
*
)(
buf
))
=
peffect
->
description
;
buf
+=
4
;
buf
+=
4
;
ct
+=
15
;
}
}
return
0
;
return
ct
;
}
}
extern
"C"
DECL_DLLEXPORT
void
set_responsei
(
ptr
pduel
,
int32
value
)
{
extern
"C"
DECL_DLLEXPORT
void
set_responsei
(
ptr
pduel
,
int32
value
)
{
((
duel
*
)
pduel
)
->
set_responsei
(
value
);
((
duel
*
)
pduel
)
->
set_responsei
(
value
);
...
...
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