示例#1
0
 internal Player(string name, string password, Guid id, Dictionary <Entity, uint> factionAccessRoles)
 {
     ID   = id;
     Name = string.IsNullOrEmpty(name) ? "Unnamed Player" : name;
     FactionAccessRoles = factionAccessRoles;
     Salt         = GenerateSalt();
     PasswordHash = GeneratePasswordHash(password, Salt);
     Orders       = new OrderQueue();
 }
示例#2
0
        public Player(SerializationInfo info, StreamingContext context)
        {
            ID   = (Guid)info.GetValue(nameof(ID), typeof(Guid));
            Name = info.GetString(nameof(Name));

            if (context.State != StreamingContextStates.Persistence)
            {
                return;
            }

            PasswordHash       = info.GetString(nameof(PasswordHash));
            Salt               = info.GetString(nameof(Salt));
            FactionAccessRoles = (Dictionary <Entity, uint>)info.GetValue(nameof(FactionAccessRoles), typeof(Dictionary <Entity, uint>));
            Orders             = new OrderQueue();
            HaltsOnEvent       = (Dictionary <EventType, bool>)info.GetValue(nameof(HaltsOnEvent), typeof(Dictionary <EventType, bool>));
        }
示例#3
0
 public OrderQueue(OrderQueue oq)
 {
     _orderList     = oq._orderList.Select(item => (Entity)item.Clone()).ToList();
     _entityManager = oq._entityManager;
 }
示例#4
0
 public OrderQueue(OrderQueue oq)
 {
     _orderList = _orderList.Select(item => (BaseOrder)item.Clone()).ToList();
     //_entityManager = oq._entityManager;
 }