From 8c7bf288c49c0022211aa38acb3a38c5c7c238ba Mon Sep 17 00:00:00 2001 From: Matthew Ray Date: Sun, 17 May 2020 06:58:45 -0400 Subject: [PATCH] various additions --- src/cscli/main.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cscli/main.ts b/src/cscli/main.ts index 5de963c..e0d72ee 100644 --- a/src/cscli/main.ts +++ b/src/cscli/main.ts @@ -4,6 +4,7 @@ import net from 'net'; import crypto from 'crypto'; import { promises as fs } from 'fs'; import Client from '../Client'; +import { dataConversion } from '../functions'; export default class CSCLI { public client: Client; @@ -42,13 +43,12 @@ export default class CSCLI { await this.client.util.accounts.lock(parsed.Username, this.client.user.id, { reason: 'Failed to accept Terms of Service.' }); break; case 'ram': - const mem = Number(await this.client.util.exec(`memory ${parsed.Username}`)) * 1000; - const memoryConversion = mem / 1024 / 1024; + const memoryConversion = dataConversion(Number(await this.client.util.exec(`memory ${parsed.Username}`)) * 1000); socket.write(`${memoryConversion}\n`); socket.destroy(); break; case 'storage': - const res = await this.client.redis.get(`storage-${parsed.Username}`) ? Number(await this.client.redis.get(`storage-${parsed.Username}`)) : '0'; + const res = await this.client.redis.get(`storage-${parsed.Username}`) ? dataConversion(Number(await this.client.redis.get(`storage-${parsed.Username}`))) : 'N/A'; socket.write(`${res}\n`); socket.destroy(); break;