Class PlayerDetailsViewModel
- Namespace
- McServerLauncher.ViewModels
- Assembly
- McServerLauncher.dll
A player's profile: everything the app and the server know about them.
public sealed class PlayerDetailsViewModel : ObservableObject, INotifyPropertyChanged, INotifyPropertyChanging
- Inheritance
-
PlayerDetailsViewModel
- Implements
- Inherited Members
Remarks
Put together when it is opened and not kept up to date on its own; the list above it calls Reload() when something about this player happens while it is on screen.
Constructors
PlayerDetailsViewModel(string, PlayerHistoryStore, string, Func<bool>, bool, bool, bool, string?, ICommand, ICommand, ICommand, Action<string>, Action)
public PlayerDetailsViewModel(string name, PlayerHistoryStore store, string serverFolder, Func<bool> isOnline, bool isOp, bool isWhitelisted, bool isBanned, string? uuidFromCache, ICommand op, ICommand kick, ICommand ban, Action<string> onCleared, Action close)
Parameters
namestringstorePlayerHistoryStoreserverFolderstringisOnlineFunc<bool>isOpboolisWhitelistedboolisBannedbooluuidFromCachestringopICommandkickICommandbanICommandonClearedAction<string>closeAction
Properties
Avatar
[ExcludeFromCodeCoverage]
public Bitmap? Avatar { get; set; }
Property Value
- Bitmap
BackCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.Back().
[ExcludeFromCodeCoverage]
public IRelayCommand BackCommand { get; }
Property Value
BanCommand
public ICommand BanCommand { get; }
Property Value
CancelClearCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.CancelClear().
[ExcludeFromCodeCoverage]
public IRelayCommand CancelClearCommand { get; }
Property Value
ClearHistoryCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ClearHistory().
[ExcludeFromCodeCoverage]
public IRelayCommand ClearHistoryCommand { get; }
Property Value
ConfirmingClear
[ExcludeFromCodeCoverage]
public bool ConfirmingClear { get; set; }
Property Value
Events
public ObservableCollection<PlayerEventRowViewModel> Events { get; }
Property Value
Filter
[ExcludeFromCodeCoverage]
public PlayerEventFilter Filter { get; set; }
Property Value
FirstSeenText
[ExcludeFromCodeCoverage]
public string FirstSeenText { get; set; }
Property Value
HasBlocks
[ExcludeFromCodeCoverage]
public bool HasBlocks { get; set; }
Property Value
HasCuriosities
[ExcludeFromCodeCoverage]
public bool HasCuriosities { get; set; }
Property Value
HasMore
[ExcludeFromCodeCoverage]
public bool HasMore { get; set; }
Property Value
HasMoreBars
[ExcludeFromCodeCoverage]
public bool HasMoreBars { get; set; }
Property Value
HasStats
[ExcludeFromCodeCoverage]
public bool HasStats { get; set; }
Property Value
IsBanned
public bool IsBanned { get; }
Property Value
IsEmpty
[ExcludeFromCodeCoverage]
public bool IsEmpty { get; set; }
Property Value
IsFilterAll
public bool IsFilterAll { get; }
Property Value
IsFilterChat
public bool IsFilterChat { get; }
Property Value
IsFilterConnections
public bool IsFilterConnections { get; }
Property Value
IsOnline
[ExcludeFromCodeCoverage]
public bool IsOnline { get; set; }
Property Value
IsOp
public bool IsOp { get; }
Property Value
IsWhitelisted
public bool IsWhitelisted { get; }
Property Value
KickCommand
public ICommand KickCommand { get; }
Property Value
LastSeenText
[ExcludeFromCodeCoverage]
public string LastSeenText { get; set; }
Property Value
MessagesText
[ExcludeFromCodeCoverage]
public string MessagesText { get; set; }
Property Value
MinedBlocks
Blocks broken, by block. The server counts these exactly.
public ObservableCollection<StatBarViewModel> MinedBlocks { get; }
Property Value
MinedTotalText
[ExcludeFromCodeCoverage]
public string MinedTotalText { get; set; }
Property Value
Name
public string Name { get; }
Property Value
OpCommand
public ICommand OpCommand { get; }
Property Value
PlayedText
[ExcludeFromCodeCoverage]
public string PlayedText { get; set; }
Property Value
SessionsText
[ExcludeFromCodeCoverage]
public string SessionsText { get; set; }
Property Value
ShowAllBlocksCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowAllBlocks().
[ExcludeFromCodeCoverage]
public IRelayCommand ShowAllBlocksCommand { get; }
Property Value
ShowAllCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowAll().
[ExcludeFromCodeCoverage]
public IRelayCommand ShowAllCommand { get; }
Property Value
ShowChatCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowChat().
[ExcludeFromCodeCoverage]
public IRelayCommand ShowChatCommand { get; }
Property Value
ShowConnectionsCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowConnections().
[ExcludeFromCodeCoverage]
public IRelayCommand ShowConnectionsCommand { get; }
Property Value
ShowMoreCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowMore().
[ExcludeFromCodeCoverage]
public IRelayCommand ShowMoreCommand { get; }
Property Value
StatsBlocksPerHour
[ExcludeFromCodeCoverage]
public string StatsBlocksPerHour { get; set; }
Property Value
StatsDamageDealt
[ExcludeFromCodeCoverage]
public string StatsDamageDealt { get; set; }
Property Value
StatsDamageTaken
[ExcludeFromCodeCoverage]
public string StatsDamageTaken { get; set; }
Property Value
StatsDeaths
[ExcludeFromCodeCoverage]
public string StatsDeaths { get; set; }
Property Value
StatsDistance
[ExcludeFromCodeCoverage]
public string StatsDistance { get; set; }
Property Value
StatsElytra
[ExcludeFromCodeCoverage]
public string StatsElytra { get; set; }
Property Value
StatsFlown
[ExcludeFromCodeCoverage]
public string StatsFlown { get; set; }
Property Value
StatsJumps
[ExcludeFromCodeCoverage]
public string StatsJumps { get; set; }
Property Value
StatsMobKills
[ExcludeFromCodeCoverage]
public string StatsMobKills { get; set; }
Property Value
StatsOresPerHour
[ExcludeFromCodeCoverage]
public string StatsOresPerHour { get; set; }
Property Value
StatsPlayTime
[ExcludeFromCodeCoverage]
public string StatsPlayTime { get; set; }
Property Value
StatsPlayerKills
[ExcludeFromCodeCoverage]
public string StatsPlayerKills { get; set; }
Property Value
StatsTopKill
[ExcludeFromCodeCoverage]
public string StatsTopKill { get; set; }
Property Value
StatsTopKiller
[ExcludeFromCodeCoverage]
public string StatsTopKiller { get; set; }
Property Value
StatsWalked
[ExcludeFromCodeCoverage]
public string StatsWalked { get; set; }
Property Value
UsedItems
Items used, by item — which for a block means placed. See Used.
public ObservableCollection<StatBarViewModel> UsedItems { get; }
Property Value
UsedTotalText
[ExcludeFromCodeCoverage]
public string UsedTotalText { get; set; }
Property Value
Uuid
[ExcludeFromCodeCoverage]
public string? Uuid { get; set; }
Property Value
Methods
LoadStatsAsync()
Reads the server's own statistics for this player, off the UI thread.
public Task LoadStatsAsync()
Returns
Remarks
This used to happen inside Reload(), on the UI thread — and Reload runs
again on every console line about this player. That was tolerable when it read five numbers;
it is not now that it walks every block the player has ever broken. So it moved here, beside
the avatar, and a line arriving while a read is already in flight is dropped rather than
queued: the read that is running will see the newer file anyway.
Nothing is cleared while it loads. A profile that blanked its numbers for a moment on every chat message would be worse than one that is a second out of date.
Reload()
Reads everything again: the summary, the server's statistics, and the events.
public void Reload()