Beispiel #1
0
        public SubscriptionManager(uint userId, UserDataFactory userdata)
        {
            this.UserId = userId;

            this.Subscriptions = new Dictionary <string, Subscription>();

            DataTable dataTable_ = userdata.GetSubscriptions();

            if (dataTable_ != null)
            {
                foreach (DataRow dataRow in dataTable_.Rows)
                {
                    this.Subscriptions.Add((string)dataRow["subscription_id"], new Subscription((string)dataRow["subscription_id"], (int)dataRow["timestamp_activated"], (int)dataRow["timestamp_expire"]));
                }
            }
        }
Beispiel #2
0
        public SubscriptionManager(uint id, Habbo habbo, UserDataFactory factory)
        {
            this.Subscriptions = new Dictionary <string, List <Subscription> >();

            this.ID    = id;
            this.Habbo = habbo;

            foreach (DataRow dataRow in factory.GetSubscriptions()?.Rows)
            {
                string subscription = (string)dataRow["subscription_name"];

                Subscription sub = new Subscription((int)dataRow["id"], subscription, (double)dataRow["subscription_started"], (double)dataRow["subscription_expires"]);
                if (!this.Subscriptions.ContainsKey(subscription))
                {
                    this.Subscriptions.Add(subscription, new List <Subscription> {
                        sub
                    });
                }
                else
                {
                    this.Subscriptions[subscription].Add(sub);
                }
            }
        }