Client, launcher, and too much stuff to document.

This commit is contained in:
John Michael Gross
2016-09-24 13:08:36 -07:00
parent e153870182
commit 7488384fb8
59 changed files with 1908 additions and 219 deletions

View File

@@ -12,6 +12,7 @@ using System.Windows;
using System.Windows.Data;
using System.Windows.Threading;
using Piston;
using Piston.Server.ViewModels;
using Sandbox.Engine.Multiplayer;
using Sandbox.Game.Multiplayer;
using Sandbox.Game.World;
@@ -101,87 +102,4 @@ namespace Piston.Server
PlayerLeft?.Invoke(player);
}
}
/// <summary>
/// Stores player information in an observable format.
/// </summary>
public class PlayerInfo : ObservableType
{
private ulong _steamId;
private string _name;
private ConnectionState _state;
public ulong SteamId
{
get { return _steamId; }
set { _steamId = value; OnPropertyChanged(); }
}
public string Name
{
get { return _name; }
set { _name = value; OnPropertyChanged(); }
}
public ConnectionState State
{
get { return _state; }
set { _state = value; OnPropertyChanged(); }
}
public PlayerInfo(ulong steamId)
{
_steamId = steamId;
_name = MyMultiplayer.Static.GetMemberName(steamId);
_state = ConnectionState.Unknown;
}
}
public class ChatItemInfo : ObservableType
{
private PlayerInfo _sender;
private string _message;
private DateTime _timestamp;
public PlayerInfo Sender
{
get { return _sender; }
set { _sender = value; OnPropertyChanged(); }
}
public string Message
{
get { return _message; }
set { _message = value; OnPropertyChanged(); }
}
public DateTime Timestamp
{
get { return _timestamp; }
set { _timestamp = value; OnPropertyChanged(); }
}
public string Time => Timestamp.ToShortTimeString();
public ChatItemInfo(PlayerInfo sender, string message)
{
_sender = sender;
_message = message;
_timestamp = DateTime.Now;
}
}
/// <summary>
/// Identifies a player's current connection state.
/// </summary>
[Flags]
public enum ConnectionState
{
Unknown,
Connected = 1,
Left = 2,
Disconnected = 4,
Kicked = 8,
Banned = 16,
}
}