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
ebf125f0
Commit
ebf125f0
authored
Oct 11, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove wcscpy
parent
48ecc05a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/gframe.cpp
gframe/gframe.cpp
+5
-5
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+11
-8
No files found.
gframe/deck_manager.cpp
View file @
ebf125f0
...
...
@@ -237,7 +237,7 @@ void DeckManager::GetCategoryPath(wchar_t* ret, int index, const wchar_t* text)
myswprintf
(
catepath
,
L"./pack"
);
break
;
case
1
:
myswprintf
(
catepath
,
mainGame
->
gameConf
.
bot_deck_
path
);
BufferIO
::
CopyWideString
(
mainGame
->
gameConf
.
bot_deck_path
,
cate
path
);
break
;
case
-
1
:
case
2
:
...
...
gframe/gframe.cpp
View file @
ebf125f0
...
...
@@ -135,7 +135,7 @@ int main(int argc, char* argv[]) {
myswprintf
(
open_file_name
,
L"%ls/%ls"
,
ygo
::
mainGame
->
gameConf
.
lastcategory
,
wargv
[
i
]);
#endif
}
else
{
wcscpy
(
open_file_name
,
wargv
[
i
]
);
BufferIO
::
CopyWideString
(
wargv
[
i
],
open_file_name
);
}
}
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
...
...
@@ -156,7 +156,7 @@ int main(int argc, char* argv[]) {
++
i
;
if
(
i
<
wargc
)
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]
);
BufferIO
::
CopyWideString
(
wargv
[
i
],
open_file_name
);
}
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
if
(
open_file
)
...
...
@@ -167,7 +167,7 @@ int main(int argc, char* argv[]) {
++
i
;
if
(
i
<
wargc
)
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]
);
BufferIO
::
CopyWideString
(
wargv
[
i
],
open_file_name
);
}
ClickButton
(
ygo
::
mainGame
->
btnSingleMode
);
if
(
open_file
)
...
...
@@ -177,14 +177,14 @@ int main(int argc, char* argv[]) {
wchar_t
*
pstrext
=
wargv
[
1
]
+
wcslen
(
wargv
[
1
])
-
4
;
if
(
!
mywcsncasecmp
(
pstrext
,
L".ydk"
,
4
))
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]
);
BufferIO
::
CopyWideString
(
wargv
[
i
],
open_file_name
);
exit_on_return
=
!
keep_on_return
;
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
}
if
(
!
mywcsncasecmp
(
pstrext
,
L".yrp"
,
4
))
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]
);
BufferIO
::
CopyWideString
(
wargv
[
i
],
open_file_name
);
exit_on_return
=
!
keep_on_return
;
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
...
...
gframe/menu_handler.cpp
View file @
ebf125f0
...
...
@@ -70,14 +70,17 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
TrimText
(
mainGame
->
ebJoinHost
);
mainGame
->
TrimText
(
mainGame
->
ebJoinPort
);
char
ip
[
20
];
const
wchar_t
*
pstr
=
mainGame
->
ebJoinHost
->
getText
();
BufferIO
::
CopyWStr
(
pstr
,
ip
,
16
);
wchar_t
pstr
[
100
];
wchar_t
portstr
[
10
];
BufferIO
::
CopyWideString
(
mainGame
->
ebJoinHost
->
getText
(),
pstr
);
BufferIO
::
CopyWideString
(
mainGame
->
ebJoinPort
->
getText
(),
portstr
);
BufferIO
::
EncodeUTF8
(
pstr
,
ip
);
unsigned
int
remote_addr
=
htonl
(
inet_addr
(
ip
));
if
(
remote_addr
==
-
1
)
{
char
hostname
[
100
];
char
port
[
6
];
BufferIO
::
CopyWStr
(
pstr
,
hostname
,
100
);
BufferIO
::
CopyWStr
(
mainGame
->
ebJoinPort
->
getText
(),
port
,
6
);
BufferIO
::
EncodeUTF8
(
pstr
,
hostname
);
BufferIO
::
EncodeUTF8
(
portstr
,
port
);
struct
evutil_addrinfo
hints
;
struct
evutil_addrinfo
*
answer
=
NULL
;
std
::
memset
(
&
hints
,
0
,
sizeof
hints
);
...
...
@@ -99,9 +102,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
evutil_freeaddrinfo
(
answer
);
}
}
unsigned
int
remote_port
=
wcstol
(
mainGame
->
ebJoinPort
->
getText
()
,
nullptr
,
10
);
BufferIO
::
CopyW
Str
(
pstr
,
mainGame
->
gameConf
.
lasthost
,
100
);
BufferIO
::
CopyW
Str
(
mainGame
->
ebJoinPort
->
getText
(),
mainGame
->
gameConf
.
lastport
,
20
);
unsigned
int
remote_port
=
wcstol
(
portstr
,
nullptr
,
10
);
BufferIO
::
CopyW
ideString
(
pstr
,
mainGame
->
gameConf
.
lasthost
);
BufferIO
::
CopyW
ideString
(
portstr
,
mainGame
->
gameConf
.
lastport
);
if
(
DuelClient
::
StartClient
(
remote_addr
,
remote_port
,
false
))
{
mainGame
->
btnCreateHost
->
setEnabled
(
false
);
mainGame
->
btnJoinHost
->
setEnabled
(
false
);
...
...
@@ -129,7 +132,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
case
BUTTON_HOST_CONFIRM
:
{
bot_mode
=
false
;
BufferIO
::
CopyW
Str
(
mainGame
->
ebServerName
->
getText
(),
mainGame
->
gameConf
.
gamename
,
20
);
BufferIO
::
CopyW
ideString
(
mainGame
->
ebServerName
->
getText
(),
mainGame
->
gameConf
.
gamename
);
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
...
...
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