SendouQ
serverapp/features/sendouq/core/SendouQ.server.tsNo overview comment at the top of the file.
- Imports
- SeasonsSendouQMatch
- Used by
- 5 loaders6 actions1 route2 modules1 component2 routines7 other
Types
export type SQUncensoredGroup = SerializeFrom< (typeof SendouQClass.prototype.groups)[number] >;
export type SQGroup = SerializeFrom< ReturnType<SendouQClass["lookingGroups"]>[number] >;
Componentssendouq/GroupCard.tsx
export type SQOwnGroup = SerializeFrom< NonNullable<ReturnType<SendouQClass["findOwnGroup"]>> >;
Componentssendouq/GroupCard.tsx
export type SQMatch = SerializeFrom<ReturnType<SendouQClass["mapMatch"]>>;
export type SQGroupMember = NonNullable<SQGroup["members"]>[number];
Componentssendouq/GroupCard.tsx
Functions & values
Global SendouQ manager: all active groups and matchmaking state.
export let SendouQ = await freshSendouQInstance();
Unit tests (53)
- likesReceivedCount › returns 0 for a group nobody has liked
- likesReceivedCount › counts likes received, not given
- refreshSendouQInstance › notifies
- currentViewByUserId › returns
- findOwnGroup › returns
- findOwnGroup › solo group has the same tier as the user's personal tier
- findGroupByInviteCode › returns
- modePreferences › counts
- previewGroups › returns empty array when no groups exist
- previewGroups › censors
- previewGroups › shows members for partial groups
- previewGroups › removes inviteCode and chatRoomId from all groups
- previewGroups › applies correct censoring for mix of full and partial groups
- previewGroups › tier
- lookingGroups › filtering
- › returns empty array when user not in a group
- › only returns ACTIVE groups
- › only returns groups without matchId
- › excludes own group from results
- › own group size 4 only shows size 4 groups
- › own group size 3 only shows size 1 groups
- › own group size 2 shows size 1 and 2 groups
- › own group size 1 shows size 1, 2, and 3 groups
- lookingGroups › replay
- lookingGroups › censoring
- lookingGroups › skill-based
- mapMatch › counts
- mapMatch › leaves out a pool of a mode its owner avoids
- mapMatch › shows
Reloads the global SendouQ instance from the database; call after any change to groups or matches. Notifies the groups whose received likes count changed, e.g. a liker left the looking pool or went stale since the last reload.
export async function refreshSendouQInstance()
Throws a redirect when the user loads a page other than the one their SendouQ group status puts them on.
export async function sqRedirectIfNeeded({ ownGroup, currentLocation, }: { ownGroup?: SQOwnGroup; currentLocation: "default" | "preparing" | "looking" | "ready" | "match"; })
Actions/q