mirror of https://github.com/axmolengine/axmol.git
issue #2404: cocos-ext include WebSocket.h and SocketIO.h now. WebSocket.h doesn't depend on <libwebsockets.h> now.
This commit is contained in:
parent
762b987ae7
commit
477dd6c3c7
|
@ -213,6 +213,10 @@ public:
|
||||||
virtual void onSuccess() {};
|
virtual void onSuccess() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Deprecated declaration
|
||||||
|
CC_DEPRECATED_ATTRIBUTE typedef AssetsManager CCAssetsManager;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE typedef AssetsManagerDelegateProtocol CCAssetsManagerDelegateProtocol;
|
||||||
|
|
||||||
NS_CC_EXT_END;
|
NS_CC_EXT_END;
|
||||||
|
|
||||||
#endif /* defined(__AssetsManager__) */
|
#endif /* defined(__AssetsManager__) */
|
||||||
|
|
|
@ -33,7 +33,7 @@ public:
|
||||||
CC_DEPRECATED_ATTRIBUTE void registerDefaultCCNodeLoaders() { registerDefaultNodeLoaders(); }
|
CC_DEPRECATED_ATTRIBUTE void registerDefaultCCNodeLoaders() { registerDefaultNodeLoaders(); }
|
||||||
CC_DEPRECATED_ATTRIBUTE void registerCCNodeLoader(const char * pClassName, NodeLoader * pNodeLoader) { registerNodeLoader(pClassName, pNodeLoader); };
|
CC_DEPRECATED_ATTRIBUTE void registerCCNodeLoader(const char * pClassName, NodeLoader * pNodeLoader) { registerNodeLoader(pClassName, pNodeLoader); };
|
||||||
CC_DEPRECATED_ATTRIBUTE void unregisterCCNodeLoader(const char * pClassName) { unregisterNodeLoader(pClassName); };
|
CC_DEPRECATED_ATTRIBUTE void unregisterCCNodeLoader(const char * pClassName) { unregisterNodeLoader(pClassName); };
|
||||||
CC_DEPRECATED_ATTRIBUTE NodeLoader * getCCNodeLoader(const char * pClassName) { getNodeLoader(pClassName); } ;
|
CC_DEPRECATED_ATTRIBUTE NodeLoader * getCCNodeLoader(const char * pClassName) { return getNodeLoader(pClassName); };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static NodeLoaderLibrary * getInstance();
|
static NodeLoaderLibrary * getInstance();
|
||||||
|
|
|
@ -79,8 +79,7 @@ CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderLibrary CCNodeLoaderLibrary;
|
||||||
CC_DEPRECATED_ATTRIBUTE typedef MenuItemLoader CCMenuItemLoader;
|
CC_DEPRECATED_ATTRIBUTE typedef MenuItemLoader CCMenuItemLoader;
|
||||||
CC_DEPRECATED_ATTRIBUTE typedef LayerColorLoader CCLayerColorLoader;
|
CC_DEPRECATED_ATTRIBUTE typedef LayerColorLoader CCLayerColorLoader;
|
||||||
CC_DEPRECATED_ATTRIBUTE typedef LabelTTFLoader CCLabelTTFLoader;
|
CC_DEPRECATED_ATTRIBUTE typedef LabelTTFLoader CCLabelTTFLoader;
|
||||||
CC_DEPRECATED_ATTRIBUTE typedef AssetsManager CCAssetsManager;
|
|
||||||
CC_DEPRECATED_ATTRIBUTE typedef AssetsManagerDelegateProtocol CCAssetsManagerDelegateProtocol;
|
|
||||||
|
|
||||||
#if CC_ENABLE_BOX2D_INTEGRATION || CC_ENABLE_CHIPMUNK_INTEGRATION
|
#if CC_ENABLE_BOX2D_INTEGRATION || CC_ENABLE_CHIPMUNK_INTEGRATION
|
||||||
CC_DEPRECATED_ATTRIBUTE typedef PhysicsSprite CCPhysicsSprite;
|
CC_DEPRECATED_ATTRIBUTE typedef PhysicsSprite CCPhysicsSprite;
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
#include "ExtensionMacros.h"
|
#include "ExtensionMacros.h"
|
||||||
|
|
||||||
#include "AssetsManager/AssetsManager.h"
|
|
||||||
|
|
||||||
#include "CCBReader/CCBFileLoader.h"
|
#include "CCBReader/CCBFileLoader.h"
|
||||||
#include "CCBReader/CCBMemberVariableAssigner.h"
|
#include "CCBReader/CCBMemberVariableAssigner.h"
|
||||||
#include "CCBReader/CCBReader.h"
|
#include "CCBReader/CCBReader.h"
|
||||||
|
@ -41,6 +39,7 @@
|
||||||
#include "network/HttpRequest.h"
|
#include "network/HttpRequest.h"
|
||||||
#include "network/HttpResponse.h"
|
#include "network/HttpResponse.h"
|
||||||
#include "network/HttpClient.h"
|
#include "network/HttpClient.h"
|
||||||
|
#include "network/WebSocket.h"
|
||||||
#include "network/SocketIO.h"
|
#include "network/SocketIO.h"
|
||||||
|
|
||||||
// Physics integration
|
// Physics integration
|
||||||
|
|
|
@ -28,12 +28,15 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "WebSocket.h"
|
#include "WebSocket.h"
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include "libwebsockets.h"
|
||||||
|
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
class WsMessage
|
class WsMessage
|
||||||
|
@ -444,7 +447,7 @@ void WebSocket::onSubThreadEnded()
|
||||||
|
|
||||||
int WebSocket::onSocketCallback(struct libwebsocket_context *ctx,
|
int WebSocket::onSocketCallback(struct libwebsocket_context *ctx,
|
||||||
struct libwebsocket *wsi,
|
struct libwebsocket *wsi,
|
||||||
enum libwebsocket_callback_reasons reason,
|
int reason,
|
||||||
void *user, void *in, size_t len)
|
void *user, void *in, size_t len)
|
||||||
{
|
{
|
||||||
//CCLOG("socket callback for %d reason", reason);
|
//CCLOG("socket callback for %d reason", reason);
|
||||||
|
|
|
@ -32,9 +32,12 @@
|
||||||
|
|
||||||
#include "ExtensionMacros.h"
|
#include "ExtensionMacros.h"
|
||||||
#include "cocos2d.h"
|
#include "cocos2d.h"
|
||||||
#include "libwebsockets.h"
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
struct libwebsocket;
|
||||||
|
struct libwebsocket_context;
|
||||||
|
struct libwebsocket_protocols;
|
||||||
|
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
class WsThreadHelper;
|
class WsThreadHelper;
|
||||||
|
@ -132,7 +135,7 @@ private:
|
||||||
friend class WebSocketCallbackWrapper;
|
friend class WebSocketCallbackWrapper;
|
||||||
int onSocketCallback(struct libwebsocket_context *ctx,
|
int onSocketCallback(struct libwebsocket_context *ctx,
|
||||||
struct libwebsocket *wsi,
|
struct libwebsocket *wsi,
|
||||||
enum libwebsocket_callback_reasons reason,
|
int reason,
|
||||||
void *user, void *in, size_t len);
|
void *user, void *in, size_t len);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue