Skip to content

Commit

Permalink
Random tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Senryoku committed May 31, 2023
1 parent 7150561 commit d844a16
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion client/src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default defineComponent({
sessionOwner: (sessionID ? userID : undefined) as UserID | undefined,
sessionOwnerUsername: userName as string,
sessionUsers: [] as SessionUser[],
disconnectedUsers: {} as { [uid: UserID]: DisconnectedUser },
disconnectedUsers: {} as { [uid: UserID]: { userName: string } },
// Session settings
ownerIsPlayer: true,
isPublic: false,
Expand Down
4 changes: 2 additions & 2 deletions src/Cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ if (process.env.NODE_ENV !== "production") {
} else {
for (const file of DBFiles) {
// Stream the JSON file on production to reduce memory usage (to the detriment of runtime)
const cardsPromise = new Promise((resolve, reject) => {
const cardsPromise = new Promise((resolve /*, reject*/) => {
const stream = JSONStream.parse("$*");
stream.on("data", function (entry: any) {
stream.on("data", function (entry) {
tmpCards.set(entry.key, entry.value as Card);
});
stream.on("end", resolve);
Expand Down
12 changes: 5 additions & 7 deletions src/Persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,11 @@ async function tempDump(exitOnCompletion = false) {
// (Disconnecting the socket would be better, but explicitly
// disconnecting socket prevents their automatic reconnection)
if (exitOnCompletion) {
for (const userID in Connections) {
const msg = new Message("Server Restarting", "Please wait...");
msg.showConfirmButton = false;
msg.allowOutsideClick = false;
msg.timer = 0;
Connections[userID].socket.emit("message", msg);
}
const msg = new Message("Server Restarting", "Please wait...");
msg.showConfirmButton = false;
msg.allowOutsideClick = false;
msg.timer = 0;
for (const userID in Connections) Connections[userID].socket.emit("message", msg);
}

const Promises: Promise<unknown>[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/SocketType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface ServerToClientEvents {
};
}) => void;

userDisconnected: (data: { owner?: UserID; disconnectedUsers: { [uid: string]: any } }) => void; // FIXME
userDisconnected: (data: { owner?: UserID; disconnectedUsers: { [uid: string]: { userName: string } } }) => void;
sessionOptions: (sessionOptions: { [key: keyof typeof SessionsSettingsProps]: any }) => void; // FIXME: Specify allowed options and their types
setRestriction: (setRestriction: Array<SetCode>) => void;
ignoreCollections: (ignoreCollections: boolean) => void;
Expand Down

0 comments on commit d844a16

Please sign in to comment.