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
8893caac
Commit
8893caac
authored
Mar 11, 2025
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'salix/patch2' into develop
parents
9dad9524
898b4687
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
45 deletions
+45
-45
gframe/config.h
gframe/config.h
+1
-1
gframe/data_manager.cpp
gframe/data_manager.cpp
+2
-2
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+40
-40
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-1
No files found.
gframe/config.h
View file @
8893caac
...
...
@@ -46,7 +46,7 @@
#endif
#include <cstdio>
#include <
stdlib.h
>
#include <
cstdlib
>
#include <iostream>
#include <algorithm>
#include <string>
...
...
gframe/data_manager.cpp
View file @
8893caac
...
...
@@ -91,10 +91,10 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
if
(
reader
==
nullptr
)
return
false
;
spmemvfs_db_t
db
;
spmembuffer_t
*
mem
=
(
spmembuffer_t
*
)
calloc
(
sizeof
(
spmembuffer_t
),
1
);
spmembuffer_t
*
mem
=
(
spmembuffer_t
*
)
std
::
calloc
(
sizeof
(
spmembuffer_t
),
1
);
spmemvfs_env_init
();
mem
->
total
=
mem
->
used
=
reader
->
getSize
();
mem
->
data
=
(
char
*
)
malloc
(
mem
->
total
+
1
);
mem
->
data
=
(
char
*
)
std
::
malloc
(
mem
->
total
+
1
);
reader
->
read
(
mem
->
data
,
mem
->
total
);
reader
->
drop
();
(
mem
->
data
)[
mem
->
total
]
=
'\0'
;
...
...
gframe/deck_manager.cpp
View file @
8893caac
...
...
@@ -196,7 +196,7 @@ int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_pa
if
(
linebuf
[
0
]
<
'0'
||
linebuf
[
0
]
>
'9'
)
continue
;
errno
=
0
;
code
=
strtol
(
linebuf
.
c_str
(),
nullptr
,
10
);
code
=
st
d
::
st
rtol
(
linebuf
.
c_str
(),
nullptr
,
10
);
if
(
errno
==
ERANGE
)
continue
;
cardlist
[
ct
++
]
=
code
;
...
...
gframe/game.cpp
View file @
8893caac
...
...
@@ -1368,13 +1368,13 @@ void Game::LoadConfig() {
if (std::sscanf(linebuf, "%63s = %959s", strbuf, valbuf) != 2)
continue;
if(!std::strcmp(strbuf, "antialias")) {
gameConf
.
antialias
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.antialias = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "use_d3d")) {
gameConf
.
use_d3d
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf.use_d3d = st
d::st
rtol(valbuf, nullptr, 10) > 0;
} else if(!std::strcmp(strbuf, "use_image_scale")) {
gameConf
.
use_image_scale
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf.use_image_scale = st
d::st
rtol(valbuf, nullptr, 10) > 0;
} else if(!std::strcmp(strbuf, "errorlog")) {
unsigned
int
val
=
strtol
(
valbuf
,
nullptr
,
10
);
unsigned int val = st
d::st
rtol(valbuf, nullptr, 10);
enable_log = val & 0xff;
} else if(!std::strcmp(strbuf, "textfont")) {
int textfontsize = 0;
...
...
@@ -1385,94 +1385,94 @@ void Game::LoadConfig() {
} else if(!std::strcmp(strbuf, "numfont")) {
BufferIO::DecodeUTF8(valbuf, gameConf.numfont);
} else if(!std::strcmp(strbuf, "serverport")) {
gameConf
.
serverport
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.serverport = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "lasthost")) {
BufferIO::DecodeUTF8(valbuf, gameConf.lasthost);
} else if(!std::strcmp(strbuf, "lastport")) {
BufferIO::DecodeUTF8(valbuf, gameConf.lastport);
} else if(!std::strcmp(strbuf, "automonsterpos")) {
gameConf
.
chkMAutoPos
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkMAutoPos = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "autospellpos")) {
gameConf
.
chkSTAutoPos
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkSTAutoPos = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "randompos")) {
gameConf
.
chkRandomPos
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkRandomPos = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "autochain")) {
gameConf
.
chkAutoChain
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkAutoChain = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "waitchain")) {
gameConf
.
chkWaitChain
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkWaitChain = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "showchain")) {
gameConf
.
chkDefaultShowChain
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkDefaultShowChain = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "mute_opponent")) {
gameConf
.
chkIgnore1
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkIgnore1 = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "mute_spectators")) {
gameConf
.
chkIgnore2
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkIgnore2 = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "use_lflist")) {
gameConf
.
use_lflist
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.use_lflist = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "default_lflist")) {
gameConf
.
default_lflist
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.default_lflist = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "default_rule")) {
gameConf
.
default_rule
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.default_rule = st
d::st
rtol(valbuf, nullptr, 10);
if(gameConf.default_rule <= 0)
gameConf.default_rule = DEFAULT_DUEL_RULE;
} else if(!std::strcmp(strbuf, "hide_setname")) {
gameConf
.
hide_setname
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.hide_setname = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "hide_hint_button")) {
gameConf
.
hide_hint_button
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.hide_hint_button = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "control_mode")) {
gameConf
.
control_mode
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.control_mode = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "draw_field_spell")) {
gameConf
.
draw_field_spell
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.draw_field_spell = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "separate_clear_button")) {
gameConf
.
separate_clear_button
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.separate_clear_button = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "auto_search_limit")) {
gameConf
.
auto_search_limit
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.auto_search_limit = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "search_multiple_keywords")) {
gameConf
.
search_multiple_keywords
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.search_multiple_keywords = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "ignore_deck_changes")) {
gameConf
.
chkIgnoreDeckChanges
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.chkIgnoreDeckChanges = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "default_ot")) {
gameConf
.
defaultOT
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.defaultOT = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "enable_bot_mode")) {
gameConf
.
enable_bot_mode
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.enable_bot_mode = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "quick_animation")) {
gameConf
.
quick_animation
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.quick_animation = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "auto_save_replay")) {
gameConf
.
auto_save_replay
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.auto_save_replay = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "draw_single_chain")) {
gameConf
.
draw_single_chain
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.draw_single_chain = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "hide_player_name")) {
gameConf
.
hide_player_name
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.hide_player_name = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "prefer_expansion_script")) {
gameConf
.
prefer_expansion_script
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.prefer_expansion_script = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "window_maximized")) {
gameConf
.
window_maximized
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf.window_maximized = st
d::st
rtol(valbuf, nullptr, 10) > 0;
} else if(!std::strcmp(strbuf, "window_width")) {
gameConf
.
window_width
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.window_width = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "window_height")) {
gameConf
.
window_height
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.window_height = st
d::st
rtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "resize_popup_menu")) {
gameConf
.
resize_popup_menu
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf.resize_popup_menu = st
d::st
rtol(valbuf, nullptr, 10) > 0;
#ifdef YGOPRO_USE_IRRKLANG
} else if(!std::strcmp(strbuf, "enable_sound")) {
gameConf
.
enable_sound
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf.enable_sound = st
d::st
rtol(valbuf, nullptr, 10) > 0;
} else if(!std::strcmp(strbuf, "sound_volume")) {
int
vol
=
strtol
(
valbuf
,
nullptr
,
10
);
int vol = st
d::st
rtol(valbuf, nullptr, 10);
if (vol < 0)
vol = 0;
else if (vol > 100)
vol = 100;
gameConf.sound_volume = (double)vol / 100;
} else if(!std::strcmp(strbuf, "enable_music")) {
gameConf
.
enable_music
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf.enable_music = st
d::st
rtol(valbuf, nullptr, 10) > 0;
} else if(!std::strcmp(strbuf, "music_volume")) {
int
vol
=
strtol
(
valbuf
,
nullptr
,
10
);
int vol = st
d::st
rtol(valbuf, nullptr, 10);
if (vol < 0)
vol = 0;
else if (vol > 100)
vol = 100;
gameConf.music_volume = (double)vol / 100;
} else if(!std::strcmp(strbuf, "music_mode")) {
gameConf
.
music_mode
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf.music_mode = st
d::st
rtol(valbuf, nullptr, 10);
#endif
} else {
// options allowing multiple words
...
...
gframe/menu_handler.cpp
View file @
8893caac
...
...
@@ -400,7 +400,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
char
arg3
[
8
];
std
::
snprintf
(
arg3
,
sizeof
arg3
,
"%d"
,
mainGame
->
gameConf
.
serverport
);
execl
(
"./bot"
,
"bot"
,
arg1
,
arg2
,
arg3
,
nullptr
);
exit
(
0
);
std
::
exit
(
0
);
}
else
{
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
...
...
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