Table of Contents

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

name string
store PlayerHistoryStore
serverFolder string
isOnline Func<bool>
isOp bool
isWhitelisted bool
isBanned bool
uuidFromCache string
op ICommand
kick ICommand
ban ICommand
onCleared Action<string>
close Action

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

IRelayCommand

BanCommand

public ICommand BanCommand { get; }

Property Value

ICommand

CancelClearCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.CancelClear().

[ExcludeFromCodeCoverage]
public IRelayCommand CancelClearCommand { get; }

Property Value

IRelayCommand

ClearHistoryCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ClearHistory().

[ExcludeFromCodeCoverage]
public IRelayCommand ClearHistoryCommand { get; }

Property Value

IRelayCommand

ConfirmingClear

[ExcludeFromCodeCoverage]
public bool ConfirmingClear { get; set; }

Property Value

bool

Events

public ObservableCollection<PlayerEventRowViewModel> Events { get; }

Property Value

ObservableCollection<PlayerEventRowViewModel>

Filter

[ExcludeFromCodeCoverage]
public PlayerEventFilter Filter { get; set; }

Property Value

PlayerEventFilter

FirstSeenText

[ExcludeFromCodeCoverage]
public string FirstSeenText { get; set; }

Property Value

string

HasBlocks

[ExcludeFromCodeCoverage]
public bool HasBlocks { get; set; }

Property Value

bool

HasCuriosities

[ExcludeFromCodeCoverage]
public bool HasCuriosities { get; set; }

Property Value

bool

HasMore

[ExcludeFromCodeCoverage]
public bool HasMore { get; set; }

Property Value

bool

HasMoreBars

[ExcludeFromCodeCoverage]
public bool HasMoreBars { get; set; }

Property Value

bool

HasStats

[ExcludeFromCodeCoverage]
public bool HasStats { get; set; }

Property Value

bool

IsBanned

public bool IsBanned { get; }

Property Value

bool

IsEmpty

[ExcludeFromCodeCoverage]
public bool IsEmpty { get; set; }

Property Value

bool

IsFilterAll

public bool IsFilterAll { get; }

Property Value

bool

IsFilterChat

public bool IsFilterChat { get; }

Property Value

bool

IsFilterConnections

public bool IsFilterConnections { get; }

Property Value

bool

IsOnline

[ExcludeFromCodeCoverage]
public bool IsOnline { get; set; }

Property Value

bool

IsOp

public bool IsOp { get; }

Property Value

bool

IsWhitelisted

public bool IsWhitelisted { get; }

Property Value

bool

KickCommand

public ICommand KickCommand { get; }

Property Value

ICommand

LastSeenText

[ExcludeFromCodeCoverage]
public string LastSeenText { get; set; }

Property Value

string

MessagesText

[ExcludeFromCodeCoverage]
public string MessagesText { get; set; }

Property Value

string

MinedBlocks

Blocks broken, by block. The server counts these exactly.

public ObservableCollection<StatBarViewModel> MinedBlocks { get; }

Property Value

ObservableCollection<StatBarViewModel>

MinedTotalText

[ExcludeFromCodeCoverage]
public string MinedTotalText { get; set; }

Property Value

string

Name

public string Name { get; }

Property Value

string

OpCommand

public ICommand OpCommand { get; }

Property Value

ICommand

PlayedText

[ExcludeFromCodeCoverage]
public string PlayedText { get; set; }

Property Value

string

SessionsText

[ExcludeFromCodeCoverage]
public string SessionsText { get; set; }

Property Value

string

ShowAllBlocksCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowAllBlocks().

[ExcludeFromCodeCoverage]
public IRelayCommand ShowAllBlocksCommand { get; }

Property Value

IRelayCommand

ShowAllCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowAll().

[ExcludeFromCodeCoverage]
public IRelayCommand ShowAllCommand { get; }

Property Value

IRelayCommand

ShowChatCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowChat().

[ExcludeFromCodeCoverage]
public IRelayCommand ShowChatCommand { get; }

Property Value

IRelayCommand

ShowConnectionsCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowConnections().

[ExcludeFromCodeCoverage]
public IRelayCommand ShowConnectionsCommand { get; }

Property Value

IRelayCommand

ShowMoreCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.PlayerDetailsViewModel.ShowMore().

[ExcludeFromCodeCoverage]
public IRelayCommand ShowMoreCommand { get; }

Property Value

IRelayCommand

StatsBlocksPerHour

[ExcludeFromCodeCoverage]
public string StatsBlocksPerHour { get; set; }

Property Value

string

StatsDamageDealt

[ExcludeFromCodeCoverage]
public string StatsDamageDealt { get; set; }

Property Value

string

StatsDamageTaken

[ExcludeFromCodeCoverage]
public string StatsDamageTaken { get; set; }

Property Value

string

StatsDeaths

[ExcludeFromCodeCoverage]
public string StatsDeaths { get; set; }

Property Value

string

StatsDistance

[ExcludeFromCodeCoverage]
public string StatsDistance { get; set; }

Property Value

string

StatsElytra

[ExcludeFromCodeCoverage]
public string StatsElytra { get; set; }

Property Value

string

StatsFlown

[ExcludeFromCodeCoverage]
public string StatsFlown { get; set; }

Property Value

string

StatsJumps

[ExcludeFromCodeCoverage]
public string StatsJumps { get; set; }

Property Value

string

StatsMobKills

[ExcludeFromCodeCoverage]
public string StatsMobKills { get; set; }

Property Value

string

StatsOresPerHour

[ExcludeFromCodeCoverage]
public string StatsOresPerHour { get; set; }

Property Value

string

StatsPlayTime

[ExcludeFromCodeCoverage]
public string StatsPlayTime { get; set; }

Property Value

string

StatsPlayerKills

[ExcludeFromCodeCoverage]
public string StatsPlayerKills { get; set; }

Property Value

string

StatsTopKill

[ExcludeFromCodeCoverage]
public string StatsTopKill { get; set; }

Property Value

string

StatsTopKiller

[ExcludeFromCodeCoverage]
public string StatsTopKiller { get; set; }

Property Value

string

StatsWalked

[ExcludeFromCodeCoverage]
public string StatsWalked { get; set; }

Property Value

string

UsedItems

Items used, by item — which for a block means placed. See Used.

public ObservableCollection<StatBarViewModel> UsedItems { get; }

Property Value

ObservableCollection<StatBarViewModel>

UsedTotalText

[ExcludeFromCodeCoverage]
public string UsedTotalText { get; set; }

Property Value

string

Uuid

[ExcludeFromCodeCoverage]
public string? Uuid { get; set; }

Property Value

string

Methods

LoadStatsAsync()

Reads the server's own statistics for this player, off the UI thread.

public Task LoadStatsAsync()

Returns

Task

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()