forked from engineering/cloudservices
fixes
parent
0b15ff3ad6
commit
0e2a9a74f1
|
@ -40,19 +40,24 @@ export default class CSCLI {
|
||||||
// FINISH VERIFICATION CHECKS
|
// FINISH VERIFICATION CHECKS
|
||||||
switch (parsed.Type) {
|
switch (parsed.Type) {
|
||||||
case 'score':
|
case 'score':
|
||||||
const acc = await this.client.db.Account.findOne({ username: parsed.Username });
|
try {
|
||||||
if (!acc) { socket.destroy(); break; }
|
const acc = await this.client.db.Account.findOne({ username: parsed.Username });
|
||||||
const pin = await Report.getPIN(acc.userID, this.client.config.internalKey);
|
if (!acc) { socket.destroy(); break; }
|
||||||
if (pin.status !== 'SUCCESS') { socket.destroy(); break; }
|
const pin = await Report.getPIN(acc.userID, this.client.config.internalKey);
|
||||||
|
if (pin.status !== 'SUCCESS') { socket.destroy(); break; }
|
||||||
|
|
||||||
const report = await Report.soft(acc.userID, pin.pin[2], this.client.config.vendorKey);
|
const report = await Report.soft(acc.userID, pin.pin[2], this.client.config.vendorKey);
|
||||||
if (report.status !== 'SUCCESS') { socket.destroy(); break; }
|
if (report.status !== 'SUCCESS') { socket.destroy(); break; }
|
||||||
|
|
||||||
if (!report.totalScore) { socket.write('N/C\n'); socket.destroy(); break; }
|
if (!report.totalScore) { socket.write('N/C\n'); socket.destroy(); break; }
|
||||||
if (report.totalScore === 0) { socket.write('---\n'); socket.destroy(); break; }
|
if (report.totalScore === 0) { socket.write('---\n'); socket.destroy(); break; }
|
||||||
|
|
||||||
socket.write(`${report.totalScore}\n`);
|
socket.write(`${report.totalScore}\n`);
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
|
} catch {
|
||||||
|
socket.write('---\n');
|
||||||
|
socket.destroy();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'lock':
|
case 'lock':
|
||||||
await this.client.util.accounts.lock(parsed.Username, this.client.user.id, { reason: parsed.Message });
|
await this.client.util.accounts.lock(parsed.Username, this.client.user.id, { reason: parsed.Message });
|
||||||
|
|
Loading…
Reference in New Issue