powerfun-new-net/Model/HostModel.cs

59 lines
1.4 KiB
C#
Raw Permalink Normal View History

2020-10-13 08:54:24 +08:00
using Prism.Mvvm;
using System;
2020-09-17 10:23:26 +08:00
using System.Collections.Generic;
using System.Net;
using System.Text;
namespace OnlineUserPool.Model
{
2020-10-13 08:54:24 +08:00
public class HostModel : BindableBase
2020-09-17 10:23:26 +08:00
{
public IPEndPoint IPEndPoint { get; set; }
2020-10-13 08:54:24 +08:00
private DateTime _LastActiveTime;
public DateTime LastActiveTime {
get {
return _LastActiveTime;
}
set {
SetProperty(ref _LastActiveTime, value);
}
}
2020-09-17 10:23:26 +08:00
/// <summary>
/// 地图编号
/// </summary>
public int RouteId { get; set; }
/// <summary>
/// 用户Id
/// </summary>
public int MemberId { get; set; }
/// <summary>
/// 客户端过期
/// </summary>
public bool Expire
{
get
{
2020-10-27 10:20:47 +08:00
return DateTime.Now.Subtract(LastActiveTime).TotalSeconds > 60;
2020-09-17 10:23:26 +08:00
}
}
public bool Equals(IPEndPoint obj)
{
//return base.Equals(obj);
return obj.Address.ToString() == IPEndPoint.Address.ToString() && obj.Port == IPEndPoint.Port;
}
/// <summary>
/// 需要展示的路书Id
/// </summary>
public List<int> ShowRouteId { get; set; }
/// <summary>
/// 是否展示在线的人
/// </summary>
public bool ShowVirtual { get; set; }
}
}