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
xiaoye
ygopro
Commits
03cce946
Commit
03cce946
authored
Feb 06, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'server' of git.mycard.moe:mycard/ygopro into server-develop
parents
496d3f6e
f1ce2613
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
46 additions
and
17 deletions
+46
-17
appveyor.yml
appveyor.yml
+3
-3
gframe/data_manager.cpp
gframe/data_manager.cpp
+6
-3
gframe/data_manager.h
gframe/data_manager.h
+6
-2
gframe/game.cpp
gframe/game.cpp
+3
-3
gframe/game.h
gframe/game.h
+3
-1
gframe/single_duel.cpp
gframe/single_duel.cpp
+2
-2
gframe/single_duel.h
gframe/single_duel.h
+1
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+2
-2
gframe/tag_duel.h
gframe/tag_duel.h
+1
-0
premake/irrlicht/irrlicht.patch
premake/irrlicht/irrlicht.patch
+19
-1
No files found.
appveyor.yml
View file @
03cce946
...
...
@@ -19,9 +19,9 @@ install:
-
tar xf lua-5.4.4.tar.gz
-
move lua-5.4.4 lua
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/202
2/sqlite-amalgamation-33903
00.zip ; exit 0"
-
7z x
-y sqlite-amalgamation-33903
00.zip
-
move sqlite-amalgamation-3
3903
00 sqlite3
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/202
4/sqlite-amalgamation-34700
00.zip ; exit 0"
-
7z x
sqlite-amalgamation-34700
00.zip
-
move sqlite-amalgamation-3
4700
00 sqlite3
before_build
:
-
xcopy /E premake\* .
...
...
gframe/data_manager.cpp
View file @
03cce946
...
...
@@ -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
())
{
...
...
@@ -413,6 +416,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
();
...
...
@@ -484,7 +488,6 @@ unsigned char* DataManager::ReadScriptFromFile(const char* script_name, int* sle
*
slen
=
(
int
)
len
;
return
scriptBuffer
;
}
#ifndef YGOPRO_SERVER_MODE
bool
DataManager
::
deck_sort_lv
(
code_pointer
p1
,
code_pointer
p2
)
{
if
((
p1
->
second
.
type
&
0x7
)
!=
(
p2
->
second
.
type
&
0x7
))
...
...
gframe/data_manager.h
View file @
03cce946
...
...
@@ -45,20 +45,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
;
...
...
@@ -80,6 +83,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/game.cpp
View file @
03cce946
...
...
@@ -99,14 +99,14 @@ HostInfo game_info;
void
Game
::
MainServerLoop
()
{
#ifdef SERVER_ZIP_SUPPORT
dataManager
.
FileSystem
=
new
irr
::
io
::
CFileSystem
();
DataManager
::
FileSystem
=
new
irr
::
io
::
CFileSystem
();
#endif
initUtils
();
deckManager
.
LoadLFList
();
dataManager
.
LoadDB
(
L"cards.cdb"
);
LoadExpansions
();
#ifdef SERVER_PRO2_SUPPORT
dataManager
.
FileSystem
->
addFileArchive
(
"data/script.zip"
,
true
,
false
,
EFAT_ZIP
);
DataManager
::
FileSystem
->
addFileArchive
(
"data/script.zip"
,
true
,
false
,
EFAT_ZIP
);
#endif
server_port
=
NetServer
::
StartServer
(
server_port
);
...
...
@@ -1310,7 +1310,7 @@ void Game::LoadExpansions() {
FileSystem
::
TraversalDir
(
L"./cdb"
,
[](
const
wchar_t
*
name
,
bool
isdir
)
{
wchar_t
fpath
[
1024
];
myswprintf
(
fpath
,
L"./cdb/%ls"
,
name
);
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".cdb"
,
4
))
{
if
(
!
isdir
&&
IsExtension
(
name
,
L".cdb"
))
{
dataManager
.
LoadDB
(
fpath
);
}
});
...
...
gframe/game.h
View file @
03cce946
...
...
@@ -30,14 +30,16 @@
#ifndef YGOPRO_DEFAULT_DUEL_RULE
#define YGOPRO_DEFAULT_DUEL_RULE 5
#endif
#define DEFAULT_DUEL_RULE YGOPRO_DEFAULT_DUEL_RULE
constexpr
int
CONFIG_LINE_SIZE
=
1024
;
constexpr
int
TEXT_LINE_SIZE
=
256
;
namespace
ygo
{
bool
IsExtension
(
const
wchar_t
*
filename
,
const
wchar_t
*
extension
);
#ifndef YGOPRO_SERVER_MODE
#ifndef YGOPRO_SERVER_MODE
struct
Config
{
bool
use_d3d
{
false
};
bool
use_image_scale
{
true
};
...
...
gframe/single_duel.cpp
View file @
03cce946
...
...
@@ -65,12 +65,12 @@ void SingleDuel::JoinGame(DuelPlayer* dp, unsigned char* pdata, bool is_creater)
BufferIO
::
NullTerminate
(
pkt
->
pass
);
BufferIO
::
CopyCharArray
(
pkt
->
pass
,
jpass
);
#ifdef YGOPRO_SERVER_MODE
if
(
!
wcscmp
(
jpass
,
L"the Big Brother"
)
&&
!
cache_recorder
)
{
if
(
!
std
::
wcscmp
(
jpass
,
L"the Big Brother"
)
&&
!
cache_recorder
)
{
is_recorder
=
true
;
cache_recorder
=
dp
;
}
#ifndef YGOPRO_SERVER_MODE_DISABLE_CLOUD_REPLAY
if
(
!
wcscmp
(
jpass
,
L"Marshtomp"
)
&&
!
replay_recorder
)
{
if
(
!
std
::
wcscmp
(
jpass
,
L"Marshtomp"
)
&&
!
replay_recorder
)
{
is_recorder
=
true
;
replay_recorder
=
dp
;
}
...
...
gframe/single_duel.h
View file @
03cce946
...
...
@@ -93,3 +93,4 @@ protected:
}
#endif //SINGLE_DUEL_H
gframe/tag_duel.cpp
View file @
03cce946
...
...
@@ -69,12 +69,12 @@ void TagDuel::JoinGame(DuelPlayer* dp, unsigned char* pdata, bool is_creater) {
BufferIO
::
NullTerminate
(
pkt
->
pass
);
BufferIO
::
CopyCharArray
(
pkt
->
pass
,
jpass
);
#ifdef YGOPRO_SERVER_MODE
if
(
!
wcscmp
(
jpass
,
L"the Big Brother"
)
&&
!
cache_recorder
)
{
if
(
!
std
::
wcscmp
(
jpass
,
L"the Big Brother"
)
&&
!
cache_recorder
)
{
is_recorder
=
true
;
cache_recorder
=
dp
;
}
#ifndef YGOPRO_SERVER_MODE_DISABLE_CLOUD_REPLAY
if
(
!
wcscmp
(
jpass
,
L"Marshtomp"
)
&&
!
replay_recorder
)
{
if
(
!
std
::
wcscmp
(
jpass
,
L"Marshtomp"
)
&&
!
replay_recorder
)
{
is_recorder
=
true
;
replay_recorder
=
dp
;
}
...
...
gframe/tag_duel.h
View file @
03cce946
...
...
@@ -91,3 +91,4 @@ protected:
}
#endif //TAG_DUEL_H
premake/irrlicht/irrlicht.patch
View file @
03cce946
...
...
@@ -37,7 +37,7 @@ index 43557cd..ffa06bc 100644
} // end namespace core
} // end namespace irr
diff --git a/include/irrTypes.h b/include/irrTypes.h
index 403f890..
940e859
100644
index 403f890..
bfa13f4
100644
--- a/include/irrTypes.h
+++ b/include/irrTypes.h
@@ -48,6 +48,9 @@
typedef __int16 s16;
...
...
@@ -50,6 +50,24 @@ index 403f890..940e859 100644
//! 32 bit unsigned variable.
@@ -113,17 +116,6 @@
typedef double f64;
#include <wchar.h>
#ifdef _IRR_WINDOWS_API_
-//! Defines for s{w,n}printf because these methods do not match the ISO C
-//! standard on Windows platforms, but it does on all others.
-//! These should be int snprintf(char *str, size_t size, const char *format, ...);
-//! and int swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...);
-#if defined(_MSC_VER) && _MSC_VER > 1310 && !defined (_WIN32_WCE)
-#define swprintf swprintf_s
-#define snprintf sprintf_s
-#elif !defined(__CYGWIN__)
-#define swprintf _snwprintf
-#define snprintf _snprintf
-#endif
// define the wchar_t type if not already built in.
#ifdef _MSC_VER
diff --git a/source/Irrlicht/CGUIEditBox.cpp b/source/Irrlicht/CGUIEditBox.cpp
index 395fb69..cc6b75f 100644
--- a/source/Irrlicht/CGUIEditBox.cpp
...
...
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