File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed
Online/Multiplayer/MatchTypes/Matchmaking
Screens/OnlinePlay/Matchmaking/Match Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public class MatchmakingUser
2323 /// The aggregate room placement (1-based).
2424 /// </summary>
2525 [ Key ( 1 ) ]
26- public int Placement { get ; set ; }
26+ public int ? Placement { get ; set ; }
2727
2828 /// <summary>
2929 /// The aggregate points.
Original file line number Diff line number Diff line change @@ -414,8 +414,11 @@ private void onRoomStateChanged(MatchRoomState? state) => Scheduler.Add(() =>
414414 if ( ! matchmakingState . Users . UserDictionary . TryGetValue ( User . Id , out MatchmakingUser ? userScore ) )
415415 return ;
416416
417- rankText . Text = userScore . Placement . Ordinalize ( CultureInfo . CurrentCulture ) ;
418- rankText . FadeColour ( SubScreenResults . ColourForPlacement ( userScore . Placement ) ) ;
417+ if ( userScore . Placement == null )
418+ return ;
419+
420+ rankText . Text = userScore . Placement . Value . Ordinalize ( CultureInfo . CurrentCulture ) ;
421+ rankText . FadeColour ( SubScreenResults . ColourForPlacement ( userScore . Placement . Value ) ) ;
419422 scoreText . Text = $ "{ userScore . Points } pts";
420423 } ) ;
421424
Original file line number Diff line number Diff line change @@ -239,8 +239,8 @@ public void AcquirePanels(PlayerPanel[] panels)
239239 if ( client . Room ? . MatchState is not MatchmakingRoomState matchmakingState )
240240 continue ;
241241
242- if ( matchmakingState . Users . UserDictionary . TryGetValue ( panels [ i ] . User . Id , out MatchmakingUser ? user ) )
243- SetLayoutPosition ( Children [ i ] , user . Placement ) ;
242+ if ( matchmakingState . Users . UserDictionary . TryGetValue ( panels [ i ] . User . Id , out MatchmakingUser ? user ) && user . Placement != null )
243+ SetLayoutPosition ( Children [ i ] , user . Placement . Value ) ;
244244 else
245245 SetLayoutPosition ( Children [ i ] , float . MaxValue ) ;
246246 }
Original file line number Diff line number Diff line change @@ -201,13 +201,16 @@ private void populateUserStatistics(MatchmakingRoomState state)
201201 return ;
202202 }
203203
204- int overallPlacement = state . Users [ client . LocalUser ! . UserID ] . Placement ;
204+ int ? overallPlacement = state . Users [ client . LocalUser ! . UserID ] . Placement ;
205205
206- placementText . Text = overallPlacement . Ordinalize ( CultureInfo . CurrentCulture ) ;
207- placementText . Colour = ColourForPlacement ( overallPlacement ) ;
206+ if ( overallPlacement != null )
207+ {
208+ placementText . Text = overallPlacement . Value . Ordinalize ( CultureInfo . CurrentCulture ) ;
209+ placementText . Colour = ColourForPlacement ( overallPlacement . Value ) ;
208210
209- int overallPoints = state . Users [ client . LocalUser ! . UserID ] . Points ;
210- addStatistic ( overallPlacement , $ "Overall position ({ overallPoints } points)") ;
211+ int overallPoints = state . Users [ client . LocalUser ! . UserID ] . Points ;
212+ addStatistic ( overallPlacement . Value , $ "Overall position ({ overallPoints } points)") ;
213+ }
211214
212215 var accuracyOrderedUsers = state . Users . Select ( u => ( user : u , avgAcc : u . Rounds . Select ( r => r . Accuracy ) . DefaultIfEmpty ( 0 ) . Average ( ) ) )
213216 . OrderByDescending ( t => t . avgAcc )
You can’t perform that action at this time.
0 commit comments