idz: Fix team-leader, add leader name and shop name

This commit is contained in:
643161de4220f1bc925fbb05bde805fd8ec95c63
2020-08-01 12:50:09 -04:00
committed by Tau
parent e61b103221
commit b2288b9b8f
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -13,10 +13,11 @@ export function _team(res: CreateAutoTeamResponse | LoadTeamResponse) {
buf.writeInt16LE(0x0078, 0x0000);
}
const leader = res.members.find(item => item.leader);
const leader = res.members.find(item => item.leader === true);
buf.writeUInt32LE(res.team.extId, 0x000c);
iconv.encode(leader ? leader.profile.name : "Error\0", "shift_jis").copy(buf, 0x0010);
iconv.encode(res.team.name, "shift_jis").copy(buf, 0x0024);
iconv.encode(process.env.SHOP_NAME ? process.env.SHOP_NAME : "\0", "shift_jis").copy(buf, 0x0044);
buf.writeUInt32LE(res.team.nameBg, 0x00d8);
buf.writeUInt32LE(res.team.nameFx, 0x00dc);
buf.fill(0xff, 0x00e0, 0x00f9); // Bitset: Unlocked BGs probably
+1 -1
View File
@@ -56,7 +56,7 @@ export class SqlTeamMemberRepository implements TeamMemberRepository {
return rows.map(row => ({
profile: _extractProfile(row),
chara: _extractChara(row),
leader: !!row.leader,
leader: row.leader === "true",
joinTime: new Date(row.join_time!),
}));
}