Commit e422cebe authored by mercury233's avatar mercury233 Committed by DailyShana

change the default replay file name to the time of duel start (#2213)

parent 7992aafb
......@@ -683,8 +683,11 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnChainWhenAvail->setVisible(false);
mainGame->btnCancelOrFinish->setVisible(false);
mainGame->btnShuffle->setVisible(false);
time_t nowtime = time(NULL);
tm* localedtime = localtime(&nowtime);
char* prep = pdata;
Replay new_replay;
memcpy(&new_replay.pheader, prep, sizeof(ReplayHeader));
time_t starttime = new_replay.pheader.seed;
tm* localedtime = localtime(&starttime);
wchar_t timetext[40];
wcsftime(timetext, 40, L"%Y-%m-%d %H-%M-%S", localedtime);
mainGame->ebRSName->setText(timetext);
......@@ -705,9 +708,6 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->WaitFrameSignal(30);
}
if(mainGame->actionParam || !is_host) {
char* prep = pdata;
Replay new_replay;
memcpy(&new_replay.pheader, prep, sizeof(ReplayHeader));
prep += sizeof(ReplayHeader);
memcpy(new_replay.comp_data, prep, len - sizeof(ReplayHeader) - 1);
new_replay.comp_size = len - sizeof(ReplayHeader) - 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment