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
64fff150
Commit
64fff150
authored
Aug 12, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
merge mc
parents
6d22aa98
f9ba30c5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
81 additions
and
9 deletions
+81
-9
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+22
-2
gframe/replay_mode.h
gframe/replay_mode.h
+1
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+21
-1
gframe/single_duel.h
gframe/single_duel.h
+2
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+9
-1
gframe/single_mode.h
gframe/single_mode.h
+1
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+21
-1
gframe/tag_duel.h
gframe/tag_duel.h
+2
-1
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/replay_mode.cpp
View file @
64fff150
...
@@ -64,11 +64,11 @@ int ReplayMode::ReplayThread(void* param) {
...
@@ -64,11 +64,11 @@ int ReplayMode::ReplayThread(void* param) {
mainGame
->
dInfo
.
tag_player
[
0
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
0
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
1
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
1
]
=
false
;
if
(
mainGame
->
dInfo
.
isSingleMode
)
{
if
(
mainGame
->
dInfo
.
isSingleMode
)
{
set_script_reader
((
script_reader
)
SingleMode
::
ScriptReader
);
set_script_reader
((
script_reader
)
SingleMode
::
ScriptReader
Ex
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
set_message_handler
((
message_handler
)
MessageHandler
);
}
else
{
}
else
{
set_script_reader
(
default_script_reader
);
set_script_reader
(
(
script_reader
)
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
set_message_handler
((
message_handler
)
MessageHandler
);
}
}
...
@@ -937,6 +937,26 @@ void ReplayMode::ReplayReload() {
...
@@ -937,6 +937,26 @@ void ReplayMode::ReplayReload() {
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
}
}
byte
*
ReplayMode
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
#ifdef YGOPRO_SERVER_MODE
char
sname
[
256
]
=
"./specials"
;
strcat
(
sname
,
script_name
+
8
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
#else
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
#endif
if
(
buffer
)
return
buffer
;
else
return
default_script_reader
(
script_name
,
slen
);
}
int
ReplayMode
::
MessageHandler
(
long
fduel
,
int
type
)
{
int
ReplayMode
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
if
(
!
enable_log
)
return
0
;
return
0
;
...
...
gframe/replay_mode.h
View file @
64fff150
...
@@ -47,6 +47,7 @@ public:
...
@@ -47,6 +47,7 @@ public:
static
void
ReplayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
ReplayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
ReplayReload
();
static
void
ReplayReload
();
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
};
};
...
...
gframe/single_duel.cpp
View file @
64fff150
...
@@ -529,7 +529,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -529,7 +529,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
}
}
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
set_script_reader
(
default_script_reader
);
set_script_reader
(
(
script_reader
)
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
SingleDuel
::
MessageHandler
);
set_message_handler
((
message_handler
)
SingleDuel
::
MessageHandler
);
rnd
.
reset
(
seed
);
rnd
.
reset
(
seed
);
...
@@ -2131,6 +2131,26 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
...
@@ -2131,6 +2131,26 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
#endif
#endif
}
}
}
}
byte
*
SingleDuel
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
#ifdef YGOPRO_SERVER_MODE
char
sname
[
256
]
=
"./specials"
;
strcat
(
sname
,
script_name
+
8
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
#else
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
#endif
if
(
buffer
)
return
buffer
;
else
return
default_script_reader
(
script_name
,
slen
);
}
int
SingleDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
int
SingleDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
if
(
!
enable_log
)
return
0
;
return
0
;
...
...
gframe/single_duel.h
View file @
64fff150
...
@@ -52,7 +52,8 @@ public:
...
@@ -52,7 +52,8 @@ public:
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
#endif
#endif
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
...
...
gframe/single_mode.cpp
View file @
64fff150
...
@@ -38,7 +38,7 @@ int SingleMode::SinglePlayThread(void* param) {
...
@@ -38,7 +38,7 @@ int SingleMode::SinglePlayThread(void* param) {
mtrandom
rnd
;
mtrandom
rnd
;
time_t
seed
=
time
(
0
);
time_t
seed
=
time
(
0
);
rnd
.
reset
(
seed
);
rnd
.
reset
(
seed
);
set_script_reader
((
script_reader
)
ScriptReader
);
set_script_reader
((
script_reader
)
ScriptReader
Ex
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
set_message_handler
((
message_handler
)
MessageHandler
);
pduel
=
create_duel
(
rnd
.
rand
());
pduel
=
create_duel
(
rnd
.
rand
());
...
@@ -851,6 +851,14 @@ void SingleMode::SinglePlayReload() {
...
@@ -851,6 +851,14 @@ void SingleMode::SinglePlayReload() {
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
}
}
byte
*
SingleMode
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
//default script name: ./script/c%d.lua
if
(
ScriptReader
(
sname
,
slen
))
return
buffer
;
else
return
ScriptReader
(
script_name
,
slen
);
}
byte
*
SingleMode
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
byte
*
SingleMode
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
FILE
*
fp
;
FILE
*
fp
;
#ifdef _WIN32
#ifdef _WIN32
...
...
gframe/single_mode.h
View file @
64fff150
...
@@ -26,6 +26,7 @@ public:
...
@@ -26,6 +26,7 @@ public:
static
void
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
SinglePlayReload
();
static
void
SinglePlayReload
();
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReader
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReader
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
...
...
gframe/tag_duel.cpp
View file @
64fff150
...
@@ -506,7 +506,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -506,7 +506,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
}
}
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
set_script_reader
(
default_script_reader
);
set_script_reader
(
(
script_reader
)
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
TagDuel
::
MessageHandler
);
set_message_handler
((
message_handler
)
TagDuel
::
MessageHandler
);
rnd
.
reset
(
seed
);
rnd
.
reset
(
seed
);
...
@@ -2272,6 +2272,26 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) {
...
@@ -2272,6 +2272,26 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) {
}
}
}
}
}
}
byte
*
TagDuel
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
#ifdef YGOPRO_SERVER_MODE
char
sname
[
256
]
=
"./specials"
;
strcat
(
sname
,
script_name
+
8
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
#else
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
#endif
if
(
buffer
)
return
buffer
;
else
return
default_script_reader
(
script_name
,
slen
);
}
int
TagDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
int
TagDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
if
(
!
enable_log
)
return
0
;
return
0
;
...
...
gframe/tag_duel.h
View file @
64fff150
...
@@ -49,7 +49,8 @@ public:
...
@@ -49,7 +49,8 @@ public:
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
#endif
#endif
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
TagTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
TagTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
...
...
ocgcore
@
2849eaf3
Subproject commit
6db38fa7638e8722429e4680bb2100d216871e2e
Subproject commit
2849eaf3a664fd4e9b6c42bb0d05ab7aaaf96aaa
script
@
2b79cea8
Subproject commit
ea1c4fe515a0822b92086af5473cda869f2e8e83
Subproject commit
2b79cea84b76eedc8ae87d6952cccd51eac32860
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