Encode and decode Adobe AMF3 protocol data for Cocos2dx