Commit Graph

75 Commits

Author SHA1 Message Date
samuele3hu d8bd65b2e8 issue #2784:Add class constructor js-binding document 2013-09-13 16:46:31 +08:00
Ricardo Quesada d7590affda Merge branch 'develop' into dictionary_array_fixes
Conflicts:
	cocos2dx/cocoa/CCArray.cpp
	cocos2dx/cocoa/CCArray.h
	cocos2dx/label_nodes/CCLabel.cpp
	extensions/CCArmature/datas/CCDatas.cpp
	extensions/CCArmature/display/CCDisplayManager.cpp
2013-08-21 21:27:44 -07:00
Ricardo Quesada 2e221ee6cc Array & Dictionary fixes
In many places `Dictionary` and `Array` are not being initialized. In fact `Dictionary` doesn't  have the `init()` method creating potential leaks.
Also in objects like `Armature` and the new `LabelTTF`, the `Array` object is not being used a pointer. So it doesn't use the 2 phase initialization, creating potential leaks.

This patch fixes all those issues.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-21 20:12:09 -07:00
minggo 2de8963a0a fix warnings caused by deprecating some functions of Array 2013-08-22 10:45:47 +08:00
James Chen 85661c976c Merge pull request #3346 from nakosung/develop
closed 2465: Wrong logic when pass an empty std::vector to WebSocket::init.
2013-08-01 19:41:11 -07:00
성낙호 c9077961e8 fix for undefined protocol 2013-08-02 10:35:45 +09:00
Timothy Qiu 5ad5cfed7a Yet another documentation fix.
Modified mismatching parameters doc caused by refactoring.
Added the missing doc of some parameters.
Removed Hungarian notation from parts of the code.
2013-08-01 21:40:13 +08:00
James Chen 343c98af13 Fixing warnings of the order of member variables and fixing errors for tizen projects. 2013-07-29 14:07:57 +08:00
minggo f7fd7a8af5 fixed warnings on Android and windows 2013-07-28 21:43:20 +08:00
James Chen feadd2b2dd issue #2430: Moved constant to header file to avoid errors in 'switch case', the error is 'case value is not a constant expression'.
Also added more deprecated constants.
2013-07-27 00:55:41 +08:00
minggo 0b8de88ddc issue 2430:use enum class 2013-07-26 12:08:18 +08:00
minggo 323af3c889 issue #2430:use upper letters for enum item in AssetsManager and WebSocket 2013-07-25 22:29:12 +08:00
James Chen 477dd6c3c7 issue #2404: cocos-ext include WebSocket.h and SocketIO.h now. WebSocket.h doesn't depend on <libwebsockets.h> now. 2013-07-25 10:33:19 +08:00
Ricardo Quesada 1f37d4d00a More best practices fixes and other bug fixes
- Adds `CC_REQUIRES_NULL_TERMINATION` to methods that require a NULL at the end
- Removes more Hungarian notations in samples
- s/sprite/scene: fix from previous commit
- `CCLog` -> `log`
- `getLayerNamed` -> `getLayer`
- `getPropertyNamed` -> `getProperty`
- and other small fixes
2013-07-23 15:20:22 -07:00
Ricardo Quesada 89d210bdb3 CCAssert -> CCASSERT
and other best pracitces like:

