Compare commits

..

5 Commits

3 changed files with 23 additions and 12 deletions

View File

@ -1,4 +1,4 @@
DATABASE_URL="file:./db.sqlite" DATABASE_URL="file:./db.sqlite"
PORT=8443 PORT=8443
ADMINPASS= ADMIN_PASS=
SALT= SALT=

View File

@ -14,7 +14,13 @@ The commit history includes BopItFreak's server because this server is (debatabl
$ curl -fsSL https://bun.sh/install | bash $ curl -fsSL https://bun.sh/install | bash
``` ```
1. Configure 1. Setup Git submodules
```
$ git submodule update --init --recursive
```
2. Configure
- Copy environment variables - Copy environment variables
@ -26,26 +32,26 @@ The commit history includes BopItFreak's server because this server is (debatabl
- Edit the files in the `config` folder to match your needs - Edit the files in the `config` folder to match your needs
2. Install packages 3. Install packages
``` ```
$ bun i $ bun i
``` ```
3. Setup database 4. Setup database
``` ```
$ bunx prisma generate $ bunx prisma generate
$ bunx prisma db push $ bunx prisma db push
``` ```
4. Build 5. Build
``` ```
$ bun run build $ bun run build
``` ```
5. Run 6. Run
``` ```
$ bun start $ bun start

View File

@ -93,7 +93,8 @@ export class Socket extends EventEmitter {
this.id = foundSocket.id; this.id = foundSocket.id;
} }
this.loadUser(); (async () => {
await this.loadUser();
// TODO Permissions // TODO Permissions
let isAdmin = false; let isAdmin = false;
@ -101,6 +102,7 @@ export class Socket extends EventEmitter {
this.setRateLimits(isAdmin ? adminLimits : userLimits); this.setRateLimits(isAdmin ? adminLimits : userLimits);
this.bindEventListeners(); this.bindEventListeners();
})();
} }
public getIP() { public getIP() {
@ -133,7 +135,10 @@ export class Socket extends EventEmitter {
// Does channel exist? // Does channel exist?
if (channel) { if (channel) {
// Exists, join normally // Exists, join normally
(async () => {
await this.loadUser();
channel.join(this); channel.join(this);
})();
} else { } else {
// Doesn't exist, create // Doesn't exist, create
channel = new Channel( channel = new Channel(