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
赤子奈落
ygopro
Commits
927c847a
Commit
927c847a
authored
Dec 30, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into server
parents
b6675cbc
d884e77c
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
474 additions
and
493 deletions
+474
-493
cards.cdb
cards.cdb
+0
-0
gframe/replay.cpp
gframe/replay.cpp
+18
-37
gframe/replay.h
gframe/replay.h
+15
-12
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+2
-2
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+2
-2
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-1
lflist.conf
lflist.conf
+431
-434
ocgcore
ocgcore
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+2
-2
No files found.
cards.cdb
View file @
927c847a
No preview for this file type
gframe/replay.cpp
View file @
927c847a
...
...
@@ -58,7 +58,6 @@ void Replay::BeginRecord() {
#ifdef YGOPRO_SERVER_MODE
}
#endif //YGOPRO_SERVER_MODE
pwrite
=
replay_data
;
replay_size
=
0
;
comp_size
=
0
;
is_replaying
=
false
;
...
...
@@ -77,13 +76,13 @@ void Replay::WriteHeader(ReplayHeader& header) {
fflush
(
fp
);
#endif
}
void
Replay
::
WriteData
(
const
void
*
data
,
in
t
length
,
bool
flush
)
{
void
Replay
::
WriteData
(
const
void
*
data
,
size_
t
length
,
bool
flush
)
{
if
(
!
is_recording
)
return
;
if
(
length
<
0
||
(
int
)(
pwrite
-
replay_data
)
+
length
>
MAX_REPLAY_SIZE
)
if
(
replay_size
+
length
>
MAX_REPLAY_SIZE
)
return
;
std
::
memcpy
(
pwrit
e
,
data
,
length
);
pwrit
e
+=
length
;
std
::
memcpy
(
replay_data
+
replay_siz
e
,
data
,
length
);
replay_siz
e
+=
length
;
#ifdef YGOPRO_SERVER_MODE
if
(
!
(
replay_mode
&
REPLAY_MODE_SAVE_IN_SERVER
))
return
;
#endif
...
...
@@ -96,14 +95,8 @@ void Replay::WriteData(const void* data, int length, bool flush) {
fflush
(
fp
);
#endif
}
void
Replay
::
WriteInt32
(
int
data
,
bool
flush
)
{
WriteData
(
&
data
,
sizeof
data
,
flush
);
}
void
Replay
::
WriteInt16
(
short
data
,
bool
flush
)
{
WriteData
(
&
data
,
sizeof
data
,
flush
);
}
void
Replay
::
WriteInt8
(
char
data
,
bool
flush
)
{
WriteData
(
&
data
,
sizeof
data
,
flush
);
void
Replay
::
WriteInt32
(
int32_t
data
,
bool
flush
)
{
Write
<
int32_t
>
(
data
,
flush
);
}
void
Replay
::
Flush
()
{
if
(
!
is_recording
)
...
...
@@ -130,7 +123,6 @@ void Replay::EndRecord() {
#ifdef YGOPRO_SERVER_MODE
}
#endif
replay_size
=
pwrite
-
replay_data
;
pheader
.
datasize
=
replay_size
;
pheader
.
flag
|=
REPLAY_COMPRESSED
;
size_t
propsize
=
5
;
...
...
@@ -164,7 +156,7 @@ bool Replay::OpenReplay(const wchar_t* name) {
if
(
!
rfp
)
return
false
;
pdata
=
replay_data
;
data_position
=
0
;
is_recording
=
false
;
is_replaying
=
false
;
replay_size
=
0
;
...
...
@@ -254,37 +246,26 @@ bool Replay::ReadName(wchar_t* data) {
BufferIO
::
CopyWStr
(
buffer
,
data
,
20
);
return
true
;
}
bool
Replay
::
ReadData
(
void
*
data
,
int
length
)
{
void
Replay
::
ReadHeader
(
ReplayHeader
&
header
)
{
header
=
pheader
;
}
bool
Replay
::
ReadData
(
void
*
data
,
size_t
length
)
{
if
(
!
is_replaying
)
return
false
;
if
(
length
<
0
)
return
false
;
if
((
int
)(
pdata
-
replay_data
)
+
length
>
(
int
)
replay_size
)
{
if
(
data_position
+
length
>
replay_size
)
{
is_replaying
=
false
;
return
false
;
}
std
::
memcpy
(
data
,
pdata
,
length
);
pdata
+=
length
;
if
(
length
)
std
::
memcpy
(
data
,
&
replay_data
[
data_position
],
length
);
data_position
+=
length
;
return
true
;
}
template
<
typename
T
>
T
Replay
::
ReadValue
()
{
T
ret
{};
if
(
!
ReadData
(
&
ret
,
sizeof
ret
))
return
-
1
;
return
ret
;
}
int
Replay
::
ReadInt32
()
{
return
ReadValue
<
int32_t
>
();
}
short
Replay
::
ReadInt16
()
{
return
ReadValue
<
int16_t
>
();
}
char
Replay
::
ReadInt8
()
{
return
ReadValue
<
char
>
();
int32_t
Replay
::
ReadInt32
()
{
return
Read
<
int32_t
>
();
}
void
Replay
::
Rewind
()
{
pdata
=
replay_data
;
data_position
=
0
;
}
}
gframe/replay.h
View file @
927c847a
...
...
@@ -40,10 +40,12 @@ public:
// record
void
BeginRecord
();
void
WriteHeader
(
ReplayHeader
&
header
);
void
WriteData
(
const
void
*
data
,
int
length
,
bool
flush
=
true
);
void
WriteInt32
(
int
data
,
bool
flush
=
true
);
void
WriteInt16
(
short
data
,
bool
flush
=
true
);
void
WriteInt8
(
char
data
,
bool
flush
=
true
);
void
WriteData
(
const
void
*
data
,
size_t
length
,
bool
flush
=
true
);
template
<
typename
T
>
void
Write
(
T
data
,
bool
flush
=
true
)
{
WriteData
(
&
data
,
sizeof
(
T
),
flush
);
}
void
WriteInt32
(
int32_t
data
,
bool
flush
=
true
);
void
Flush
();
void
EndRecord
();
void
SaveReplay
(
const
wchar_t
*
name
);
...
...
@@ -55,13 +57,15 @@ public:
static
bool
RenameReplay
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
bool
ReadNextResponse
(
unsigned
char
resp
[]);
bool
ReadName
(
wchar_t
*
data
);
//
void ReadHeader(ReplayHeader& header);
bool
ReadData
(
void
*
data
,
in
t
length
);
void
ReadHeader
(
ReplayHeader
&
header
);
bool
ReadData
(
void
*
data
,
size_
t
length
);
template
<
typename
T
>
T
ReadValue
();
int
ReadInt32
();
short
ReadInt16
();
char
ReadInt8
();
T
Read
()
{
T
ret
{};
ReadData
(
&
ret
,
sizeof
(
T
));
return
ret
;
}
int32_t
ReadInt32
();
void
Rewind
();
FILE
*
fp
{
nullptr
};
...
...
@@ -76,8 +80,7 @@ public:
private:
unsigned
char
*
replay_data
;
size_t
replay_size
{};
unsigned
char
*
pwrite
{};
unsigned
char
*
pdata
{};
size_t
data_position
{};
bool
is_recording
{};
bool
is_replaying
{};
};
...
...
gframe/replay_mode.cpp
View file @
927c847a
...
...
@@ -230,8 +230,8 @@ bool ReplayMode::StartDuel() {
}
}
else
{
char
filename
[
256
];
int
slen
=
cur_replay
.
ReadInt16
();
if
(
slen
<
0
||
slen
>
255
)
{
auto
slen
=
cur_replay
.
Read
<
uint16_t
>
();
if
(
slen
>
sizeof
(
filename
)
-
1
)
{
return
false
;
}
cur_replay
.
ReadData
(
filename
,
slen
);
...
...
gframe/single_duel.cpp
View file @
927c847a
...
...
@@ -1797,7 +1797,7 @@ void SingleDuel::GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int
if
(
len
>
SIZE_RETURN_VALUE
)
len
=
SIZE_RETURN_VALUE
;
std
::
memcpy
(
resb
,
pdata
,
len
);
last_replay
.
Write
Int8
(
len
);
last_replay
.
Write
<
uint8_t
>
(
len
);
last_replay
.
WriteData
(
resb
,
len
);
set_responseb
(
pduel
,
resb
);
players
[
dp
->
type
]
->
state
=
0xff
;
...
...
gframe/single_mode.cpp
View file @
927c847a
...
...
@@ -25,7 +25,7 @@ void SingleMode::StopPlay(bool is_exiting) {
void
SingleMode
::
SetResponse
(
unsigned
char
*
resp
,
unsigned
int
len
)
{
if
(
!
pduel
)
return
;
last_replay
.
Write
Int8
(
len
);
last_replay
.
Write
<
uint8_t
>
(
len
);
last_replay
.
WriteData
(
resp
,
len
);
set_responseb
(
pduel
,
resp
);
}
...
...
@@ -122,7 +122,7 @@ int SingleMode::SinglePlayThread() {
last_replay
.
WriteInt32
(
start_hand
,
false
);
last_replay
.
WriteInt32
(
draw_count
,
false
);
last_replay
.
WriteInt32
(
opt
,
false
);
last_replay
.
Write
Int16
(
slen
,
false
);
last_replay
.
Write
<
uint16_t
>
(
slen
,
false
);
last_replay
.
WriteData
(
filename
,
slen
,
false
);
last_replay
.
Flush
();
start_duel
(
pduel
,
opt
);
...
...
gframe/tag_duel.cpp
View file @
927c847a
...
...
@@ -1894,7 +1894,7 @@ void TagDuel::GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len
if
(
len
>
SIZE_RETURN_VALUE
)
len
=
SIZE_RETURN_VALUE
;
std
::
memcpy
(
resb
,
pdata
,
len
);
last_replay
.
Write
Int8
(
len
);
last_replay
.
Write
<
uint8_t
>
(
len
);
last_replay
.
WriteData
(
resb
,
len
);
set_responseb
(
pduel
,
resb
);
players
[
dp
->
type
]
->
state
=
0xff
;
...
...
lflist.conf
View file @
927c847a
This diff is collapsed.
Click to expand it.
ocgcore
@
67b36590
Subproject commit 6
4739171180c049c2dca6cbd6838ed6d9576ac6f
Subproject commit 6
7b3659025be1d06b547e9a3adf854f985b0e2e7
script
@
38a7056c
Subproject commit
e4b80d22400e90a6ca132b67554accf435ca2a62
Subproject commit
38a7056cb4a9120ec10732155500a6c320c783a0
strings.conf
View file @
927c847a
...
...
@@ -668,7 +668,7 @@
!
counter
0
x68
指示物(图腾柱)
!
counter
0
x69
指示物(吠陀-优婆尼沙昙)
!
counter
0
x6a
响鸣指示物
!
counter
0
x6b
狂爱指示物
!
counter
0
x
10
6b
狂爱指示物
!
counter
0
x6c
访问指示物
!
counter
0
x6d
祝台指示物
#setnames, using tab for comment
...
...
@@ -1251,5 +1251,5 @@
!
setname
0
x1be
雷火沸动 ライゼオル
!
setname
0
x1bf
码丽丝
M
∀
LICE
!
setname
0
x1c0
龙华 竜華
!
setname
0
x1c1
阿
耳戈视☆将
星
ARG
☆
S
!
setname
0
x1c1
阿
尔戈☆群
星
ARG
☆
S
!
setname
0
x1c2
喷水引擎 アクア・ジェット
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