mirror of
https://github.com/psforever/PSFPortal.git
synced 2026-04-26 06:45:22 +00:00
Add PsAdmin support to get player list
This commit is contained in:
parent
d616a57404
commit
1e34cbdfb0
6 changed files with 145 additions and 16 deletions
11
api/db.js
11
api/db.js
|
|
@ -317,6 +317,17 @@ export async function get_account_by_name(name) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function get_character_by_name(name) {
|
||||
try {
|
||||
const account = await pool.query('SELECT id, account_id, name, faction_id, created, last_login FROM characters WHERE name=$1 AND deleted=false', [name]);
|
||||
return account.rows[0];
|
||||
} catch (e) {
|
||||
if (e.code)
|
||||
e.code = pg_error_inv[e.code]
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
export async function create_account(username, password) {
|
||||
try {
|
||||
const passhash = await bcrypt.hash(password, BCRYPT_ROUNDS);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue