MCPcopy Create free account
hub / github.com/JACoders/OpenJK / SG_WriteComment

Function SG_WriteComment

code/server/sv_savegame.cpp:711–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711static void SG_WriteComment(qboolean qbAutosave, const char *psMapName)
712{
713 ojk::SavedGameHelper saved_game(
714 &ojk::SavedGame::get_instance());
715
716 char sComment[iSG_COMMENT_SIZE];
717
718 if ( qbAutosave || !*saveGameComment)
719 {
720 Com_sprintf( sComment, sizeof(sComment), "---> %s", psMapName );
721 }
722 else
723 {
724 Q_strncpyz(sComment,saveGameComment, sizeof(sComment));
725 }
726
727 saved_game.write_chunk(
728 INT_ID('C', 'O', 'M', 'M'),
729 sComment);
730
731 // Add Date/Time/Map stamp
732 unsigned int timestamp = SG_UnixTimestamp (time (NULL));
733
734 saved_game.write_chunk<uint32_t>(
735 INT_ID('C', 'M', 'T', 'M'),
736 timestamp);
737
738 Com_DPrintf("Saving: current (%s)\n", sComment);
739}
740
741static time_t SG_GetTime ( unsigned int timestamp )
742{

Callers 1

sv_savegame.cppFile · 0.85

Calls 5

Q_strncpyzFunction · 0.85
SG_UnixTimestampFunction · 0.85
Com_sprintfFunction · 0.50
Com_DPrintfFunction · 0.50
write_chunkMethod · 0.45

Tested by

no test coverage detected