Exemple #1
0
        public static void AddNewPicture(GameClient Session)
        {
            var Pic = HabboCameraPictureData.Generate(Session);

            Session.SendMessage(new CameraSendImageUrlComposer("?mode=get&name=" + Pic.Id));
            UsersPic.Add(Session, Pic);
        }
        public static HabboCameraPictureData Generate(int id)
        {
            DataTable table;

            using (var adap = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                adap.RunQuery("SELECT * FROM server_pictures WHERE id = '" + id + "'");
                table = adap.getTable();
            }

            if (table.Rows.Count == 0)
            {
                return(null);
            }

            var row = table.Rows[0];

            var pid    = int.Parse(row["id"].ToString());
            var userid = int.Parse(row["user_id"].ToString());
            var time   = long.Parse(row["timestamp"].ToString());
            var url    = row["url"].ToString();

            var pic = new HabboCameraPictureData(pid, userid, time, url);

            HabboCameraManager.CachedPictures.Add(pic);
            return(pic);
        }
Exemple #3
0
        public static HabboCameraPictureData GetPicture(int id)
        {
            if (!CachedPictures.Any(c => c.Id == id))
            {
                return(HabboCameraPictureData.Generate(id));
            }

            return(CachedPictures.Where(c => c.Id == id).FirstOrDefault());
        }