In the previous two notes, a more detailed description of how to use tools to analyze the Web page and how to write code to implement some simple functions. If there are follow-up notes, I will simply record the "Happy Net Auxiliary program" in the development process of the main problems and solutions.
In this post, the author will briefly describe how to achieve a simple parking function, and make a simple interface to present the development of a series of notebooks.
First, the identification of friends of the private car in the free parking space: Parking to the free parking space but will not receive a penny, so you must not park the car to the free parking.
Through Firebug debugging found that when the player clicks on the "parking" in the middle of Flash parking button, Parking-7.js 169th business Parking_park method will be implemented.
g_curparkid = parkid;
var v_park_free = (parseInt(g_curparkid) >> 16) & 0xff;
In Parking-park, you have the above code. Where the incoming parameter parkid is in the "Happy Net Auxiliary program development notes (ii): Get friends private car bit information" Get friends private car bit information in the Parkid. You don't know what JavaScript means when a friend sees this code and is confused.
1. Bitwise operator ">>" in Javscript: for bit operators in JS, refer to http://www.w3school.com.cn/js/as_js_operators_bitwise.asp. In C #, the right shift operator is also ">>". such as: 67174403 >> 16 = 1025;
2.0xff: This is actually a number expressed in 16, corresponding to the decimal 255
In the program, the author in Parkinginfo this entity class to add a property isparkfree to mark whether the parking space is free
<summary>
Is it a free parking space?
</summary>
public bool Isparkfree
{
Get
{
Return Convert.toboolean (parkid >> & 255);
}
}