Rename to Torch, add command system
This commit is contained in:
38
Torch.Server/ViewModels/ChatItemInfo.cs
Normal file
38
Torch.Server/ViewModels/ChatItemInfo.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Torch.Server.ViewModels
|
||||
{
|
||||
public class ChatItemInfo : ViewModel
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
37
Torch.Server/ViewModels/ConfigDedicatedViewModel.cs
Normal file
37
Torch.Server/ViewModels/ConfigDedicatedViewModel.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Sandbox.Engine.Utils;
|
||||
using VRage.Game;
|
||||
using VRage.Game.ModAPI;
|
||||
|
||||
namespace Torch.Server.ViewModels
|
||||
{
|
||||
public class ConfigDedicatedViewModel : ViewModel
|
||||
{
|
||||
public IMyConfigDedicated Config { get; }
|
||||
|
||||
public MTObservableCollection<string> Administrators { get; } = new MTObservableCollection<string>();
|
||||
public MTObservableCollection<ulong> BannedPlayers { get; } = new MTObservableCollection<ulong>();
|
||||
|
||||
public int AsteroidAmount
|
||||
{
|
||||
get { return Config.AsteroidAmount; }
|
||||
set { Config.AsteroidAmount = value; OnPropertyChanged(); }
|
||||
}
|
||||
|
||||
public ConfigDedicatedViewModel(IMyConfigDedicated config)
|
||||
{
|
||||
Config = config;
|
||||
Config.Administrators.ForEach(x => Administrators.Add(x));
|
||||
Config.Banned.ForEach(x => BannedPlayers.Add(x));
|
||||
}
|
||||
|
||||
public void FlushConfig()
|
||||
{
|
||||
Config.Administrators = Administrators.ToList();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user