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-520DIY
ygopro
Commits
60dc4cd7
Commit
60dc4cd7
authored
Jan 25, 2025
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exclude more client codes
parent
a4d0aece
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
13 deletions
+16
-13
gframe/data_manager.cpp
gframe/data_manager.cpp
+8
-11
gframe/data_manager.h
gframe/data_manager.h
+6
-2
gframe/single_duel.h
gframe/single_duel.h
+1
-0
gframe/tag_duel.h
gframe/tag_duel.h
+1
-0
No files found.
gframe/data_manager.cpp
View file @
60dc4cd7
...
...
@@ -130,6 +130,7 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
#endif //YGOPRO_SERVER_MODE
return
ret
;
}
#ifndef YGOPRO_SERVER_MODE
bool
DataManager
::
LoadStrings
(
const
char
*
file
)
{
FILE
*
fp
=
fopen
(
file
,
"r"
);
if
(
!
fp
)
...
...
@@ -141,7 +142,6 @@ bool DataManager::LoadStrings(const char* file) {
fclose
(
fp
);
return
true
;
}
#ifndef YGOPRO_SERVER_MODE
bool
DataManager
::
LoadStrings
(
irr
::
io
::
IReadFile
*
reader
)
{
char
ch
{};
std
::
string
linebuf
;
...
...
@@ -157,7 +157,6 @@ bool DataManager::LoadStrings(irr::io::IReadFile* reader) {
reader
->
drop
();
return
true
;
}
#endif //YGOPRO_SERVER_MODE
void
DataManager
::
ReadStringConfLine
(
const
char
*
linebuf
)
{
if
(
linebuf
[
0
]
!=
'!'
)
return
;
...
...
@@ -189,6 +188,7 @@ void DataManager::ReadStringConfLine(const char* linebuf) {
_setnameStrings
[
value
]
=
strBuffer
;
}
}
#endif //YGOPRO_SERVER_MODE
bool
DataManager
::
Error
(
sqlite3
*
pDB
,
sqlite3_stmt
*
pStmt
)
{
errmsg
[
0
]
=
'\0'
;
std
::
strncat
(
errmsg
,
sqlite3_errmsg
(
pDB
),
sizeof
errmsg
-
1
);
...
...
@@ -199,6 +199,7 @@ bool DataManager::Error(sqlite3* pDB, sqlite3_stmt* pStmt) {
code_pointer
DataManager
::
GetCodePointer
(
unsigned
int
code
)
const
{
return
_datas
.
find
(
code
);
}
#ifndef YGOPRO_SERVER_MODE
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
return
_strings
.
find
(
code
);
}
...
...
@@ -214,6 +215,7 @@ string_pointer DataManager::strings_begin() const {
string_pointer
DataManager
::
strings_end
()
const
{
return
_strings
.
cend
();
}
#endif //YGOPRO_SERVER_MODE
bool
DataManager
::
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
{
auto
cdit
=
_datas
.
find
(
code
);
if
(
cdit
==
_datas
.
end
())
...
...
@@ -223,6 +225,7 @@ bool DataManager::GetData(unsigned int code, CardData* pData) const {
}
return
true
;
}
#ifndef YGOPRO_SERVER_MODE
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
const
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
{
...
...
@@ -408,6 +411,7 @@ std::wstring DataManager::FormatLinkMarker(unsigned int link_marker) const {
buffer
.
append
(
L"[\u2198]"
);
return
buffer
;
}
#endif //YGOPRO_SERVER_MODE
uint32_t
DataManager
::
CardReader
(
uint32_t
code
,
card_data
*
pData
)
{
if
(
!
dataManager
.
GetData
(
code
,
pData
))
pData
->
clear
();
...
...
@@ -447,14 +451,7 @@ unsigned char* DataManager::ScriptReaderExSingle(const char* path, const char* s
}
unsigned
char
*
DataManager
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
#if defined(YGOPRO_SERVER_MODE) && !defined(SERVER_ZIP_SUPPORT)
FILE
*
fp
=
fopen
(
script_name
,
"rb"
);
if
(
!
fp
)
return
0
;
int
len
=
fread
(
scriptBuffer
,
1
,
sizeof
(
scriptBuffer
),
fp
);
fclose
(
fp
);
if
(
len
>=
(
int
)
sizeof
(
scriptBuffer
))
return
nullptr
;
*
slen
=
len
;
return
DefaultScriptReader
(
script_name
,
slen
);
#else
#ifdef _WIN32
wchar_t
fname
[
256
]{};
...
...
@@ -470,8 +467,8 @@ unsigned char* DataManager::ScriptReader(const char* script_name, int* slen) {
if
(
size
>=
(
int
)
sizeof
scriptBuffer
)
return
nullptr
;
*
slen
=
size
;
#endif //YGOPRO_SERVER_MODE
return
scriptBuffer
;
#endif //YGOPRO_SERVER_MODE
}
unsigned
char
*
DataManager
::
DefaultScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
wchar_t
fname
[
256
]{};
...
...
gframe/data_manager.h
View file @
60dc4cd7
...
...
@@ -44,20 +44,23 @@ public:
DataManager
();
bool
ReadDB
(
sqlite3
*
pDB
);
bool
LoadDB
(
const
wchar_t
*
wfile
);
bool
LoadStrings
(
const
char
*
file
);
#ifndef YGOPRO_SERVER_MODE
bool
LoadStrings
(
const
char
*
file
);
bool
LoadStrings
(
irr
::
io
::
IReadFile
*
reader
);
#endif
void
ReadStringConfLine
(
const
char
*
linebuf
);
#endif
bool
Error
(
sqlite3
*
pDB
,
sqlite3_stmt
*
pStmt
=
nullptr
);
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
#ifndef YGOPRO_SERVER_MODE
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
code_pointer
datas_begin
()
const
;
code_pointer
datas_end
()
const
;
string_pointer
strings_begin
()
const
;
string_pointer
strings_end
()
const
;
#endif
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
;
#ifndef YGOPRO_SERVER_MODE
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
const
;
const
wchar_t
*
GetName
(
unsigned
int
code
)
const
;
const
wchar_t
*
GetText
(
unsigned
int
code
)
const
;
...
...
@@ -79,6 +82,7 @@ public:
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_victoryStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_setnameStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_sysStrings
;
#endif
char
errmsg
[
512
]{};
static
unsigned
char
scriptBuffer
[
0x100000
];
...
...
gframe/single_duel.h
View file @
60dc4cd7
...
...
@@ -90,3 +90,4 @@ protected:
}
#endif //SINGLE_DUEL_H
gframe/tag_duel.h
View file @
60dc4cd7
...
...
@@ -88,3 +88,4 @@ protected:
}
#endif //TAG_DUEL_H
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