Skip to content

Commit 28f8521

Browse files
committed
Update battle log format
Closes #2732
1 parent 02deaed commit 28f8521

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

rooms.js

+18
Original file line numberDiff line numberDiff line change
@@ -960,11 +960,29 @@ let BattleRoom = (() => {
960960
if (!logData) return;
961961
this.battle.logData = null; // deallocate to save space
962962
logData.log = BattleRoom.prototype.getLog.call(logData, 3); // replay log (exact damage)
963+
964+
// delete some redundant data
965+
if (p1rating) {
966+
delete p1rating.formatid;
967+
delete p1rating.username;
968+
delete p1rating.rpsigma;
969+
delete p1rating.sigma;
970+
}
971+
if (p2rating) {
972+
delete p2rating.formatid;
973+
delete p2rating.username;
974+
delete p2rating.rpsigma;
975+
delete p2rating.sigma;
976+
}
977+
963978
logData.p1rating = p1rating;
964979
logData.p2rating = p2rating;
965980
logData.endType = this.battle.endType;
966981
if (!p1rating) logData.ladderError = true;
967982
const date = new Date();
983+
logData.timestamp = '' + date;
984+
logData.id = this.id;
985+
logData.format = this.format;
968986
const logsubfolder = Tools.toTimeStamp(date).split(' ')[0];
969987
const logfolder = logsubfolder.split('-', 2).join('-');
970988

0 commit comments

Comments
 (0)