Comunidad PHPeros

Lenguajes => General => Mensaje iniciado por: HunterCash97 en 27 de Abril de 2012, 01:32:42 am

Título: Encontré este Código en un juego del Facebook
Publicado por: HunterCash97 en 27 de Abril de 2012, 01:32:42 am
Hola , Bueno hoy a esta misma hora (Bueno unos minutos antes) , quise ver que tal era "Plant. Vs Zombies" del Facebook , me salío este code !!

El code está totalmente incompleto , esque es tan largo que exede los 20000 caracteres xDDD ! solo diganme si me servirá , porque como sabrán estoy en un proyecto de un juego multijugador :D

 /*1335476002,169776066*/

if (window.CavalryLogger) { CavalryLogger.start_js(["ggCxK"]); }

function AppUseTracker(){if(!AppUseTracker.instance)AppUseTracker.instance=this;return AppUseTracker.instance;}copy_properties(AppUseTracker.prototype,{instance:null,endpoint:'/ajax/apps/usage_update.php',INITIAL_PING:0,ONGOING_PING:1,DISCOVERY_PING:2,ENDING_PING:3,_application_id:0,_is_game:0,_do_log_on_session_end:0,_createRequest:function(a){return new AsyncRequest().setURI(this.endpoint).setMethod('POST').setData({app:this._application_id,is_game:this._is_game,type:a,condition:this._signal_on_page_transition});},init:function(a,b,c,d,e,f){if(window!=window.top)return;this.cleanup();PageTransitions.registerHandler(this.catchPageTransition.bind(this));this._application_id=a;this._is_game=b;this._do_log_on_session_end=f;this._timers.push(setTimeout(function(){this._createRequest(this.INITIAL_PING).send();var g=this._createRequest(this.ONGOING_PING);this._timers.push(setInterval(g.send.bind(g),d));}.bind(this),c));if(e)this._timers.push(setTimeout(function(){this._createRequest(this.DISCOVERY_PING).send();}.bind(this),e));if(this._do_log_on_session_end)onbeforeunloadRegister(this.onBeforeUnload.bind(this));},catchPageTransition:function(a){if(this._do_log_on_session_end)this._createRequest(this.ENDING_PING).send();this.cleanup();},onBeforeUnload:function(){if(this._do_log_on_session_end)this._createRequest(this.ENDING_PING).setOption('asynchronous',false).send();this.cleanup();},cleanup:function(){if(this._timers)for(i=0;i<this._timers.length;i++)clearInterval(this._timers);this._timers=[];this._do_log_on_session_end=0;}});
__d("legacy:image-has-loaded",["ImageUtils"],function(a,b,c,d){a.image_has_loaded=b('ImageUtils').hasLoaded;},3);
function adjustImage(a,b){if(!b){var c=a.parentNode;while(c.parentNode&&(CSS.getStyle(c,'display')!='block'||c.offsetWidth==0))c=c.parentNode;b=c.offsetWidth;}var d=a.offsetWidth;if(d==0){var e=a.nextSibling,f=a.parentNode;DOM.appendContent(DOM.getDocumentBodyElement(),a);d=a.offsetWidth;if(e){f.insertBefore(a,e);}else f.appendChild(a);}if(d>b)try{if(ua.ie()<8){var h=document.createElement('div');h.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a.src.replace('"','%22')+'", sizingMethod="scale")';h.style.width=b+'px';h.style.height=Math.floor(((b/a.offsetWidth)*a.offsetHeight))+'px';if(a.parentNode.tagName=='A')h.style.cursor='pointer';a.parentNode.insertBefore(h,a);a.parentNode.removeChild(a);}else throw 1;}catch(g){a.style.width=b+'px';}CSS.removeClass(a,'img_loading');}function imageConstrainSize(a,b,c,d){var e=new Image();e.onload=function(){if(e.width>0&&e.height>0){var f=e.width,g=e.height;if(f>b||g>c){var h=c/b,i=g/f;if(i>h){f=f*(c/g);g=c;}else{g=g*(b/f);f=b;}}var j=ge(d);if(j){var k=document.createElement('img');k.src=a;k.width=f;k.height=g;j.parentNode.insertBefore(k,j);j.parentNode.removeChild(j);}}};e.src=a;}function image_has_failed(a){if((a.complete==null&&a.width==20&&a.height==20)||(a.mimeType!=null&&a.complete&&a.mimeType=='')||(a.naturalHeight!=null&&a.complete&&a.naturalHeight==0))return true;}
function ComposerAttachment(){this._container=null;}copy_properties(ComposerAttachment,{setupThumbnails:function(a,b){var c=new ImageSandbox();c.onfinish=function(){a=c.getImages();for(var d=a.length-1;d>=0;d--)if(a[d].width&&(a[d].height<50||a[d].width<50||a[d].height/a[d].width>3||a[d].width/a[d].height>3))a.splice(d,1);if(!a.length){CSS.removeClass(b,'loading');CSS.removeClass(b.parentNode,'has_image');var e=b;while(e.parentNode&&e.tagName.toLowerCase()!='form')e=e.parentNode;e=e.getElementsByTagName('input');for(var d=0;d<e.length;d++)if(e[d].name.indexOf('[params][images]')!=-1)e[d].parentNode.removeChild(e[d]);return;}for(var f=0;f<a.length-1;f++)for(var g=a.length-1;g>=f;g--)if(a[f].width*a[f].height<a[g].width*a[g].height){temp=a[f];a[f]=a[g];a[g]=temp;}var e=b;while(e.parentNode&&e.tagName.toLowerCase()!='form')e=e.parentNode;e=e.getElementsByTagName('input');for(var d=0;d<e.length;d++)if(e[d].name.indexOf('[params][images]')!=-1){e=e[d];break;}CSS.removeClass(b,'loading');new ThumbnailSelector(b,e,a);}.bind(this);c.loadImages(a);}});copy_properties(ComposerAttachment.prototype,{containerReady:function(a,b){this._container=a;var c=a.getElementsByTagName('input'),d=[''];for(var e=0;e<c.length;e++)if(c[e].type=='text'||c[e].type=='hidden')d.push('<input type="hidden" name="'+htmlspecialchars(c[e].name)+'" value="'+htmlspecialchars(c[e].value)+'" />');if(b){d.push('&nbsp;');a.innerHTML=d.join('');CSS.addClass(a,'share_attachment_loading');}else a.innerHTML+=d.join('');},_renderInputsRecursive:function(a,b){if(b===null)return '';var c=[];if(typeof(b)=='object'){for(var d in b)c.push(this._renderInputsRecursive(a+'['+d+']',b[d]));}else if(typeof(b)!='function')c.push('<input type="hidden" name="',a,'" value="',htmlspecialchars(b),'" />');return c.join('');},_asyncCallback:function(a){var b=a.getPayload().html;CSS.removeClass(this._container,'share_attachment_loading');DOM.setContent(this._container,HTML(b));}});function ThumbnailSelector(a,b,c){var d=['<div class="thumbnail_stage"><h4>'+"Selecciona una miniatura"+'</h4><div class="selector clearfix"><div class="arrows clearfix">','<span class="left"><a href="#" class="arrow disabled">&nbsp;</a></span>','<span class="right"><a href="#" class="arrow ',c.length>1?'enabled':'disabled','">&nbsp;</a></span>','</div><div class="counter"><span>1 of ',c.length,'</span></div></div>'];for(var e=0;e<c.length;e++)d.push('<div class="thumbnail',e==0?' thumbnail_selected':' thumbnail_unselected','">','<img class="img_loading" src="',c[e].src,'" onload="adjustImage(this);" />','</div>');d.push('<label style="white-space:nowrap"><input name="no_picture" type="checkbox" onclick="this.parentNode.parentNode.parentNode.thumbnail.use_thumbnail(this.checked)" />'+"Sin foto"+'</label></div>');a.innerHTML=d.join('');this.images=c;this.input=b;b.value=this.images[0].src;this.obj=a;this.obj.thumbnail=this;this.label=a.getElementsByTagName('span')[2];this.index=0;var f=a.getElementsByTagName('a');this.left=f[0];this.right=f[1];this.left.onclick=this.left_arrow_press.bind(this);this.right.onclick=this.right_arrow_press.bind(this);this.left.onselectstart=this.right.onselectstart=function(){return false;};this.left.onmousedown=this.right.onmousedown=this._onmousedown;this.left.onmouseout=this.right.onmouseout=this._onmouseout;}copy_properties(ThumbnailSelector.prototype,{use_thumbnail:function(a){if(!a){this.move_selection(0);CSS.removeClass(this.obj,'thumbnail_dont_use');}else{this.input.value='';CSS.addClass(this.obj,'thumbnail_dont_use');}},_onmousedown:function(){CSS.addClass(this,'active');return false;},_onmouseout:function(){CSS.removeClass(this,'active');},left_arrow_press:function(){CSS.addClass(this.left,'active');this.move_selection(-1);return false;},right_arrow_press:function(){CSS.removeClass(this.right,'active');this.move_selection(1);return false;},move_selection:function(a){var b=this.index+a;if(b>=0&&b<this.images.length){var c=this.obj.getElementsByTagName('div'),d=0;this.index=b;for(var e=0;e<c.length;e++){var f=c[e].className;if(!CSS.hasClass(c[e],'thumbnail '))continue;var g=d==b;if(f.indexOf(g?'_unselected':'_selected')!=-1)CSS.setClass(c[e],f.replace(/thumbnail_(?:un)?selected/,g?'thumbnail_selected':'thumbnail_unselected'));d++;}this.label.innerHTML=tx._("{selected} de {total}",{selected:(b+1),total:d});CSS.setClass(this.left,this.left.className.replace(/[^ ]+abled/,b==0?'disabled':'enabled'));CSS.setClass(this.right,this.right.className.replace(/[^ ]+abled/,b==this.images.length-1?'disabled':'enabled'));this.input.value=this.images.src;}}});function ImageSandbox(){this.obj=document.createElement('div');this.obj.style.left=this.obj.style.top='-100px';this.obj.style.width=this.obj.style.height='1px';this.obj.style.overflow='hidden';this.images=0;this.done=0;DOM.getRootElement().appendChild(this.obj);}copy_properties(ImageSandbox.prototype,{loadImages:function(a){this.images=a.length;for(var b=0;b<a.length;b++)new ImageSandboxLoader(this,a);},onImageLoaded:function(a){this.done++;this._stateChange();},onImageFailed:function(a){a.destroy();this.images--;this._stateChange();},getImages:function(){var a=new Array(),b=this.obj.getElementsByTagName('img');for(var c=0;c<b.length;c++)a.push(b[c]);return a;},_stateChange:function(){if(this.done==this.images)if(this.onfinish)this.onfinish();}});function ImageSandboxLoader(a,b){this._timeout=4000;this._start=Date.now();this._sandbox=a;if(typeof b!='object')b={src:b};this._obj=document.createElement('img');this._obj.onload=function(){if(this._pollImage)this._pollImage(1);}.bind(this);this._obj.onerror=function()
Título: Re:Encontré este Código en un juego del Facebook
Publicado por: SoyJoaquin. en 27 de Abril de 2012, 03:52:03 am
Los copyright que los atropelle un carrito de helados, ¿no?
No te servirá absolutamente para nada.
Saludos.

Edito: Perdonen que edite el mensaje, es que se me olvido poner algo que para mi es importante resaltar.
Si invirtieras el tiempo que gastas buscando esta clase de cosas en aprender, todo seria mejor y mucho mas fácil.

¿Te soy sincero?, Un juego como el que quieres y teniendo escasos conocimientos en programación como los tuyos, créeme que no lo harás en menos de 5 años. Eso sin contar de que las posibilidades de que llegue a ser un éxito son muy pero muy pocas ya que la gente por lo general se aburre rápidamente de esta clase de juegos.

Saludos.
Título: Re:Encontré este Código en un juego del Facebook
Publicado por: HunterCash97 en 28 de Abril de 2012, 01:21:29 am
Los copyright que los atropelle un carrito de helados, ¿no?
No te servirá absolutamente para nada.
Saludos.

Edito: Perdonen que edite el mensaje, es que se me olvido poner algo que para mi es importante resaltar.
Si invirtieras el tiempo que gastas buscando esta clase de cosas en aprender, todo seria mejor y mucho mas fácil.

¿Te soy sincero?, Un juego como el que quieres y teniendo escasos conocimientos en programación como los tuyos, créeme que no lo harás en menos de 5 años. Eso sin contar de que las posibilidades de que llegue a ser un éxito son muy pero muy pocas ya que la gente por lo general se aburre rápidamente de esta clase de juegos.

Saludos.

Men estoy en un curso en Youtube sobre PHP ! solo pregunto ¬¬