using OnlineUserPool.Services;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
namespace OnlineUserPool.Model
{
public class HostModel : BindableBase
{
public IPEndPoint IPEndPoint { get; set; }
private DateTime _LastActiveTime;
public DateTime LastActiveTime {
get {
return _LastActiveTime;
}
set {
SetProperty(ref _LastActiveTime, value);
}
}
private int _RouteId = 0;
///
/// 地图编号
///
public int RouteId {
get {
return _RouteId;
}
set {
SetProperty(ref _RouteId, value);
}
}
private int _MemberId;
///
/// 用户Id
///
public int MemberId {
get {
return _MemberId;
}
set {
SetProperty(ref _MemberId, value);
}
}
///
/// 客户端过期
///
public bool Expire
{
get
{
return DateTime.Now.Subtract(LastActiveTime).TotalSeconds > 20;
}
}
public bool Equals(IPEndPoint obj)
{
//return base.Equals(obj);
return obj.Address.ToString() == IPEndPoint.Address.ToString() && obj.Port == IPEndPoint.Port;
}
///
/// 需要展示的路书Id
///
public List ShowRouteId { get; set; }
private int _Competitionid = 0;
public int Competitionid {
get {
return _Competitionid;
} set {
SetProperty(ref _Competitionid, value);
}
}
/////
///// 是否展示在线的人
/////
//public bool ShowVirtual { get; set; }
public string Encoding { get; set; }
public string Client { get; set; }
private int _V = 0;
///
/// 客户端支持的消息格式的版本号
///
public int V {
get
{
return _V;
}
set
{
SetProperty(ref _V, value);
}
}
[Newtonsoft.Json.JsonIgnore]
public IService Service { get; set; }
public String ServiceName
{
get
{
return Service.ToString();
}
}
private bool _IsWatch;
public bool IsWatch
{
get { return _IsWatch; }
set
{
SetProperty(ref _IsWatch, value);
}
}
private string _Request;
public string Request
{
get { return _Request; }
set
{
SetProperty(ref _Request, value);
}
}
private string _Model;
public string Model
{
get { return _Model; }
set
{
SetProperty(ref _Model, value);
}
}
private int _RoomId;
public int RoomId
{
get { return _RoomId; }
set
{
SetProperty(ref _RoomId, value);
}
}
}
}