Client
1. About the game engine
When I started preparing to make h5 games in March 2015, the first problem I encountered was engine selection.
There were three main 2d engines on the market at that time: egret, layabox and cocos2d-js.
On the one hand, it’s because I used cocos2d-x(c) to make mobile game clients for more than a year, so I naturally chose cocos2d-js. On the other hand, it was because there were not many successful projects with the other two engines on the market at that time.
Every time the cocos engine is updated, we will test it in our game as soon as possible.
If we find that the performance of the game on Android phones is significantly improved, we will upgrade it together with the engine version. Standing on the shoulders of giants, we can get twice the result with half the effort.
From v3.5 in March 2015, to v3.8 in September 2015, to v3.9 in November 2015, until the latest v3.12 in July 2016. We have updated the game engine 3 times in total!
PS: The OpenGl Test in js-tests was not able to see the running effect on the real Android device until v3.12, which made me burst into tears!
2. About data encryption and communication protocols
Because it is a strong network game, it can only be websocket. Because our original mobile game client and server used to be tcpsocket, the transmitted content was sha1-encrypted binary data in a custom format.
So the first difficulty of the project is how to use js to implement binary encoding and decoding of json strings, as well as sha1 encryption and decryption.
TODO: In fact, it is not necessary to encrypt, encode and decode every uplink and downlink. This will cause excessive pressure on the client and server CPUs. You only need to protect some important events (such as login, recharge, deduction of gold coins, etc.)!
Statement:
All resources on this website are contributed and published by netizens, or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this website are for learning and reference only. Please do not use them for commercial purposes, otherwise you will be responsible for all consequences incurred! If there is any infringement, please contact us to delete and remove it. Contact information: admin@php.cn