<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[小宝游戏]]></title>
  <subtitle type="html"><![CDATA[专注Flash Game开发!]]></subtitle>
  <id>http://www.71mao.com/</id>
  <link rel="alternate" type="text/html" href="http://www.71mao.com/" /> 
  <link rel="self" type="application/atom+xml" href="http://www.71mao.com/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.8">PJBlog3</generator> 
  <updated>2010-06-29T14:20:00+08:00</updated>

  <entry>
	  <title type="html"><![CDATA[解TLBB的资源包]]></title>
	  <author>
		 <name>dingding</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=3" label="Flash Game" /> 
	  <updated>2010-06-29T14:20:00+08:00</updated>
	  <published>2010-06-29T14:20:00+08:00</published>
		  <summary type="html"><![CDATA[<p>《天龙八部二》Data目录下是所有的资源包，文件后缀名为AXP，文件格式大致如下</p>
<p><br />
文件头:AXPK ..... <br />
文件个数:int <br />
文件索引表: 文件名|文件大小|文件偏移 <br />
01苗疆/苗疆浅草底层.jpg|00014DEB|0B294255 1441832 <br />
01苗疆/苗疆浅草上层.tga|0002002C|F2504416 1527336 ..... <br />
文件表: .....</p>
<p><br />
文件索引表的的偏移不知道放在哪里，我是用UE搜的文件名，比如材质的<br />
<img alt="" src="http://www.71mao.com/download.asp?id=1" /></p>
<p>8535是文件的个数,文件索引表位置就是</p>
<p><img alt="" src="http://www.71mao.com/download.asp?id=3" /><br />
后面就是文件索引表，解出来格式如下</p>
<p><img alt="" src="http://www.71mao.com/download.asp?id=2" /></p>
<p>最后解出的图如下<br />
<img alt="" src="http://www.71mao.com/download.asp?id=4" /><br />
&nbsp;</p>
<p>&nbsp;</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/" /> 
	  <id>http://www.71mao.com/default.asp?id=83</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Flash Player 10.1优化?]]></title>
	  <author>
		 <name>dingding</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=3" label="Flash Game" /> 
	  <updated>2010-06-21T15:16:44+08:00</updated>
	  <published>2010-06-21T15:16:44+08:00</published>
		  <summary type="html"><![CDATA[Flash Player 10.1主要在性能和功耗管理、视频方面进行了完善，跟游戏有关的优化摘录如下<br/>1.We achieved some large gains in reducing the amount of memory used at runtime, <br/>particularly for bitmap-intensive apps. <br/><strong>极大的改善了密集型位图应用的性能</strong><br/>虽然是降低了,但没看出怎么个极大？<br/>2.Now, content that runs in Flash Player will automatically shut down when the available <br/>memory is running low.<br/><strong>消耗内存过大会自动停止运行</strong><br/>在停止运行时，我是否能获知，以便给用户友好提示呢？<br/>3.Flash Player can now automatically reduce the power consumption for content running in the background on a non-visible browser tab to improve performance when users are <br/>multitasking. In cases wh&#101;re audio is playing in the background, playback fidelity is <br/>maintained<br/><strong>看不见的Flash(非当前选项卡可见、最小化浏览器时)，将降帧运行！</strong>WebGame很多模块是基于EnterFrame,localConnection,Timer做的,怎么办?]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/" /> 
	  <id>http://www.71mao.com/default.asp?id=82</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[只因为我们太火]]></title>
	  <author>
		 <name>c</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=3" label="Flash Game" /> 
	  <updated>2010-06-02T09:50:26+08:00</updated>
	  <published>2010-06-02T09:50:26+08:00</published>
		  <summary type="html"><![CDATA[昆仑08年就开始在google用天书奇谈，现在又用龙之刃....真Q<br/><img src="http://www.71mao.com/attachments/month_1006/l20106294652.jpg" border="0" alt=""/><br/>仙域接昆仑的班，用天书奇谈&lt;br/&gt;<img src="http://www.71mao.com/attachments/month_1006/520106294836.jpg" border="0" alt=""/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/article/81.html" /> 
	  <id>http://www.71mao.com/default.asp?id=81</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[诡异的cacheAsBitmap]]></title>
	  <author>
		 <name>c</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=5" label="ActionScript" /> 
	  <updated>2010-05-06T17:42:44+08:00</updated>
	  <published>2010-05-06T17:42:44+08:00</published>
		  <summary type="html"><![CDATA[<p>public class ScaleImg extends Bitmap{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public function ScaleImg(bimapData:BitmapData=null,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pixelSnapping:String=&quot;auto&quot;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; smoothing:Boolean=false){</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<strong> this.cacheAsBitmap = true;</strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(bimapData,pixelSnapping,smoothing);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>}</p>
<p>测试:</p>
<p>addChild(new ScaleImg());</p>
<p>如果是10.0.32.18之前的Flash Player 直接就crash了，但把<strong>t<strong>h</strong>is.cacheAsBitmap = true;</strong>放在super之后执行，就不会crash。<br />
如果是10.0.32.18之后的版本的放在super前后都可以执行。</p>
<p>不知何故？</p>
<p>为了找到player crash的这个原因纠结了我好久！！！！</p>
<p>备注:<br />
10.0.12.36&nbsp; flash10a.ocx&nbsp;&nbsp; 2008.11<br />
10.0.22.87&nbsp; flash10b.ocx &nbsp; 2009.2<br />
10.0.32.18&nbsp; flash10c.ocx&nbsp;&nbsp; 2009.7<br />
10.0.42.34&nbsp; flash10d.ocx &nbsp; 2009.12<br />
10.0.45.2&nbsp;&nbsp;&nbsp; flash10e.ocx&nbsp;&nbsp; 2010.2<br />
10.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; flash10f.ocx&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><br />
找到一个有用信息:<br />
The following issues have been fixed in Flash Player 10.0.22.87:<br />
.........<br />
Setting bitmap width/height before super() crashes player. (FP-760/2216975)<br />
.........</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/article/80.html" /> 
	  <id>http://www.71mao.com/default.asp?id=80</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Amf数据分析]]></title>
	  <author>
		 <name>c</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=3" label="Flash Game" /> 
	  <updated>2009-11-21T23:35:00+08:00</updated>
	  <published>2009-11-21T23:35:00+08:00</published>
		  <summary type="html"><![CDATA[<p>前段时间分析了一个网页游戏,美术风格类似梦幻西游,是外包的。分析代码得知，客户端资源做了一些特殊处理，是用通过netconnection发过来的decode的swf来解资源,本地是无缓存，存在内存中,自己如果用模拟的客户端去连服务器, 接受的是只是一个zip压缩的png文件,wpe抓包如下：</p>
<p><img alt="" src="http://71mao.com/attachments/month_0911/d20091121232825.jpg" /></p>
<p>看来做了域限制！用原客户端连服务器发的才是真实的decode的swf，一时找不到很好的内存读取工具，.只得用wpe抓包去分析amf3数据了，数据封包图如下：</p>
<p><img alt="" src="http://71mao.com/attachments/month_0911/b2009112203657.jpg" /></p>
<p>现RTMP协议，amf0~3数据格式已开源，不难看出找个核心的数据包：</p>
<p><strong>数据包协议头12字节<br />
</strong>03表示12字节头,channelid=3,这个是Invoke通道,NetConnection.Call()&nbsp;是用的找个通道，调用的方法在下面。<br />
00 00 00表示时间戳 Timmer=0<br />
00 31 D9表示数据大小 AMFSize=12761<br />
14表示数据包类型 AMFType=Invoke 方法调用<br />
00 00 00 00 表示StreamID = 0&nbsp;音视频流的ID<br />
<strong>AMF数据</strong><br />
02表示String<br />
0008表示String长度8<br />
6F 6E 42 57 44 6F 6E 65&nbsp; 是String的值onBWDone<br />
00表示Double<br />
40 00 00 00 00 00 00 00 表示double的<br />
05表示 null<br />
0a表示 ARRAY<br />
00 00 05 87 数组长度1415<br />
之后的就是数组里的数据，就是decode的swf数据文件.但这个只是amf序列化字节，还要转化,下面以如何得到arr[0]的值为例分析：<br />
00&nbsp;表示Double<br />
40 5e 00 00 00 00 00 00 是表示在网络中的字节循序的（符号位在低存储）8字节的IEEE-754双精度浮点数，<br />
那么读的时候就到过来，00 00 00 00 00 00 5e&nbsp;40。java转换代码如下：<br />
public static void main(String[] args) {<br />
&nbsp;&nbsp;byte[] b = new byte[8];<br />
&nbsp;&nbsp;b[0] = 0x00;<br />
&nbsp;&nbsp;b[1] = 0x00;<br />
&nbsp;&nbsp;b[2] = 0x00;<br />
&nbsp;&nbsp;b[3] = 0x00;<br />
&nbsp;&nbsp;b[4] = 0x00;<br />
&nbsp;&nbsp;b[5] = 0x00;<br />
&nbsp;&nbsp;b[6] = 0x5e;<br />
&nbsp;&nbsp;b[7] = 0x40;<br />
&nbsp;&nbsp;System.out.println(byteToDouble(b));<br />
&nbsp;}<br />
//bye转double<br />
public static double byteToDouble(byte[] b){<br />
&nbsp;&nbsp;&nbsp;&nbsp; long l;<br />
&nbsp;&nbsp;&nbsp;&nbsp; l=b[0];<br />
&nbsp;&nbsp;&nbsp;&nbsp; l&amp;=0xff;<br />
&nbsp;&nbsp;&nbsp;&nbsp; l|=((long)b[1]&lt;&lt;8);<br />
&nbsp;&nbsp;&nbsp;&nbsp; l&amp;=0xffff;<br />
&nbsp;&nbsp;&nbsp;&nbsp; l|=((long)b[2]&lt;&lt;16);<br />
&nbsp;&nbsp;&nbsp;&nbsp; l&amp;=0xffffff;<br />
&nbsp;&nbsp;&nbsp;&nbsp; l|=((long)b[3]&lt;&lt;24);<br />
&nbsp;&nbsp;&nbsp;&nbsp; l&amp;=0xffffffff;<br />
&nbsp;&nbsp;&nbsp;&nbsp; l|=((long)b[4]&lt;&lt;32);<br />
&nbsp;&nbsp;&nbsp;&nbsp; l&amp;=0xffffffffffl;<br />
&nbsp;&nbsp;&nbsp;&nbsp; l|=((long)b[5]&lt;&lt;40);<br />
&nbsp;&nbsp;&nbsp;&nbsp; l&amp;=0xffffffffffffl;<br />
&nbsp;&nbsp;&nbsp;&nbsp; l|=((long)b[6]&lt;&lt;48);<br />
&nbsp;&nbsp;&nbsp;&nbsp; l|=((long)b[7]&lt;&lt;56);<br />
&nbsp;&nbsp;&nbsp;&nbsp; return Double.longBitsToDouble(l);<br />
&nbsp;&nbsp; }</p>
<p>//当然用这个方法也可以验证一下数据<br />
public static byte[] doubleToByte(double d){<br />
&nbsp;&nbsp;&nbsp;&nbsp; byte[] b=new byte[8];<br />
&nbsp;&nbsp;&nbsp;&nbsp; long l=Double.doubleToLongBits(d);<br />
&nbsp;&nbsp;&nbsp;&nbsp; for(int i=0;i&lt;b.length;i++){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b[i]=new Long(l).byteValue();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l=l&gt;&gt;8;<br />
&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp; return b;<br />
&nbsp; }</p>
<p>如此读1415个double数，得到一个byte[]转为bytearray,uncompress之，得到可以解文件的swf&nbsp;.<br />
注意后续的字节，分了很多个包，用wpe封包后，凑一个完整的包，再读！<br />
&nbsp;</p>
<p><strong>资料<br />
<a target="_blank" href="http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf">Amf数据格式</a><br />
<a target="_blank" href="http://www.adobe.com/aboutadobe/pressroom/pressreleases/200901/012009RTMP.html">RTMP协议</a></strong></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/article/79.html" /> 
	  <id>http://www.71mao.com/default.asp?id=79</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[天书多语言版本]]></title>
	  <author>
		 <name>c</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=3" label="Flash Game" /> 
	  <updated>2009-10-16T10:11:32+08:00</updated>
	  <published>2009-10-16T10:11:32+08:00</published>
		  <summary type="html"><![CDATA[<p>简体中文版:<a target="_blank" href="http://t.mop.com">http://t.mop.com</a><br />
英文版:<a target="_blank" href="http://neverland.hithere.com/">http://neverland.hithere.com/</a><br />
港/澳/台/新/马版:<a target="_blank" href="https://member.runup.com.hk/">https://member.runup.com.hk/</a></p>
<p>更多版本敬请期待.......</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/article/78.html" /> 
	  <id>http://www.71mao.com/default.asp?id=78</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Flex Builder 3使用air 1.5记录]]></title>
	  <author>
		 <name>c</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=10" label="life" /> 
	  <updated>2009-09-01T18:53:02+08:00</updated>
	  <published>2009-09-01T18:53:02+08:00</published>
		  <summary type="html"><![CDATA[<p>在Flex Builder3下使用建air项目使用flash builder下的sdk 4,<br />
F11报错<br />
VerifyError: Error #1053: Illegal override of scaleZ in mx.core.UIComponent. at flash.display::MovieClip/nextFrame() ..... <br />
解决方法：<br />
1.将项目根目录下的xxx-app.xml的第二行xmlns=&quot;http://ns.adobe.com/air/application/1.0&quot; 改为 xmlns=&quot;http://ns.adobe.com/air/application/1.5&quot;<br />
2.将.actionScriptProperties中的htmlPlayerVersion=&quot;9.0.28&quot;改为htmlPlayerVersion=&quot;10.0.0&quot;,并设置为只读</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/article/77.html" /> 
	  <id>http://www.71mao.com/default.asp?id=77</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[pv3d和box2d]]></title>
	  <author>
		 <name>c</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=5" label="ActionScript" /> 
	  <updated>2009-07-16T16:05:02+08:00</updated>
	  <published>2009-07-16T16:05:02+08:00</published>
		  <summary type="html"><![CDATA[<p>以前研究魔术笔的游戏,今日心血来潮仿制了一个pv3d和box2d的小程序,按下鼠标左键右拖动绘制盒子,按下左拖动绘制球,还比较有意思。</p>
<p>box2d： <a target="_blank" href="http://box2dflash.sourceforge.net/ ">http://box2dflash.sourceforge.net/ </a></p>
<p>papervision3d: <a target="_blank" href="http://www.papervision3d.org">http://www.papervision3d.org</a></p>
<p>效果图：</p>
<p><img alt="" src="http://71mao.com/attachments/month_0907/w2009716163129.jpg" /></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/article/76.html" /> 
	  <id>http://www.71mao.com/default.asp?id=76</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[adobe真的要放弃as3吗?]]></title>
	  <author>
		 <name>c</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=5" label="ActionScript" /> 
	  <updated>2009-05-26T17:32:14+08:00</updated>
	  <published>2009-05-26T17:32:14+08:00</published>
		  <summary type="html"><![CDATA[<p>adobe真的要放弃as3吗?详文见:<a target="_blank" href="http://www.ncannasse.fr/blog/adobe_drop_as3_for_haxe"><br />
www.ncannasse.fr/blog/adobe_drop_as3_for_haxe</a></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/article/75.html" /> 
	  <id>http://www.71mao.com/default.asp?id=75</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[IE并发连接限制(as)]]></title>
	  <author>
		 <name>c</name>
		 <uri>http://www.71mao.com/</uri>
		 <email>83392943#qq.com</email>
	  </author>
	  <category term="" scheme="http://www.71mao.com/default.asp?cateID=5" label="ActionScript" /> 
	  <updated>2009-05-23T16:30:33+08:00</updated>
	  <published>2009-05-23T16:30:33+08:00</published>
		  <summary type="html"><![CDATA[<p>由于ie遵守严格的标准，as 只能并发下载2个文件,其原因可能是由于带宽或下载大量小文件，其他浏览器好像没有这个限制，游戏里的小资源很多，部分打包，部分还是要实时加载，虽然只能同时下2个,但在下载大量资源时,经测试用并发还是比队列下载快，但并发下载有时无故停掉，也不抛出事件，可以做个超时处理，或不下同一个资源。这样就可以保证下载的速度，最后把资源分散,也可加速。</p>
<p>Internet Explorer and Connection Limits<br />
<a target="_blank" href="http://blogs.msdn.com/ie/archive/2005/04/11/407189.aspx">http://blogs.msdn.com/ie/archive/2005/04/11/407189.aspx</a></p>
<p>修改连接限制<br />
<a target="_blank" href="http://support.microsoft.com/kb/183110">http://support.microsoft.com/kb/183110</a></p>
<p>队列下载：<br />
BulkLoader： <a target="_blank" href="http://code.google.com/p/bulk-loader/">http://code.google.com/p/bulk-loader/</a><br />
QueueLoader： <a target="_blank" href="http://code.google.com/p/queueloader-as3/">http://code.google.com/p/queueloaderas3</a></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.71mao.com/article/74.html" /> 
	  <id>http://www.71mao.com/default.asp?id=74</id>
  </entry>	
		
</feed>
