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
wyykak
ygopro
Commits
de9457d7
Commit
de9457d7
authored
May 04, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
YGOPRO_TEST_REDTEXT
parent
9161ee11
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
gframe/game.cpp
gframe/game.cpp
+18
-0
gframe/gframe.cpp
gframe/gframe.cpp
+11
-0
gframe/premake4.lua
gframe/premake4.lua
+1
-0
No files found.
gframe/game.cpp
View file @
de9457d7
...
...
@@ -40,8 +40,18 @@ void Game::MainServerLoop() {
dataManager
.
LoadDB
(
"cards.cdb"
);
aServerPort
=
NetServer
::
StartServer
(
aServerPort
);
NetServer
::
InitDuel
();
#ifdef YGOPRO_TEST_REDTEXT
time_t
nowtime
=
time
(
NULL
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
char
timebuf
[
40
];
strftime
(
timebuf
,
40
,
"%Y-%m-%d %H:%M:%S"
,
localedtime
);
char
startmsg
[
256
];
sprintf
(
startmsg
,
"Log of redtext check with commit %s
\"
%s
\"
on %s."
,
getenv
(
"TRAVIS_COMMIT"
),
getenv
(
"TRAVIS_COMMIT_MESSAGE"
),
timebuf
);
AddDebugMsg
(
startmsg
);
#else
printf
(
"%u
\n
"
,
aServerPort
);
fflush
(
stdout
);
#endif //YGOPRO_TEST_REDTEXT
while
(
NetServer
::
net_evbase
)
{
#ifdef WIN32
...
...
@@ -1616,7 +1626,15 @@ void Game::ClearChatMsg() {
void
Game
::
AddDebugMsg
(
char
*
msg
)
{
#ifdef YGOPRO_SERVER_MODE
#ifdef YGOPRO_TEST_REDTEXT
FILE
*
fp
=
fopen
(
"./redtext.txt"
,
"at"
);
if
(
!
fp
)
return
;
fprintf
(
fp
,
"%s
\n
"
,
msg
);
fclose
(
fp
);
#else
fprintf
(
stderr
,
"%s
\n
"
,
msg
);
#endif //YGOPRO_TEST_REDTEXT
#else
if
(
enable_log
&
0x1
)
{
wchar_t
wbuf
[
1024
];
...
...
gframe/gframe.cpp
View file @
de9457d7
...
...
@@ -76,14 +76,24 @@ int main(int argc, char* argv[]) {
ygo
::
replay_mode
=
0
;
ygo
::
game_info
.
lflist
=
0
;
ygo
::
game_info
.
rule
=
0
;
#ifdef YGOPRO_TEST_REDTEXT
ygo
::
game_info
.
mode
=
2
;
#else
ygo
::
game_info
.
mode
=
0
;
#endif //YGOPRO_TEST_REDTEXT
ygo
::
game_info
.
start_hand
=
5
;
ygo
::
game_info
.
start_lp
=
8000
;
ygo
::
game_info
.
draw_count
=
1
;
#ifdef YGOPRO_TEST_REDTEXT
ygo
::
game_info
.
no_check_deck
=
true
;
ygo
::
game_info
.
no_shuffle_deck
=
true
;
#else
ygo
::
game_info
.
no_check_deck
=
false
;
ygo
::
game_info
.
no_shuffle_deck
=
false
;
#endif //YGOPRO_TEST_REDTEXT
ygo
::
game_info
.
duel_rule
=
DEFAULT_DUEL_RULE
;
ygo
::
game_info
.
time_limit
=
180
;
#ifndef YGOPRO_TEST_REDTEXT
if
(
argc
>
1
)
{
ygo
::
aServerPort
=
atoi
(
argv
[
1
]);
int
lflist
=
atoi
(
argv
[
2
]);
...
...
@@ -113,6 +123,7 @@ int main(int argc, char* argv[]) {
ygo
::
game_info
.
time_limit
=
atoi
(
argv
[
11
]);
ygo
::
replay_mode
=
atoi
(
argv
[
12
]);
}
#endif //YGOPRO_TEST_REDTEXT
ygo
::
mainGame
=
&
_game
;
ygo
::
mainGame
->
MainServerLoop
();
return
0
;
...
...
gframe/premake4.lua
View file @
de9457d7
...
...
@@ -4,6 +4,7 @@ project "ygopro"
kind
"ConsoleApp"
defines
{
"YGOPRO_SERVER_MODE"
}
if
os.getenv
(
"YGOPRO_TEST_REDTEXT"
)
then
defines
{
"YGOPRO_TEST_REDTEXT"
}
end
files
{
"gframe.cpp"
,
"config.h"
,
"game.cpp"
,
"game.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