Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
1002ef59
Commit
1002ef59
authored
Dec 19, 2017
by
mercury233
Committed by
Momobako
Dec 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linux_bot
parent
188e06a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+23
-2
No files found.
gframe/menu_handler.cpp
View file @
1002ef59
...
...
@@ -245,13 +245,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
if
(
sel
==
-
1
)
break
;
bot_mode
=
true
;
#ifdef _WIN32
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
break
;
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
break
;
}
#ifdef _WIN32
STARTUPINFO
si
;
PROCESS_INFORMATION
pi
;
ZeroMemory
(
&
si
,
sizeof
(
si
));
...
...
@@ -261,11 +261,32 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
int
flag
=
0
;
flag
+=
(
mainGame
->
chkBotHand
->
isChecked
()
?
0x1
:
0
);
myswprintf
(
cmd
,
L"Bot.exe
\"
%ls
\"
%d %d"
,
mainGame
->
botInfo
[
sel
].
command
,
flag
,
mainGame
->
gameConf
.
serverport
);
if
(
!
CreateProcessW
(
NULL
,
(
LPWSTR
)
cmd
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
))
if
(
!
CreateProcessW
(
NULL
,
cmd
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
))
{
NetServer
::
StopServer
();
break
;
}
#else
if
(
fork
()
==
0
)
{
usleep
(
100000
);
char
arg1
[
512
];
BufferIO
::
EncodeUTF8
(
mainGame
->
botInfo
[
sel
].
command
,
arg1
);
int
flag
=
0
;
flag
+=
(
mainGame
->
chkBotHand
->
isChecked
()
?
0x1
:
0
);
char
arg2
[
8
];
sprintf
(
arg2
,
"%d"
,
flag
);
char
arg3
[
5
];
sprintf
(
arg3
,
"%d"
,
mainGame
->
gameConf
.
serverport
);
execl
(
"./bot"
,
"bot"
,
arg1
,
arg2
,
arg3
,
NULL
);
exit
(
0
);
}
else
{
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
break
;
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
break
;
}
}
#endif
mainGame
->
btnStartBot
->
setEnabled
(
false
);
mainGame
->
btnBotCancel
->
setEnabled
(
false
);
...
...
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