Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ Add Stalker UI and functionality #112

Merged
merged 64 commits into from
Nov 9, 2022

Conversation

nstringham
Copy link
Member

@nstringham nstringham commented Nov 7, 2022

This PR includes all the changes from #65 but also contains some improvements and some Material and CSS

note that this PR does not complete #34 because it does not complete this criteria

A hacker shouldn't be able to see if they are being stalked

image

Adds stalker bool to be used for checking.
Adds stalker component which contains buttons for each chatting pair. Also adds test data to be used for testing.
Adds stalker being sent to their proper component in games page.svelte
remove test data from temp page as 1 on 1 chat should be available soon.
adds tests for stalkchatroom for security
Adds getChatRoomCollection to be used in stalker.ts for setting the stalker as spectator.
adds path to stalker in index.ts
fixes stalker.svelte to be used for when 1 on 1 chat is merged
cleaning code from merge with giantte branch.
updates chatroom declaration in stalker.svelte and stalker call in game page.svelte
removes a redundant import in stalker.svelte
update and delete stalker bool on generating pair and deleting chat
subscribe/unsubscribe from chatroom
add firestore rule to update stalker boolean in private players
update firestore rules for isStalker()
add chatroomIds collection and attempt to use ids for the buttons (does not work)
add comment for StalkChatroomRequest type
change LobbyRequest input to StalkChatroomRequest input for stalkChatroom in firestore-functions
fix private player not includingthe stalker bool in a call
change the transaction update to look at the ref for chatrooms instead of lobby
load chatroom in stalker.svelte (does not work atm)
update stalker component to get rid of console log and work
fix chatroom in page.svelte call so it works with new parameters
njumaah
njumaah previously approved these changes Nov 8, 2022
@gchamb
Copy link
Member

gchamb commented Nov 8, 2022



Mobile for the icons and names mess up a bit

@gchamb gchamb self-requested a review November 9, 2022 00:01
Copy link
Member

@gchamb gchamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

@gchamb
Copy link
Member

gchamb commented Nov 9, 2022

/**
 * Checks if the user is in a chatroom then returns their chatroom doc
 */
export async function findChatRoom(lobbyId: string, playerId: string) {
  const queryChatRoom = await getDocs(query(getChatRoomCollection(lobbyId), where("pair", "array-contains", playerId)));
  return queryChatRoom.docs[0];
}

export async function findViewerChatRoom(lobbyId: string, viewerId: string) {
  const queryChatRoom = await getDocs(
    query(getChatRoomCollection(lobbyId), where("viewers", "array-contains", viewerId))
  );
  return queryChatRoom.docs[0];
}

in chat.ts delete this pls

Copy link
Member

@gchamb gchamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix build checks

this is just because girhub is bieng weird and I want to see what happens if I make a commit
gchamb
gchamb previously approved these changes Nov 9, 2022
@gchamb gchamb merged commit 7ddae14 into development Nov 9, 2022
@nstringham nstringham deleted the nstringham/material-stalker branch November 9, 2022 02:40
@nstringham nstringham linked an issue Nov 9, 2022 that may be closed by this pull request
4 tasks
@nstringham nstringham removed a link to an issue Nov 9, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Catniss to "stalk" other players (if a match isn't found) Material Components and CSS Style
3 participants