---
# System prepended metadata

title: UpdateValorantMatchMutation

---


PlaygroundLobby
- join_queue!(user)

LobbyLeaderboard:
- join_user(user)

LobbyBracket:
- room_join_user(user)
- queue_room_join_user(user)


ContextManager:
- current_room
- current_party
- current_match
- current_leaderboard

Organization [PL, LL, (LB, BracketNode), CP]
Queueing [Queue, QueueGroup]
Parties [EventParty, EventPartyMembership]
Scoring v1 [Match, MatchGroup]
Scoring v2 [MatchLobby, Series, SeriesMatch, SeriesResult, SeriesMatchResult, MatchDatum, PartyMatchDatum, PlayerMatchDatum, RawMatchDatum, AggregateMatchDatum]
Scoring Results [LobbyBracketResult]

IScoring.get_result(lobby)
IScoring.update_user_match_result(raw_data_from_user)

IMatching - by current ML, by Warden

RawData - Store everything with context clues
- match id (from game)
- current match lobby id
- active series match

# UpdateValorantMatchMutation
scorable_object = IRawData.store("valorant", raw_result, current_user, leaderboard, party_id)
IScoring.score!(scoreable_object)

ILobby.join(user, playground_lobby)
IScoring.get_score_user(user, playground_lobby)

Current: PL.current_lobby_leaderboard.lobby_leaderboard_player_results
New: 
- IScoring.get_leaderboard(lobby)
- IScoring.reset_leaderboard(lobby)

PL -> Room/Bracket/Queue


# Parties
- MatchLobbyParty keeps track of historical party, and goes into scoring
- EventParty keeps track of current party, and goes into organization
- SeriesResults and SeriesMatchResults should connect to MatchLobbyParty instead of EventParty
- LobbyBracketParty for LobbyBracketResult?


# Priorities
- use MatchLobbyParty for historical state (eric)
- move LB under LL (eric)
- PlaygroundLobby.join_user(user) / JoinPlaygroundLobbyMutation (anhang)
- Store more context to raw data (hynek)
- Moving CP to LobbyParticipant (eric / anhang


# Circular dependencies
(This is usually a sign of bad design)
- PlayerQueueGroup -> LobbyBracket, PlaygroundLobby
- LobbyLeaderboardSession depending on UserPlayground
- User -> Playground
- PlaygroundLobby <-> LobbyLeaderboard (PL should use LL, but not the other way around)
- LobbyLeaderboardEntry should not depend on anything, and only LL should use it
- LobbyLeaderboard -> Playground needs to stop
- PlaygroundLobby -> LobbyBracket needs to stop
- MatchLobby -> CP needs to stop