示例#1
0
        public Habbo GetHabbo(string sUsername)
        {
            // TODO: some sort of cache?

            Habbo habbo = new Habbo();
            if (habbo.LoadByUsername(IonEnvironment.GetDatabase(), sUsername))
            {
                return habbo;
            }

            return null;
        }
示例#2
0
        public Habbo GetHabbo(string sUsername)
        {
            // TODO: some sort of cache?

            Habbo habbo = new Habbo();

            if (habbo.LoadByUsername(IonEnvironment.GetDatabase(), sUsername))
            {
                return(habbo);
            }

            return(null);
        }
示例#3
0
        public Habbo Login(string sUsername, string sPassword)
        {
            // Do not use HabboManager.GetHabbo(string) here, as caching is planned to be implemented there
            Habbo habbo = new Habbo();
            if (habbo.LoadByUsername(IonEnvironment.GetDatabase(), sUsername) == false)
                throw new IncorrectLoginException("login incorrect: Wrong username");

            if (habbo.Password != sPassword)
                throw new IncorrectLoginException("login incorrect: Wrong password");

            // Drop old client (if logged in via other connection)
            IonEnvironment.GetHabboHotel().GetClients().KillClientOfHabbo(habbo.ID);

            return habbo;
        }
示例#4
0
        public Habbo Login(string sUsername, string sPassword)
        {
            // Do not use HabboManager.GetHabbo(string) here, as caching is planned to be implemented there
            Habbo habbo = new Habbo();

            if (habbo.LoadByUsername(IonEnvironment.GetDatabase(), sUsername) == false)
            {
                throw new IncorrectLoginException("login incorrect: Wrong username");
            }

            if (habbo.Password != sPassword)
            {
                throw new IncorrectLoginException("login incorrect: Wrong password");
            }

            // Drop old client (if logged in via other connection)
            IonEnvironment.GetHabboHotel().GetClients().KillClientOfHabbo(habbo.ID);

            return(habbo);
        }