using System;
using System.Collections.Generic;
using System.Net;
using System.Text;

namespace OnlineUserPool.Model
{
    public class HostModel
    {
        public IPEndPoint IPEndPoint { get; set; }

        public DateTime LastActiveTime { get; set; }
        /// <summary>
        /// 地图编号
        /// </summary>
        public int RouteId { get; set; }
        /// <summary>
        /// 用户Id
        /// </summary>
        public int MemberId { get; set; }

        /// <summary>
        /// 客户端过期
        /// </summary>
        public bool Expire
        {
            get
            {
                return DateTime.Now.Subtract(LastActiveTime).TotalSeconds > 6000;
            }
        }

        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; }
    }
}
