Update server.js
Browse files
server.js
CHANGED
|
@@ -16,7 +16,10 @@ const fetch = require('node-fetch');
|
|
| 16 |
const crypto = require('crypto');
|
| 17 |
|
| 18 |
// βββ 1) BLUE BUYER CODE & STORAGE SETUP βββββββββββββββββββββββββββββββββββββ
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
let blueBuyerCode;
|
| 22 |
if (fs.existsSync(blueBuyerCodeFile)) {
|
|
@@ -31,8 +34,8 @@ console.log(`YOUR BUYER CODE: ${blueBuyerCode}`);
|
|
| 31 |
const serverStartTime = Date.now();
|
| 32 |
|
| 33 |
const userStates = {}; // { [userId]: { step, started, runningProcess? } }
|
| 34 |
-
const bannedFilePath = path.join(
|
| 35 |
-
const usersFilePath = path.join(
|
| 36 |
|
| 37 |
let activeUsers = 0;
|
| 38 |
|
|
|
|
| 16 |
const crypto = require('crypto');
|
| 17 |
|
| 18 |
// βββ 1) BLUE BUYER CODE & STORAGE SETUP βββββββββββββββββββββββββββββββββββββ
|
| 19 |
+
// LINE 25β28
|
| 20 |
+
const DATA_DIR = path.join(__dirname, 'storage');
|
| 21 |
+
if (!fs.existsSync(DATA_DIR)) fs.mkdirSync(DATA_DIR, { recursive: true });
|
| 22 |
+
const blueBuyerCodeFile = path.join(DATA_DIR, 'blueBuyerCode.json');
|
| 23 |
|
| 24 |
let blueBuyerCode;
|
| 25 |
if (fs.existsSync(blueBuyerCodeFile)) {
|
|
|
|
| 34 |
const serverStartTime = Date.now();
|
| 35 |
|
| 36 |
const userStates = {}; // { [userId]: { step, started, runningProcess? } }
|
| 37 |
+
const bannedFilePath = path.join(DATA_DIR, 'banned.json');
|
| 38 |
+
const usersFilePath = path.join(DATA_DIR, 'users.json');
|
| 39 |
|
| 40 |
let activeUsers = 0;
|
| 41 |
|