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
1
Merge Requests
1
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
8dac6db3
Commit
8dac6db3
authored
May 21, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro into develop
parents
7d1c0c71
f9b5c7ed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
21 deletions
+32
-21
gframe/bufferio.h
gframe/bufferio.h
+5
-5
gframe/gframe.cpp
gframe/gframe.cpp
+9
-3
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+3
-3
gframe/single_mode.cpp
gframe/single_mode.cpp
+14
-10
premake/irrlicht/premake5.lua
premake/irrlicht/premake5.lua
+1
-0
No files found.
gframe/bufferio.h
View file @
8dac6db3
...
@@ -38,7 +38,7 @@ public:
...
@@ -38,7 +38,7 @@ public:
* @brief Copy a C-style string to another C-style string.
* @brief Copy a C-style string to another C-style string.
* @param src The source wide string
* @param src The source wide string
* @param pstr The destination char string
* @param pstr The destination char string
* @param bufsize The
size
of the destination buffer
* @param bufsize The
length
of the destination buffer
* @return The length of the copied string
* @return The length of the copied string
*/
*/
template
<
typename
T1
,
typename
T2
>
template
<
typename
T1
,
typename
T2
>
...
@@ -68,13 +68,13 @@ public:
...
@@ -68,13 +68,13 @@ public:
}
}
template
<
size_t
N
>
template
<
size_t
N
>
static
void
CopyString
(
const
char
*
src
,
char
(
&
dst
)[
N
])
{
static
void
CopyString
(
const
char
*
src
,
char
(
&
dst
)[
N
])
{
dst
[
0
]
=
0
;
std
::
strncpy
(
dst
,
src
,
N
-
1
)
;
std
::
strncat
(
dst
,
src
,
N
-
1
)
;
dst
[
N
-
1
]
=
0
;
}
}
template
<
size_t
N
>
template
<
size_t
N
>
static
void
CopyWideString
(
const
wchar_t
*
src
,
wchar_t
(
&
dst
)[
N
])
{
static
void
CopyWideString
(
const
wchar_t
*
src
,
wchar_t
(
&
dst
)[
N
])
{
dst
[
0
]
=
0
;
std
::
wcsncpy
(
dst
,
src
,
N
-
1
)
;
std
::
wcsncat
(
dst
,
src
,
N
-
1
)
;
dst
[
N
-
1
]
=
0
;
}
}
template
<
typename
T
>
template
<
typename
T
>
static
bool
CheckUTF8Byte
(
const
T
*
str
,
int
len
)
{
static
bool
CheckUTF8Byte
(
const
T
*
str
,
int
len
)
{
...
...
gframe/gframe.cpp
View file @
8dac6db3
...
@@ -35,11 +35,17 @@ int main(int argc, char* argv[]) {
...
@@ -35,11 +35,17 @@ int main(int argc, char* argv[]) {
#ifdef __APPLE__
#ifdef __APPLE__
CFURLRef
bundle_url
=
CFBundleCopyBundleURL
(
CFBundleGetMainBundle
());
CFURLRef
bundle_url
=
CFBundleCopyBundleURL
(
CFBundleGetMainBundle
());
CFURLRef
bundle_base_url
=
CFURLCreateCopyDeletingLastPathComponent
(
nullptr
,
bundle_url
);
CFURLRef
bundle_base_url
=
CFURLCreateCopyDeletingLastPathComponent
(
nullptr
,
bundle_url
);
CFStringRef
bundle_ext
=
CFURLCopyPathExtension
(
bundle_url
);
if
(
bundle_ext
)
{
char
path
[
PATH_MAX
];
if
(
CFStringCompare
(
bundle_ext
,
CFSTR
(
"app"
),
kCFCompareCaseInsensitive
)
==
kCFCompareEqualTo
&&
CFURLGetFileSystemRepresentation
(
bundle_base_url
,
true
,
(
UInt8
*
)
path
,
PATH_MAX
))
{
chdir
(
path
);
}
CFRelease
(
bundle_ext
);
}
CFRelease
(
bundle_url
);
CFRelease
(
bundle_url
);
CFStringRef
path
=
CFURLCopyFileSystemPath
(
bundle_base_url
,
kCFURLPOSIXPathStyle
);
CFRelease
(
bundle_base_url
);
CFRelease
(
bundle_base_url
);
chdir
(
CFStringGetCStringPtr
(
path
,
kCFStringEncodingUTF8
));
CFRelease
(
path
);
#endif //__APPLE__
#endif //__APPLE__
#ifdef _WIN32
#ifdef _WIN32
if
(
argc
==
2
&&
(
ygo
::
IsExtension
(
argv
[
1
],
".ydk"
)
||
ygo
::
IsExtension
(
argv
[
1
],
".yrp"
)))
{
// open file from explorer
if
(
argc
==
2
&&
(
ygo
::
IsExtension
(
argv
[
1
],
".ydk"
)
||
ygo
::
IsExtension
(
argv
[
1
],
".yrp"
)))
{
// open file from explorer
...
...
gframe/replay_mode.cpp
View file @
8dac6db3
...
@@ -159,7 +159,7 @@ bool ReplayMode::StartDuel() {
...
@@ -159,7 +159,7 @@ bool ReplayMode::StartDuel() {
unsigned
int
seed
=
rh
.
seed
;
unsigned
int
seed
=
rh
.
seed
;
std
::
mt19937
rnd
(
seed
);
std
::
mt19937
rnd
(
seed
);
cur_replay
.
SkipInfo
();
cur_replay
.
SkipInfo
();
if
(
mainGame
->
dInfo
.
isTag
)
{
if
(
rh
.
flag
&
REPLAY_TAG
)
{
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
0
].
c_str
(),
mainGame
->
dInfo
.
hostname
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
0
].
c_str
(),
mainGame
->
dInfo
.
hostname
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
1
].
c_str
(),
mainGame
->
dInfo
.
hostname_tag
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
1
].
c_str
(),
mainGame
->
dInfo
.
hostname_tag
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
2
].
c_str
(),
mainGame
->
dInfo
.
clientname_tag
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
2
].
c_str
(),
mainGame
->
dInfo
.
clientname_tag
);
...
@@ -850,12 +850,12 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -850,12 +850,12 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
break
;
}
}
case
MSG_AI_NAME
:
{
case
MSG_AI_NAME
:
{
int
len
=
BufferIO
::
ReadInt16
(
pbuf
);
int
len
=
buffer_read
<
uint16_t
>
(
pbuf
);
pbuf
+=
len
+
1
;
pbuf
+=
len
+
1
;
break
;
break
;
}
}
case
MSG_SHOW_HINT
:
{
case
MSG_SHOW_HINT
:
{
int
len
=
BufferIO
::
ReadInt16
(
pbuf
);
int
len
=
buffer_read
<
uint16_t
>
(
pbuf
);
pbuf
+=
len
+
1
;
pbuf
+=
len
+
1
;
break
;
break
;
}
}
...
...
gframe/single_mode.cpp
View file @
8dac6db3
...
@@ -763,21 +763,25 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -763,21 +763,25 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
case
MSG_AI_NAME
:
{
case
MSG_AI_NAME
:
{
char
namebuf
[
128
]{};
char
namebuf
[
128
]{};
wchar_t
wname
[
20
]{};
wchar_t
wname
[
20
]{};
int
len
=
BufferIO
::
ReadInt16
(
pbuf
);
int
name_len
=
buffer_read
<
uint16_t
>
(
pbuf
);
auto
begin
=
pbuf
;
if
(
name_len
+
1
<=
(
int
)
sizeof
namebuf
)
{
pbuf
+=
len
+
1
;
std
::
memcpy
(
namebuf
,
pbuf
,
name_len
);
std
::
memcpy
(
namebuf
,
begin
,
len
+
1
);
namebuf
[
name_len
]
=
0
;
}
pbuf
+=
name_len
+
1
;
BufferIO
::
DecodeUTF8
(
namebuf
,
wname
);
BufferIO
::
DecodeUTF8
(
namebuf
,
wname
);
BufferIO
::
CopyCharArray
(
wname
,
mainGame
->
dInfo
.
clientname
);
BufferIO
::
CopyCharArray
(
wname
,
mainGame
->
dInfo
.
clientname
);
break
;
break
;
}
}
case
MSG_SHOW_HINT
:
{
case
MSG_SHOW_HINT
:
{
char
msgbuf
[
1024
];
char
msgbuf
[
1024
]{};
wchar_t
msg
[
1024
];
wchar_t
msg
[
1024
]{};
int
len
=
BufferIO
::
ReadInt16
(
pbuf
);
int
msg_len
=
buffer_read
<
uint16_t
>
(
pbuf
);
auto
begin
=
pbuf
;
if
(
msg_len
+
1
<=
(
int
)
sizeof
msgbuf
)
{
pbuf
+=
len
+
1
;
std
::
memcpy
(
msgbuf
,
pbuf
,
msg_len
);
std
::
memcpy
(
msgbuf
,
begin
,
len
+
1
);
msgbuf
[
msg_len
]
=
0
;
}
pbuf
+=
msg_len
+
1
;
BufferIO
::
DecodeUTF8
(
msgbuf
,
msg
);
BufferIO
::
DecodeUTF8
(
msgbuf
,
msg
);
mainGame
->
gMutex
.
lock
();
mainGame
->
gMutex
.
lock
();
mainGame
->
SetStaticText
(
mainGame
->
stMessage
,
310
,
mainGame
->
guiFont
,
msg
);
mainGame
->
SetStaticText
(
mainGame
->
stMessage
,
310
,
mainGame
->
guiFont
,
msg
);
...
...
premake/irrlicht/premake5.lua
View file @
8dac6db3
...
@@ -16,6 +16,7 @@ project "irrlicht"
...
@@ -16,6 +16,7 @@ project "irrlicht"
"_IRR_STATIC_LIB_"
,
"_IRR_STATIC_LIB_"
,
"NO_IRR_USE_NON_SYSTEM_BZLIB_"
,
"NO_IRR_USE_NON_SYSTEM_BZLIB_"
,
"NO_IRR_COMPILE_WITH_BZIP2_"
,
"NO_IRR_COMPILE_WITH_BZIP2_"
,
"NO_IRR_COMPILE_WITH_LZMA_"
,
"NO_IRR_COMPILE_WITH_CONSOLE_DEVICE_"
,
"NO_IRR_COMPILE_WITH_CONSOLE_DEVICE_"
,
"NO_IRR_COMPILE_WITH_DIRECT3D_8_"
,
"NO_IRR_COMPILE_WITH_DIRECT3D_8_"
,
"NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_"
,
"NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_"
,
...
...
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