Update README.md

This commit is contained in:
Hri7566 2024-11-06 15:13:22 -05:00
parent 41d86b545d
commit e506999f76
3 changed files with 23 additions and 24 deletions

View File

@ -82,7 +82,7 @@ This has always been the future intention of this project.
- [x] Token generation - [x] Token generation
- [x] Frontend implementation - [x] Frontend implementation
- [ ] Token generator - [x] Token generator
- [ ] Test if they even work correctly - [ ] Test if they even work correctly
- [x] Permission groups and permissions - [x] Permission groups and permissions
- [x] Probable permission groups: owner, admin, mod, trialmod, default - [x] Probable permission groups: owner, admin, mod, trialmod, default
@ -130,6 +130,9 @@ This has always been the future intention of this project.
- fork? - fork?
- Probably use a simple in-memory cache - Probably use a simple in-memory cache
- Likely store with leveldb or JSON - Likely store with leveldb or JSON
- Socket events could all be handled in one emitter
- Maybe use one external emitter so the functions aren't copied on each conncetion
- Does JS/Bun use symbols for such a thing already?
## How to run ## How to run

26
src/util/types.d.ts vendored
View File

@ -25,7 +25,7 @@ declare type UserFlags = Partial<{
}>; }>;
type TChannelFlags = Partial<{ type TChannelFlags = Partial<{
limit: number; limit: number; // slightly different compared to mppnet
owner_id: string; // brandonism owner_id: string; // brandonism
no_crown: boolean; no_crown: boolean;
rainbow: boolean; rainbow: boolean;
@ -90,18 +90,18 @@ declare type Notification = Partial<{
declare type CustomTarget = { declare type CustomTarget = {
global?: boolean; global?: boolean;
} & ( } & (
| { | {
mode: "subscribed"; mode: "subscribed";
} }
| { | {
mode: "ids"; mode: "ids";
ids: string[]; ids: string[];
} }
| { | {
mode: "id"; mode: "id";
id: string; id: string;
} }
); );
declare interface Crown { declare interface Crown {
userId: string; userId: string;

View File

@ -39,12 +39,9 @@ import type { RateLimit } from "./ratelimit/RateLimit";
import type { RateLimitChain } from "./ratelimit/RateLimitChain"; import type { RateLimitChain } from "./ratelimit/RateLimitChain";
import { import {
getUserPermissions, getUserPermissions,
hasPermission,
validatePermission validatePermission
} from "~/data/permissions"; } from "~/data/permissions";
import { getRoles } from "~/data/role";
import { removeTag, setTag } from "~/util/tags"; import { removeTag, setTag } from "~/util/tags";
import { bus } from "~/event/bus";
import { notificationConfig } from "~/util/notificationConfig"; import { notificationConfig } from "~/util/notificationConfig";
const logger = new Logger("Sockets"); const logger = new Logger("Sockets");
@ -72,9 +69,9 @@ export class Socket extends EventEmitter {
_id: string | undefined; _id: string | undefined;
set: Partial<IChannelSettings> | undefined; set: Partial<IChannelSettings> | undefined;
} = { } = {
_id: undefined, _id: undefined,
set: {} set: {}
}; };
public currentChannelID: string | undefined; public currentChannelID: string | undefined;
private cursorPos: Vector2<CursorValue> = { x: 200, y: 100 }; private cursorPos: Vector2<CursorValue> = { x: 200, y: 100 };
@ -91,9 +88,8 @@ export class Socket extends EventEmitter {
this.ip = ws.data.ip; this.ip = ws.data.ip;
} else { } else {
// Fake user // Fake user
this.ip = `::ffff:${Math.random() * 255}.${Math.random() * 255}.${ this.ip = `::ffff:${Math.random() * 255}.${Math.random() * 255}.${Math.random() * 255
Math.random() * 255 }.${Math.random() * 255}`;
}.${Math.random() * 255}`;
} }
// User ID // User ID
@ -395,7 +391,7 @@ export class Socket extends EventEmitter {
try { try {
if (typeof this.user.tag === "string") if (typeof this.user.tag === "string")
tag = JSON.parse(this.user.tag) as Tag; tag = JSON.parse(this.user.tag) as Tag;
} catch (err) {} } catch (err) { }
return { return {
_id: facadeID, _id: facadeID,