public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            try
            {
                int count = Packet.PopInt();

                byte[] bytes   = Packet.ReadBytes(count);
                string outData = Deflate(bytes);

                string url = WebManager.HttpPostJson("http://habborpg.com.br/swfs/servercamera/servercamera.php?room", outData);

                Session.SendMessage(new ThumbnailSuccessMessageComposer());
            }
            catch
            {
                Session.SendNotification("Por favor, tente novamente, a área da foto tem muito pixel.");
            }
        }
示例#2
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            try
            {
                int    count   = Packet.PopInt();
                byte[] bytes   = Packet.ReadBytes(count);
                string outData = Deflate(bytes);

                string url = WebManager.HttpPostJson("http://habborpg.com.br/swfs/servercamera/servercamera.php?run", outData);
                JavaScriptSerializer serializer = new JavaScriptSerializer();

                dynamic jsonArray  = serializer.Deserialize(outData, typeof(object));;
                string  encodedurl = "http://habborpg.com.br/swfs/servercamera/" + url;
                encodedurl = encodedurl.Replace("\n", string.Empty);

                int  roomId    = jsonArray["roomid"];
                long timeStamp = jsonArray["timestamp"];

                using (IQueryAdapter commitableQueryReactor = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    commitableQueryReactor.SetQuery("INSERT INTO `cms_stories_photos_preview` (`user_id`,`user_name`,`room_id`,`image_preview_url`,`image_url`,`type`,`date`,`tags`) VALUES (@userid,@username,@roomid,@imagepreviewurl,@imageurl,@types,@dates,@tag)");
                    commitableQueryReactor.AddParameter("userid", Session.GetHabbo().Id);
                    commitableQueryReactor.AddParameter("username", Session.GetHabbo().Username);
                    commitableQueryReactor.AddParameter("roomid", roomId);
                    commitableQueryReactor.AddParameter("imagepreviewurl", encodedurl);
                    commitableQueryReactor.AddParameter("imageurl", encodedurl);
                    commitableQueryReactor.AddParameter("types", "PHOTO");
                    commitableQueryReactor.AddParameter("dates", timeStamp);
                    commitableQueryReactor.AddParameter("tag", "");
                    commitableQueryReactor.RunQuery();
                }

                Session.SendMessage(new CameraStorageUrlMessageComposer(url));
            }
            catch
            {
                Session.SendNotification("Esta imagem tem muito pixel, pegue a foto em uma área com menos tamanho!");
                return;
            }
        }
示例#3
0
文件: Others.cs 项目: xXSicilyXx/Yupi
        /// <summary>
        ///     Saves the room thumbnail.
        /// </summary>
        internal void SaveRoomThumbnail()
        {
            try
            {
                // Disabled until recreate that function

                int count = Request.GetInteger();

                byte[] bytes   = Request.GetBytes(count);
                string outData = Converter.Deflate(bytes);

                WebManager.HttpPostJson(ServerExtraSettings.StoriesApiThumbnailServerUrl, outData);

                ServerMessage thumb = new ServerMessage(LibraryParser.OutgoingRequest("ThumbnailSuccessMessageComposer"));
                thumb.AppendBool(true);
                thumb.AppendBool(false);
                Session.SendMessage(thumb);
            }
            catch
            {
                Session.SendNotif("Por favor tente novamente, a área da foto possui muitos itens.");
            }
        }