示例#1
0
 private static void ProcessHabboInfoRequest(Habbo sender, IncomingMessage message)
 {
     new MHabboData
     {
         Figure   = sender.GetFigure() as HabboFigure,
         Motto    = sender.GetMotto(),
         HabboID  = sender.GetID(),
         Username = sender.GetUsername()
     }.Send(sender);
 }
示例#2
0
 /// <summary>
 /// Checks if a given user is friends with this user.
 /// </summary>
 /// <param name="RequireLoggedIn">If true then the user must also be online.</param>
 /// <returns>True if the user is on the friends list (and online if required), false otherwise.</returns>
 public bool IsFriendsWith(Habbo User, bool RequireLoggedIn)
 {
     if (!this.fFriends.ContainsKey(User.GetID()))
     {
         return(false);
     }
     if (RequireLoggedIn)
     {
         return(User.IsLoggedIn());
     }
     return(true);
 }
        public SubscriptionData SaveChanges()
        {
            using (ISession db = CoreManager.ServerCore.GetDatabaseSession())
            {
                Subscription s = db.Get <Subscription>(_habbo.GetID());
                s.paused_start   = _subscriptionDatabase.paused_start;
                s.skipped_length = _subscriptionDatabase.skipped_length;
                s.total_bought   = _subscriptionDatabase.total_bought;

                db.SaveOrUpdate(s);
            }
            return(this);
        }
        public SubscriptionData(Habbo habbo, string type)
        {
            _habbo = habbo;

            using (ISession db = CoreManager.ServerCore.GetDatabaseSession())
            {
                _subscriptionDatabase = db.CreateCriteria <Subscription>().
                                        Add(Restrictions.Eq("habbo_id", _habbo.GetID())).
                                        Add(Restrictions.Eq("subscription_type", type)).
                                        UniqueResult <Subscription>();
            }
            if (_subscriptionDatabase != null)
            {
                return;
            }
            _subscriptionDatabase = new Subscription {
                habbo_id = habbo.GetID()
            };
        }