Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTPS on Cocos2d-x

I'm implementing a game app based on cocos2d-x. In order to technically prevent cheating, one of the ideas to do is using HTTPS for all the client-server communication, which make it difficult to get the data format / game logic and send modified request to cheat. (I know "prevent" is actually impossible but for increasing the cost of making game cheating it's ok : ). My question is,

  1. In Cocos2d-x, how to make HTTPS request? Possible?
  2. In a more general case, technically what to do to reduce such game hacking? What strategy to hold?
like image 592
Jason Xu Avatar asked Nov 04 '22 14:11

Jason Xu


1 Answers

For native cross platform C++ networking you may consider using Boost C++ libraries. Boost.Asio is the one used for networking.

Boost.Asio link: http://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio.html

Boost.Asio tutorials link: http://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/tutorial.html

Although not officially supported (only due to lack of regression testing on iOS and Android), Boost runs without any problems on iOS and Android (and probably other C++ based mobile platforms as well).

To prevent cheating you usually rely on an external source (which can be your game server) e.g. if your game relies on the time of day you may get the time form an external server. You may use encryption libraries for data transfer on the client and server side.

like image 149
Mubeen Iqbal Avatar answered Nov 09 '22 12:11

Mubeen Iqbal