Compare commits

..

5 Commits

3 changed files with 23 additions and 12 deletions

View File

@ -1,4 +1,4 @@
DATABASE_URL="file:./db.sqlite"
PORT=8443
ADMINPASS=
ADMIN_PASS=
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
```
1. Configure
1. Setup Git submodules
```
$ git submodule update --init --recursive
```
2. Configure
- 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
2. Install packages
3. Install packages
```
$ bun i
```
3. Setup database
4. Setup database
```
$ bunx prisma generate
$ bunx prisma db push
```
4. Build
5. Build
```
$ bun run build
```
5. Run
6. Run
```
$ bun start

View File

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