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
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
xiaoye
ygopro-core
Commits
9b3458c7
Commit
9b3458c7
authored
Jan 29, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'x64' of github.com:moecube/ygopro-core
parents
7922811e
b2c7fb31
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
54 deletions
+54
-54
common.h
common.h
+1
-2
effect.cpp
effect.cpp
+2
-2
field.cpp
field.cpp
+1
-1
field.h
field.h
+6
-6
interpreter.cpp
interpreter.cpp
+8
-8
interpreter.h
interpreter.h
+1
-1
ocgapi.cpp
ocgapi.cpp
+17
-17
ocgapi.h
ocgapi.h
+17
-16
processor.cpp
processor.cpp
+1
-1
No files found.
common.h
View file @
9b3458c7
...
@@ -8,13 +8,12 @@
...
@@ -8,13 +8,12 @@
#ifndef COMMON_H_
#ifndef COMMON_H_
#define COMMON_H_
#define COMMON_H_
typedef
unsigned
long
uptr
;
#include <stdint.h>
typedef
unsigned
long
long
uint64
;
typedef
unsigned
long
long
uint64
;
typedef
unsigned
int
uint32
;
typedef
unsigned
int
uint32
;
typedef
unsigned
short
uint16
;
typedef
unsigned
short
uint16
;
typedef
unsigned
char
uint8
;
typedef
unsigned
char
uint8
;
typedef
unsigned
char
byte
;
typedef
unsigned
char
byte
;
typedef
long
ptr
;
typedef
long
long
int64
;
typedef
long
long
int64
;
typedef
int
int32
;
typedef
int
int32
;
typedef
short
int16
;
typedef
short
int16
;
...
...
effect.cpp
View file @
9b3458c7
...
@@ -422,7 +422,7 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
...
@@ -422,7 +422,7 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
(
ptr
)
0
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
0
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
cost
,
9
))
{
if
(
!
pduel
->
lua
->
check_condition
(
cost
,
9
))
{
return
FALSE
;
return
FALSE
;
}
}
...
@@ -436,7 +436,7 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
...
@@ -436,7 +436,7 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
(
ptr
)
0
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
0
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
target
,
9
))
{
if
(
!
pduel
->
lua
->
check_condition
(
target
,
9
))
{
return
FALSE
;
return
FALSE
;
}
}
...
...
field.cpp
View file @
9b3458c7
...
@@ -3393,7 +3393,7 @@ int32 field::check_chain_target(uint8 chaincount, card * pcard) {
...
@@ -3393,7 +3393,7 @@ int32 field::check_chain_target(uint8 chaincount, card * pcard) {
pduel
->
lua
->
add_param
(
pchain
->
evt
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pchain
->
evt
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pchain
->
evt
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pchain
->
evt
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pchain
->
evt
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pchain
->
evt
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
(
ptr
)
0
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
0
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
return
pduel
->
lua
->
check_condition
(
peffect
->
target
,
10
);
return
pduel
->
lua
->
check_condition
(
peffect
->
target
,
10
);
}
}
...
...
field.h
View file @
9b3458c7
...
@@ -156,10 +156,10 @@ struct processor_unit {
...
@@ -156,10 +156,10 @@ struct processor_unit {
uint16
step
;
uint16
step
;
effect
*
peffect
;
effect
*
peffect
;
group
*
ptarget
;
group
*
ptarget
;
ptr
arg1
;
int32
arg1
;
ptr
arg2
;
int32
arg2
;
ptr
arg3
;
int32
arg3
;
ptr
arg4
;
int32
arg4
;
void
*
ptr1
;
void
*
ptr1
;
void
*
ptr2
;
void
*
ptr2
;
...
@@ -266,7 +266,7 @@ struct processor {
...
@@ -266,7 +266,7 @@ struct processor {
std
::
unordered_map
<
uint32
,
uint32
>
spsummon_once_map
[
2
];
std
::
unordered_map
<
uint32
,
uint32
>
spsummon_once_map
[
2
];
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>>
xmaterial_lst
;
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>>
xmaterial_lst
;
ptr
temp_var
[
4
];
int32
temp_var
[
4
];
uint32
global_flag
;
uint32
global_flag
;
uint16
pre_field
[
2
];
uint16
pre_field
[
2
];
std
::
set
<
uint16
>
opp_mzone
;
std
::
set
<
uint16
>
opp_mzone
;
...
@@ -524,7 +524,7 @@ public:
...
@@ -524,7 +524,7 @@ public:
int32
check_spself_from_hand_trigger
(
const
chain
&
ch
)
const
;
int32
check_spself_from_hand_trigger
(
const
chain
&
ch
)
const
;
int32
is_able_to_enter_bp
();
int32
is_able_to_enter_bp
();
void
add_process
(
uint16
type
,
uint16
step
,
effect
*
peffect
,
group
*
target
,
ptr
arg1
,
ptr
arg2
,
ptr
arg3
=
0
,
ptr
arg4
=
0
,
void
*
ptr1
=
nullptr
,
void
*
ptr2
=
nullptr
);
void
add_process
(
uint16
type
,
uint16
step
,
effect
*
peffect
,
group
*
target
,
int32
arg1
,
int32
arg2
,
int32
arg3
=
0
,
int32
arg4
=
0
,
void
*
ptr1
=
nullptr
,
void
*
ptr2
=
nullptr
);
int32
process
();
int32
process
();
int32
execute_cost
(
uint16
step
,
effect
*
peffect
,
uint8
triggering_player
);
int32
execute_cost
(
uint16
step
,
effect
*
peffect
,
uint8
triggering_player
);
int32
execute_operation
(
uint16
step
,
effect
*
peffect
,
uint8
triggering_player
);
int32
execute_operation
(
uint16
step
,
effect
*
peffect
,
uint8
triggering_player
);
...
...
interpreter.cpp
View file @
9b3458c7
...
@@ -271,11 +271,11 @@ void interpreter::add_param(void *param, int32 type, bool front) {
...
@@ -271,11 +271,11 @@ void interpreter::add_param(void *param, int32 type, bool front) {
else
else
params
.
emplace_back
(
param
,
type
);
params
.
emplace_back
(
param
,
type
);
}
}
void
interpreter
::
add_param
(
ptr
param
,
int32
type
,
bool
front
)
{
void
interpreter
::
add_param
(
int32
param
,
int32
type
,
bool
front
)
{
if
(
front
)
if
(
front
)
params
.
emplace_front
((
void
*
)
param
,
type
);
params
.
emplace_front
((
void
*
)
(
intptr_t
)
param
,
type
);
else
else
params
.
emplace_back
((
void
*
)
param
,
type
);
params
.
emplace_back
((
void
*
)
(
intptr_t
)
param
,
type
);
}
}
void
interpreter
::
push_param
(
lua_State
*
L
,
bool
is_coroutine
)
{
void
interpreter
::
push_param
(
lua_State
*
L
,
bool
is_coroutine
)
{
int32
pushed
=
0
;
int32
pushed
=
0
;
...
@@ -284,13 +284,13 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
...
@@ -284,13 +284,13 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
uint32
type
=
it
.
second
;
uint32
type
=
it
.
second
;
switch
(
type
)
{
switch
(
type
)
{
case
PARAM_TYPE_INT
:
case
PARAM_TYPE_INT
:
lua_pushinteger
(
L
,
(
ptr
)
it
.
first
);
lua_pushinteger
(
L
,
(
lua_Integer
)
it
.
first
);
break
;
break
;
case
PARAM_TYPE_STRING
:
case
PARAM_TYPE_STRING
:
lua_pushstring
(
L
,
(
const
char
*
)
it
.
first
);
lua_pushstring
(
L
,
(
const
char
*
)
it
.
first
);
break
;
break
;
case
PARAM_TYPE_BOOLEAN
:
case
PARAM_TYPE_BOOLEAN
:
lua_pushboolean
(
L
,
(
int32
)(
ptr
)
it
.
first
);
lua_pushboolean
(
L
,
(
int32
)(
intptr_t
)
it
.
first
);
break
;
break
;
case
PARAM_TYPE_CARD
:
{
case
PARAM_TYPE_CARD
:
{
if
(
it
.
first
)
if
(
it
.
first
)
...
@@ -314,11 +314,11 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
...
@@ -314,11 +314,11 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
break
;
break
;
}
}
case
PARAM_TYPE_FUNCTION
:
{
case
PARAM_TYPE_FUNCTION
:
{
function2value
(
L
,
(
int32
)(
ptr
)
it
.
first
);
function2value
(
L
,
(
int32
)(
intptr_t
)
it
.
first
);
break
;
break
;
}
}
case
PARAM_TYPE_INDEX
:
{
case
PARAM_TYPE_INDEX
:
{
int32
index
=
(
int32
)(
ptr
)
it
.
first
;
int32
index
=
(
int32
)(
intptr_t
)
it
.
first
;
if
(
index
>
0
)
if
(
index
>
0
)
lua_pushvalue
(
L
,
index
);
lua_pushvalue
(
L
,
index
);
else
if
(
is_coroutine
)
{
else
if
(
is_coroutine
)
{
...
...
interpreter.h
View file @
9b3458c7
...
@@ -56,7 +56,7 @@ public:
...
@@ -56,7 +56,7 @@ public:
int32
load_script
(
const
char
*
script_name
);
int32
load_script
(
const
char
*
script_name
);
int32
load_card_script
(
uint32
code
);
int32
load_card_script
(
uint32
code
);
void
add_param
(
void
*
param
,
int32
type
,
bool
front
=
false
);
void
add_param
(
void
*
param
,
int32
type
,
bool
front
=
false
);
void
add_param
(
ptr
param
,
int32
type
,
bool
front
=
false
);
void
add_param
(
int32
param
,
int32
type
,
bool
front
=
false
);
void
push_param
(
lua_State
*
L
,
bool
is_coroutine
=
false
);
void
push_param
(
lua_State
*
L
,
bool
is_coroutine
=
false
);
int32
call_function
(
int32
f
,
uint32
param_count
,
int32
ret_count
);
int32
call_function
(
int32
f
,
uint32
param_count
,
int32
ret_count
);
int32
call_card_function
(
card
*
pcard
,
const
char
*
f
,
uint32
param_count
,
int32
ret_count
);
int32
call_card_function
(
card
*
pcard
,
const
char
*
f
,
uint32
param_count
,
int32
ret_count
);
...
...
ocgapi.cpp
View file @
9b3458c7
...
@@ -57,14 +57,14 @@ uint32 default_card_reader(uint32 code, card_data* data) {
...
@@ -57,14 +57,14 @@ uint32 default_card_reader(uint32 code, card_data* data) {
uint32
default_message_handler
(
void
*
pduel
,
uint32
message_type
)
{
uint32
default_message_handler
(
void
*
pduel
,
uint32
message_type
)
{
return
0
;
return
0
;
}
}
extern
"C"
DECL_DLLEXPORT
ptr
create_duel
(
uint32
seed
)
{
extern
"C"
DECL_DLLEXPORT
intptr_t
create_duel
(
uint32
seed
)
{
duel
*
pduel
=
new
duel
();
duel
*
pduel
=
new
duel
();
duel_set
.
insert
(
pduel
);
duel_set
.
insert
(
pduel
);
pduel
->
random
.
reset
(
seed
);
pduel
->
random
.
reset
(
seed
);
pduel
->
lua
->
preloaded
=
FALSE
;
pduel
->
lua
->
preloaded
=
FALSE
;
return
(
ptr
)
pduel
;
return
(
intptr_t
)
pduel
;
}
}
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
ptr
pduel
,
int32
options
)
{
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
intptr_t
pduel
,
int32
options
)
{
duel
*
pd
=
(
duel
*
)
pduel
;
duel
*
pd
=
(
duel
*
)
pduel
;
pd
->
game_field
->
core
.
duel_options
|=
options
&
0xffff
;
pd
->
game_field
->
core
.
duel_options
|=
options
&
0xffff
;
int32
duel_rule
=
options
>>
16
;
int32
duel_rule
=
options
>>
16
;
...
@@ -104,14 +104,14 @@ extern "C" DECL_DLLEXPORT void start_duel(ptr pduel, int32 options) {
...
@@ -104,14 +104,14 @@ extern "C" DECL_DLLEXPORT void start_duel(ptr pduel, int32 options) {
}
}
pd
->
game_field
->
add_process
(
PROCESSOR_TURN
,
0
,
0
,
0
,
0
,
0
);
pd
->
game_field
->
add_process
(
PROCESSOR_TURN
,
0
,
0
,
0
,
0
,
0
);
}
}
extern
"C"
DECL_DLLEXPORT
void
end_duel
(
ptr
pduel
)
{
extern
"C"
DECL_DLLEXPORT
void
end_duel
(
intptr_t
pduel
)
{
duel
*
pd
=
(
duel
*
)
pduel
;
duel
*
pd
=
(
duel
*
)
pduel
;
if
(
duel_set
.
count
(
pd
))
{
if
(
duel_set
.
count
(
pd
))
{
duel_set
.
erase
(
pd
);
duel_set
.
erase
(
pd
);
delete
pd
;
delete
pd
;
}
}
}
}
extern
"C"
DECL_DLLEXPORT
void
set_player_info
(
ptr
pduel
,
int32
playerid
,
int32
lp
,
int32
startcount
,
int32
drawcount
)
{
extern
"C"
DECL_DLLEXPORT
void
set_player_info
(
intptr_t
pduel
,
int32
playerid
,
int32
lp
,
int32
startcount
,
int32
drawcount
)
{
duel
*
pd
=
(
duel
*
)
pduel
;
duel
*
pd
=
(
duel
*
)
pduel
;
if
(
lp
>
0
)
if
(
lp
>
0
)
pd
->
game_field
->
player
[
playerid
].
lp
=
lp
;
pd
->
game_field
->
player
[
playerid
].
lp
=
lp
;
...
@@ -120,22 +120,22 @@ extern "C" DECL_DLLEXPORT void set_player_info(ptr pduel, int32 playerid, int32
...
@@ -120,22 +120,22 @@ extern "C" DECL_DLLEXPORT void set_player_info(ptr pduel, int32 playerid, int32
if
(
drawcount
>=
0
)
if
(
drawcount
>=
0
)
pd
->
game_field
->
player
[
playerid
].
draw_count
=
drawcount
;
pd
->
game_field
->
player
[
playerid
].
draw_count
=
drawcount
;
}
}
extern
"C"
DECL_DLLEXPORT
void
get_log_message
(
ptr
pduel
,
byte
*
buf
)
{
extern
"C"
DECL_DLLEXPORT
void
get_log_message
(
intptr_t
pduel
,
byte
*
buf
)
{
strcpy
((
char
*
)
buf
,
((
duel
*
)
pduel
)
->
strbuffer
);
strcpy
((
char
*
)
buf
,
((
duel
*
)
pduel
)
->
strbuffer
);
}
}
extern
"C"
DECL_DLLEXPORT
int32
get_message
(
ptr
pduel
,
byte
*
buf
)
{
extern
"C"
DECL_DLLEXPORT
int32
get_message
(
intptr_t
pduel
,
byte
*
buf
)
{
int32
len
=
((
duel
*
)
pduel
)
->
read_buffer
(
buf
);
int32
len
=
((
duel
*
)
pduel
)
->
read_buffer
(
buf
);
((
duel
*
)
pduel
)
->
clear_buffer
();
((
duel
*
)
pduel
)
->
clear_buffer
();
return
len
;
return
len
;
}
}
extern
"C"
DECL_DLLEXPORT
int32
process
(
ptr
pduel
)
{
extern
"C"
DECL_DLLEXPORT
int32
process
(
intptr_t
pduel
)
{
duel
*
pd
=
(
duel
*
)
pduel
;
duel
*
pd
=
(
duel
*
)
pduel
;
int
result
=
pd
->
game_field
->
process
();
int
result
=
pd
->
game_field
->
process
();
while
((
result
&
0xffff
)
==
0
&&
(
result
&
0xf0000
)
==
0
)
while
((
result
&
0xffff
)
==
0
&&
(
result
&
0xf0000
)
==
0
)
result
=
pd
->
game_field
->
process
();
result
=
pd
->
game_field
->
process
();
return
result
;
return
result
;
}
}
extern
"C"
DECL_DLLEXPORT
void
new_card
(
ptr
pduel
,
uint32
code
,
uint8
owner
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
uint8
position
)
{
extern
"C"
DECL_DLLEXPORT
void
new_card
(
intptr_t
pduel
,
uint32
code
,
uint8
owner
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
uint8
position
)
{
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
if
(
!
ptduel
->
lua
->
preloaded
)
{
if
(
!
ptduel
->
lua
->
preloaded
)
{
ptduel
->
lua
->
preloaded
=
TRUE
;
ptduel
->
lua
->
preloaded
=
TRUE
;
...
@@ -155,7 +155,7 @@ extern "C" DECL_DLLEXPORT void new_card(ptr pduel, uint32 code, uint8 owner, uin
...
@@ -155,7 +155,7 @@ extern "C" DECL_DLLEXPORT void new_card(ptr pduel, uint32 code, uint8 owner, uin
}
}
}
}
}
}
extern
"C"
DECL_DLLEXPORT
void
new_tag_card
(
ptr
pduel
,
uint32
code
,
uint8
owner
,
uint8
location
)
{
extern
"C"
DECL_DLLEXPORT
void
new_tag_card
(
intptr_t
pduel
,
uint32
code
,
uint8
owner
,
uint8
location
)
{
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
if
(
owner
>
1
||
!
(
location
&
(
LOCATION_DECK
|
LOCATION_EXTRA
)))
if
(
owner
>
1
||
!
(
location
&
(
LOCATION_DECK
|
LOCATION_EXTRA
)))
return
;
return
;
...
@@ -179,7 +179,7 @@ extern "C" DECL_DLLEXPORT void new_tag_card(ptr pduel, uint32 code, uint8 owner,
...
@@ -179,7 +179,7 @@ extern "C" DECL_DLLEXPORT void new_tag_card(ptr pduel, uint32 code, uint8 owner,
break
;
break
;
}
}
}
}
extern
"C"
DECL_DLLEXPORT
int32
query_card
(
ptr
pduel
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
)
{
extern
"C"
DECL_DLLEXPORT
int32
query_card
(
intptr_t
pduel
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
)
{
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
...
@@ -212,7 +212,7 @@ extern "C" DECL_DLLEXPORT int32 query_card(ptr pduel, uint8 playerid, uint8 loca
...
@@ -212,7 +212,7 @@ extern "C" DECL_DLLEXPORT int32 query_card(ptr pduel, uint8 playerid, uint8 loca
return
4
;
return
4
;
}
}
}
}
extern
"C"
DECL_DLLEXPORT
int32
query_field_count
(
ptr
pduel
,
uint8
playerid
,
uint8
location
)
{
extern
"C"
DECL_DLLEXPORT
int32
query_field_count
(
intptr_t
pduel
,
uint8
playerid
,
uint8
location
)
{
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
...
@@ -241,7 +241,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_count(ptr pduel, uint8 playerid, uin
...
@@ -241,7 +241,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_count(ptr pduel, uint8 playerid, uin
}
}
return
0
;
return
0
;
}
}
extern
"C"
DECL_DLLEXPORT
int32
query_field_card
(
ptr
pduel
,
uint8
playerid
,
uint8
location
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
)
{
extern
"C"
DECL_DLLEXPORT
int32
query_field_card
(
intptr_t
pduel
,
uint8
playerid
,
uint8
location
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
)
{
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
...
@@ -288,7 +288,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
...
@@ -288,7 +288,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
}
}
return
(
int32
)(
p
-
buf
);
return
(
int32
)(
p
-
buf
);
}
}
extern
"C"
DECL_DLLEXPORT
int32
query_field_info
(
ptr
pduel
,
byte
*
buf
)
{
extern
"C"
DECL_DLLEXPORT
int32
query_field_info
(
intptr_t
pduel
,
byte
*
buf
)
{
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
byte
*
p
=
buf
;
byte
*
p
=
buf
;
*
p
++
=
MSG_RELOAD_FIELD
;
*
p
++
=
MSG_RELOAD_FIELD
;
...
@@ -336,12 +336,12 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
...
@@ -336,12 +336,12 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
}
}
return
(
int32
)(
p
-
buf
);
return
(
int32
)(
p
-
buf
);
}
}
extern
"C"
DECL_DLLEXPORT
void
set_responsei
(
ptr
pduel
,
int32
value
)
{
extern
"C"
DECL_DLLEXPORT
void
set_responsei
(
intptr_t
pduel
,
int32
value
)
{
((
duel
*
)
pduel
)
->
set_responsei
(
value
);
((
duel
*
)
pduel
)
->
set_responsei
(
value
);
}
}
extern
"C"
DECL_DLLEXPORT
void
set_responseb
(
ptr
pduel
,
byte
*
buf
)
{
extern
"C"
DECL_DLLEXPORT
void
set_responseb
(
intptr_t
pduel
,
byte
*
buf
)
{
((
duel
*
)
pduel
)
->
set_responseb
(
buf
);
((
duel
*
)
pduel
)
->
set_responseb
(
buf
);
}
}
extern
"C"
DECL_DLLEXPORT
int32
preload_script
(
ptr
pduel
,
const
char
*
script
,
int32
len
)
{
extern
"C"
DECL_DLLEXPORT
int32
preload_script
(
intptr_t
pduel
,
const
char
*
script
,
int32
len
)
{
return
((
duel
*
)
pduel
)
->
lua
->
load_script
(
script
);
return
((
duel
*
)
pduel
)
->
lua
->
load_script
(
script
);
}
}
ocgapi.h
View file @
9b3458c7
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#define OCGAPI_H_
#define OCGAPI_H_
#include "common.h"
#include "common.h"
#ifdef WIN32
#ifdef WIN32
#define DECL_DLLEXPORT __declspec(dllexport)
#define DECL_DLLEXPORT __declspec(dllexport)
#else
#else
...
@@ -34,22 +35,22 @@ byte* read_script(const char* script_name, int* len);
...
@@ -34,22 +35,22 @@ byte* read_script(const char* script_name, int* len);
uint32
read_card
(
uint32
code
,
card_data
*
data
);
uint32
read_card
(
uint32
code
,
card_data
*
data
);
uint32
handle_message
(
void
*
pduel
,
uint32
message_type
);
uint32
handle_message
(
void
*
pduel
,
uint32
message_type
);
extern
"C"
DECL_DLLEXPORT
ptr
create_duel
(
uint32
seed
);
extern
"C"
DECL_DLLEXPORT
intptr_t
create_duel
(
uint32
seed
);
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
ptr
pduel
,
int32
options
);
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
intptr_t
pduel
,
int32
options
);
extern
"C"
DECL_DLLEXPORT
void
end_duel
(
ptr
pduel
);
extern
"C"
DECL_DLLEXPORT
void
end_duel
(
intptr_t
pduel
);
extern
"C"
DECL_DLLEXPORT
void
set_player_info
(
ptr
pduel
,
int32
playerid
,
int32
lp
,
int32
startcount
,
int32
drawcount
);
extern
"C"
DECL_DLLEXPORT
void
set_player_info
(
intptr_t
pduel
,
int32
playerid
,
int32
lp
,
int32
startcount
,
int32
drawcount
);
extern
"C"
DECL_DLLEXPORT
void
get_log_message
(
ptr
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
void
get_log_message
(
intptr_t
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
int32
get_message
(
ptr
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
int32
get_message
(
intptr_t
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
int32
process
(
ptr
pduel
);
extern
"C"
DECL_DLLEXPORT
int32
process
(
intptr_t
pduel
);
extern
"C"
DECL_DLLEXPORT
void
new_card
(
ptr
pduel
,
uint32
code
,
uint8
owner
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
uint8
position
);
extern
"C"
DECL_DLLEXPORT
void
new_card
(
intptr_t
pduel
,
uint32
code
,
uint8
owner
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
uint8
position
);
extern
"C"
DECL_DLLEXPORT
void
new_tag_card
(
ptr
pduel
,
uint32
code
,
uint8
owner
,
uint8
location
);
extern
"C"
DECL_DLLEXPORT
void
new_tag_card
(
intptr_t
pduel
,
uint32
code
,
uint8
owner
,
uint8
location
);
extern
"C"
DECL_DLLEXPORT
int32
query_card
(
ptr
pduel
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
);
extern
"C"
DECL_DLLEXPORT
int32
query_card
(
intptr_t
pduel
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
);
extern
"C"
DECL_DLLEXPORT
int32
query_field_count
(
ptr
pduel
,
uint8
playerid
,
uint8
location
);
extern
"C"
DECL_DLLEXPORT
int32
query_field_count
(
intptr_t
pduel
,
uint8
playerid
,
uint8
location
);
extern
"C"
DECL_DLLEXPORT
int32
query_field_card
(
ptr
pduel
,
uint8
playerid
,
uint8
location
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
);
extern
"C"
DECL_DLLEXPORT
int32
query_field_card
(
intptr_t
pduel
,
uint8
playerid
,
uint8
location
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
);
extern
"C"
DECL_DLLEXPORT
int32
query_field_info
(
ptr
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
int32
query_field_info
(
intptr_t
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
void
set_responsei
(
ptr
pduel
,
int32
value
);
extern
"C"
DECL_DLLEXPORT
void
set_responsei
(
intptr_t
pduel
,
int32
value
);
extern
"C"
DECL_DLLEXPORT
void
set_responseb
(
ptr
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
void
set_responseb
(
intptr_t
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
int32
preload_script
(
ptr
pduel
,
const
char
*
script
,
int32
len
);
extern
"C"
DECL_DLLEXPORT
int32
preload_script
(
intptr_t
pduel
,
const
char
*
script
,
int32
len
);
byte
*
default_script_reader
(
const
char
*
script_name
,
int
*
len
);
byte
*
default_script_reader
(
const
char
*
script_name
,
int
*
len
);
uint32
default_card_reader
(
uint32
code
,
card_data
*
data
);
uint32
default_card_reader
(
uint32
code
,
card_data
*
data
);
uint32
default_message_handler
(
void
*
pduel
,
uint32
msg_type
);
uint32
default_message_handler
(
void
*
pduel
,
uint32
msg_type
);
...
...
processor.cpp
View file @
9b3458c7
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#include "ocgapi.h"
#include "ocgapi.h"
#include <iterator>
#include <iterator>
void
field
::
add_process
(
uint16
type
,
uint16
step
,
effect
*
peffect
,
group
*
target
,
ptr
arg1
,
ptr
arg2
,
ptr
arg3
,
ptr
arg4
,
void
*
ptr1
,
void
*
ptr2
)
{
void
field
::
add_process
(
uint16
type
,
uint16
step
,
effect
*
peffect
,
group
*
target
,
int32
arg1
,
int32
arg2
,
int32
arg3
,
int32
arg4
,
void
*
ptr1
,
void
*
ptr2
)
{
processor_unit
new_unit
;
processor_unit
new_unit
;
new_unit
.
type
=
type
;
new_unit
.
type
=
type
;
new_unit
.
step
=
step
;
new_unit
.
step
=
step
;
...
...
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