Skip to content

Commit

Permalink
0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbasPL committed Feb 4, 2021
1 parent d24d36c commit eb88b42
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body style="background: #333; color: #ddd">
<nav>
<div class="nav-wrapper red">
<a class="brand-logo center">Steam account checker</a>
<a class="brand-logo center">Steam account checker 1.1</a>
<ul class="right">
<li>
<a class="btn-flat waves-effect waves-light modal-trigger white-text" href="#modal1" style="margin: 0;"><i class="large material-icons">add</i></a>
Expand Down Expand Up @@ -87,7 +87,7 @@ <h4 class="center">Add account</h4>
let preloader = '<div class="preloader-wrapper small active"><div class="spinner-layer spinner-red-only"><div class="circle-clipper left"><div class="circle"></div>\
</div><div class="gap-patch"><div class="circle"></div></div><div class="circle-clipper right"><div class="circle"></div></div></div></div>';
let name = account.pending ? preloader : account.name ?? '?';
let rank = account.pending ? preloader : account.wins === -1 ? '-' : (account.wins ?? 0) > 10 ? (account.rank == 0 ? "?" : account.rank) : (account.wins ?? "?");
let rank = account.pending ? preloader : account.wins === -1 ? '-' : (account.wins ?? "?") + ((account.wins ?? 0) > 10 ? ('/' + (account.rank ?? "?")) : '');
let ban = account.pending ? preloader : account.error ? account.error : (account.penalty_reason === 0 ? "-" : ((account.penalty_reason ?? '?')
+ ((account.penalty_seconds ?? -1) == -1 ? "" :
(Date.now() > (account.penalty_seconds * 1000) ? " - Expired"
Expand Down Expand Up @@ -179,6 +179,7 @@ <h4 class="center">Add account</h4>
M.toast({html: username + ': ' + ret.error, classes: 'red'});
}
});
await new Promise(p => setTimeout(p, 200));
}
}
updateAccounts();
Expand Down
66 changes: 34 additions & 32 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ ipcMain.handle("accounts:check", async (event, username) => {

try {
const res = await check_account(username, account.password);
console.log(res);
db.set(username, {
password: account.password,
name: res.name,
Expand Down Expand Up @@ -124,26 +125,26 @@ function penalty_reason_string(id) {
function rank_string(id) {
switch (id)
{
case 0: "Unranked"
case 1: "S1"
case 2: "S2"
case 3: "S3"
case 4: "S4"
case 5: "S5"
case 6: "S6"
case 7: "G1"
case 8: "G2"
case 9: "G3"
case 10: "G4"
case 11: "MG1"
case 12: "MG2"
case 13: "MGE"
case 14: "DMG"
case 15: "LE"
case 16: "LEM"
case 17: "Supreme"
case 18: "Global"
default: `Unknown(${id})`;
case 0: return "Unranked";
case 1: return "S1";
case 2: return "S2";
case 3: return "S3";
case 4: return "S4";
case 5: return "S5";
case 6: return "S6";
case 7: return "G1";
case 8: return "G2";
case 9: return "G3";
case 10: return "G4";
case 11: return "MG1";
case 12: return "MG2";
case 13: return "MGE";
case 14: return "DMG";
case 15: return "LE";
case 16: return "LEM";
case 17: return "Supreme";
case 18: return "Global";
default: return `Unknown(${id})`;
}
}

Expand Down Expand Up @@ -239,18 +240,18 @@ function check_account(username, pass) {
let msg = Protos.csgo.CMsgGCCStrike15_v2_MatchmakingGC2ClientHello.decode(payload);
msg = Protos.csgo.CMsgGCCStrike15_v2_MatchmakingGC2ClientHello.toObject(msg, { defaults: true });

if(is_permanent_penalty_reason(msg.penalty_reason)) {
steamClient.logOff();
currently_checking = currently_checking.filter(x => x !== username);
resolve({
penalty_reason: penalty_reason_string(msg.penalty_reason),
penalty_seconds: -1,
wins: -1,
rank: -1,
name: steamClient.accountInfo.name
});
return;
}
// if(is_permanent_penalty_reason(msg.penalty_reason)) {
// steamClient.logOff();
// currently_checking = currently_checking.filter(x => x !== username);
// resolve({
// penalty_reason: penalty_reason_string(msg.penalty_reason),
// penalty_seconds: -1,
// wins: -1,
// rank: -1,
// name: steamClient.accountInfo.name
// });
// return;
// }

if(!AcknowledgedPenalty && msg.penalty_seconds > 0) {
let message = Protos.csgo.CMsgGCCStrike15_v2_AcknowledgePenalty.create({
Expand Down Expand Up @@ -281,6 +282,7 @@ function check_account(username, pass) {
if(!Done) {
Done = true;
currently_checking = currently_checking.filter(x => x !== username);
console.log(msg);
resolve({
penalty_reason: msg.vac_banned ? 'VAC' : penalty_reason_string(msg.penalty_reason),
penalty_seconds: msg.vac_banned ? -1 : msg.penalty_seconds > 0 ? (Math.floor(Date.now() / 1000) + msg.penalty_seconds) : 0,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "csgo-checker",
"version": "0.1.0",
"version": "0.1.1",
"description": "csgo-checker",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit eb88b42

Please sign in to comment.