Ejemplo n.º 1
0
        private bool ValidateUser(SvManager svManager, ConnectionData connectionData)
        {
            if (!svManager.HandleWhitelist(connectionData.username))
            {
                svManager.RegisterFail(connectionData.connection, "Account not whitelisted");
                return(false);
            }

            // Don't allow multi-boxing, WebAPI doesn't prevent this
            if (EntityCollections.Accounts.ContainsKey(connectionData.username))
            {
                svManager.RegisterFail(connectionData.connection, "Account still logged in");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        private bool ValidateUser(SvManager svManager, AuthData authData)
        {
            if (!svManager.HandleWhitelist(authData.accountID))
            {
                svManager.RegisterFail(authData.connection, "Account not whitelisted");
                return(false);
            }

            // Don't allow multi-boxing, WebAPI doesn't prevent this
            foreach (ShPlayer p in EntityCollections.Humans)
            {
                if (p.accountID == authData.accountID)
                {
                    svManager.RegisterFail(authData.connection, "Account still logged in");
                    return(false);
                }
            }

            return(true);
        }