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
dc5a3053
Commit
dc5a3053
authored
Feb 12, 2025
by
Chen Bill
Committed by
GitHub
Feb 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use <ctime> header (#2668)
parent
d6c4ad21
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
16 deletions
+12
-16
gframe/deck_con.cpp
gframe/deck_con.cpp
+1
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-2
gframe/game.cpp
gframe/game.cpp
+2
-3
gframe/game.h
gframe/game.h
+1
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-2
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+3
-4
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+1
-1
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-1
No files found.
gframe/deck_con.cpp
View file @
dc5a3053
...
...
@@ -63,7 +63,7 @@ void DeckBuilder::Initialize() {
mainGame
->
btnSideReload
->
setVisible
(
false
);
filterList
=
&
deckManager
.
_lfList
[
mainGame
->
gameConf
.
use_lflist
?
mainGame
->
gameConf
.
default_lflist
:
deckManager
.
_lfList
.
size
()
-
1
].
content
;
ClearSearch
();
rnd
.
reset
((
uint_fast32_t
)
time
(
nullptr
));
rnd
.
reset
((
uint_fast32_t
)
std
::
time
(
nullptr
));
mouse_pos
.
set
(
0
,
0
);
hovered_code
=
0
;
hovered_pos
=
0
;
...
...
gframe/duelclient.cpp
View file @
dc5a3053
...
...
@@ -730,9 +730,8 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, int len) {
else
starttime
=
new_replay
.
pheader
.
seed
;
tm
*
localedtime
=
localtime
(
&
starttime
);
wchar_t
timetext
[
40
];
std
::
wcsftime
(
timetext
,
40
,
L"%Y-%m-%d %H-%M-%S"
,
localedtime
);
std
::
wcsftime
(
timetext
,
sizeof
timetext
/
sizeof
timetext
[
0
],
L"%Y-%m-%d %H-%M-%S"
,
std
::
localtime
(
&
starttime
)
);
mainGame
->
ebRSName
->
setText
(
timetext
);
if
(
!
mainGame
->
chkAutoSaveReplay
->
isChecked
())
{
mainGame
->
wReplaySave
->
setText
(
dataManager
.
GetSysString
(
1340
));
...
...
gframe/game.cpp
View file @
dc5a3053
...
...
@@ -1723,10 +1723,9 @@ void Game::ErrorLog(const char* msg) {
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
if
(
!
fp
)
return
;
time_t
nowtime
=
time
(
nullptr
);
tm
*
localedtime
=
localtime
(
&
nowtime
);
time_t
nowtime
=
std
::
time
(
nullptr
);
char
timebuf
[
40
];
st
rftime
(
timebuf
,
40
,
"%Y-%m-%d %H:%M:%S"
,
localedtime
);
st
d
::
strftime
(
timebuf
,
sizeof
timebuf
,
"%Y-%m-%d %H:%M:%S"
,
std
::
localtime
(
&
nowtime
)
);
fprintf
(
fp
,
"[%s]%s
\n
"
,
timebuf
,
msg
);
fclose
(
fp
);
}
...
...
gframe/game.h
View file @
dc5a3053
...
...
@@ -15,7 +15,7 @@
#include "client_field.h"
#include "deck_con.h"
#include "menu_handler.h"
#include <
time.h
>
#include <
ctime
>
#include <unordered_map>
#include <vector>
#include <list>
...
...
gframe/menu_handler.cpp
View file @
dc5a3053
...
...
@@ -556,8 +556,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
curtime
=
ReplayMode
::
cur_replay
.
pheader
.
start_time
;
else
curtime
=
ReplayMode
::
cur_replay
.
pheader
.
seed
;
tm
*
st
=
localtime
(
&
curtime
);
std
::
wcsftime
(
infobuf
,
256
,
L"%Y/%m/%d %H:%M:%S
\n
"
,
st
);
std
::
wcsftime
(
infobuf
,
sizeof
infobuf
/
sizeof
infobuf
[
0
],
L"%Y/%m/%d %H:%M:%S
\n
"
,
std
::
localtime
(
&
curtime
));
repinfo
.
append
(
infobuf
);
wchar_t
namebuf
[
4
][
20
]{};
ReplayMode
::
cur_replay
.
ReadName
(
namebuf
[
0
]);
...
...
gframe/single_duel.cpp
View file @
dc5a3053
...
...
@@ -419,7 +419,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
rh
.
version
=
PRO_VERSION
;
rh
.
flag
=
REPLAY_UNIFORM
;
rh
.
seed
=
seed
;
rh
.
start_time
=
(
unsigned
int
)
time
(
nullptr
);
rh
.
start_time
=
(
unsigned
int
)
std
::
time
(
nullptr
);
last_replay
.
BeginRecord
();
last_replay
.
WriteHeader
(
rh
);
last_replay
.
WriteData
(
players
[
0
]
->
name
,
40
,
false
);
...
...
gframe/single_mode.cpp
View file @
dc5a3053
...
...
@@ -84,7 +84,7 @@ int SingleMode::SinglePlayThread() {
rh
.
version
=
PRO_VERSION
;
rh
.
flag
=
REPLAY_UNIFORM
|
REPLAY_SINGLE_MODE
;
rh
.
seed
=
seed
;
rh
.
start_time
=
(
unsigned
int
)
time
(
nullptr
);
rh
.
start_time
=
(
unsigned
int
)
std
::
time
(
nullptr
);
mainGame
->
gMutex
.
lock
();
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ClearCardInfo
();
...
...
@@ -135,10 +135,9 @@ int SingleMode::SinglePlayThread() {
}
last_replay
.
EndRecord
();
mainGame
->
gMutex
.
lock
();
time_t
nowtime
=
time
(
nullptr
);
tm
*
localedtime
=
localtime
(
&
nowtime
);
time_t
nowtime
=
std
::
time
(
nullptr
);
wchar_t
timetext
[
40
];
std
::
wcsftime
(
timetext
,
40
,
L"%Y-%m-%d %H-%M-%S"
,
localedtime
);
std
::
wcsftime
(
timetext
,
sizeof
timetext
/
sizeof
timetext
[
0
],
L"%Y-%m-%d %H-%M-%S"
,
std
::
localtime
(
&
nowtime
)
);
mainGame
->
ebRSName
->
setText
(
timetext
);
if
(
!
mainGame
->
chkAutoSaveReplay
->
isChecked
())
{
mainGame
->
wReplaySave
->
setText
(
dataManager
.
GetSysString
(
1340
));
...
...
gframe/sound_manager.cpp
View file @
dc5a3053
...
...
@@ -12,7 +12,7 @@ bool SoundManager::Init() {
#ifdef YGOPRO_USE_IRRKLANG
bgm_scene
=
-
1
;
RefreshBGMList
();
rnd
.
reset
((
unsigned
int
)
time
(
nullptr
));
rnd
.
reset
((
unsigned
int
)
std
::
time
(
nullptr
));
engineSound
=
irrklang
::
createIrrKlangDevice
();
engineMusic
=
irrklang
::
createIrrKlangDevice
();
if
(
!
engineSound
||
!
engineMusic
)
{
...
...
gframe/tag_duel.cpp
View file @
dc5a3053
...
...
@@ -392,7 +392,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
rh
.
version
=
PRO_VERSION
;
rh
.
flag
=
REPLAY_UNIFORM
|
REPLAY_TAG
;
rh
.
seed
=
seed
;
rh
.
start_time
=
(
unsigned
int
)
time
(
nullptr
);
rh
.
start_time
=
(
unsigned
int
)
std
::
time
(
nullptr
);
last_replay
.
BeginRecord
();
last_replay
.
WriteHeader
(
rh
);
last_replay
.
WriteData
(
players
[
0
]
->
name
,
40
,
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