Skip to content

Commit

Permalink
0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbasPL committed Feb 4, 2021
1 parent eb88b42 commit 8bcc3b5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
17 changes: 13 additions & 4 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 1.1</a>
<a class="brand-logo center">Steam account checker 0.1.2</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 All @@ -25,6 +25,7 @@
<tr>
<th>login</th>
<th>Name</th>
<th>Lvl</th>
<th>Wins/rank</th>
<th>Ban/Error</th>
<th>Action</th>
Expand Down Expand Up @@ -87,11 +88,12 @@ <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 ?? "?") + ((account.wins ?? 0) > 10 ? ('/' + (account.rank ?? "?")) : '');
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"
: " - " + countdown(account.penalty_seconds - Math.floor(Date.now() / 1000))))));
let lvl = account.lvl ?? '?';
if(!tr) {
tr = document.createElement('tr');
tr.id = 'acc-' + username;
Expand All @@ -100,6 +102,8 @@ <h4 class="center">Add account</h4>
td_username.innerHTML = username;
let td_name = document.createElement('td');
td_name.innerHTML = name;
let td_lvl = document.createElement('td');
td_lvl.innerHTML = lvl;
let td_rank = document.createElement('td');
td_rank.innerHTML = rank;
let td_ban = document.createElement('td');
Expand Down Expand Up @@ -135,6 +139,7 @@ <h4 class="center">Add account</h4>

tr.appendChild(td_username);
tr.appendChild(td_name);
tr.appendChild(td_lvl);
tr.appendChild(td_rank);
tr.appendChild(td_ban);
tr.appendChild(td_action);
Expand All @@ -144,11 +149,15 @@ <h4 class="center">Add account</h4>
if(td_name.innerHTML != name) {
td_name.innerHTML = name;
}
let td_rank = tr.querySelector("td:nth-child(3)");
let td_lvl = tr.querySelector("td:nth-child(3)");
if(td_lvl.innerHTML != lvl) {
td_lvl.innerHTML = lvl;
}
let td_rank = tr.querySelector("td:nth-child(4)");
if(td_rank.innerHTML != rank) {
td_rank.innerHTML = rank;
}
let td_ban = tr.querySelector("td:nth-child(4)");
let td_ban = tr.querySelector("td:nth-child(5)");
if(td_ban.innerHTML != ban) {
td_ban.innerHTML = ban;
}
Expand Down
25 changes: 7 additions & 18 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var currently_checking = [];
function createWindow () {
const win = new BrowserWindow({
webPreferences: {
nodeIntegration: true
nodeIntegration: true,
},
});

Expand Down Expand Up @@ -72,7 +72,8 @@ ipcMain.handle("accounts:check", async (event, username) => {
penalty_reason: res.penalty_reason,
penalty_seconds: res.penalty_seconds,
rank: res.rank,
wins: res.wins
wins: res.wins,
lvl: res.lvl
});
return res;
} catch (error) {
Expand Down Expand Up @@ -240,19 +241,6 @@ 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(!AcknowledgedPenalty && msg.penalty_seconds > 0) {
let message = Protos.csgo.CMsgGCCStrike15_v2_AcknowledgePenalty.create({
acknowledged: 1
Expand Down Expand Up @@ -284,11 +272,12 @@ function check_account(username, pass) {
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,
penalty_reason: steamClient.limitations.communityBanned ? 'Community' : msg.vac_banned ? 'VAC' : penalty_reason_string(msg.penalty_reason),
penalty_seconds: msg.vac_banned || steamClient.limitations.communityBanned ? -1 : msg.penalty_seconds > 0 ? (Math.floor(Date.now() / 1000) + msg.penalty_seconds) : 0,
wins: msg.vac_banned ? -1 : attempts < 5 ? msg.ranking.wins : 0,
rank: msg.vac_banned ? -1 : attempts < 5 ? rank_string(msg.ranking.rank_id) : 0,
name: steamClient.accountInfo.name
name: steamClient.accountInfo.name,
lvl: msg.player_level
});
}
steamClient.logOff();
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.1",
"version": "0.1.2",
"description": "csgo-checker",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 8bcc3b5

Please sign in to comment.