public override bool LogIn(UserBase user, string account, byte[] password)
{
try
{
if (!Cache.Accounts.ContainsKey(account))
{
return false;
}
UserSurrogate cache = Cache.Accounts[account];
if (password.Length != cache.Password.Length)
{
return false;
}
for (int i = 0; i < password.Length; i++)
{
if (password[i] != cache.Password[i])
{
return false;
}
}
cache.LastSeen = DateTime.Now;
user.Load(cache);
user.Mask.Account = account;
if (UsersByAccount.ContainsKey(account))
{
UsersByAccount[account].Add(user);
}
else
{
UsersByAccount.Add(account, new List<UserBase>(new UserBase[] { user }));
}
user.SetModes(null, "+r" + (user.Level < Authorizations.NetworkOperator ? "" : "o"), string.Empty);
return true;
}
catch
{
return false;
}
}