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
nanahira
ygopro
Commits
ec9c71bf
Commit
ec9c71bf
authored
May 14, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro into develop
parents
a4d27804
2e0af898
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
233 additions
and
48 deletions
+233
-48
gframe/bufferio.h
gframe/bufferio.h
+9
-18
gframe/replay.cpp
gframe/replay.cpp
+10
-16
lflist.conf
lflist.conf
+213
-13
strings.conf
strings.conf
+1
-1
No files found.
gframe/bufferio.h
View file @
ec9c71bf
#ifndef BUFFERIO_H
#ifndef BUFFERIO_H
#define BUFFERIO_H
#define BUFFERIO_H
#include <cstdint>
#include "../ocgcore/buffer.h"
class
BufferIO
{
class
BufferIO
{
public:
public:
inline
static
int
ReadInt32
(
unsigned
char
*&
p
)
{
inline
static
int
ReadInt32
(
unsigned
char
*&
p
)
{
int
ret
=
*
(
int
*
)
p
;
return
buffer_read
<
int32_t
>
(
p
);
p
+=
4
;
return
ret
;
}
}
inline
static
unsigned
int
ReadUInt32
(
unsigned
char
*&
p
)
{
inline
static
unsigned
int
ReadUInt32
(
unsigned
char
*&
p
)
{
unsigned
int
ret
=
*
(
unsigned
int
*
)
p
;
unsigned
int
ret
=
*
(
unsigned
int
*
)
p
;
...
@@ -15,9 +15,7 @@ public:
...
@@ -15,9 +15,7 @@ public:
return
ret
;
return
ret
;
}
}
inline
static
short
ReadInt16
(
unsigned
char
*&
p
)
{
inline
static
short
ReadInt16
(
unsigned
char
*&
p
)
{
short
ret
=
*
(
short
*
)
p
;
return
buffer_read
<
int16_t
>
(
p
);
p
+=
2
;
return
ret
;
}
}
inline
static
unsigned
short
ReadUInt16
(
unsigned
char
*&
p
)
{
inline
static
unsigned
short
ReadUInt16
(
unsigned
char
*&
p
)
{
unsigned
short
ret
=
*
(
unsigned
short
*
)
p
;
unsigned
short
ret
=
*
(
unsigned
short
*
)
p
;
...
@@ -25,26 +23,19 @@ public:
...
@@ -25,26 +23,19 @@ public:
return
ret
;
return
ret
;
}
}
inline
static
char
ReadInt8
(
unsigned
char
*&
p
)
{
inline
static
char
ReadInt8
(
unsigned
char
*&
p
)
{
char
ret
=
*
(
char
*
)
p
;
return
buffer_read
<
char
>
(
p
);
p
++
;
return
ret
;
}
}
inline
static
unsigned
char
ReadUInt8
(
unsigned
char
*&
p
)
{
inline
static
unsigned
char
ReadUInt8
(
unsigned
char
*&
p
)
{
unsigned
char
ret
=
*
(
unsigned
char
*
)
p
;
return
buffer_read
<
unsigned
char
>
(
p
);
p
++
;
return
ret
;
}
}
inline
static
void
WriteInt32
(
unsigned
char
*&
p
,
int
val
)
{
inline
static
void
WriteInt32
(
unsigned
char
*&
p
,
int
val
)
{
(
*
(
int
*
)
p
)
=
val
;
buffer_write
<
int32_t
>
(
p
,
val
);
p
+=
4
;
}
}
inline
static
void
WriteInt16
(
unsigned
char
*&
p
,
short
val
)
{
inline
static
void
WriteInt16
(
unsigned
char
*&
p
,
short
val
)
{
(
*
(
short
*
)
p
)
=
val
;
buffer_write
<
int16_t
>
(
p
,
val
);
p
+=
2
;
}
}
inline
static
void
WriteInt8
(
unsigned
char
*&
p
,
char
val
)
{
inline
static
void
WriteInt8
(
unsigned
char
*&
p
,
char
val
)
{
*
p
=
val
;
buffer_write
<
char
>
(
p
,
val
);
p
++
;
}
}
template
<
typename
T1
,
typename
T2
>
template
<
typename
T1
,
typename
T2
>
inline
static
int
CopyWStr
(
T1
*
src
,
T2
*
pstr
,
int
bufsize
)
{
inline
static
int
CopyWStr
(
T1
*
src
,
T2
*
pstr
,
int
bufsize
)
{
...
...
gframe/replay.cpp
View file @
ec9c71bf
#include "replay.h"
#include "replay.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h"
#include "lzma/LzmaLib.h"
#include "lzma/LzmaLib.h"
namespace
ygo
{
namespace
ygo
{
...
@@ -54,7 +52,7 @@ void Replay::WriteData(const void* data, int length, bool flush) {
...
@@ -54,7 +52,7 @@ void Replay::WriteData(const void* data, int length, bool flush) {
return
;
return
;
if
(
length
<
0
||
(
pdata
-
replay_data
)
+
length
>
MAX_REPLAY_SIZE
)
if
(
length
<
0
||
(
pdata
-
replay_data
)
+
length
>
MAX_REPLAY_SIZE
)
return
;
return
;
memcpy
(
pdata
,
data
,
length
);
std
::
memcpy
(
pdata
,
data
,
length
);
pdata
+=
length
;
pdata
+=
length
;
#ifdef _WIN32
#ifdef _WIN32
DWORD
size
;
DWORD
size
;
...
@@ -70,8 +68,7 @@ void Replay::WriteInt32(int data, bool flush) {
...
@@ -70,8 +68,7 @@ void Replay::WriteInt32(int data, bool flush) {
return
;
return
;
if
((
pdata
-
replay_data
)
+
4
>
MAX_REPLAY_SIZE
)
if
((
pdata
-
replay_data
)
+
4
>
MAX_REPLAY_SIZE
)
return
;
return
;
*
((
int
*
)(
pdata
))
=
data
;
BufferIO
::
WriteInt32
(
pdata
,
data
);
pdata
+=
4
;
#ifdef _WIN32
#ifdef _WIN32
DWORD
size
;
DWORD
size
;
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
int
),
&
size
,
NULL
);
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
int
),
&
size
,
NULL
);
...
@@ -86,8 +83,7 @@ void Replay::WriteInt16(short data, bool flush) {
...
@@ -86,8 +83,7 @@ void Replay::WriteInt16(short data, bool flush) {
return
;
return
;
if
((
pdata
-
replay_data
)
+
2
>
MAX_REPLAY_SIZE
)
if
((
pdata
-
replay_data
)
+
2
>
MAX_REPLAY_SIZE
)
return
;
return
;
*
((
short
*
)(
pdata
))
=
data
;
BufferIO
::
WriteInt16
(
pdata
,
data
);
pdata
+=
2
;
#ifdef _WIN32
#ifdef _WIN32
DWORD
size
;
DWORD
size
;
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
short
),
&
size
,
NULL
);
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
short
),
&
size
,
NULL
);
...
@@ -102,8 +98,7 @@ void Replay::WriteInt8(char data, bool flush) {
...
@@ -102,8 +98,7 @@ void Replay::WriteInt8(char data, bool flush) {
return
;
return
;
if
((
pdata
-
replay_data
)
+
1
>
MAX_REPLAY_SIZE
)
if
((
pdata
-
replay_data
)
+
1
>
MAX_REPLAY_SIZE
)
return
;
return
;
*
pdata
=
data
;
BufferIO
::
WriteInt8
(
pdata
,
data
);
pdata
++
;
#ifdef _WIN32
#ifdef _WIN32
DWORD
size
;
DWORD
size
;
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
char
),
&
size
,
NULL
);
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
char
),
&
size
,
NULL
);
...
@@ -266,7 +261,7 @@ bool Replay::ReadNextResponse(unsigned char resp[]) {
...
@@ -266,7 +261,7 @@ bool Replay::ReadNextResponse(unsigned char resp[]) {
int
len
=
*
pdata
++
;
int
len
=
*
pdata
++
;
if
(
len
>
SIZE_RETURN_VALUE
)
if
(
len
>
SIZE_RETURN_VALUE
)
return
false
;
return
false
;
memcpy
(
resp
,
pdata
,
len
);
std
::
memcpy
(
resp
,
pdata
,
len
);
pdata
+=
len
;
pdata
+=
len
;
return
true
;
return
true
;
}
}
...
@@ -280,27 +275,26 @@ void Replay::ReadName(wchar_t* data) {
...
@@ -280,27 +275,26 @@ void Replay::ReadName(wchar_t* data) {
void
Replay
::
ReadData
(
void
*
data
,
int
length
)
{
void
Replay
::
ReadData
(
void
*
data
,
int
length
)
{
if
(
!
is_replaying
)
if
(
!
is_replaying
)
return
;
return
;
memcpy
(
data
,
pdata
,
length
);
std
::
memcpy
(
data
,
pdata
,
length
);
pdata
+=
length
;
pdata
+=
length
;
}
}
int
Replay
::
ReadInt32
()
{
int
Replay
::
ReadInt32
()
{
if
(
!
is_replaying
)
if
(
!
is_replaying
)
return
-
1
;
return
-
1
;
int
ret
=
*
((
int
*
)
pdata
);
int
ret
=
BufferIO
::
ReadInt32
(
pdata
);
pdata
+=
4
;
return
ret
;
return
ret
;
}
}
short
Replay
::
ReadInt16
()
{
short
Replay
::
ReadInt16
()
{
if
(
!
is_replaying
)
if
(
!
is_replaying
)
return
-
1
;
return
-
1
;
short
ret
=
*
((
short
*
)
pdata
);
short
ret
=
BufferIO
::
ReadInt16
(
pdata
);
pdata
+=
2
;
return
ret
;
return
ret
;
}
}
char
Replay
::
ReadInt8
()
{
char
Replay
::
ReadInt8
()
{
if
(
!
is_replaying
)
if
(
!
is_replaying
)
return
-
1
;
return
-
1
;
return
*
pdata
++
;
char
ret
=
BufferIO
::
ReadInt8
(
pdata
);
return
ret
;
}
}
void
Replay
::
Rewind
()
{
void
Replay
::
Rewind
()
{
pdata
=
replay_data
;
pdata
=
replay_data
;
...
...
lflist.conf
View file @
ec9c71bf
This diff is collapsed.
Click to expand it.
strings.conf
View file @
ec9c71bf
...
@@ -672,7 +672,7 @@
...
@@ -672,7 +672,7 @@
!
setname
0
x2
次世代 ジェネクス
!
setname
0
x2
次世代 ジェネクス
!
setname
0
x1002
真次世代 レアル·ジェネクス
!
setname
0
x1002
真次世代 レアル·ジェネクス
#!setname 0x2002 盟军·次世代 A・ジェネクス
#!setname 0x2002 盟军·次世代 A・ジェネクス
#setname 0x3 N/A
!
setname
0
x3
魅惑的女王 魅惑の女王
!
setname
0
x4
亚马逊 アマゾネス
!
setname
0
x4
亚马逊 アマゾネス
!
setname
0
x5
秘仪之力 アルカナフォース
!
setname
0
x5
秘仪之力 アルカナフォース
!
setname
0
x6
暗黑界 暗黒界
!
setname
0
x6
暗黑界 暗黒界
...
...
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