mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' into update-curl
Conflicts: build/cocos2d_tests.xcodeproj/project.pbxproj
This commit is contained in:
commit
62b1404213
|
@ -9,6 +9,7 @@ cocos2d-x-3.4beta0 ??
|
|||
[FIX] ui::Button: fix setTitleColor calls method setColor instead of setTextColor of title label.
|
||||
[FIX] FileUtils: WebP format with alpha channel displayed wrong
|
||||
[FIX] Label: content size of Label is incorrect if the string is set to empty string
|
||||
[FIX] GLProgramState: fix assert error caused by outdated uniform and attribute cache
|
||||
|
||||
cocos2d-x-3.3 Dec.12
|
||||
[FIX] Billboard: allow billboard rotate along z axis
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30723.0
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libcocos2d", "libcocos2d", "{B3F299D4-B4CA-4F0B-8BE2-FB328483BC13}"
|
||||
EndProject
|
||||
|
|
|
@ -704,7 +704,6 @@
|
|||
15AE1BAE19AADFDF00C27E9E /* UILayoutParameter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905F9FD18CF08D000240AA3 /* UILayoutParameter.h */; };
|
||||
15AE1BAF19AADFDF00C27E9E /* UILayoutManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29CB8F4A1929D1BB00C841D6 /* UILayoutManager.cpp */; };
|
||||
15AE1BB019AADFDF00C27E9E /* UILayoutManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CB8F4B1929D1BB00C841D6 /* UILayoutManager.h */; };
|
||||
15AE1BB119AADFEF00C27E9E /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5362180E3374000584C8 /* HttpClient.cpp */; };
|
||||
15AE1BB219AADFEF00C27E9E /* HttpClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5363180E3374000584C8 /* HttpClient.h */; };
|
||||
15AE1BB319AADFEF00C27E9E /* HttpRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5364180E3374000584C8 /* HttpRequest.h */; };
|
||||
15AE1BB419AADFEF00C27E9E /* HttpResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5365180E3374000584C8 /* HttpResponse.h */; };
|
||||
|
@ -712,7 +711,6 @@
|
|||
15AE1BB619AADFEF00C27E9E /* SocketIO.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5367180E3374000584C8 /* SocketIO.h */; };
|
||||
15AE1BB719AADFEF00C27E9E /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5368180E3374000584C8 /* WebSocket.cpp */; };
|
||||
15AE1BB819AADFEF00C27E9E /* WebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5369180E3374000584C8 /* WebSocket.h */; };
|
||||
15AE1BB919AADFF000C27E9E /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5362180E3374000584C8 /* HttpClient.cpp */; };
|
||||
15AE1BBA19AADFF000C27E9E /* HttpClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5363180E3374000584C8 /* HttpClient.h */; };
|
||||
15AE1BBB19AADFF000C27E9E /* HttpRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5364180E3374000584C8 /* HttpRequest.h */; };
|
||||
15AE1BBC19AADFF000C27E9E /* HttpResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5365180E3374000584C8 /* HttpResponse.h */; };
|
||||
|
@ -1754,6 +1752,12 @@
|
|||
50ED2BE519BEAF7900A0AB90 /* UIEditBoxImpl-win32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ED2BDE19BEAF7900A0AB90 /* UIEditBoxImpl-win32.cpp */; };
|
||||
50ED2BE619BEAF7900A0AB90 /* UIEditBoxImpl-wp8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ED2BDF19BEAF7900A0AB90 /* UIEditBoxImpl-wp8.cpp */; };
|
||||
50ED2BE719BEAF7900A0AB90 /* UIEditBoxImpl-wp8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ED2BDF19BEAF7900A0AB90 /* UIEditBoxImpl-wp8.cpp */; };
|
||||
52B47A1E1A53489B004E4C60 /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A1D1A53489B004E4C60 /* HttpClient.cpp */; };
|
||||
52B47A2E1A5349A3004E4C60 /* HttpAsynConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */; };
|
||||
52B47A2F1A5349A3004E4C60 /* HttpAsynConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */; };
|
||||
52B47A301A5349A3004E4C60 /* HttpClient-ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2B1A5349A3004E4C60 /* HttpClient-ios.mm */; };
|
||||
52B47A311A5349A3004E4C60 /* HttpCookie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */; };
|
||||
52B47A321A5349A3004E4C60 /* HttpCookie.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B47A2D1A5349A3004E4C60 /* HttpCookie.h */; };
|
||||
5E9F61261A3FFE3D0038DE01 /* CCFrustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E9F61221A3FFE3D0038DE01 /* CCFrustum.cpp */; };
|
||||
5E9F61271A3FFE3D0038DE01 /* CCFrustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E9F61221A3FFE3D0038DE01 /* CCFrustum.cpp */; };
|
||||
5E9F61281A3FFE3D0038DE01 /* CCFrustum.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E9F61231A3FFE3D0038DE01 /* CCFrustum.h */; };
|
||||
|
@ -2281,7 +2285,6 @@
|
|||
1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLBufferedNode.h; sourceTree = "<group>"; };
|
||||
1AAF5351180E3060000584C8 /* AssetsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AssetsManager.cpp; sourceTree = "<group>"; };
|
||||
1AAF5352180E3060000584C8 /* AssetsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssetsManager.h; sourceTree = "<group>"; };
|
||||
1AAF5362180E3374000584C8 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = "<group>"; };
|
||||
1AAF5363180E3374000584C8 /* HttpClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpClient.h; sourceTree = "<group>"; };
|
||||
1AAF5364180E3374000584C8 /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = "<group>"; };
|
||||
1AAF5365180E3374000584C8 /* HttpResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpResponse.h; sourceTree = "<group>"; };
|
||||
|
@ -2940,6 +2943,12 @@
|
|||
50FCEB9018C72017004AD434 /* WidgetReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WidgetReader.cpp; sourceTree = "<group>"; };
|
||||
50FCEB9118C72017004AD434 /* WidgetReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetReader.h; sourceTree = "<group>"; };
|
||||
50FCEB9218C72017004AD434 /* WidgetReaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetReaderProtocol.h; sourceTree = "<group>"; };
|
||||
52B47A1D1A53489B004E4C60 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = "<group>"; };
|
||||
52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpAsynConnection.h; sourceTree = "<group>"; };
|
||||
52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpAsynConnection.m; sourceTree = "<group>"; };
|
||||
52B47A2B1A5349A3004E4C60 /* HttpClient-ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "HttpClient-ios.mm"; sourceTree = "<group>"; };
|
||||
52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpCookie.cpp; sourceTree = "<group>"; };
|
||||
52B47A2D1A5349A3004E4C60 /* HttpCookie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpCookie.h; sourceTree = "<group>"; };
|
||||
5E9F61221A3FFE3D0038DE01 /* CCFrustum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFrustum.cpp; sourceTree = "<group>"; };
|
||||
5E9F61231A3FFE3D0038DE01 /* CCFrustum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFrustum.h; sourceTree = "<group>"; };
|
||||
5E9F61241A3FFE3D0038DE01 /* CCPlane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPlane.cpp; sourceTree = "<group>"; };
|
||||
|
@ -3921,7 +3930,12 @@
|
|||
1AAF5360180E3374000584C8 /* network */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1AAF5362180E3374000584C8 /* HttpClient.cpp */,
|
||||
52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */,
|
||||
52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */,
|
||||
52B47A2B1A5349A3004E4C60 /* HttpClient-ios.mm */,
|
||||
52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */,
|
||||
52B47A2D1A5349A3004E4C60 /* HttpCookie.h */,
|
||||
52B47A1D1A53489B004E4C60 /* HttpClient.cpp */,
|
||||
1AAF5363180E3374000584C8 /* HttpClient.h */,
|
||||
1AAF5364180E3374000584C8 /* HttpRequest.h */,
|
||||
1AAF5365180E3374000584C8 /* HttpResponse.h */,
|
||||
|
@ -6003,6 +6017,7 @@
|
|||
15AE1C1819AAE2C700C27E9E /* CCPhysicsSprite.h in Headers */,
|
||||
15AE1BC819AAE00000C27E9E /* AssetsManager.h in Headers */,
|
||||
B29A7E0419EE1B7700872B35 /* BoundingBoxAttachment.h in Headers */,
|
||||
52B47A2E1A5349A3004E4C60 /* HttpAsynConnection.h in Headers */,
|
||||
15AE1BBC19AADFF000C27E9E /* HttpResponse.h in Headers */,
|
||||
15AE186019AAD31200C27E9E /* SimpleAudioEngine_objc.h in Headers */,
|
||||
50ABBDA61925AB4100A911A9 /* CCQuadCommand.h in Headers */,
|
||||
|
@ -6087,6 +6102,7 @@
|
|||
5034CA2C191D591100CE6051 /* ccShader_PositionTextureA8Color.vert in Headers */,
|
||||
50ABBE981925AB6F00A911A9 /* CCProtocols.h in Headers */,
|
||||
50CB247A19D9C5A100687767 /* AudioEngine-inl.h in Headers */,
|
||||
52B47A321A5349A3004E4C60 /* HttpCookie.h in Headers */,
|
||||
50ABBD431925AB0000A911A9 /* CCMathBase.h in Headers */,
|
||||
15EFA214198A2BB5000C57D3 /* CCProtectedNode.h in Headers */,
|
||||
15AE194419AAD35100C27E9E /* CCComBase.h in Headers */,
|
||||
|
@ -6648,7 +6664,6 @@
|
|||
1A570296180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */,
|
||||
B29A7E1B19EE1B7700872B35 /* SkeletonJson.c in Sources */,
|
||||
50ABBE351925AB6F00A911A9 /* CCConsole.cpp in Sources */,
|
||||
15AE1BB119AADFEF00C27E9E /* HttpClient.cpp in Sources */,
|
||||
50ABBEAF1925AB6F00A911A9 /* CCUserDefault.cpp in Sources */,
|
||||
15AE1BCB19AAE01E00C27E9E /* CCControlButton.cpp in Sources */,
|
||||
50ABBE791925AB6F00A911A9 /* CCEventMouse.cpp in Sources */,
|
||||
|
@ -6720,6 +6735,7 @@
|
|||
50ABBEB31925AB6F00A911A9 /* CCUserDefault-apple.mm in Sources */,
|
||||
50ABBEB51925AB6F00A911A9 /* CCUserDefault-android.cpp in Sources */,
|
||||
5E9F61261A3FFE3D0038DE01 /* CCFrustum.cpp in Sources */,
|
||||
52B47A1E1A53489B004E4C60 /* HttpClient.cpp in Sources */,
|
||||
29394CF619B01DBA00D2DE1A /* UIWebViewImpl-ios.mm in Sources */,
|
||||
382383FC1A258FA7002C4610 /* idl_gen_text.cpp in Sources */,
|
||||
50ABBE831925AB6F00A911A9 /* ccFPSImages.c in Sources */,
|
||||
|
@ -6921,6 +6937,7 @@
|
|||
1A570072180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */,
|
||||
15AE1ABC19AAD40300C27E9E /* b2PolygonAndCircleContact.cpp in Sources */,
|
||||
15AE1ADA19AAD41000C27E9E /* b2Rope.cpp in Sources */,
|
||||
52B47A301A5349A3004E4C60 /* HttpClient-ios.mm in Sources */,
|
||||
B29A7E1619EE1B7700872B35 /* BoundingBoxAttachment.c in Sources */,
|
||||
382384081A25900F002C4610 /* FlatBuffersSerialize.cpp in Sources */,
|
||||
DABC9FAA19E7DFA900FA252C /* CCClippingRectangleNode.cpp in Sources */,
|
||||
|
@ -6977,7 +6994,6 @@
|
|||
B29A7E2619EE1B7700872B35 /* Attachment.c in Sources */,
|
||||
15AE18C119AAD33D00C27E9E /* CCLayerColorLoader.cpp in Sources */,
|
||||
B37510851823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp in Sources */,
|
||||
15AE1BB919AADFF000C27E9E /* HttpClient.cpp in Sources */,
|
||||
50ABBD551925AB0000A911A9 /* TransformUtils.cpp in Sources */,
|
||||
292DB14419B4574100A80320 /* UIEditBoxImpl-android.cpp in Sources */,
|
||||
15AE193619AAD35100C27E9E /* CCArmature.cpp in Sources */,
|
||||
|
@ -7231,6 +7247,7 @@
|
|||
50ABBD451925AB0000A911A9 /* CCVertex.cpp in Sources */,
|
||||
50ABBEB01925AB6F00A911A9 /* CCUserDefault.cpp in Sources */,
|
||||
50ABBE521925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */,
|
||||
52B47A2F1A5349A3004E4C60 /* HttpAsynConnection.m in Sources */,
|
||||
15AE1B8019AADA9A00C27E9E /* UITextAtlas.cpp in Sources */,
|
||||
15AE195919AAD35100C27E9E /* CCProcessBase.cpp in Sources */,
|
||||
15AE18D319AAD33D00C27E9E /* CCParticleSystemQuadLoader.cpp in Sources */,
|
||||
|
@ -7252,6 +7269,7 @@
|
|||
503DD8E71926736A00CD74DD /* CCEAGLView-ios.mm in Sources */,
|
||||
3E2BDAEC19C0436F0055CDCD /* AudioEngine.cpp in Sources */,
|
||||
382383F11A258FA7002C4610 /* flatc.cpp in Sources */,
|
||||
52B47A311A5349A3004E4C60 /* HttpCookie.cpp in Sources */,
|
||||
15B3707919EE414C00ABE682 /* AssetsManagerEx.cpp in Sources */,
|
||||
50ABBDA41925AB4100A911A9 /* CCQuadCommand.cpp in Sources */,
|
||||
15AE18C319AAD33D00C27E9E /* CCLayerGradientLoader.cpp in Sources */,
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
15427B7A198B87AA00DC375D /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; };
|
||||
15427B7D198B880100DC375D /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15427B7B198B880100DC375D /* lua_cocos2dx_controller_manual.cpp */; };
|
||||
156EAE071977D0BD00F53709 /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; };
|
||||
15AE17DB19A7235300C27E9E /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EE465A19A7200300AF29F1 /* libcurl.a */; };
|
||||
15AE17DC19A725A000C27E9E /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EE465A19A7200300AF29F1 /* libcurl.a */; };
|
||||
15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
|
||||
15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; };
|
||||
15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
|
||||
|
@ -85,6 +87,7 @@
|
|||
15CBA9ED196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA9EB196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp */; };
|
||||
15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; };
|
||||
15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; };
|
||||
15EE465B19A7200300AF29F1 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EE465A19A7200300AF29F1 /* libcurl.a */; };
|
||||
15EFA25B198A4A47000C57D3 /* libluacocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EFA258198A4A24000C57D3 /* libluacocos2d Mac.a */; };
|
||||
15EFA270198B25B9000C57D3 /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; };
|
||||
15EFA273198B265A000C57D3 /* libluacocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EFA258198A4A24000C57D3 /* libluacocos2d Mac.a */; };
|
||||
|
@ -94,6 +97,7 @@
|
|||
15EFA68D198B3AD8000C57D3 /* libluacocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EFA665198B33EE000C57D3 /* libluacocos2d iOS.a */; };
|
||||
1A0EE2A218CDF6DA004CD58F /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; };
|
||||
1A0EE2A518CDF6DA004CD58F /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };
|
||||
1A0EE2A618CDF6DA004CD58F /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };
|
||||
1A0EE2A718CDF6DA004CD58F /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };
|
||||
1A0EE2A818CDF6DA004CD58F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };
|
||||
1A0EE2A918CDF6DA004CD58F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };
|
||||
|
@ -102,6 +106,7 @@
|
|||
1A0EE2AC18CDF6DA004CD58F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };
|
||||
1A0EE2AD18CDF6DA004CD58F /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };
|
||||
1A0EE2AE18CDF6DA004CD58F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };
|
||||
1A0EE2C918CDF733004CD58F /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };
|
||||
1A0EE2CA18CDF733004CD58F /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA36018CD9AC00087CE3A /* libz.dylib */; };
|
||||
1A0EE2CB18CDF733004CD58F /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };
|
||||
1A0EE2CC18CDF733004CD58F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA28B18CD91510087CE3A /* Foundation.framework */; };
|
||||
|
@ -138,6 +143,7 @@
|
|||
1A221C9D191771E400FD2BE4 /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 1A221C9B191771E300FD2BE4 /* ccs-res */; };
|
||||
1A97AC001A1DC3E30076D9CC /* PerformanceMathTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A97ABFE1A1DC3E30076D9CC /* PerformanceMathTest.cpp */; };
|
||||
1A97AC011A1DC3E30076D9CC /* PerformanceMathTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A97ABFE1A1DC3E30076D9CC /* PerformanceMathTest.cpp */; };
|
||||
1A9F808D177E98A600D9A1CB /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };
|
||||
1AAF534D180E2F4E000584C8 /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; };
|
||||
1AAF5400180E39D4000584C8 /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; };
|
||||
1ABCA28718CD91510087CE3A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };
|
||||
|
@ -151,6 +157,7 @@
|
|||
1ABCA35E18CD9AA50087CE3A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA28B18CD91510087CE3A /* Foundation.framework */; };
|
||||
1ABCA35F18CD9AAE0087CE3A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };
|
||||
1ABCA36118CD9AC00087CE3A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA36018CD9AC00087CE3A /* libz.dylib */; };
|
||||
1ABCA36218CD9AC60087CE3A /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };
|
||||
1ABCA39D18CD9ED80087CE3A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA39C18CD9ED80087CE3A /* AVFoundation.framework */; };
|
||||
1ABCA39F18CD9EE50087CE3A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA39E18CD9EE50087CE3A /* UIKit.framework */; };
|
||||
1ABCA3A118CD9EF60087CE3A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA3A018CD9EF60087CE3A /* OpenGLES.framework */; };
|
||||
|
@ -786,6 +793,8 @@
|
|||
527B1F4119EFAD44000A1F82 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 527B1F3F19EFAD44000A1F82 /* Default-736h@3x.png */; };
|
||||
527B1F4419EFAE13000A1F82 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 527B1F4219EFAE13000A1F82 /* Default-667h@2x.png */; };
|
||||
527B1F4519EFAE13000A1F82 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 527B1F4319EFAE13000A1F82 /* Default-736h@3x.png */; };
|
||||
52B47A341A534B2B004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A331A534B2B004E4C60 /* Security.framework */; };
|
||||
52B47A351A53A43A004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A331A534B2B004E4C60 /* Security.framework */; };
|
||||
59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; };
|
||||
59620E901921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; };
|
||||
5EBEECB01995247000429821 /* DrawNode3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBEECAE1995247000429821 /* DrawNode3D.cpp */; };
|
||||
|
@ -1717,6 +1726,7 @@
|
|||
527B1F3F19EFAD44000A1F82 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = "<group>"; };
|
||||
527B1F4219EFAE13000A1F82 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = "<group>"; };
|
||||
527B1F4319EFAE13000A1F82 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = "<group>"; };
|
||||
52B47A331A534B2B004E4C60 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
|
||||
59620E8D1921E5CF002021B6 /* Bug-Child.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-Child.cpp"; sourceTree = "<group>"; };
|
||||
59620E8E1921E5CF002021B6 /* Bug-Child.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-Child.h"; sourceTree = "<group>"; };
|
||||
5EBEECAE1995247000429821 /* DrawNode3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawNode3D.cpp; path = Sprite3DTest/DrawNode3D.cpp; sourceTree = "<group>"; };
|
||||
|
@ -1773,6 +1783,7 @@
|
|||
files = (
|
||||
1A0EE2A218CDF6DA004CD58F /* libcocos2d Mac.a in Frameworks */,
|
||||
1A0EE2A518CDF6DA004CD58F /* IOKit.framework in Frameworks */,
|
||||
1A0EE2A618CDF6DA004CD58F /* libcurl.dylib in Frameworks */,
|
||||
1A0EE2A718CDF6DA004CD58F /* libz.dylib in Frameworks */,
|
||||
1A0EE2A818CDF6DA004CD58F /* Foundation.framework in Frameworks */,
|
||||
1A0EE2A918CDF6DA004CD58F /* AudioToolbox.framework in Frameworks */,
|
||||
|
@ -1790,6 +1801,7 @@
|
|||
files = (
|
||||
15EFA270198B25B9000C57D3 /* libcocos2d Mac.a in Frameworks */,
|
||||
15EFA25B198A4A47000C57D3 /* libluacocos2d Mac.a in Frameworks */,
|
||||
1A0EE2C918CDF733004CD58F /* libcurl.dylib in Frameworks */,
|
||||
1A0EE2CA18CDF733004CD58F /* libz.dylib in Frameworks */,
|
||||
1A0EE2CB18CDF733004CD58F /* IOKit.framework in Frameworks */,
|
||||
1A0EE2CC18CDF733004CD58F /* Foundation.framework in Frameworks */,
|
||||
|
@ -1824,6 +1836,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
15AE17DB19A7235300C27E9E /* libcurl.a in Frameworks */,
|
||||
15EFA68B198B3AD8000C57D3 /* libcocos2d iOS.a in Frameworks */,
|
||||
15EFA68D198B3AD8000C57D3 /* libluacocos2d iOS.a in Frameworks */,
|
||||
15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */,
|
||||
|
@ -1846,6 +1859,7 @@
|
|||
files = (
|
||||
15EFA273198B265A000C57D3 /* libluacocos2d Mac.a in Frameworks */,
|
||||
1ABCA2C318CD92420087CE3A /* libcocos2d Mac.a in Frameworks */,
|
||||
1ABCA36218CD9AC60087CE3A /* libcurl.dylib in Frameworks */,
|
||||
1ABCA36118CD9AC00087CE3A /* libz.dylib in Frameworks */,
|
||||
1ABCA35F18CD9AAE0087CE3A /* IOKit.framework in Frameworks */,
|
||||
1ABCA35E18CD9AA50087CE3A /* Foundation.framework in Frameworks */,
|
||||
|
@ -1862,6 +1876,8 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
52B47A351A53A43A004E4C60 /* Security.framework in Frameworks */,
|
||||
15AE17DC19A725A000C27E9E /* libcurl.a in Frameworks */,
|
||||
15EFA66F198B356E000C57D3 /* libluacocos2d iOS.a in Frameworks */,
|
||||
15EFA666198B34D7000C57D3 /* libcocos2d iOS.a in Frameworks */,
|
||||
15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */,
|
||||
|
@ -1884,6 +1900,7 @@
|
|||
files = (
|
||||
1AAF534D180E2F4E000584C8 /* libcocos2d Mac.a in Frameworks */,
|
||||
EDCC747F17C455FD007B692C /* IOKit.framework in Frameworks */,
|
||||
1A9F808D177E98A600D9A1CB /* libcurl.dylib in Frameworks */,
|
||||
15C6482F165F399D007D4F18 /* libz.dylib in Frameworks */,
|
||||
15C64833165F3AFD007D4F18 /* Foundation.framework in Frameworks */,
|
||||
15C6482D165F3988007D4F18 /* AudioToolbox.framework in Frameworks */,
|
||||
|
@ -1918,6 +1935,8 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
52B47A341A534B2B004E4C60 /* Security.framework in Frameworks */,
|
||||
15EE465B19A7200300AF29F1 /* libcurl.a in Frameworks */,
|
||||
3EA0FB66191B933000B170C8 /* MediaPlayer.framework in Frameworks */,
|
||||
1AAF5400180E39D4000584C8 /* libcocos2d iOS.a in Frameworks */,
|
||||
D60AE43417F7FFE100757E4B /* CoreMotion.framework in Frameworks */,
|
||||
|
@ -3662,6 +3681,7 @@
|
|||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52B47A331A534B2B004E4C60 /* Security.framework */,
|
||||
15EE465A19A7200300AF29F1 /* libcurl.a */,
|
||||
15CBA9DC196EEAA6005877BB /* libz.dylib */,
|
||||
15CBA9DA196EEA90005877BB /* CoreMotion.framework */,
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30723.0
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cocos2dShaderCompiler", "Cocos2dShaderCompiler.vcxproj", "{4F6DEF20-AC4C-487F-85B8-5993519E3911}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libcocos2d", "libcocos2d", "{29321038-F308-421E-B8CA-140BB23D3C6D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Shared", "..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems", "{5D6F020F-7E72-4494-90A0-2DF11D235DF9}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{ECA7A2AA-8501-4177-8360-322A569B6C3E}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Box2D", "Box2D", "{7CA66464-6A5E-493B-82EF-DBD84F91766F}"
|
||||
|
@ -23,14 +19,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Shared", "..\..\..
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Windows", "..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj", "{F3550FE0-C795-44F6-8FEB-093EB68143AE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Windows", "..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Windows\libcocos2d_8_1.Windows.vcxproj", "{9335005F-678E-4E8E-9B84-50037216AEC8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4
|
||||
..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9
|
||||
..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9
|
||||
..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9
|
||||
..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{3b26a12d-3a44-47ea-82d2-282660fc844d}*SharedItemsImports = 4
|
||||
..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{f3550fe0-c795-44f6-8feb-093eb68143ae}*SharedItemsImports = 4
|
||||
EndGlobalSection
|
||||
|
@ -85,30 +77,16 @@ Global
|
|||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.Build.0 = Release|x64
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.Build.0 = Debug|x64
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.Build.0 = Release|ARM
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.Build.0 = Release|Win32
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.ActiveCfg = Release|x64
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{5D6F020F-7E72-4494-90A0-2DF11D235DF9} = {29321038-F308-421E-B8CA-140BB23D3C6D}
|
||||
{7CA66464-6A5E-493B-82EF-DBD84F91766F} = {ECA7A2AA-8501-4177-8360-322A569B6C3E}
|
||||
{8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA} = {ECA7A2AA-8501-4177-8360-322A569B6C3E}
|
||||
{4A3C6BA8-C227-498B-AA21-40BDA27B461F} = {7CA66464-6A5E-493B-82EF-DBD84F91766F}
|
||||
{3B26A12D-3A44-47EA-82D2-282660FC844D} = {7CA66464-6A5E-493B-82EF-DBD84F91766F}
|
||||
{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE} = {8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA}
|
||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE} = {8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA}
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8} = {29321038-F308-421E-B8CA-140BB23D3C6D}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -286,8 +286,39 @@
|
|||
<ClInclude Include="..\..\..\cocos\2d\CCTransitionPageTurn.h" />
|
||||
<ClInclude Include="..\..\..\cocos\2d\CCTransitionProgress.h" />
|
||||
<ClInclude Include="..\..\..\cocos\2d\CCTweenFunction.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAABB.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimate3D.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimation3D.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimationCurve.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAttachNode.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCBillBoard.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCBundle3D.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCBundle3DData.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCBundleReader.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCFrustum.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCMesh.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCMeshSkin.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCMeshVertexIndexData.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCOBB.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCObjLoader.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCPlane.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCRay.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCSkeleton3D.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCSprite3D.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCSprite3DMaterial.h" />
|
||||
<ClInclude Include="..\..\..\cocos\3d\cocos3d.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorBase.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorDiagnostics.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorGlobal.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorMacros.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorMutex.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyDefault.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyFixedBlock.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyGlobalSmallBlock.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyPool.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\atitc.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\base64.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\CCAsyncTaskPool.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\CCAutoreleasePool.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\ccCArray.h" />
|
||||
<ClInclude Include="..\..\..\cocos\base\ccConfig.h" />
|
||||
|
@ -484,8 +515,30 @@
|
|||
<ClCompile Include="..\..\..\cocos\2d\CCTransitionPageTurn.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\2d\CCTransitionProgress.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\2d\CCTweenFunction.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCAABB.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCAnimate3D.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCAnimation3D.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCAttachNode.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCBillBoard.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCBundle3D.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCBundleReader.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCFrustum.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCMesh.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCMeshSkin.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCMeshVertexIndexData.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCOBB.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCObjLoader.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCPlane.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCRay.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCSkeleton3D.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCSprite3D.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCSprite3DMaterial.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorDiagnostics.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorGlobal.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorGlobalNewDelete.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\atitc.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\base64.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\CCAsyncTaskPool.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\CCAutoreleasePool.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\ccCArray.cpp" />
|
||||
<ClCompile Include="..\..\..\cocos\base\CCConfiguration.cpp" />
|
||||
|
@ -621,6 +674,7 @@
|
|||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="..\..\..\cocos\3d\CCAnimationCurve.inl" />
|
||||
<None Include="..\..\..\cocos\math\MathUtil.inl" />
|
||||
<None Include="Cocos2dShaderCompiler_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -59,6 +59,12 @@
|
|||
<Filter Include="libcoco2d\deprecated">
|
||||
<UniqueIdentifier>{e33e50a3-b742-4f4f-ae01-b233f27764c2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="libcoco2d\3d">
|
||||
<UniqueIdentifier>{bbb9abc2-fcf3-4341-8a22-20443e57d702}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="libcoco2d\base\allocator">
|
||||
<UniqueIdentifier>{50bc6348-a253-45c5-a2f2-160932464451}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml" />
|
||||
|
@ -583,6 +589,72 @@
|
|||
<ClCompile Include="..\..\..\cocos\2d\CCLight.cpp">
|
||||
<Filter>libcoco2d\2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCAABB.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCAnimate3D.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCAnimation3D.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCAttachNode.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCBillBoard.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCBundle3D.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCBundleReader.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCFrustum.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCMesh.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCMeshSkin.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCMeshVertexIndexData.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCOBB.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCObjLoader.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCPlane.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCRay.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCSkeleton3D.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCSprite3D.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\3d\CCSprite3DMaterial.cpp">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorDiagnostics.cpp">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorGlobal.cpp">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorGlobalNewDelete.cpp">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\cocos\base\CCAsyncTaskPool.cpp">
|
||||
<Filter>libcoco2d\base</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="App.xaml.h" />
|
||||
|
@ -1155,6 +1227,99 @@
|
|||
<ClInclude Include="..\..\..\cocos\2d\CCLight.h">
|
||||
<Filter>libcoco2d\2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAABB.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimate3D.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimation3D.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimationCurve.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCAttachNode.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCBillBoard.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCBundle3D.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCBundle3DData.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCBundleReader.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCFrustum.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCMesh.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCMeshSkin.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCMeshVertexIndexData.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCOBB.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCObjLoader.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCPlane.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCRay.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCSkeleton3D.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCSprite3D.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\CCSprite3DMaterial.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\3d\cocos3d.h">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorBase.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorDiagnostics.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorGlobal.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorMacros.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorMutex.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyDefault.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyFixedBlock.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyGlobalSmallBlock.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyPool.h">
|
||||
<Filter>libcoco2d\base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\cocos\base\CCAsyncTaskPool.h">
|
||||
<Filter>libcoco2d\base</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest" />
|
||||
|
@ -1166,6 +1331,9 @@
|
|||
<None Include="..\..\..\cocos\math\MathUtil.inl">
|
||||
<Filter>libcoco2d\math</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\cocos\3d\CCAnimationCurve.inl">
|
||||
<Filter>libcoco2d\3d</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="DirectXPage.xaml" />
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\..\external\unzip\ioapi_mem.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\..\external\unzip\unzip.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\..\external\xxhash\xxhash.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\3dExport.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCAABB.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCAnimate3D.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCAnimation3D.h" />
|
||||
|
@ -87,6 +86,15 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\audio\include\SimpleAudioEngine.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\audio\winrt\Audio.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\audio\winrt\MediaStreamer.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorBase.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorDiagnostics.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorGlobal.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorMacros.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorMutex.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorStrategyDefault.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorStrategyFixedBlock.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorStrategyGlobalSmallBlock.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorStrategyPool.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\atitc.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\base64.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCAsyncTaskPool.h" />
|
||||
|
@ -518,6 +526,9 @@
|
|||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorDiagnostics.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorGlobal.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorGlobalNewDelete.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\atitc.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\base64.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCAsyncTaskPool.cpp" />
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
<ItemGroup>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)targetver.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\cocos2d.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\3dExport.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCAABB.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
|
@ -1282,6 +1279,33 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\inet_pton_winrt.h">
|
||||
<Filter>platform\winrt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorBase.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorDiagnostics.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorGlobal.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorMacros.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorMutex.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorStrategyDefault.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorStrategyFixedBlock.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorStrategyGlobalSmallBlock.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorStrategyPool.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\cocos2d.cpp" />
|
||||
|
@ -2375,6 +2399,15 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\inet_pton_winrt.cpp">
|
||||
<Filter>platform\winrt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorDiagnostics.cpp">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorGlobal.cpp">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\allocator\CCAllocatorGlobalNewDelete.cpp">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="2d">
|
||||
|
@ -2611,6 +2644,9 @@
|
|||
<Filter Include="ui\shaders">
|
||||
<UniqueIdentifier>{10d3def7-52ba-4939-8de7-d9960a752f1e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="base\allocator">
|
||||
<UniqueIdentifier>{673ca2c5-2183-424e-a2aa-728cd5231b62}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="$(MSBuildThisFileDirectory)..\..\..\cocos2d.def" />
|
||||
|
|
|
@ -113,32 +113,32 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_Windows_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_Windows_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_Windows_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_Windows_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_Windows_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_Windows_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
|
|
@ -85,22 +85,22 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_WindowsPhone_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_WindowsPhone_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_WindowsPhone_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_WindowsPhone_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_WindowsPhone_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_WindowsPhone_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.3_WindowsPhone_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_WindowsPhone_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
|
|
@ -72,18 +72,18 @@
|
|||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<TargetName>libcocos2d_v3.3_WindowsPhone_8.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_WindowsPhone_8.0</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<TargetName>libcocos2d_v3.3_WindowsPhone_8.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_WindowsPhone_8.0</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<TargetName>libcocos2d_v3.3_WindowsPhone_8.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_WindowsPhone_8.0</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<TargetName>libcocos2d_v3.3_WindowsPhone_8.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.4_WindowsPhone_8.0</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -240,6 +240,15 @@
|
|||
<ClInclude Include="..\audio\include\SimpleAudioEngine.h" />
|
||||
<ClInclude Include="..\audio\wp8\Audio.h" />
|
||||
<ClInclude Include="..\audio\wp8\MediaStreamer.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorBase.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorDiagnostics.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorGlobal.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorMacros.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorMutex.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorStrategyDefault.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorStrategyFixedBlock.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorStrategyGlobalSmallBlock.h" />
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorStrategyPool.h" />
|
||||
<ClInclude Include="..\base\atitc.h" />
|
||||
<ClInclude Include="..\base\base64.h" />
|
||||
<ClInclude Include="..\base\CCAsyncTaskPool.h" />
|
||||
|
@ -721,6 +730,9 @@
|
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\base\allocator\CCAllocatorDiagnostics.cpp" />
|
||||
<ClCompile Include="..\base\allocator\CCAllocatorGlobal.cpp" />
|
||||
<ClCompile Include="..\base\allocator\CCAllocatorGlobalNewDelete.cpp" />
|
||||
<ClCompile Include="..\base\atitc.cpp" />
|
||||
<ClCompile Include="..\base\base64.cpp" />
|
||||
<ClCompile Include="..\base\CCAsyncTaskPool.cpp" />
|
||||
|
|
|
@ -248,6 +248,9 @@
|
|||
<Filter Include="ui\shaders">
|
||||
<UniqueIdentifier>{f6df0f43-3b03-4746-b786-4323895be3b1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="base\allocator">
|
||||
<UniqueIdentifier>{b870ea4f-2751-4a44-92f5-a7fb3b3672cb}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CCAction.cpp">
|
||||
|
@ -1335,6 +1338,15 @@
|
|||
<ClCompile Include="..\platform\winrt\inet_pton_winrt.cpp">
|
||||
<Filter>platform\winrt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\base\allocator\CCAllocatorDiagnostics.cpp">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\base\allocator\CCAllocatorGlobal.cpp">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\base\allocator\CCAllocatorGlobalNewDelete.cpp">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CCAction.h">
|
||||
|
@ -2592,6 +2604,33 @@
|
|||
<ClInclude Include="..\platform\winrt\inet_pton_winrt.h">
|
||||
<Filter>platform\winrt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorBase.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorDiagnostics.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorGlobal.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorMacros.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorMutex.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorStrategyDefault.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorStrategyFixedBlock.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorStrategyGlobalSmallBlock.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\allocator\CCAllocatorStrategyPool.h">
|
||||
<Filter>base\allocator</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\math\Mat4.inl">
|
||||
|
|
|
@ -87,6 +87,7 @@ static const char* TRANSLATION = "translation";
|
|||
static const char* ROTATION = "rotation";
|
||||
static const char* SCALE = "scale";
|
||||
static const char* KEYTIME = "keytime";
|
||||
static const char* AABBS = "aabb";
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -431,7 +432,22 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas)
|
|||
}
|
||||
meshData->subMeshIndices.push_back(indexArray);
|
||||
meshData->numIndex = (int)meshData->subMeshIndices.size();
|
||||
meshData->subMeshAABB.push_back(calculateAABB(meshData->vertex, meshData->getPerVertexSize(), indexArray));
|
||||
//meshData->subMeshAABB.push_back(calculateAABB(meshData->vertex, meshData->getPerVertexSize(), indexArray));
|
||||
if (_version != "0.3" && _version != "0.4" && _version != "0.5")
|
||||
{
|
||||
//read mesh aabb
|
||||
float aabb[6];
|
||||
if (_binaryReader.read(aabb, 4, 6) != 6)
|
||||
{
|
||||
CCLOG("warning: Failed to read meshdata: aabb '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
meshData->subMeshAABB.push_back(AABB(Vec3(aabb[0], aabb[1], aabb[2]), Vec3(aabb[3], aabb[4], aabb[5])));
|
||||
}
|
||||
else
|
||||
{
|
||||
meshData->subMeshAABB.push_back(calculateAABB(meshData->vertex, meshData->getPerVertexSize(), indexArray));
|
||||
}
|
||||
}
|
||||
meshdatas.meshDatas.push_back(meshData);
|
||||
}
|
||||
|
@ -710,7 +726,19 @@ bool Bundle3D::loadMeshDatasJson(MeshDatas& meshdatas)
|
|||
|
||||
meshData->subMeshIndices.push_back(indexArray);
|
||||
meshData->numIndex = (int)meshData->subMeshIndices.size();
|
||||
meshData->subMeshAABB.push_back(calculateAABB(meshData->vertex, meshData->getPerVertexSize(), indexArray));
|
||||
|
||||
//meshData->subMeshAABB.push_back(calculateAABB(meshData->vertex, meshData->getPerVertexSize(), indexArray));
|
||||
const rapidjson::Value& mesh_part_aabb = mesh_part[AABBS];
|
||||
if (mesh_part.HasMember(AABBS) && mesh_part_aabb.Size() == 6)
|
||||
{
|
||||
Vec3 min = Vec3(mesh_part_aabb[(rapidjson::SizeType)0].GetDouble(), mesh_part_aabb[(rapidjson::SizeType)1].GetDouble(), mesh_part_aabb[(rapidjson::SizeType)2].GetDouble());
|
||||
Vec3 max = Vec3(mesh_part_aabb[(rapidjson::SizeType)3].GetDouble(), mesh_part_aabb[(rapidjson::SizeType)4].GetDouble(), mesh_part_aabb[(rapidjson::SizeType)5].GetDouble());
|
||||
meshData->subMeshAABB.push_back(AABB(min, max));
|
||||
}
|
||||
else
|
||||
{
|
||||
meshData->subMeshAABB.push_back(calculateAABB(meshData->vertex, meshData->getPerVertexSize(), indexArray));
|
||||
}
|
||||
}
|
||||
meshdatas.meshDatas.push_back(meshData);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
WaitForSingleObject(m, INFINITE)
|
||||
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
|
||||
#define MUTEX_INIT(m) \
|
||||
m = OpenMutex(0, FALSE, 0)
|
||||
m = CreateMutexEx(NULL,FALSE,0,NULL);
|
||||
#define MUTEX_LOCK(m) \
|
||||
WaitForSingleObjectEx(m, INFINITE, false)
|
||||
#endif
|
||||
|
|
|
@ -5,7 +5,7 @@ LOCAL_MODULE := cocos_network_static
|
|||
|
||||
LOCAL_MODULE_FILENAME := libnetwork
|
||||
|
||||
LOCAL_SRC_FILES := HttpClient.cpp \
|
||||
LOCAL_SRC_FILES := HttpClient-android.cpp \
|
||||
SocketIO.cpp \
|
||||
WebSocket.cpp
|
||||
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#ifndef __HTTPASYNCONNECTION_H__
|
||||
#define __HTTPASYNCONNECTION_H__
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Security/Security.h>
|
||||
|
||||
@interface HttpAsynConnection : NSObject <NSURLConnectionDelegate, NSURLConnectionDataDelegate>
|
||||
{
|
||||
}
|
||||
|
||||
// The original URL to download. Due to redirects the actual content may come from another URL
|
||||
@property (strong) NSString *srcURL;
|
||||
|
||||
@property (strong) NSString *sslFile;
|
||||
|
||||
@property (strong) NSDictionary *responseHeader;
|
||||
|
||||
@property (strong) NSMutableData *responseData;
|
||||
|
||||
@property (readonly) NSInteger getDataTime;
|
||||
|
||||
@property (readonly) NSInteger responseCode;
|
||||
|
||||
@property (strong) NSError *responseError;
|
||||
|
||||
@property (strong) NSURLConnection *conn;
|
||||
|
||||
@property bool finish;
|
||||
|
||||
@property (strong) NSRunLoop *runLoop;
|
||||
|
||||
// instructs the class to start the request.
|
||||
-(void) startRequest:(NSURLRequest*)request;
|
||||
|
||||
@end
|
||||
|
||||
#endif //__HTTPASYNCONNECTION_H__
|
|
@ -0,0 +1,176 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#import "HttpAsynConnection.h"
|
||||
|
||||
@implementation HttpAsynConnection
|
||||
|
||||
@synthesize srcURL;
|
||||
@synthesize sslFile;
|
||||
@synthesize responseHeader;
|
||||
@synthesize responseData;
|
||||
@synthesize getDataTime;
|
||||
@synthesize responseCode;
|
||||
@synthesize responseError;
|
||||
@synthesize conn;
|
||||
@synthesize finish;
|
||||
@synthesize runLoop;
|
||||
|
||||
- (void) startRequest:(NSURLRequest *)request
|
||||
{
|
||||
NSLog(@"Starting to load %@", srcURL);
|
||||
finish = false;
|
||||
|
||||
responseData = [NSMutableData new];
|
||||
getDataTime = 0;
|
||||
responseError = nil;
|
||||
|
||||
// create the connection with the target request and this class as the delegate
|
||||
self.conn = [[NSURLConnection alloc] initWithRequest:request
|
||||
delegate:self
|
||||
startImmediately:NO];
|
||||
|
||||
[self.conn scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
|
||||
|
||||
// start the connection
|
||||
[self.conn start];
|
||||
}
|
||||
|
||||
#pragma mark NSURLConnectionDelegate methods
|
||||
/**
|
||||
* This delegate method is called when the NSURLConnection connects to the server. It contains the
|
||||
* NSURLResponse object with the headers returned by the server. This method may be called multiple times.
|
||||
* Therefore, it is important to reset the data on each call. Do not assume that it is the first call
|
||||
* of this method.
|
||||
**/
|
||||
- (void) connection:(NSURLConnection *)connection
|
||||
didReceiveResponse:(NSURLResponse *)response {
|
||||
NSLog(@"Received response from request to url %@", srcURL);
|
||||
|
||||
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
|
||||
//NSLog(@"All headers = %@", [httpResponse allHeaderFields]);
|
||||
responseHeader = [[httpResponse allHeaderFields] copy];
|
||||
|
||||
responseCode = httpResponse.statusCode;
|
||||
if (responseCode != 200)
|
||||
{// something went wrong, abort the whole thing
|
||||
|
||||
[connection cancel];
|
||||
finish = true;
|
||||
return;
|
||||
}
|
||||
|
||||
[responseData setLength:0];
|
||||
}
|
||||
|
||||
/**
|
||||
* This delegate method is called for each chunk of data received from the server. The chunk size
|
||||
* is dependent on the network type and the server configuration.
|
||||
*/
|
||||
- (void)connection:(NSURLConnection *)connection
|
||||
didReceiveData:(NSData *)data
|
||||
{
|
||||
//NSLog(@"get some data");
|
||||
[responseData appendData:data];
|
||||
getDataTime++;
|
||||
}
|
||||
|
||||
/**
|
||||
* This delegate methodis called if the connection cannot be established to the server.
|
||||
* The error object will have a description of the error
|
||||
**/
|
||||
- (void)connection:(NSURLConnection *)connection
|
||||
didFailWithError:(NSError *)error
|
||||
{
|
||||
//NSLog(@"Load failed with error %@", [error localizedDescription]);
|
||||
responseError = [error copy];
|
||||
|
||||
finish = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This delegate method is called when the data load is complete. The delegate will be released
|
||||
* following this call
|
||||
**/
|
||||
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
|
||||
{
|
||||
finish = true;
|
||||
}
|
||||
|
||||
//Server evaluates client's certificate
|
||||
- (BOOL) shouldTrustProtectionSpace:(NSURLProtectionSpace*)protectionSpace
|
||||
{
|
||||
if(sslFile == nil)
|
||||
return YES;
|
||||
//load the bundle client certificate
|
||||
NSString *certPath = [[NSBundle mainBundle] pathForResource:sslFile ofType:@"der"];
|
||||
NSData *certData = [[NSData alloc] initWithContentsOfFile:certPath];
|
||||
CFDataRef certDataRef = (CFDataRef)certData;
|
||||
SecCertificateRef cert = SecCertificateCreateWithData(NULL, certDataRef);
|
||||
|
||||
//Establish a chain of trust anchored on our bundled certificate
|
||||
CFArrayRef certArrayRef = CFArrayCreate(NULL, (void*)&cert, 1, NULL);
|
||||
SecTrustRef serverTrust = protectionSpace.serverTrust;
|
||||
SecTrustSetAnchorCertificates(serverTrust, certArrayRef);
|
||||
|
||||
//Verify that trust
|
||||
SecTrustResultType trustResult;
|
||||
SecTrustEvaluate(serverTrust, &trustResult);
|
||||
|
||||
if(trustResult == kSecTrustResultRecoverableTrustFailure)
|
||||
{
|
||||
CFDataRef errDataRef = SecTrustCopyExceptions(serverTrust);
|
||||
SecTrustSetExceptions(serverTrust, errDataRef);
|
||||
|
||||
SecTrustEvaluate(serverTrust, &trustResult);
|
||||
}
|
||||
|
||||
//Did our custom trust chain evaluate successfully?
|
||||
return trustResult = kSecTrustResultUnspecified || trustResult == kSecTrustResultProceed;
|
||||
}
|
||||
|
||||
- (void) connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
|
||||
{
|
||||
id <NSURLAuthenticationChallengeSender> sender = challenge.sender;
|
||||
NSURLProtectionSpace *protectionSpace = challenge.protectionSpace;
|
||||
|
||||
//Should server trust client?
|
||||
if([self shouldTrustProtectionSpace:protectionSpace])
|
||||
{
|
||||
SecTrustRef trust = [protectionSpace serverTrust];
|
||||
//
|
||||
// SecCertificateRef certificate = SecTrustGetCertificateAtIndex(trust, 0);
|
||||
//
|
||||
// NSData *serverCertificateData = (NSData*)SecCertificateCopyData(certificate);
|
||||
// NSString *serverCertificateDataHash = [[serverCertificateData base64EncodedString] ]
|
||||
NSURLCredential *credential = [NSURLCredential credentialForTrust:trust];
|
||||
[sender useCredential:credential forAuthenticationChallenge:challenge];
|
||||
}
|
||||
else
|
||||
{
|
||||
[sender cancelAuthenticationChallenge:challenge];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,972 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2012 greathqy
|
||||
Copyright (c) 2012 cocos2d-x.org
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "HttpClient.h"
|
||||
|
||||
#include <thread>
|
||||
#include <queue>
|
||||
#include <sstream>
|
||||
#include <condition_variable>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "base/CCVector.h"
|
||||
#include "base/CCDirector.h"
|
||||
#include "base/CCScheduler.h"
|
||||
|
||||
#include "platform/CCFileUtils.h"
|
||||
#include "platform/android/jni/JniHelper.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
namespace network {
|
||||
|
||||
typedef std::vector<std::string> HttpRequestHeaders;
|
||||
typedef HttpRequestHeaders::iterator HttpRequestHeadersIter;
|
||||
typedef std::vector<std::string> HttpCookies;
|
||||
typedef HttpCookies::iterator HttpCookiesIter;
|
||||
|
||||
static std::mutex s_requestQueueMutex;
|
||||
static std::mutex s_responseQueueMutex;
|
||||
static std::mutex s_cookieFileMutex;
|
||||
|
||||
static std::condition_variable_any s_sleepCondition;
|
||||
|
||||
static Vector<HttpRequest*>* s_requestQueue = nullptr;
|
||||
static Vector<HttpResponse*>* s_responseQueue = nullptr;
|
||||
|
||||
static HttpClient *s_httpClient = nullptr; // pointer to singleton
|
||||
|
||||
static std::string s_responseMessage = "";
|
||||
|
||||
static std::string s_cookieFilename = "";
|
||||
|
||||
static std::string s_sslCaFilename = "";
|
||||
|
||||
static HttpRequest *s_requestSentinel = new HttpRequest;
|
||||
|
||||
|
||||
struct CookiesInfo
|
||||
{
|
||||
std::string domain;
|
||||
bool tailmatch;
|
||||
std::string path;
|
||||
bool secure;
|
||||
std::string key;
|
||||
std::string value;
|
||||
std::string expires;
|
||||
};
|
||||
|
||||
//static size_t writeData(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
static size_t writeData(void* buffer, size_t sizes, HttpResponse* response)
|
||||
{
|
||||
std::vector<char> * recvBuffer = (std::vector<char>*)response->getResponseData();
|
||||
recvBuffer->clear();
|
||||
recvBuffer->insert(recvBuffer->end(), (char*)buffer, ((char*)buffer) + sizes);
|
||||
return sizes;
|
||||
}
|
||||
|
||||
//static size_t writeHeaderData(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
size_t writeHeaderData(void* buffer, size_t sizes,HttpResponse* response)
|
||||
{
|
||||
std::vector<char> * recvBuffer = (std::vector<char>*) response->getResponseHeader();
|
||||
recvBuffer->clear();
|
||||
recvBuffer->insert(recvBuffer->end(), (char*)buffer, (char*)buffer + sizes);
|
||||
return sizes;
|
||||
}
|
||||
|
||||
static void processResponse(HttpResponse* response, std::string& responseMessage);
|
||||
|
||||
class HttpURLConnection
|
||||
{
|
||||
public:
|
||||
HttpURLConnection():_httpURLConnection(nullptr),
|
||||
_requestmethod(""),
|
||||
_responseCookies(""),
|
||||
_cookieFileName(""),
|
||||
_contentLength(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
~HttpURLConnection()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void setRequestMethod(const char* method)
|
||||
{
|
||||
_requestmethod = method;
|
||||
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"setRequestMethod",
|
||||
"(Ljava/net/HttpURLConnection;Ljava/lang/String;)V"))
|
||||
{
|
||||
jstring jstr = methodInfo.env->NewStringUTF(_requestmethod.c_str());
|
||||
methodInfo.env->CallStaticVoidMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection, jstr);
|
||||
methodInfo.env->DeleteLocalRef(jstr);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
}
|
||||
|
||||
bool init(HttpRequest* request)
|
||||
{
|
||||
createHttpURLConnection(request->getUrl());
|
||||
if(!configure())
|
||||
return false;
|
||||
/* get custom header data (if set) */
|
||||
HttpRequestHeaders headers=request->getHeaders();
|
||||
if(!headers.empty())
|
||||
{
|
||||
/* append custom headers one by one */
|
||||
for (HttpRequestHeadersIter it = headers.begin(); it != headers.end(); ++it)
|
||||
{
|
||||
std::string val = *it;
|
||||
|
||||
int len = val.length();
|
||||
int pos = val.find(':');
|
||||
if (-1 == pos || pos >= len)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
std::string str1 = val.substr(0, pos);
|
||||
std::string str2 = val.substr(pos + 1, len - pos - 1);
|
||||
addRequestHeader(str1.c_str(), str2.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
addCookiesForRequestHeader();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int connect()
|
||||
{
|
||||
int suc = 0;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"connect",
|
||||
"(Ljava/net/HttpURLConnection;)I"))
|
||||
{
|
||||
suc = methodInfo.env->CallStaticIntMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
|
||||
return suc;
|
||||
}
|
||||
|
||||
void disconnect()
|
||||
{
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"disconnect",
|
||||
"(Ljava/net/HttpURLConnection;)V"))
|
||||
{
|
||||
methodInfo.env->CallStaticVoidMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
}
|
||||
|
||||
int getResponseCode()
|
||||
{
|
||||
int responseCode = 0;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"getResponseCode",
|
||||
"(Ljava/net/HttpURLConnection;)I"))
|
||||
{
|
||||
responseCode = methodInfo.env->CallStaticIntMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
|
||||
return responseCode;
|
||||
}
|
||||
|
||||
char* getResponseMessage()
|
||||
{
|
||||
char* message = nullptr;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"getResponseMessage",
|
||||
"(Ljava/net/HttpURLConnection;)Ljava/lang/String;"))
|
||||
{
|
||||
jobject jObj = methodInfo.env->CallStaticObjectMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection);
|
||||
message = getBufferFromJString((jstring)jObj, methodInfo.env);
|
||||
if (nullptr != jObj)
|
||||
{
|
||||
methodInfo.env->DeleteLocalRef(jObj);
|
||||
}
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
void sendRequest(HttpRequest* request)
|
||||
{
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"sendRequest",
|
||||
"(Ljava/net/HttpURLConnection;[B)V"))
|
||||
{
|
||||
|
||||
jbyteArray bytearray;
|
||||
ssize_t dataSize = request->getRequestDataSize();
|
||||
bytearray = methodInfo.env->NewByteArray(dataSize);
|
||||
methodInfo.env->SetByteArrayRegion(bytearray, 0, dataSize, (const jbyte*)request->getRequestData());
|
||||
methodInfo.env->CallStaticVoidMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection, bytearray);
|
||||
methodInfo.env->DeleteLocalRef(bytearray);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
}
|
||||
|
||||
size_t saveResponseCookies(const char* responseCookies, size_t count)
|
||||
{
|
||||
if (nullptr == responseCookies || strlen(responseCookies) == 0 || count == 0)
|
||||
return 0;
|
||||
|
||||
if (_cookieFileName.empty())
|
||||
{
|
||||
_cookieFileName = FileUtils::getInstance()->getWritablePath() + "cookieFile.txt";
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(s_cookieFileMutex);
|
||||
|
||||
FILE* fp = fopen(_cookieFileName.c_str(), "w");
|
||||
if (nullptr == fp)
|
||||
{
|
||||
CCLOG("can't create or open response cookie files");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fwrite(responseCookies, sizeof(char), count, fp);
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
char* getResponseHeaders()
|
||||
{
|
||||
char* headers = nullptr;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"getResponseHeaders",
|
||||
"(Ljava/net/HttpURLConnection;)Ljava/lang/String;"))
|
||||
{
|
||||
jobject jObj = methodInfo.env->CallStaticObjectMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection);
|
||||
headers = getBufferFromJString((jstring)jObj, methodInfo.env);
|
||||
if (nullptr != jObj) {
|
||||
methodInfo.env->DeleteLocalRef(jObj);
|
||||
}
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
|
||||
return headers;
|
||||
|
||||
}
|
||||
|
||||
char* getResponseContent(HttpResponse* response)
|
||||
{
|
||||
if (nullptr == response)
|
||||
return nullptr;
|
||||
|
||||
char* content = nullptr;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"getResponseContent",
|
||||
"(Ljava/net/HttpURLConnection;)[B"))
|
||||
{
|
||||
jobject jObj = methodInfo.env->CallStaticObjectMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection);
|
||||
|
||||
_contentLength = getCStrFromJByteArray((jbyteArray)jObj, methodInfo.env, &content);
|
||||
if (nullptr != jObj)
|
||||
{
|
||||
methodInfo.env->DeleteLocalRef(jObj);
|
||||
}
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
char* getResponseHeaderByKey(const char* key)
|
||||
{
|
||||
char* value = nullptr;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"getResponseHeaderByKey",
|
||||
"(Ljava/net/HttpURLConnection;Ljava/lang/String;)Ljava/lang/String;"))
|
||||
{
|
||||
jstring jstrKey = methodInfo.env->NewStringUTF(key);
|
||||
jobject jObj = methodInfo.env->CallStaticObjectMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection, jstrKey);
|
||||
value = getBufferFromJString((jstring)jObj, methodInfo.env);
|
||||
methodInfo.env->DeleteLocalRef(jstrKey);
|
||||
if (nullptr != jObj) {
|
||||
methodInfo.env->DeleteLocalRef(jObj);
|
||||
}
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
int getResponseHeaderByKeyInt(const char* key)
|
||||
{
|
||||
int contentLength = 0;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"getResponseHeaderByKeyInt",
|
||||
"(Ljava/net/HttpURLConnection;Ljava/lang/String;)I"))
|
||||
{
|
||||
jstring jstrKey = methodInfo.env->NewStringUTF(key);
|
||||
contentLength = methodInfo.env->CallStaticIntMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection, jstrKey);
|
||||
methodInfo.env->DeleteLocalRef(jstrKey);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
|
||||
return contentLength;
|
||||
}
|
||||
|
||||
char* getResponseHeaderByIdx(int idx)
|
||||
{
|
||||
char* header = nullptr;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"getResponseHeaderByIdx",
|
||||
"(Ljava/net/HttpURLConnection;I)Ljava/lang/String;"))
|
||||
{
|
||||
jobject jObj = methodInfo.env->CallStaticObjectMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection, idx);
|
||||
header = getBufferFromJString((jstring)jObj, methodInfo.env);
|
||||
if (nullptr != jObj) {
|
||||
methodInfo.env->DeleteLocalRef(jObj);
|
||||
}
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
||||
const std::string getCookieFileName()
|
||||
{
|
||||
return _cookieFileName;
|
||||
}
|
||||
|
||||
void setCookieFileName(std::string& filename)
|
||||
{
|
||||
_cookieFileName = filename;
|
||||
}
|
||||
|
||||
int getContentLength()
|
||||
{
|
||||
return _contentLength;
|
||||
}
|
||||
|
||||
private:
|
||||
void createHttpURLConnection(std::string url)
|
||||
{
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"createHttpURLConnection",
|
||||
"(Ljava/lang/String;)Ljava/net/HttpURLConnection;"))
|
||||
{
|
||||
_url = url;
|
||||
jstring jurl = methodInfo.env->NewStringUTF(url.c_str());
|
||||
jobject jObj = methodInfo.env->CallStaticObjectMethod(methodInfo.classID, methodInfo.methodID, jurl);
|
||||
_httpURLConnection = methodInfo.env->NewGlobalRef(jObj);
|
||||
methodInfo.env->DeleteLocalRef(jurl);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
}
|
||||
|
||||
void addRequestHeader(const char* key, const char* value)
|
||||
{
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"addRequestHeader",
|
||||
"(Ljava/net/HttpURLConnection;Ljava/lang/String;Ljava/lang/String;)V"))
|
||||
{
|
||||
jstring jstrKey = methodInfo.env->NewStringUTF(key);
|
||||
jstring jstrVal = methodInfo.env->NewStringUTF(value);
|
||||
methodInfo.env->CallStaticVoidMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection, jstrKey, jstrVal);
|
||||
methodInfo.env->DeleteLocalRef(jstrKey);
|
||||
methodInfo.env->DeleteLocalRef(jstrVal);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
}
|
||||
|
||||
void addCookiesForRequestHeader()
|
||||
{
|
||||
if(s_cookieFilename.empty())
|
||||
return;
|
||||
|
||||
_cookieFileName = FileUtils::getInstance()->fullPathForFilename(s_cookieFilename.c_str());
|
||||
|
||||
std::lock_guard<std::mutex> lock(s_cookieFileMutex);
|
||||
|
||||
std::string cookiesInfo = FileUtils::getInstance()->getStringFromFile(_cookieFileName.c_str());
|
||||
|
||||
if (cookiesInfo.empty())
|
||||
return;
|
||||
|
||||
HttpCookies cookiesVec;
|
||||
cookiesVec.clear();
|
||||
|
||||
std::stringstream stream(cookiesInfo);
|
||||
std::string item;
|
||||
while (std::getline(stream, item, '\n'))
|
||||
{
|
||||
cookiesVec.push_back(item);
|
||||
}
|
||||
|
||||
if (cookiesVec.empty())
|
||||
return;
|
||||
|
||||
HttpCookiesIter iter = cookiesVec.begin();
|
||||
|
||||
std::vector<CookiesInfo> cookiesInfoVec;
|
||||
cookiesInfoVec.clear();
|
||||
|
||||
for (; iter != cookiesVec.end(); iter++)
|
||||
{
|
||||
std::string cookies = *iter;
|
||||
if (cookies.find("#HttpOnly_") != std::string::npos)
|
||||
{
|
||||
cookies = cookies.substr(10);
|
||||
}
|
||||
|
||||
if(cookies.at(0) == '#')
|
||||
continue;
|
||||
|
||||
CookiesInfo co;
|
||||
std::stringstream streamInfo(cookies);
|
||||
std::string item;
|
||||
std::vector<std::string> elems;
|
||||
|
||||
while (std::getline(streamInfo, item, '\t'))
|
||||
{
|
||||
elems.push_back(item);
|
||||
}
|
||||
|
||||
co.domain = elems[0];
|
||||
if (co.domain.at(0) == '.')
|
||||
{
|
||||
co.domain = co.domain.substr(1);
|
||||
}
|
||||
co.tailmatch = strcmp("TRUE", elems.at(1).c_str())?true: false;
|
||||
co.path = elems.at(2);
|
||||
co.secure = strcmp("TRUE", elems.at(3).c_str())?true: false;
|
||||
co.expires = elems.at(4);
|
||||
co.key = elems.at(5);
|
||||
co.value = elems.at(6);
|
||||
cookiesInfoVec.push_back(co);
|
||||
}
|
||||
|
||||
std::vector<CookiesInfo>::iterator cookiesIter = cookiesInfoVec.begin();
|
||||
std::string sendCookiesInfo = "";
|
||||
int cookiesCount = 0;
|
||||
for (; cookiesIter != cookiesInfoVec.end(); cookiesIter++)
|
||||
{
|
||||
if (_url.find(cookiesIter->domain) != std::string::npos)
|
||||
{
|
||||
std::string keyValue = cookiesIter->key;
|
||||
keyValue.append("=");
|
||||
keyValue.append(cookiesIter->value);
|
||||
if (cookiesCount != 0)
|
||||
sendCookiesInfo.append(";");
|
||||
|
||||
sendCookiesInfo.append(keyValue);
|
||||
}
|
||||
cookiesCount++;
|
||||
}
|
||||
|
||||
//set Cookie
|
||||
addRequestHeader("Cookie",sendCookiesInfo.c_str());
|
||||
}
|
||||
|
||||
void setReadAndConnectTimeout(int readMiliseconds, int connectMiliseconds)
|
||||
{
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"setReadAndConnectTimeout",
|
||||
"(Ljava/net/HttpURLConnection;II)V"))
|
||||
{
|
||||
methodInfo.env->CallStaticVoidMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection, readMiliseconds, connectMiliseconds);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
}
|
||||
|
||||
void setVerifySSL()
|
||||
{
|
||||
if(s_sslCaFilename.empty())
|
||||
return;
|
||||
|
||||
std::string fullpath = FileUtils::getInstance()->fullPathForFilename(s_sslCaFilename.c_str());
|
||||
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
"org/cocos2dx/lib/Cocos2dxHttpURLConnection",
|
||||
"setVerifySSL",
|
||||
"(Ljava/net/HttpURLConnection;Ljava/lang/String;)V"))
|
||||
{
|
||||
jstring jstrfullpath = methodInfo.env->NewStringUTF(fullpath.c_str());
|
||||
methodInfo.env->CallStaticVoidMethod(
|
||||
methodInfo.classID, methodInfo.methodID, _httpURLConnection, jstrfullpath);
|
||||
methodInfo.env->DeleteLocalRef(jstrfullpath);
|
||||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
}
|
||||
}
|
||||
|
||||
bool configure()
|
||||
{
|
||||
if(nullptr == _httpURLConnection)
|
||||
return false;
|
||||
|
||||
HttpClient* instnace = HttpClient::getInstance();
|
||||
if(nullptr == instnace)
|
||||
return false;
|
||||
|
||||
setReadAndConnectTimeout(instnace->getTimeoutForRead(), instnace->getTimeoutForConnect());
|
||||
|
||||
setVerifySSL();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char* getBufferFromJString(jstring jstr, JNIEnv* env)
|
||||
{
|
||||
if (nullptr == jstr)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* str = nullptr;
|
||||
char* ret = nullptr;
|
||||
str = env->GetStringUTFChars(jstr, nullptr);
|
||||
if (nullptr != str)
|
||||
{
|
||||
ret = strdup(str);
|
||||
}
|
||||
|
||||
env->ReleaseStringUTFChars(jstr, str);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int getCStrFromJByteArray(jbyteArray jba, JNIEnv* env, char** ppData)
|
||||
{
|
||||
if (nullptr == jba)
|
||||
{
|
||||
*ppData = nullptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* str = nullptr;
|
||||
|
||||
int len = env->GetArrayLength(jba);
|
||||
str = (char*)malloc(sizeof(char)*len);
|
||||
env->GetByteArrayRegion(jba, 0, len, (jbyte*)str);
|
||||
|
||||
*ppData = str;
|
||||
return len;
|
||||
}
|
||||
|
||||
const std::string getCookieString()
|
||||
{
|
||||
return _responseCookies;
|
||||
}
|
||||
private:
|
||||
jobject _httpURLConnection;
|
||||
std::string _requestmethod;
|
||||
std::string _responseCookies;
|
||||
std::string _cookieFileName;
|
||||
std::string _url;
|
||||
int _contentLength;
|
||||
};
|
||||
|
||||
// Process Response
|
||||
static void processResponse(HttpResponse* response, std::string& responseMessage)
|
||||
{
|
||||
auto request = response->getHttpRequest();
|
||||
HttpRequest::Type requestType = request->getRequestType();
|
||||
|
||||
if (HttpRequest::Type::GET != requestType &&
|
||||
HttpRequest::Type::POST != requestType &&
|
||||
HttpRequest::Type::PUT != requestType &&
|
||||
HttpRequest::Type::DELETE != requestType)
|
||||
{
|
||||
CCASSERT(true, "CCHttpClient: unkown request type, only GET、POST、PUT、DELETE are supported");
|
||||
return;
|
||||
}
|
||||
|
||||
long responseCode = -1;
|
||||
int retValue = 0;
|
||||
|
||||
HttpURLConnection urlConnection;
|
||||
if(!urlConnection.init(request))
|
||||
{
|
||||
response->setSucceed(false);
|
||||
response->setErrorBuffer("HttpURLConnetcion init failed");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (requestType)
|
||||
{
|
||||
case HttpRequest::Type::GET:
|
||||
urlConnection.setRequestMethod("GET");
|
||||
break;
|
||||
|
||||
case HttpRequest::Type::POST:
|
||||
urlConnection.setRequestMethod("POST");
|
||||
break;
|
||||
|
||||
case HttpRequest::Type::PUT:
|
||||
urlConnection.setRequestMethod("PUT");
|
||||
break;
|
||||
|
||||
case HttpRequest::Type::DELETE:
|
||||
urlConnection.setRequestMethod("DELETE");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
int suc = urlConnection.connect();
|
||||
if (0 != suc)
|
||||
{
|
||||
response->setSucceed(false);
|
||||
response->setErrorBuffer("connect failed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (HttpRequest::Type::POST == requestType ||
|
||||
HttpRequest::Type::PUT == requestType)
|
||||
{
|
||||
urlConnection.sendRequest(request);
|
||||
}
|
||||
|
||||
responseCode = urlConnection.getResponseCode();
|
||||
|
||||
char* headers = urlConnection.getResponseHeaders();
|
||||
if (nullptr != headers)
|
||||
{
|
||||
writeHeaderData(headers, strlen(headers), response);
|
||||
}
|
||||
free(headers);
|
||||
|
||||
//get and save cookies
|
||||
char* cookiesInfo = urlConnection.getResponseHeaderByKey("set-cookie");
|
||||
if (nullptr != cookiesInfo)
|
||||
{
|
||||
urlConnection.saveResponseCookies(cookiesInfo, strlen(cookiesInfo));
|
||||
}
|
||||
free(cookiesInfo);
|
||||
|
||||
//content len
|
||||
int contentLength = urlConnection.getResponseHeaderByKeyInt("Content-Length");
|
||||
char* contentInfo = urlConnection.getResponseContent(response);
|
||||
if (nullptr != contentInfo) {
|
||||
// response->setResponseDataString(contentInfo, contentLength);
|
||||
std::vector<char> * recvBuffer = (std::vector<char>*)response->getResponseData();
|
||||
recvBuffer->clear();
|
||||
recvBuffer->insert(recvBuffer->begin(), (char*)contentInfo, ((char*)contentInfo) + urlConnection.getContentLength());
|
||||
}
|
||||
free(contentInfo);
|
||||
|
||||
responseMessage = urlConnection.getResponseMessage();
|
||||
urlConnection.disconnect();
|
||||
|
||||
// write data to HttpResponse
|
||||
response->setResponseCode(responseCode);
|
||||
|
||||
if (responseCode == -1)
|
||||
{
|
||||
response->setSucceed(false);
|
||||
response->setErrorBuffer(responseMessage.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
response->setSucceed(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Worker thread
|
||||
void HttpClient::networkThread()
|
||||
{
|
||||
auto scheduler = Director::getInstance()->getScheduler();
|
||||
|
||||
while (true)
|
||||
{
|
||||
HttpRequest *request;
|
||||
|
||||
// step 1: send http request if the requestQueue isn't empty
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(s_requestQueueMutex);
|
||||
while (s_requestQueue->empty()) {
|
||||
s_sleepCondition.wait(s_requestQueueMutex);
|
||||
}
|
||||
request = s_requestQueue->at(0);
|
||||
s_requestQueue->erase(0);
|
||||
}
|
||||
|
||||
if (request == s_requestSentinel) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Create a HttpResponse object, the default setting is http access failed
|
||||
HttpResponse *response = new (std::nothrow) HttpResponse(request);
|
||||
processResponse(response, s_responseMessage);
|
||||
|
||||
// add response packet into queue
|
||||
s_responseQueueMutex.lock();
|
||||
s_responseQueue->pushBack(response);
|
||||
s_responseQueueMutex.unlock();
|
||||
|
||||
if (nullptr != s_httpClient) {
|
||||
scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this));
|
||||
}
|
||||
}
|
||||
|
||||
// cleanup: if worker thread received quit signal, clean up un-completed request queue
|
||||
s_requestQueueMutex.lock();
|
||||
s_requestQueue->clear();
|
||||
s_requestQueueMutex.unlock();
|
||||
|
||||
|
||||
if (s_requestQueue != nullptr) {
|
||||
delete s_requestQueue;
|
||||
s_requestQueue = nullptr;
|
||||
delete s_responseQueue;
|
||||
s_responseQueue = nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Worker thread
|
||||
void HttpClient::networkThreadAlone(HttpRequest* request)
|
||||
{
|
||||
// Create a HttpResponse object, the default setting is http access failed
|
||||
HttpResponse *response = new (std::nothrow) HttpResponse(request);
|
||||
std::string responseMessage = "";
|
||||
processResponse(response, responseMessage);
|
||||
|
||||
auto scheduler = Director::getInstance()->getScheduler();
|
||||
scheduler->performFunctionInCocosThread([response, request]{
|
||||
const ccHttpRequestCallback& callback = request->getCallback();
|
||||
Ref* pTarget = request->getTarget();
|
||||
SEL_HttpResponse pSelector = request->getSelector();
|
||||
|
||||
if (callback != nullptr)
|
||||
{
|
||||
callback(s_httpClient, response);
|
||||
}
|
||||
else if (pTarget && pSelector)
|
||||
{
|
||||
(pTarget->*pSelector)(s_httpClient, response);
|
||||
}
|
||||
response->release();
|
||||
// do not release in other thread
|
||||
request->release();
|
||||
});
|
||||
}
|
||||
|
||||
// HttpClient implementation
|
||||
HttpClient* HttpClient::getInstance()
|
||||
{
|
||||
if (s_httpClient == nullptr) {
|
||||
s_httpClient = new (std::nothrow) HttpClient();
|
||||
}
|
||||
|
||||
return s_httpClient;
|
||||
}
|
||||
|
||||
void HttpClient::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(s_httpClient);
|
||||
}
|
||||
|
||||
void HttpClient::enableCookies(const char* cookieFile) {
|
||||
if (cookieFile) {
|
||||
s_cookieFilename = std::string(cookieFile);
|
||||
}
|
||||
else {
|
||||
s_cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt");
|
||||
}
|
||||
}
|
||||
|
||||
void HttpClient::setSSLVerification(const std::string& caFile)
|
||||
{
|
||||
s_sslCaFilename = caFile;
|
||||
}
|
||||
|
||||
HttpClient::HttpClient()
|
||||
: _timeoutForConnect(30*1000)
|
||||
, _timeoutForRead(60*1000)
|
||||
{
|
||||
}
|
||||
|
||||
HttpClient::~HttpClient()
|
||||
{
|
||||
if (s_requestQueue != nullptr) {
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(s_requestQueueMutex);
|
||||
s_requestQueue->pushBack(s_requestSentinel);
|
||||
}
|
||||
s_sleepCondition.notify_one();
|
||||
}
|
||||
|
||||
s_httpClient = nullptr;
|
||||
}
|
||||
|
||||
//Lazy create semaphore & mutex & thread
|
||||
bool HttpClient::lazyInitThreadSemphore()
|
||||
{
|
||||
if (s_requestQueue != nullptr) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
s_requestQueue = new (std::nothrow) Vector<HttpRequest*>();
|
||||
s_responseQueue = new (std::nothrow) Vector<HttpResponse*>();
|
||||
|
||||
auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this));
|
||||
t.detach();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Add a get task to queue
|
||||
void HttpClient::send(HttpRequest* request)
|
||||
{
|
||||
if (false == lazyInitThreadSemphore())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!request)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
request->retain();
|
||||
|
||||
if (nullptr != s_requestQueue) {
|
||||
s_requestQueueMutex.lock();
|
||||
s_requestQueue->pushBack(request);
|
||||
s_requestQueueMutex.unlock();
|
||||
|
||||
// Notify thread start to work
|
||||
s_sleepCondition.notify_one();
|
||||
}
|
||||
}
|
||||
|
||||
void HttpClient::sendImmediate(HttpRequest* request)
|
||||
{
|
||||
if(!request)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
request->retain();
|
||||
auto t = std::thread(&HttpClient::networkThreadAlone, this, request);
|
||||
t.detach();
|
||||
}
|
||||
|
||||
// Poll and notify main thread if responses exists in queue
|
||||
void HttpClient::dispatchResponseCallbacks()
|
||||
{
|
||||
// log("CCHttpClient::dispatchResponseCallbacks is running");
|
||||
//occurs when cocos thread fires but the network thread has already quited
|
||||
if (nullptr == s_responseQueue) {
|
||||
return;
|
||||
}
|
||||
HttpResponse* response = nullptr;
|
||||
|
||||
s_responseQueueMutex.lock();
|
||||
|
||||
if (!s_responseQueue->empty())
|
||||
{
|
||||
response = s_responseQueue->at(0);
|
||||
s_responseQueue->erase(0);
|
||||
}
|
||||
|
||||
s_responseQueueMutex.unlock();
|
||||
|
||||
if (response)
|
||||
{
|
||||
HttpRequest *request = response->getHttpRequest();
|
||||
const ccHttpRequestCallback& callback = request->getCallback();
|
||||
Ref* pTarget = request->getTarget();
|
||||
SEL_HttpResponse pSelector = request->getSelector();
|
||||
|
||||
if (callback != nullptr)
|
||||
{
|
||||
callback(this, response);
|
||||
}
|
||||
else if (pTarget && pSelector)
|
||||
{
|
||||
(pTarget->*pSelector)(this, response);
|
||||
}
|
||||
|
||||
response->release();
|
||||
// do not release in other thread
|
||||
request->release();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
|
|
@ -0,0 +1,516 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2012 greathqy
|
||||
Copyright (c) 2012 cocos2d-x.org
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "HttpClient.h"
|
||||
|
||||
#include <thread>
|
||||
#include <queue>
|
||||
#include <condition_variable>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#import "HttpAsynConnection.h"
|
||||
#include "HttpCookie.h"
|
||||
|
||||
#include "base/CCVector.h"
|
||||
#include "base/CCDirector.h"
|
||||
#include "base/CCScheduler.h"
|
||||
|
||||
#include "platform/CCFileUtils.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
#define ERROR_SIZE 256
|
||||
|
||||
namespace network {
|
||||
|
||||
static std::mutex s_requestQueueMutex;
|
||||
static std::mutex s_responseQueueMutex;
|
||||
|
||||
static std::condition_variable_any s_SleepCondition;
|
||||
|
||||
static Vector<HttpRequest*>* s_requestQueue = nullptr;
|
||||
static Vector<HttpResponse*>* s_responseQueue = nullptr;
|
||||
|
||||
static HttpClient *s_pHttpClient = nullptr; // pointer to singleton
|
||||
|
||||
static HttpAsynConnection *httpAsynConn = nullptr;
|
||||
static HttpCookie *s_cookie = nullptr;
|
||||
|
||||
static char s_errorBuffer[ERROR_SIZE] = {0};
|
||||
|
||||
static std::string s_cookieFilename = "";
|
||||
|
||||
static std::string s_sslCaFilename = "";
|
||||
|
||||
|
||||
static int processTask(HttpRequest *request, NSString *requestType, void *stream, long *errorCode, void *headerStream, char *errorBuffer);
|
||||
|
||||
static void processResponse(HttpResponse* response, char* errorBuffer);
|
||||
|
||||
static HttpRequest *s_requestSentinel = new HttpRequest;
|
||||
|
||||
// Worker thread
|
||||
void HttpClient::networkThread()
|
||||
{
|
||||
auto scheduler = Director::getInstance()->getScheduler();
|
||||
|
||||
while (true)
|
||||
{
|
||||
HttpRequest *request;
|
||||
|
||||
// step 1: send http request if the requestQueue isn't empty
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(s_requestQueueMutex);
|
||||
while (s_requestQueue->empty()) {
|
||||
s_SleepCondition.wait(s_requestQueueMutex);
|
||||
}
|
||||
request = s_requestQueue->at(0);
|
||||
s_requestQueue->erase(0);
|
||||
}
|
||||
|
||||
if (request == s_requestSentinel) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Create a HttpResponse object, the default setting is http access failed
|
||||
HttpResponse *response = new (std::nothrow) HttpResponse(request);
|
||||
|
||||
processResponse(response, s_errorBuffer);
|
||||
|
||||
// add response packet into queue
|
||||
s_responseQueueMutex.lock();
|
||||
s_responseQueue->pushBack(response);
|
||||
s_responseQueueMutex.unlock();
|
||||
|
||||
if (nullptr != s_pHttpClient) {
|
||||
scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this));
|
||||
}
|
||||
}
|
||||
|
||||
// cleanup: if worker thread received quit signal, clean up un-completed request queue
|
||||
s_requestQueueMutex.lock();
|
||||
s_requestQueue->clear();
|
||||
s_requestQueueMutex.unlock();
|
||||
|
||||
|
||||
if (s_requestQueue != nullptr) {
|
||||
delete s_requestQueue;
|
||||
s_requestQueue = nullptr;
|
||||
delete s_responseQueue;
|
||||
s_responseQueue = nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Worker thread
|
||||
void HttpClient::networkThreadAlone(HttpRequest* request)
|
||||
{
|
||||
// Create a HttpResponse object, the default setting is http access failed
|
||||
HttpResponse *response = new (std::nothrow) HttpResponse(request);
|
||||
char errorBuffer[ERROR_SIZE] = { 0 };
|
||||
processResponse(response, errorBuffer);
|
||||
|
||||
auto scheduler = Director::getInstance()->getScheduler();
|
||||
scheduler->performFunctionInCocosThread([response, request]{
|
||||
const ccHttpRequestCallback& callback = request->getCallback();
|
||||
Ref* pTarget = request->getTarget();
|
||||
SEL_HttpResponse pSelector = request->getSelector();
|
||||
|
||||
if (callback != nullptr)
|
||||
{
|
||||
callback(s_pHttpClient, response);
|
||||
}
|
||||
else if (pTarget && pSelector)
|
||||
{
|
||||
(pTarget->*pSelector)(s_pHttpClient, response);
|
||||
}
|
||||
response->release();
|
||||
// do not release in other thread
|
||||
request->release();
|
||||
});
|
||||
}
|
||||
|
||||
//Process Request
|
||||
static int processTask(HttpRequest *request, NSString* requestType, void *stream, long *responseCode, void *headerStream, char *errorBuffer)
|
||||
{
|
||||
//create request with url
|
||||
NSString* urlstring = [NSString stringWithUTF8String:request->getUrl()];
|
||||
NSURL *url = [NSURL URLWithString:urlstring];
|
||||
|
||||
NSMutableURLRequest *nsrequest = [NSMutableURLRequest requestWithURL:url
|
||||
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
|
||||
timeoutInterval:HttpClient::getInstance()->getTimeoutForConnect()];
|
||||
|
||||
//set request type
|
||||
[nsrequest setHTTPMethod:requestType];
|
||||
|
||||
//if request type is post or put,set header and data
|
||||
if([requestType isEqual: @"POST"] || [requestType isEqual: @"PUT"])
|
||||
{
|
||||
/* get custom header data (if set) */
|
||||
std::vector<std::string> headers=request->getHeaders();
|
||||
if(!headers.empty())
|
||||
{
|
||||
/* append custom headers one by one */
|
||||
for (std::vector<std::string>::iterator it = headers.begin(); it != headers.end(); ++it)
|
||||
{
|
||||
unsigned long i = it->find(':', 0);
|
||||
unsigned long length = it->size();
|
||||
std::string field = it->substr(0, i);
|
||||
std::string value = it->substr(i+1, length-i);
|
||||
NSString *headerField = [NSString stringWithUTF8String:field.c_str()];
|
||||
NSString *headerValue = [NSString stringWithUTF8String:value.c_str()];
|
||||
[nsrequest setValue:headerValue forHTTPHeaderField:headerField];
|
||||
}
|
||||
}
|
||||
|
||||
NSString* requestData = [NSString stringWithUTF8String:request->getRequestData()];
|
||||
NSData *postData = [requestData dataUsingEncoding:NSUTF8StringEncoding];
|
||||
[nsrequest setHTTPBody:postData];
|
||||
}
|
||||
|
||||
//read cookie propertities from file and set cookie
|
||||
if(!s_cookieFilename.empty())
|
||||
{
|
||||
const CookiesInfo* cookieInfo = s_cookie->getMatchCookie(request->getUrl());
|
||||
if(cookieInfo != nullptr)
|
||||
{
|
||||
NSString *domain = [NSString stringWithCString:cookieInfo->domain.c_str() encoding:[NSString defaultCStringEncoding]];
|
||||
NSString *path = [NSString stringWithCString:cookieInfo->path.c_str() encoding:[NSString defaultCStringEncoding]];
|
||||
NSString *value = [NSString stringWithCString:cookieInfo->value.c_str() encoding:[NSString defaultCStringEncoding]];
|
||||
NSString *name = [NSString stringWithCString:cookieInfo->name.c_str() encoding:[NSString defaultCStringEncoding]];
|
||||
|
||||
// create the properties for a cookie
|
||||
NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys: name,NSHTTPCookieName,
|
||||
value, NSHTTPCookieValue, path, NSHTTPCookiePath,
|
||||
domain, NSHTTPCookieDomain,
|
||||
nil];
|
||||
|
||||
// create the cookie from the properties
|
||||
NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:properties];
|
||||
|
||||
// add the cookie to the cookie storage
|
||||
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];
|
||||
}
|
||||
}
|
||||
|
||||
httpAsynConn = [HttpAsynConnection new];
|
||||
httpAsynConn.srcURL = urlstring;
|
||||
httpAsynConn.sslFile = nil;
|
||||
NSString *sslFile = nil;
|
||||
if(!s_sslCaFilename.empty())
|
||||
{
|
||||
long len = s_sslCaFilename.length();
|
||||
long pos = s_sslCaFilename.rfind('.', len-1);
|
||||
[sslFile initWithUTF8String:s_sslCaFilename.substr(0, pos-1).c_str()];
|
||||
httpAsynConn.sslFile = sslFile;
|
||||
}
|
||||
[httpAsynConn startRequest:nsrequest];
|
||||
|
||||
while( httpAsynConn.finish != true)
|
||||
{
|
||||
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
|
||||
}
|
||||
|
||||
//if http connection return error
|
||||
if (httpAsynConn.responseError != nil)
|
||||
{
|
||||
NSString* errorString = [httpAsynConn.responseError localizedDescription];
|
||||
strcpy(errorBuffer, [errorString UTF8String]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*responseCode = httpAsynConn.responseCode;
|
||||
|
||||
//add cookie to cookies vector
|
||||
if(!s_cookieFilename.empty())
|
||||
{
|
||||
NSArray *cookies = [NSHTTPCookie cookiesWithResponseHeaderFields:httpAsynConn.responseHeader forURL:url];
|
||||
for (NSHTTPCookie *cookie in cookies)
|
||||
{
|
||||
//NSLog(@"Cookie: %@", cookie);
|
||||
NSString *domain = cookie.domain;
|
||||
//BOOL session = cookie.sessionOnly;
|
||||
NSString *path = cookie.path;
|
||||
BOOL secure = cookie.secure;
|
||||
NSDate *date = cookie.expiresDate;
|
||||
NSString *name = cookie.name;
|
||||
NSString *value = cookie.value;
|
||||
|
||||
CookiesInfo cookieInfo;
|
||||
cookieInfo.domain = [domain cStringUsingEncoding: NSUTF8StringEncoding];
|
||||
cookieInfo.path = [path cStringUsingEncoding: NSUTF8StringEncoding];
|
||||
cookieInfo.secure = (secure == YES) ? true : false;
|
||||
cookieInfo.expires = [[NSString stringWithFormat:@"%ld", (long)[date timeIntervalSince1970]] cStringUsingEncoding: NSUTF8StringEncoding];
|
||||
cookieInfo.name = [name cStringUsingEncoding: NSUTF8StringEncoding];
|
||||
cookieInfo.value = [value cStringUsingEncoding: NSUTF8StringEncoding];
|
||||
cookieInfo.tailmatch = true;
|
||||
|
||||
s_cookie->updateOrAddCookie(&cookieInfo);
|
||||
}
|
||||
}
|
||||
|
||||
//handle response header
|
||||
NSMutableString *header = [NSMutableString new];
|
||||
for (id key in httpAsynConn.responseHeader)
|
||||
{
|
||||
[header appendFormat:@"%@: %@\n", key, [httpAsynConn.responseHeader objectForKey:key]];
|
||||
}
|
||||
if (header.length > 0)
|
||||
{
|
||||
NSRange range = NSMakeRange(header.length-1, 1);
|
||||
[header deleteCharactersInRange:range];
|
||||
}
|
||||
NSData *headerData = [header dataUsingEncoding:NSUTF8StringEncoding];
|
||||
std::vector<char> *headerBuffer = (std::vector<char>*)headerStream;
|
||||
const void* headerptr = [headerData bytes];
|
||||
long headerlen = [headerData length];
|
||||
headerBuffer->insert(headerBuffer->end(), (char*)headerptr, (char*)headerptr+headerlen);
|
||||
|
||||
//handle response data
|
||||
std::vector<char> *recvBuffer = (std::vector<char>*)stream;
|
||||
const void* ptr = [httpAsynConn.responseData bytes];
|
||||
long len = [httpAsynConn.responseData length];
|
||||
recvBuffer->insert(recvBuffer->end(), (char*)ptr, (char*)ptr+len);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Process Response
|
||||
static void processResponse(HttpResponse* response, char* errorBuffer)
|
||||
{
|
||||
auto request = response->getHttpRequest();
|
||||
long responseCode = -1;
|
||||
int retValue = 0;
|
||||
NSString* requestType = nil;
|
||||
|
||||
// Process the request -> get response packet
|
||||
switch (request->getRequestType())
|
||||
{
|
||||
case HttpRequest::Type::GET: // HTTP GET
|
||||
requestType = @"GET";
|
||||
break;
|
||||
|
||||
case HttpRequest::Type::POST: // HTTP POST
|
||||
requestType = @"POST";
|
||||
break;
|
||||
|
||||
case HttpRequest::Type::PUT:
|
||||
requestType = @"PUT";
|
||||
break;
|
||||
|
||||
case HttpRequest::Type::DELETE:
|
||||
requestType = @"DELETE";
|
||||
break;
|
||||
|
||||
default:
|
||||
CCASSERT(true, "CCHttpClient: unkown request type, only GET and POSt are supported");
|
||||
break;
|
||||
}
|
||||
|
||||
retValue = processTask(request,
|
||||
requestType,
|
||||
response->getResponseData(),
|
||||
&responseCode,
|
||||
response->getResponseHeader(),
|
||||
errorBuffer);
|
||||
|
||||
// write data to HttpResponse
|
||||
response->setResponseCode(responseCode);
|
||||
|
||||
if (retValue != 0)
|
||||
{
|
||||
response->setSucceed(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
response->setSucceed(false);
|
||||
response->setErrorBuffer(errorBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
// HttpClient implementation
|
||||
HttpClient* HttpClient::getInstance()
|
||||
{
|
||||
if (s_pHttpClient == nullptr) {
|
||||
s_pHttpClient = new (std::nothrow) HttpClient();
|
||||
}
|
||||
|
||||
return s_pHttpClient;
|
||||
}
|
||||
|
||||
void HttpClient::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(s_pHttpClient);
|
||||
}
|
||||
|
||||
void HttpClient::enableCookies(const char* cookieFile) {
|
||||
if (cookieFile) {
|
||||
s_cookieFilename = std::string(cookieFile);
|
||||
s_cookieFilename = FileUtils::getInstance()->fullPathForFilename(s_cookieFilename);
|
||||
}
|
||||
else {
|
||||
s_cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt");
|
||||
}
|
||||
|
||||
s_cookie = new(std::nothrow)HttpCookie;
|
||||
s_cookie->setCookieFileName(s_cookieFilename);
|
||||
s_cookie->readFile();
|
||||
}
|
||||
|
||||
void HttpClient::setSSLVerification(const std::string& caFile)
|
||||
{
|
||||
s_sslCaFilename = caFile;
|
||||
}
|
||||
|
||||
HttpClient::HttpClient()
|
||||
: _timeoutForConnect(30)
|
||||
, _timeoutForRead(60)
|
||||
{
|
||||
}
|
||||
|
||||
HttpClient::~HttpClient()
|
||||
{
|
||||
if (s_requestQueue != nullptr) {
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(s_requestQueueMutex);
|
||||
s_requestQueue->pushBack(s_requestSentinel);
|
||||
}
|
||||
s_SleepCondition.notify_one();
|
||||
}
|
||||
|
||||
s_pHttpClient = nullptr;
|
||||
|
||||
if(!s_cookieFilename.empty())
|
||||
{
|
||||
s_cookie->writeFile();
|
||||
//delete s_cookie;
|
||||
}
|
||||
//s_cookie = nullptr;
|
||||
}
|
||||
|
||||
//Lazy create semaphore & mutex & thread
|
||||
bool HttpClient::lazyInitThreadSemphore()
|
||||
{
|
||||
if (s_requestQueue != nullptr) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
s_requestQueue = new (std::nothrow) Vector<HttpRequest*>();
|
||||
s_responseQueue = new (std::nothrow) Vector<HttpResponse*>();
|
||||
|
||||
auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this));
|
||||
t.detach();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Add a get task to queue
|
||||
void HttpClient::send(HttpRequest* request)
|
||||
{
|
||||
if (false == lazyInitThreadSemphore())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!request)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
request->retain();
|
||||
|
||||
if (nullptr != s_requestQueue) {
|
||||
s_requestQueueMutex.lock();
|
||||
s_requestQueue->pushBack(request);
|
||||
s_requestQueueMutex.unlock();
|
||||
|
||||
// Notify thread start to work
|
||||
s_SleepCondition.notify_one();
|
||||
}
|
||||
}
|
||||
|
||||
void HttpClient::sendImmediate(HttpRequest* request)
|
||||
{
|
||||
if(!request)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
request->retain();
|
||||
auto t = std::thread(&HttpClient::networkThreadAlone, this, request);
|
||||
t.detach();
|
||||
}
|
||||
|
||||
// Poll and notify main thread if responses exists in queue
|
||||
void HttpClient::dispatchResponseCallbacks()
|
||||
{
|
||||
// log("CCHttpClient::dispatchResponseCallbacks is running");
|
||||
//occurs when cocos thread fires but the network thread has already quited
|
||||
if (nullptr == s_responseQueue) {
|
||||
return;
|
||||
}
|
||||
HttpResponse* response = nullptr;
|
||||
|
||||
s_responseQueueMutex.lock();
|
||||
|
||||
if (!s_responseQueue->empty())
|
||||
{
|
||||
response = s_responseQueue->at(0);
|
||||
s_responseQueue->erase(0);
|
||||
}
|
||||
|
||||
s_responseQueueMutex.unlock();
|
||||
|
||||
if (response)
|
||||
{
|
||||
HttpRequest *request = response->getHttpRequest();
|
||||
const ccHttpRequestCallback& callback = request->getCallback();
|
||||
Ref* pTarget = request->getTarget();
|
||||
SEL_HttpResponse pSelector = request->getSelector();
|
||||
|
||||
if (callback != nullptr)
|
||||
{
|
||||
callback(this, response);
|
||||
}
|
||||
else if (pTarget && pSelector)
|
||||
{
|
||||
(pTarget->*pSelector)(this, response);
|
||||
}
|
||||
|
||||
response->release();
|
||||
// do not release in other thread
|
||||
request->release();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "HttpCookie.h"
|
||||
#include "CCFileUtils.h"
|
||||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
|
||||
void HttpCookie::readFile()
|
||||
{
|
||||
std::string inString = cocos2d::FileUtils::getInstance()->getStringFromFile(_cookieFileName);
|
||||
if(inString.length() != 0)
|
||||
{
|
||||
std::vector<std::string> cookiesVec;
|
||||
cookiesVec.clear();
|
||||
|
||||
std::stringstream stream(inString);
|
||||
std::string item;
|
||||
while(std::getline(stream, item, '\n'))
|
||||
{
|
||||
cookiesVec.push_back(item);
|
||||
}
|
||||
|
||||
if(cookiesVec.empty())
|
||||
return;
|
||||
|
||||
_cookies.clear();
|
||||
|
||||
for(auto iter = cookiesVec.begin();iter != cookiesVec.end(); iter++)
|
||||
{
|
||||
std::string cookie = *iter;
|
||||
|
||||
if(cookie.length() == 0)
|
||||
continue;
|
||||
|
||||
if(cookie.find("#HttpOnly_") != std::string::npos)
|
||||
{
|
||||
cookie = cookie.substr(10);
|
||||
}
|
||||
|
||||
if(cookie.at(0) == '#')
|
||||
continue;
|
||||
|
||||
CookiesInfo co;
|
||||
std::stringstream streamInfo(cookie);
|
||||
std::vector<std::string> elems;
|
||||
std::string elemsItem;
|
||||
|
||||
while (std::getline(streamInfo, elemsItem, '\t'))
|
||||
{
|
||||
elems.push_back(elemsItem);
|
||||
}
|
||||
|
||||
co.domain = elems[0];
|
||||
if (co.domain.at(0) == '.')
|
||||
{
|
||||
co.domain = co.domain.substr(1);
|
||||
}
|
||||
co.tailmatch = strcmp("TRUE", elems[1].c_str())?true: false;
|
||||
co.path = elems[2];
|
||||
co.secure = strcmp("TRUE", elems[3].c_str())?true: false;
|
||||
co.expires = elems[4];
|
||||
co.name = elems[5];
|
||||
co.value = elems[6];
|
||||
_cookies.push_back(co);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<CookiesInfo>* HttpCookie::getCookies() const
|
||||
{
|
||||
return &_cookies;
|
||||
}
|
||||
|
||||
const CookiesInfo* HttpCookie::getMatchCookie(const std::string& url) const
|
||||
{
|
||||
for(auto iter = _cookies.begin(); iter != _cookies.end(); iter++)
|
||||
{
|
||||
if(url.find(iter->domain) != std::string::npos)
|
||||
return &(*iter);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void HttpCookie::updateOrAddCookie(CookiesInfo* cookie)
|
||||
{
|
||||
for(auto iter = _cookies.begin(); iter != _cookies.end(); iter++)
|
||||
{
|
||||
if(cookie->domain == iter->domain)
|
||||
{
|
||||
*iter = *cookie;
|
||||
return;
|
||||
}
|
||||
}
|
||||
_cookies.push_back(*cookie);
|
||||
}
|
||||
|
||||
void HttpCookie::writeFile()
|
||||
{
|
||||
FILE *out;
|
||||
out = fopen(_cookieFileName.c_str(), "w");
|
||||
fputs("# Netscape HTTP Cookie File\n"
|
||||
"# http://curl.haxx.se/docs/http-cookies.html\n"
|
||||
"# This file was generated by cocos2d-x! Edit at your own risk.\n"
|
||||
"# Test cocos2d-x cookie write.\n\n",
|
||||
out);
|
||||
|
||||
std::string line;
|
||||
for(auto iter = _cookies.begin(); iter != _cookies.end(); iter++)
|
||||
{
|
||||
line.clear();
|
||||
line.append(iter->domain);
|
||||
line.append(1, '\t');
|
||||
iter->tailmatch ? line.append("TRUE") : line.append("FALSE");
|
||||
line.append(1, '\t');
|
||||
line.append(iter->path);
|
||||
line.append(1, '\t');
|
||||
iter->secure ? line.append("TRUE") : line.append("FALSE");
|
||||
line.append(1, '\t');
|
||||
line.append(iter->expires);
|
||||
line.append(1, '\t');
|
||||
line.append(iter->name);
|
||||
line.append(1, '\t');
|
||||
line.append(iter->value);
|
||||
//line.append(1, '\n');
|
||||
|
||||
fprintf(out, "%s\n", line.c_str());
|
||||
}
|
||||
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
void HttpCookie::setCookieFileName(std::string filename)
|
||||
{
|
||||
_cookieFileName = filename;
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef HTTP_COOKIE_H
|
||||
#define HTTP_COOKIE_H
|
||||
|
||||
struct CookiesInfo
|
||||
{
|
||||
std::string domain;
|
||||
bool tailmatch;
|
||||
std::string path;
|
||||
bool secure;
|
||||
std::string name;
|
||||
std::string value;
|
||||
std::string expires;
|
||||
};
|
||||
|
||||
class HttpCookie
|
||||
{
|
||||
public:
|
||||
void readFile();
|
||||
|
||||
void writeFile();
|
||||
void setCookieFileName(const std::string fileName);
|
||||
|
||||
const std::vector<CookiesInfo>* getCookies()const;
|
||||
const CookiesInfo* getMatchCookie(const std::string& url) const;
|
||||
void updateOrAddCookie(CookiesInfo* cookie);
|
||||
|
||||
private:
|
||||
std::string _cookieFileName;
|
||||
std::vector<CookiesInfo> _cookies;
|
||||
};
|
||||
|
||||
#endif /* HTTP_COOKIE_H */
|
|
@ -54,6 +54,7 @@ public:
|
|||
_succeed = false;
|
||||
_responseData.clear();
|
||||
_errorBuffer.clear();
|
||||
_responseDataString = "";
|
||||
}
|
||||
|
||||
/** Destructor, it will be called in HttpClient internal,
|
||||
|
@ -166,6 +167,17 @@ public:
|
|||
_errorBuffer.assign(value);
|
||||
};
|
||||
|
||||
inline void setResponseDataString(const char* value, size_t n)
|
||||
{
|
||||
_responseDataString.clear();
|
||||
_responseDataString.assign(value, n);
|
||||
}
|
||||
|
||||
inline const char* getResponseDataString()
|
||||
{
|
||||
return _responseDataString.c_str();
|
||||
}
|
||||
|
||||
protected:
|
||||
bool initWithRequest(HttpRequest* request);
|
||||
|
||||
|
@ -175,7 +187,8 @@ protected:
|
|||
std::vector<char> _responseData; /// the returned raw data. You can also dump it as a string
|
||||
std::vector<char> _responseHeader; /// the returned raw header data. You can also dump it as a string
|
||||
long _responseCode; /// the status code returned from libcurl, e.g. 200, 404
|
||||
std::string _errorBuffer; /// if _responseCode != 200, please read _errorBuffer to find the reason
|
||||
std::string _errorBuffer; /// if _responseCode != 200, please read _errorBuffer to find the reason
|
||||
std::string _responseDataString; // the returned raw data. You can also dump it as a string
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,391 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2010-2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
package org.cocos2dx.lib;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
|
||||
import java.net.ProtocolException;
|
||||
import java.net.URL;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.security.KeyStore;
|
||||
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
|
||||
import org.cocos2dx.lib.Cocos2dxHelper;
|
||||
|
||||
import android.content.res.AssetManager;
|
||||
import android.util.Log;
|
||||
|
||||
public class Cocos2dxHttpURLConnection
|
||||
{
|
||||
private static final String POST_METHOD = "POST" ;
|
||||
private static final String PUT_METHOD = "PUT" ;
|
||||
|
||||
static HttpURLConnection createHttpURLConnection(String linkURL) {
|
||||
URL url;
|
||||
HttpURLConnection urlConnection;
|
||||
try {
|
||||
url = new URL(linkURL);
|
||||
urlConnection = (HttpURLConnection) url.openConnection();
|
||||
//Accept-Encoding
|
||||
urlConnection.setRequestProperty("Accept-Encoding", "identity");
|
||||
urlConnection.setDoInput(true);
|
||||
} catch (Exception e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
return null;
|
||||
}
|
||||
|
||||
return urlConnection;
|
||||
}
|
||||
|
||||
static void setReadAndConnectTimeout(HttpURLConnection urlConnection, int readMiliseconds, int connectMiliseconds) {
|
||||
urlConnection.setReadTimeout(readMiliseconds);
|
||||
urlConnection.setConnectTimeout(connectMiliseconds);
|
||||
}
|
||||
|
||||
static void setRequestMethod(HttpURLConnection urlConnection, String method){
|
||||
try {
|
||||
urlConnection.setRequestMethod(method);
|
||||
if(method.equalsIgnoreCase(POST_METHOD) || method.equalsIgnoreCase(PUT_METHOD)) {
|
||||
urlConnection.setDoOutput(true);
|
||||
}
|
||||
} catch (ProtocolException e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void setVerifySSL(HttpURLConnection urlConnection, String sslFilename) {
|
||||
if(!(urlConnection instanceof HttpsURLConnection))
|
||||
return;
|
||||
|
||||
|
||||
HttpsURLConnection httpsURLConnection = (HttpsURLConnection)urlConnection;
|
||||
|
||||
try {
|
||||
InputStream caInput = null;
|
||||
if (sslFilename.startsWith("/")) {
|
||||
caInput = new BufferedInputStream(new FileInputStream(sslFilename));
|
||||
}else {
|
||||
String assetString = "assets/";
|
||||
String assetsfilenameString = sslFilename.substring(assetString.length());
|
||||
caInput = new BufferedInputStream(Cocos2dxHelper.getActivity().getAssets().open(assetsfilenameString));
|
||||
}
|
||||
|
||||
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||
Certificate ca;
|
||||
ca = cf.generateCertificate(caInput);
|
||||
System.out.println("ca=" + ((X509Certificate) ca).getSubjectDN());
|
||||
caInput.close();
|
||||
|
||||
// Create a KeyStore containing our trusted CAs
|
||||
String keyStoreType = KeyStore.getDefaultType();
|
||||
KeyStore keyStore = KeyStore.getInstance(keyStoreType);
|
||||
keyStore.load(null, null);
|
||||
keyStore.setCertificateEntry("ca", ca);
|
||||
|
||||
// Create a TrustManager that trusts the CAs in our KeyStore
|
||||
String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
|
||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);
|
||||
tmf.init(keyStore);
|
||||
|
||||
// Create an SSLContext that uses our TrustManager
|
||||
SSLContext context = SSLContext.getInstance("TLS");
|
||||
context.init(null, tmf.getTrustManagers(), null);
|
||||
|
||||
httpsURLConnection.setSSLSocketFactory(context.getSocketFactory());
|
||||
} catch (Exception e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
//Add header
|
||||
static void addRequestHeader(HttpURLConnection urlConnection, String key, String value) {
|
||||
urlConnection.setRequestProperty(key, value);
|
||||
}
|
||||
|
||||
static int connect(HttpURLConnection http) {
|
||||
int suc = 0;
|
||||
|
||||
try {
|
||||
http.connect();
|
||||
} catch (IOException e) {
|
||||
Log.e("cocos2d-x debug info", "come in connect");
|
||||
Log.e("cocos2d-x debug info", e.toString());
|
||||
suc = 1;
|
||||
}
|
||||
|
||||
return suc;
|
||||
}
|
||||
|
||||
static void disconnect(HttpURLConnection http) {
|
||||
http.disconnect();
|
||||
}
|
||||
|
||||
static void sendRequest(HttpURLConnection http, byte[] byteArray) {
|
||||
try {
|
||||
OutputStream out = http.getOutputStream();
|
||||
if(null != byteArray) {
|
||||
out.write(byteArray);
|
||||
out.flush();
|
||||
}
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
static String getResponseHeaders(HttpURLConnection http) {
|
||||
Map<String, List<String>> headers = http.getHeaderFields();
|
||||
if (null == headers) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String header = null;
|
||||
|
||||
for (Entry<String, List<String>> entry: headers.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (null == key) {
|
||||
header += listToString(entry.getValue(), ",");
|
||||
} else {
|
||||
header += key + ":" + listToString(entry.getValue(), ",");
|
||||
}
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
||||
static String getResponseHeaderByIdx(HttpURLConnection http, int idx) {
|
||||
Map<String, List<String>> headers = http.getHeaderFields();
|
||||
if (null == headers) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String header = null;
|
||||
|
||||
int counter = 0;
|
||||
for (Entry<String, List<String>> entry: headers.entrySet()) {
|
||||
if (counter == idx) {
|
||||
String key = entry.getKey();
|
||||
if (null == key) {
|
||||
header = listToString(entry.getValue(), ",") + "\n";
|
||||
} else {
|
||||
header = key + ":" + listToString(entry.getValue(), ",") + "\n";
|
||||
}
|
||||
break;
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
||||
static String getResponseHeaderByKey(HttpURLConnection http, String key) {
|
||||
if (null == key) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<String, List<String>> headers = http.getHeaderFields();
|
||||
if (null == headers) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String header = null;
|
||||
|
||||
for (Entry<String, List<String>> entry: headers.entrySet()) {
|
||||
if (key.equalsIgnoreCase(entry.getKey())) {
|
||||
if ("set-cookie".equalsIgnoreCase(key)) {
|
||||
header = combinCookies(entry.getValue(), http.getURL().getHost());
|
||||
} else {
|
||||
header = listToString(entry.getValue(), ",");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
||||
static int getResponseHeaderByKeyInt(HttpURLConnection http, String key) {
|
||||
String value = http.getHeaderField(key);
|
||||
|
||||
if (null == value) {
|
||||
return 0;
|
||||
} else {
|
||||
return Integer.parseInt(value);
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] getResponseContent(HttpURLConnection http) {
|
||||
try {
|
||||
DataInputStream in = new DataInputStream(http.getInputStream());
|
||||
byte[] buffer = new byte[1024];
|
||||
int size = 0;
|
||||
ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
|
||||
while((size = in.read(buffer, 0 , 1024)) != -1)
|
||||
{
|
||||
bytestream.write(buffer, 0, size);
|
||||
}
|
||||
byte retbuffer[] = bytestream.toByteArray();
|
||||
bytestream.close();
|
||||
return retbuffer;
|
||||
} catch (Exception e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static int getResponseCode(HttpURLConnection http) {
|
||||
int code = 0;
|
||||
try {
|
||||
code = http.getResponseCode();
|
||||
} catch (IOException e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
static String getResponseMessage(HttpURLConnection http) {
|
||||
String msg;
|
||||
try {
|
||||
msg = http.getResponseMessage();
|
||||
} catch (IOException e) {
|
||||
msg = e.toString();
|
||||
Log.e("Cocos2dxHttpURLConnection exception", msg);
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String listToString(List<String> list, String strInterVal) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder result = new StringBuilder();
|
||||
boolean flag = false;
|
||||
for (String str : list) {
|
||||
if (flag) {
|
||||
result.append(strInterVal);
|
||||
}
|
||||
if (null == str) {
|
||||
str = "";
|
||||
}
|
||||
result.append(str);
|
||||
flag = true;
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static String combinCookies(List<String> list, String hostDomain) {
|
||||
StringBuilder sbCookies = new StringBuilder();
|
||||
String domain = hostDomain;
|
||||
String tailmatch = "FALSE";
|
||||
String path = "/";
|
||||
String secure = "FALSE";
|
||||
String key = null;
|
||||
String value = null;
|
||||
String expires = null;
|
||||
for (String str : list) {
|
||||
String[] parts = str.split(";");
|
||||
for (String part : parts) {
|
||||
int firstIndex = part.indexOf("=");
|
||||
if (-1 == firstIndex)
|
||||
continue;
|
||||
|
||||
String[] item = {part.substring(0, firstIndex), part.substring(firstIndex + 1)};
|
||||
if ("expires".equalsIgnoreCase(item[0].trim())) {
|
||||
expires = str2Seconds(item[1].trim());
|
||||
} else if("path".equalsIgnoreCase(item[0].trim())) {
|
||||
path = item[1];
|
||||
} else if("secure".equalsIgnoreCase(item[0].trim())) {
|
||||
secure = item[1];
|
||||
} else if("domain".equalsIgnoreCase(item[0].trim())) {
|
||||
domain = item[1];
|
||||
} else if("version".equalsIgnoreCase(item[0].trim()) || "max-age".equalsIgnoreCase(item[0].trim())) {
|
||||
//do nothing
|
||||
} else {
|
||||
key = item[0];
|
||||
value = item[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (null == domain) {
|
||||
domain = "none";
|
||||
}
|
||||
|
||||
sbCookies.append(domain);
|
||||
sbCookies.append('\t');
|
||||
sbCookies.append(tailmatch); //access
|
||||
sbCookies.append('\t');
|
||||
sbCookies.append(path); //path
|
||||
sbCookies.append('\t');
|
||||
sbCookies.append(secure); //secure
|
||||
sbCookies.append('\t');
|
||||
sbCookies.append(expires); //expires
|
||||
sbCookies.append("\t");
|
||||
sbCookies.append(key); //key
|
||||
sbCookies.append("\t");
|
||||
sbCookies.append(value); //value
|
||||
sbCookies.append('\n');
|
||||
}
|
||||
|
||||
return sbCookies.toString();
|
||||
}
|
||||
|
||||
private static String str2Seconds(String strTime) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
long millisSecond = 0;
|
||||
|
||||
try {
|
||||
c.setTime(new SimpleDateFormat("EEE, dd-MMM-yy hh:mm:ss zzz", Locale.US).parse(strTime));
|
||||
millisSecond = c.getTimeInMillis()/1000;
|
||||
} catch (ParseException e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
}
|
||||
|
||||
return Long.toString(millisSecond);
|
||||
}
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2010-2013 cocos2d-x.org
|
||||
Copyright (c) Microsoft Open Technologies, Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#ifndef __CCPLATFORMDEFINE_H__
|
||||
#define __CCPLATFORMDEFINE_H__
|
||||
|
||||
#include "platform/CCPlatformConfig.h"
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_WP8
|
||||
|
||||
#if 0
|
||||
#if defined(_USRDLL)
|
||||
#define CC_DLL __declspec(dllexport)
|
||||
#else /* use a DLL library */
|
||||
#define CC_DLL __declspec(dllimport)
|
||||
#endif
|
||||
#endif // 0
|
||||
|
||||
|
||||
#define CC_DLL
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#if CC_DISABLE_ASSERT > 0
|
||||
#define CC_ASSERT(cond)
|
||||
#else
|
||||
#define CC_ASSERT(cond) assert(cond)
|
||||
#endif
|
||||
#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam
|
||||
|
||||
|
||||
|
||||
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_WP8
|
||||
|
||||
|
||||
#endif /* __CCPLATFORMDEFINE_H__*/
|
|
@ -46,7 +46,7 @@ else
|
|||
-- Spine
|
||||
require "cocos.spine.SpineConstants"
|
||||
|
||||
require "cocos.deprecated"
|
||||
require "cocos.cocos2d.deprecated"
|
||||
require "cocos.cocos2d.DrawPrimitives"
|
||||
|
||||
-- Lua extensions
|
||||
|
|
|
@ -798,8 +798,14 @@
|
|||
"cocos/math/Vec4.inl",
|
||||
"cocos/network/Android.mk",
|
||||
"cocos/network/CMakeLists.txt",
|
||||
"cocos/network/HttpAsynConnection.h",
|
||||
"cocos/network/HttpAsynConnection.m",
|
||||
"cocos/network/HttpClient-android.cpp",
|
||||
"cocos/network/HttpClient-ios.mm",
|
||||
"cocos/network/HttpClient.cpp",
|
||||
"cocos/network/HttpClient.h",
|
||||
"cocos/network/HttpCookie.cpp",
|
||||
"cocos/network/HttpCookie.h",
|
||||
"cocos/network/HttpRequest.h",
|
||||
"cocos/network/HttpResponse.h",
|
||||
"cocos/network/SocketIO.cpp",
|
||||
|
@ -894,6 +900,7 @@
|
|||
"cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java",
|
||||
"cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHandler.java",
|
||||
"cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java",
|
||||
"cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHttpURLConnection.java",
|
||||
"cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java",
|
||||
"cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java",
|
||||
"cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java",
|
||||
|
@ -1003,7 +1010,6 @@
|
|||
"cocos/platform/winrt/CCPThreadWinRT.cpp",
|
||||
"cocos/platform/winrt/CCPThreadWinRT.h",
|
||||
"cocos/platform/winrt/CCPlatformDefine-winrt.h",
|
||||
"cocos/platform/winrt/CCPlatformDefine.h",
|
||||
"cocos/platform/winrt/CCPrecompiledShaders.cpp",
|
||||
"cocos/platform/winrt/CCPrecompiledShaders.h",
|
||||
"cocos/platform/winrt/CCStdC.cpp",
|
||||
|
|
|
@ -92,22 +92,23 @@ namespace AllocatorTestNS
|
|||
test1Container.push_back(new Test1);
|
||||
alloc1End = std::chrono::high_resolution_clock::now();
|
||||
|
||||
alloc2Start = std::chrono::high_resolution_clock::now();
|
||||
for (int i = 0; i < kNumberOfInstances; ++i)
|
||||
test2Container.push_back(new Test2);
|
||||
alloc2End = std::chrono::high_resolution_clock::now();
|
||||
|
||||
free1Start = std::chrono::high_resolution_clock::now();
|
||||
for (int i = 0; i < kNumberOfInstances; ++i)
|
||||
delete test1Container[i];
|
||||
free1End = std::chrono::high_resolution_clock::now();
|
||||
|
||||
test1Container.clear();
|
||||
|
||||
alloc2Start = std::chrono::high_resolution_clock::now();
|
||||
for (int i = 0; i < kNumberOfInstances; ++i)
|
||||
test2Container.push_back(new Test2);
|
||||
alloc2End = std::chrono::high_resolution_clock::now();
|
||||
|
||||
|
||||
free2Start = std::chrono::high_resolution_clock::now();
|
||||
for (int i = 0; i < kNumberOfInstances; ++i)
|
||||
delete test2Container[i];
|
||||
free2End = std::chrono::high_resolution_clock::now();
|
||||
|
||||
test1Container.clear();
|
||||
test2Container.clear();
|
||||
|
||||
std::chrono::duration<double> elapsed_seconds_alloc1 = alloc1End - alloc1Start;
|
||||
|
|
Loading…
Reference in New Issue