capacity and "index" are ints and not unsigned int (google's recomendation).
 It is easier to detect underflow bugs like this

plus other minor improvements
2013-07-19 22:01:27 -07:00
Lee, Jae-Hong 980a053e50 [Tizen] Fix compile error.
- Tizen SDK doesn't support override keyword yet.
- add class keyword before friend keyword.
2013-07-19 15:16:05 +09:00
minggo eada29ee40 issue #2404:created CCDprecated.h and move all global functions and variables into it 2013-07-15 16:14:26 +08:00
James Chen 93bb7bcb31 friend SIOClientImpl --> friend class SIOClientImpl, that will be clearer. 2013-07-13 19:26:46 +08:00
James Chen 4b2165e648 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into socketio 2013-07-13 19:24:41 +08:00
James Chen 8409e2942f Fixing warning in SocketIO.cpp 2013-07-13 19:20:11 +08:00
Chris Hannon 8791c8119e task: hiding non-interface methods in the SsocketIO and SIOClient classes, adding SIOClientImpl as friend to access 2013-07-12 13:05:15 -04:00
Ricardo Quesada cf262c28e2 getInstance() / destroyInstance() are used...
... instead of sharedXXX / purgeXXX.
They are more C++ friendly, and also easier to remember.

common files + Mac files + iOS files + tests/samples files were updated.

The old methods are deprecated now.
2013-07-11 15:24:23 -07:00
Chris Hannon 126ebb888c Implements a socket.io client extension, adds a test case and updates the android makefiles.
Contains the following tasks:
-initial socket.io extension commit
-sioclientimpl subclasses websocket:delegate to respond to websocket events
-implement static connect methods and basic client creation
-move SocketIO class files into correct extension folder (network)
-create SocketIO test in TestCpp
-update project references
-add missing static modifier to connect method
-implement basic test methods
-update extensions tests with SocketIO test entry
-implement basic handshake and opensocket methods for SocketIO
-add Delegate class to handle callbacks, implement virtual Delegate methods in test
-implement socket and client registries for lookup when connecting to hosts and endpoints
-connect delegate onOpen method by separating impl creation from connection
-update test to demonstrate onOpen callback
-create send and emit methods, move SIOClient into header file, add send and emit methods to test
-implement basic socket.io message parsing
-improve logging for events and messages
-add logic to pull event name from payload
-schedule heartbeat to keep connection alive, scheduled for 90% of the heartbeat interval from the server for safety
-add onConnect handler to to catch socket.io onconnect vs websocket onopen
-add disconnect and disconnectFromEndpoint methods to properly disconnect and destroy objects
-modify SIOClientImpl to track _uri for easier lookup in registries
-connect handler for onMessage to message event from socket.io, modify onError handler to take a string instead of WebSocket error code
-create SIOEvent callback type, implement event registry in clients, add test for event registration and callback
-update SIOEvent to use std::function and c++11, utilize cocos2d CC_CALLBACK method to bind selectors, this ensures that the *this reference is properly passed
-check for connect before sending or emitting in the client, cleanup some codes
-change connect logic to reuse existing socket connections instead of opening a new one
-implements get and set Tag methods for clients for easy reference
-improve endpoint handling, add endpoint tests to test layer
-additional error handling within socket disconnect error and failure to open connection
-fixes extracting endpoint from socket.io messages (in cases of the connect message, where there is 1 less colon for the connect message to the default namespace). Also fixes connecting to the default namespace "/" in the connectToEndpoint method
-add disconnect and onClose handlers to client so that onClose is called in the delegate
-add disconnect test methods to test layers
-change c-style casts to static_casts when using a CCDICT_FOREACH
-remove some unneeded namespace completion
-add usage documentation
-add handling for disconnect from server, cleanup some codes
-update comments and documentation in the socketiotest
-update includes so the NDK doesn't complain when compiling with c++11
-add socketio.cpp and test.cpp to the android makefiles
-update test URL to my public server, test script can also be found in my repo at https://github.com/hannon235/socket.io-testserver.git

Signed-off-by: Chris Hannon <himynameschris@gmail.com>
2013-07-11 17:41:42 -04:00
James Chen 3af6f6fe58 enableCookies is static method now 2013-07-10 15:46:01 +08:00
James Chen 3f57275848 issue #2389: Adding cookie support for HttpClient 2013-07-10 11:37:39 +08:00
James Chen ae737365d7 issue #2305: Sleep(50) on Win32, usleep(50000) on unix --> std::this_thread::sleep_for(std::chrono::milliseconds(50)); 2013-06-26 11:34:04 +08:00
James Chen ea36707c57 issue #2305: Using the old logic of "wait". 2013-06-26 11:10:19 +08:00
James Chen 3ad11cc63a issue #2305: Fixing a bug that passing wrong mutex parameter to "wait". 2013-06-26 11:06:13 +08:00
James Chen f2ab73c533 issue #2305: Reverting to use lock and unlock for HttpClient. 2013-06-26 10:45:46 +08:00
James Chen 8a0046a139 issue #2305: Fixing a crash when error is triggered in WebSocket. Using std::lock_guard to replace lock and unlock manually. 2013-06-26 10:11:10 +08:00
James Chen 79962cdf5d issue #2305: Using c++11 std::thread instead of pthread for HttpClient class. 2013-06-26 10:11:10 +08:00
James Chen 3b9fa904ba issue #2305:use c++11 thread instead of pthread for WebSocket. 2013-06-25 12:51:44 +08:00
James Chen cb67ed0227 issue #2129: Removing CC prefix for extension module. 2013-06-20 14:15:53 +08:00
James Chen 1ea7fd2594 Merge pull request #2904 from edwardzhou/master
closed #2312: WebSocket url parse error for 'ws://domain.com/websocket' pattern
2013-06-19 05:04:11 -07:00
Edward Zhou 53be008dcf fix url parse error for 'ws://domain.com/websocket' pattern 2013-06-17 18:28:12 +08:00
James Chen c0d44cb2e4 fixed #2129: Rename m_iVar to _var, remove CC prefixes. 2013-06-15 14:03:30 +08:00
James Chen a14df8d28d issue #2271: Fixing some memory leaks. 2013-06-10 11:43:43 +08:00
minggo 81b579c032 issue #2271: fixed memory leak of WebSocket 2013-06-09 14:50:51 +08:00
James Chen 5c8d4378a6 Fixing compilation errors in TestLua for Win32. 2013-06-07 21:23:15 +08:00
samuele3hu 5986d3904d Merge branch 'master' of https://github.com/cocos2d/cocos2d-x into test_sample_of_http_bind 2013-06-07 10:14:12 +08:00
samuele3hu 66d4acc31a issue #2103 add webSocket lua test sample 2013-06-07 10:12:01 +08:00
samuele3hu e4ec801363 issue #2103 add webSocket lua test sample 2013-06-06 22:29:02 +08:00
James Chen f056757a9f Adding libwebsockets license in WebSocket.h/.cpp. 2013-06-06 14:16:57 +08:00
James Chen f2f0f031c7 fixed #1647: Renaming enumerations to Cocos2d-x style. ERROR and ERROR_TIMEOUT is defined as macros on Windows, fuck it. 2013-06-03 09:55:43 +08:00
James Chen 4b8f76c903 WS_ERROR -> ERROR, WS_STATE -> STATE. 2013-06-02 18:56:49 +08:00
James Chen cedb427a6e fixed #1647: Adding WebSocket support for Cpp and JSB.
Conflicts:
	extensions/proj.win32/libExtensions.vcxproj
	extensions/proj.win32/libExtensions.vcxproj.filters
2013-06-02 18:55:57 +08:00
James Chen ad340f0a32 fixed #2092: Make some function static. 2013-05-20 18:11:55 +08:00
James Chen af655ce965 fixed #2092: #define httpresponse_selector(_SELECTOR) (SEL_HttpResponse)(&_SELECTOR) --> #define httpresponse_selector(_SELECTOR) (cocos2d::extension::SEL_HttpResponse)(&_SELECTOR). 2013-05-20 17:48:21 +08:00
Carsten Sandtner 354a8408f6 Added getter and setter for raw header data 2013-05-13 16:57:07 +02:00
James Chen 7a472f7f5d Moving CC_DEPRECATED_ATTRIBUTE to the front of functions in HttpRequest.h 2013-05-08 11:32:09 +08:00