Alireza Sanaee
Alireza Sanaee

Reputation: 475

How to add Raknet to Cocos2d-x

I try to add Raknet to Cocos2d-x game engine for android games but I don't know how . I couldn't find good tutorial about this integration . I can compile and run both of them separately as well , the problem is integration of them . I think that I should change my Android.mk . I see these links and some more but I couldn't find them useful :

  1. http://www.jenkinssoftware.com/forum/index.php?topic=5069.0
  2. http://www.jenkinssoftware.com/forum/index.php?topic=3744.0
  3. The Completest Cocos2d-x Tutorial & Guide List
  4. https://code.google.com/p/fellz/source/browse/trunk/cocos2dx?r=7

my cocos2d-x version: 3.2, raknet : 4.x, ndk : r9d

Upvotes: 1

Views: 722

Answers (1)

Alireza Sanaee
Alireza Sanaee

Reputation: 475

I use Visual Studio and a document about compiler setup in RakNet tutorials. I followed this doc and finally created a DLL form the Raknet sources, put it next to the my game's .exe file, and it worked well.

You should also add Raknet sources to included header files of Visual Studio.

Update:

RakNet is not the best way; try another way like WebSocket or Socket.io. Socket.io is highly recommended and is already used in cocos2d-x sources, but it's not compatible with socket.io 1.X. You can make some changes to Socketio.h and Socketio.cpp to use it with socket.io version 1.X. Also, cocos2d-x says they will consider this issue in the next releases.

Upvotes: 0

Related Questions