فهرست منبع

Merge pull request #1273 from seanpaultaylor/next

Removing Social features and moving to seperate repo as an extension sam...
Sean Taylor 12 سال پیش
والد
کامیت
79d8d57400
52فایلهای تغییر یافته به همراه4 افزوده شده و 4913 حذف شده
  1. 0 125
      gameplay/gameplay.xcodeproj/project.pbxproj
  2. 2 14
      gameplay/src/Game.cpp
  3. 0 12
      gameplay/src/Game.h
  4. 0 5
      gameplay/src/Game.inl
  5. 0 18
      gameplay/src/SocialAchievement.cpp
  6. 0 65
      gameplay/src/SocialAchievement.h
  7. 0 16
      gameplay/src/SocialChallenge.cpp
  8. 0 86
      gameplay/src/SocialChallenge.h
  9. 0 110
      gameplay/src/SocialController.cpp
  10. 0 102
      gameplay/src/SocialController.h
  11. 0 17
      gameplay/src/SocialPlayer.cpp
  12. 0 42
      gameplay/src/SocialPlayer.h
  13. 0 18
      gameplay/src/SocialScore.cpp
  14. 0 54
      gameplay/src/SocialScore.h
  15. 0 125
      gameplay/src/SocialSession.h
  16. 0 92
      gameplay/src/SocialSessionListener.cpp
  17. 0 95
      gameplay/src/SocialSessionListener.h
  18. 0 8
      gameplay/src/gameplay.h
  19. 0 208
      gameplay/src/social/GameCenterSocialSession.h
  20. 0 872
      gameplay/src/social/GameCenterSocialSession.mm
  21. 0 194
      gameplay/src/social/GooglePlaySocialSession.cpp
  22. 0 234
      gameplay/src/social/GooglePlaySocialSession.h
  23. 0 1419
      gameplay/src/social/ScoreloopSocialSession.cpp
  24. 0 273
      gameplay/src/social/ScoreloopSocialSession.h
  25. 0 8
      samples/browser/sample-browser.xcodeproj/project.pbxproj
  26. 0 85
      samples/browser/src/SceneRendererSample.cpp
  27. 0 35
      samples/browser/src/SceneRendererSample.h
  28. 0 45
      samples/spaceship/game.config
  29. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.challenge.achieved.png
  30. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.challenge.unachieved.png
  31. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.cleanrun.achieved.png
  32. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.cleanrun.unachieved.png
  33. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.fiftytimes.achieved.png
  34. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.fiftytimes.unachieved.png
  35. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.firsttime.achieved.png
  36. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.firsttime.unachieved.png
  37. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.hundredtimes.achieved.png
  38. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.hundredtimes.unachieved.png
  39. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.tentimes.achieved.png
  40. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.tentimes.unachieved.png
  41. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under16.achieved.png
  42. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under16.unachieved.png
  43. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under17.achieved.png
  44. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under17.unachieved.png
  45. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under20.achieved.png
  46. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under20.unachieved.png
  47. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.winchallenge.achieved.png
  48. BIN
      samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.winchallenge.unachieved.png
  49. 0 1
      samples/spaceship/scoreloop/SLAwards.bundle/Info.json
  50. 0 20
      samples/spaceship/scoreloop/SLAwards.bundle/en.lproj/Localizable.strings
  51. 1 401
      samples/spaceship/src/SpaceshipGame.cpp
  52. 1 114
      samples/spaceship/src/SpaceshipGame.h

+ 0 - 125
gameplay/gameplay.xcodeproj/project.pbxproj

@@ -291,10 +291,6 @@
 		420BBE3F1817416F00C7B720 /* lua_RenderTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBC1817416E00C7B720 /* lua_RenderTarget.cpp */; };
 		420BBE421817416F00C7B720 /* lua_Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBE1817416E00C7B720 /* lua_Scene.cpp */; };
 		420BBE431817416F00C7B720 /* lua_Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBBE1817416E00C7B720 /* lua_Scene.cpp */; };
-		420BBE4A1817416F00C7B720 /* lua_SceneRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC21817416E00C7B720 /* lua_SceneRenderer.cpp */; };
-		420BBE4B1817416F00C7B720 /* lua_SceneRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC21817416E00C7B720 /* lua_SceneRenderer.cpp */; };
-		420BBE4E1817416F00C7B720 /* lua_SceneRendererForward.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC41817416E00C7B720 /* lua_SceneRendererForward.cpp */; };
-		420BBE4F1817416F00C7B720 /* lua_SceneRendererForward.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC41817416E00C7B720 /* lua_SceneRendererForward.cpp */; };
 		420BBE521817416F00C7B720 /* lua_ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC61817416E00C7B720 /* lua_ScreenDisplayer.cpp */; };
 		420BBE531817416F00C7B720 /* lua_ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC61817416E00C7B720 /* lua_ScreenDisplayer.cpp */; };
 		420BBE561817416F00C7B720 /* lua_ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBBC81817416E00C7B720 /* lua_ScriptController.cpp */; };
@@ -361,8 +357,6 @@
 		420BBED31817416F00C7B720 /* lua_VertexFormatUsage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC061817416F00C7B720 /* lua_VertexFormatUsage.cpp */; };
 		420BBED61817416F00C7B720 /* lua_VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC081817416F00C7B720 /* lua_VerticalLayout.cpp */; };
 		420BBED71817416F00C7B720 /* lua_VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC081817416F00C7B720 /* lua_VerticalLayout.cpp */; };
-		420BBEDA1817416F00C7B720 /* lua_VisibleSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC0A1817416F00C7B720 /* lua_VisibleSet.cpp */; };
-		420BBEDB1817416F00C7B720 /* lua_VisibleSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBC0A1817416F00C7B720 /* lua_VisibleSet.cpp */; };
 		42252DCC1828145B00EE234B /* lua_CameraListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42252DC81828145B00EE234B /* lua_CameraListener.cpp */; };
 		42252DCD1828145B00EE234B /* lua_CameraListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42252DC81828145B00EE234B /* lua_CameraListener.cpp */; };
 		42252DD01828145B00EE234B /* lua_TerrainPatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42252DCA1828145B00EE234B /* lua_TerrainPatch.cpp */; };
@@ -552,10 +546,6 @@
 		42CC599F1809A4EF00AAD8AD /* Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55221809A4EE00AAD8AD /* Scene.cpp */; };
 		42CC59A21809A4EF00AAD8AD /* SceneLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55241809A4EE00AAD8AD /* SceneLoader.cpp */; };
 		42CC59A31809A4EF00AAD8AD /* SceneLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55241809A4EE00AAD8AD /* SceneLoader.cpp */; };
-		42CC59A61809A4EF00AAD8AD /* SceneRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55261809A4EE00AAD8AD /* SceneRenderer.cpp */; };
-		42CC59A71809A4EF00AAD8AD /* SceneRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55261809A4EE00AAD8AD /* SceneRenderer.cpp */; };
-		42CC59AA1809A4EF00AAD8AD /* SceneRendererForward.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55281809A4EE00AAD8AD /* SceneRendererForward.cpp */; };
-		42CC59AB1809A4EF00AAD8AD /* SceneRendererForward.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55281809A4EE00AAD8AD /* SceneRendererForward.cpp */; };
 		42CC59AE1809A4EF00AAD8AD /* ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC552A1809A4EE00AAD8AD /* ScreenDisplayer.cpp */; };
 		42CC59AF1809A4EF00AAD8AD /* ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC552A1809A4EE00AAD8AD /* ScreenDisplayer.cpp */; };
 		42CC59B21809A4EF00AAD8AD /* ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC552C1809A4EE00AAD8AD /* ScriptController.cpp */; };
@@ -564,22 +554,6 @@
 		42CC59B71809A4EF00AAD8AD /* ScriptTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC552F1809A4EE00AAD8AD /* ScriptTarget.cpp */; };
 		42CC59BA1809A4EF00AAD8AD /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55311809A4EE00AAD8AD /* Slider.cpp */; };
 		42CC59BB1809A4EF00AAD8AD /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55311809A4EE00AAD8AD /* Slider.cpp */; };
-		42CC59BE1809A4EF00AAD8AD /* GooglePlaySocialSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55341809A4EE00AAD8AD /* GooglePlaySocialSession.cpp */; };
-		42CC59BF1809A4EF00AAD8AD /* GooglePlaySocialSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55341809A4EE00AAD8AD /* GooglePlaySocialSession.cpp */; };
-		42CC59C21809A4EF00AAD8AD /* ScoreloopSocialSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55361809A4EE00AAD8AD /* ScoreloopSocialSession.cpp */; };
-		42CC59C31809A4EF00AAD8AD /* ScoreloopSocialSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55361809A4EE00AAD8AD /* ScoreloopSocialSession.cpp */; };
-		42CC59C61809A4EF00AAD8AD /* SocialAchievement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55381809A4EE00AAD8AD /* SocialAchievement.cpp */; };
-		42CC59C71809A4EF00AAD8AD /* SocialAchievement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55381809A4EE00AAD8AD /* SocialAchievement.cpp */; };
-		42CC59CA1809A4EF00AAD8AD /* SocialChallenge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC553A1809A4EE00AAD8AD /* SocialChallenge.cpp */; };
-		42CC59CB1809A4EF00AAD8AD /* SocialChallenge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC553A1809A4EE00AAD8AD /* SocialChallenge.cpp */; };
-		42CC59CE1809A4EF00AAD8AD /* SocialController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC553C1809A4EE00AAD8AD /* SocialController.cpp */; };
-		42CC59CF1809A4EF00AAD8AD /* SocialController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC553C1809A4EE00AAD8AD /* SocialController.cpp */; };
-		42CC59D21809A4EF00AAD8AD /* SocialPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC553E1809A4EE00AAD8AD /* SocialPlayer.cpp */; };
-		42CC59D31809A4EF00AAD8AD /* SocialPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC553E1809A4EE00AAD8AD /* SocialPlayer.cpp */; };
-		42CC59D61809A4EF00AAD8AD /* SocialScore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55401809A4EE00AAD8AD /* SocialScore.cpp */; };
-		42CC59D71809A4EF00AAD8AD /* SocialScore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55401809A4EE00AAD8AD /* SocialScore.cpp */; };
-		42CC59DC1809A4EF00AAD8AD /* SocialSessionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55431809A4EE00AAD8AD /* SocialSessionListener.cpp */; };
-		42CC59DD1809A4EF00AAD8AD /* SocialSessionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55431809A4EE00AAD8AD /* SocialSessionListener.cpp */; };
 		42CC59E01809A4EF00AAD8AD /* SpriteBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55451809A4EE00AAD8AD /* SpriteBatch.cpp */; };
 		42CC59E11809A4EF00AAD8AD /* SpriteBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55451809A4EE00AAD8AD /* SpriteBatch.cpp */; };
 		42CC59E61809A4EF00AAD8AD /* Technique.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC55481809A4EE00AAD8AD /* Technique.cpp */; };
@@ -615,8 +589,6 @@
 		5B2BC7601512514500D176CD /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2BC75E1512514500D176CD /* OpenGL.framework */; };
 		5B2BC7621512514D00D176CD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2BC7611512514D00D176CD /* QuartzCore.framework */; };
 		5B2BC7641512516B00D176CD /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2BC7631512516B00D176CD /* libz.dylib */; };
-		6290E04718223C4A00A28FB9 /* GameCenterSocialSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6290E04418223C4A00A28FB9 /* GameCenterSocialSession.mm */; };
-		6290E04818223C4A00A28FB9 /* GameCenterSocialSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6290E04418223C4A00A28FB9 /* GameCenterSocialSession.mm */; };
 		6290E04A18223DCC00A28FB9 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6290E04918223DCC00A28FB9 /* GameKit.framework */; };
 		6290E04C18223DDD00A28FB9 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6290E04B18223DDD00A28FB9 /* GameKit.framework */; };
 		BD2636E516CF5B7400CFE15F /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD2636DF16CF5B7400CFE15F /* CoreMotion.framework */; };
@@ -912,10 +884,6 @@
 		420BBBBD1817416E00C7B720 /* lua_RenderTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderTarget.h; sourceTree = "<group>"; };
 		420BBBBE1817416E00C7B720 /* lua_Scene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Scene.cpp; sourceTree = "<group>"; };
 		420BBBBF1817416E00C7B720 /* lua_Scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Scene.h; sourceTree = "<group>"; };
-		420BBBC21817416E00C7B720 /* lua_SceneRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_SceneRenderer.cpp; sourceTree = "<group>"; };
-		420BBBC31817416E00C7B720 /* lua_SceneRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_SceneRenderer.h; sourceTree = "<group>"; };
-		420BBBC41817416E00C7B720 /* lua_SceneRendererForward.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_SceneRendererForward.cpp; sourceTree = "<group>"; };
-		420BBBC51817416E00C7B720 /* lua_SceneRendererForward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_SceneRendererForward.h; sourceTree = "<group>"; };
 		420BBBC61817416E00C7B720 /* lua_ScreenDisplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScreenDisplayer.cpp; sourceTree = "<group>"; };
 		420BBBC71817416E00C7B720 /* lua_ScreenDisplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_ScreenDisplayer.h; sourceTree = "<group>"; };
 		420BBBC81817416E00C7B720 /* lua_ScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_ScriptController.cpp; sourceTree = "<group>"; };
@@ -982,8 +950,6 @@
 		420BBC071817416F00C7B720 /* lua_VertexFormatUsage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VertexFormatUsage.h; sourceTree = "<group>"; };
 		420BBC081817416F00C7B720 /* lua_VerticalLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VerticalLayout.cpp; sourceTree = "<group>"; };
 		420BBC091817416F00C7B720 /* lua_VerticalLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VerticalLayout.h; sourceTree = "<group>"; };
-		420BBC0A1817416F00C7B720 /* lua_VisibleSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_VisibleSet.cpp; sourceTree = "<group>"; };
-		420BBC0B1817416F00C7B720 /* lua_VisibleSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_VisibleSet.h; sourceTree = "<group>"; };
 		42252DC81828145B00EE234B /* lua_CameraListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_CameraListener.cpp; sourceTree = "<group>"; };
 		42252DC91828145B00EE234B /* lua_CameraListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_CameraListener.h; sourceTree = "<group>"; };
 		42252DCA1828145B00EE234B /* lua_TerrainPatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TerrainPatch.cpp; sourceTree = "<group>"; };
@@ -1190,10 +1156,6 @@
 		42CC55231809A4EE00AAD8AD /* Scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scene.h; path = src/Scene.h; sourceTree = SOURCE_ROOT; };
 		42CC55241809A4EE00AAD8AD /* SceneLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SceneLoader.cpp; path = src/SceneLoader.cpp; sourceTree = SOURCE_ROOT; };
 		42CC55251809A4EE00AAD8AD /* SceneLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SceneLoader.h; path = src/SceneLoader.h; sourceTree = SOURCE_ROOT; };
-		42CC55261809A4EE00AAD8AD /* SceneRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SceneRenderer.cpp; path = src/SceneRenderer.cpp; sourceTree = SOURCE_ROOT; };
-		42CC55271809A4EE00AAD8AD /* SceneRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SceneRenderer.h; path = src/SceneRenderer.h; sourceTree = SOURCE_ROOT; };
-		42CC55281809A4EE00AAD8AD /* SceneRendererForward.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SceneRendererForward.cpp; path = src/SceneRendererForward.cpp; sourceTree = SOURCE_ROOT; };
-		42CC55291809A4EE00AAD8AD /* SceneRendererForward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SceneRendererForward.h; path = src/SceneRendererForward.h; sourceTree = SOURCE_ROOT; };
 		42CC552A1809A4EE00AAD8AD /* ScreenDisplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScreenDisplayer.cpp; path = src/ScreenDisplayer.cpp; sourceTree = SOURCE_ROOT; };
 		42CC552B1809A4EE00AAD8AD /* ScreenDisplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScreenDisplayer.h; path = src/ScreenDisplayer.h; sourceTree = SOURCE_ROOT; };
 		42CC552C1809A4EE00AAD8AD /* ScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptController.cpp; path = src/ScriptController.cpp; sourceTree = SOURCE_ROOT; };
@@ -1203,23 +1165,6 @@
 		42CC55301809A4EE00AAD8AD /* ScriptTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptTarget.h; path = src/ScriptTarget.h; sourceTree = SOURCE_ROOT; };
 		42CC55311809A4EE00AAD8AD /* Slider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = src/Slider.cpp; sourceTree = SOURCE_ROOT; };
 		42CC55321809A4EE00AAD8AD /* Slider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = src/Slider.h; sourceTree = SOURCE_ROOT; };
-		42CC55341809A4EE00AAD8AD /* GooglePlaySocialSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GooglePlaySocialSession.cpp; sourceTree = "<group>"; };
-		42CC55351809A4EE00AAD8AD /* GooglePlaySocialSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GooglePlaySocialSession.h; sourceTree = "<group>"; };
-		42CC55361809A4EE00AAD8AD /* ScoreloopSocialSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScoreloopSocialSession.cpp; sourceTree = "<group>"; };
-		42CC55371809A4EE00AAD8AD /* ScoreloopSocialSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScoreloopSocialSession.h; sourceTree = "<group>"; };
-		42CC55381809A4EE00AAD8AD /* SocialAchievement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocialAchievement.cpp; path = src/SocialAchievement.cpp; sourceTree = SOURCE_ROOT; };
-		42CC55391809A4EE00AAD8AD /* SocialAchievement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocialAchievement.h; path = src/SocialAchievement.h; sourceTree = SOURCE_ROOT; };
-		42CC553A1809A4EE00AAD8AD /* SocialChallenge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocialChallenge.cpp; path = src/SocialChallenge.cpp; sourceTree = SOURCE_ROOT; };
-		42CC553B1809A4EE00AAD8AD /* SocialChallenge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocialChallenge.h; path = src/SocialChallenge.h; sourceTree = SOURCE_ROOT; };
-		42CC553C1809A4EE00AAD8AD /* SocialController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocialController.cpp; path = src/SocialController.cpp; sourceTree = SOURCE_ROOT; };
-		42CC553D1809A4EE00AAD8AD /* SocialController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocialController.h; path = src/SocialController.h; sourceTree = SOURCE_ROOT; };
-		42CC553E1809A4EE00AAD8AD /* SocialPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocialPlayer.cpp; path = src/SocialPlayer.cpp; sourceTree = SOURCE_ROOT; };
-		42CC553F1809A4EE00AAD8AD /* SocialPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocialPlayer.h; path = src/SocialPlayer.h; sourceTree = SOURCE_ROOT; };
-		42CC55401809A4EE00AAD8AD /* SocialScore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocialScore.cpp; path = src/SocialScore.cpp; sourceTree = SOURCE_ROOT; };
-		42CC55411809A4EE00AAD8AD /* SocialScore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocialScore.h; path = src/SocialScore.h; sourceTree = SOURCE_ROOT; };
-		42CC55421809A4EE00AAD8AD /* SocialSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocialSession.h; path = src/SocialSession.h; sourceTree = SOURCE_ROOT; };
-		42CC55431809A4EE00AAD8AD /* SocialSessionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocialSessionListener.cpp; path = src/SocialSessionListener.cpp; sourceTree = SOURCE_ROOT; };
-		42CC55441809A4EE00AAD8AD /* SocialSessionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocialSessionListener.h; path = src/SocialSessionListener.h; sourceTree = SOURCE_ROOT; };
 		42CC55451809A4EE00AAD8AD /* SpriteBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SpriteBatch.cpp; path = src/SpriteBatch.cpp; sourceTree = SOURCE_ROOT; };
 		42CC55461809A4EE00AAD8AD /* SpriteBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpriteBatch.h; path = src/SpriteBatch.h; sourceTree = SOURCE_ROOT; };
 		42CC55471809A4EE00AAD8AD /* Stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stream.h; path = src/Stream.h; sourceTree = SOURCE_ROOT; };
@@ -1256,7 +1201,6 @@
 		42CC55661809A4EE00AAD8AD /* VertexFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VertexFormat.h; path = src/VertexFormat.h; sourceTree = SOURCE_ROOT; };
 		42CC55671809A4EE00AAD8AD /* VerticalLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VerticalLayout.cpp; path = src/VerticalLayout.cpp; sourceTree = SOURCE_ROOT; };
 		42CC55681809A4EE00AAD8AD /* VerticalLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VerticalLayout.h; path = src/VerticalLayout.h; sourceTree = SOURCE_ROOT; };
-		42CC55691809A4EE00AAD8AD /* VisibleSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VisibleSet.h; path = src/VisibleSet.h; sourceTree = SOURCE_ROOT; };
 		42CCD555146EC1EB00353661 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = "../external-deps/png/lib/macosx/libpng.a"; sourceTree = "<group>"; };
 		42CD0DA6147D8EA80000361E /* libbullet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbullet.a; path = "../external-deps/bullet/lib/macosx/libbullet.a"; sourceTree = "<group>"; };
 		42CD0DA7147D8EA80000361E /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = "../external-deps/oggvorbis/lib/macosx/libogg.a"; sourceTree = "<group>"; };
@@ -1273,8 +1217,6 @@
 		5B5DB93114C25BA5007755DB /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = "../external-deps/oggvorbis/lib/ios/armv7s/libogg.a"; sourceTree = "<group>"; };
 		5B5DB93214C25BA5007755DB /* libvorbis.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbis.a; path = "../external-deps/oggvorbis/lib/ios/armv7s/libvorbis.a"; sourceTree = "<group>"; };
 		5BC4E7D4150F8C3C00CBE1C0 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; path = res; sourceTree = "<group>"; };
-		6290E04318223C4A00A28FB9 /* GameCenterSocialSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameCenterSocialSession.h; sourceTree = "<group>"; };
-		6290E04418223C4A00A28FB9 /* GameCenterSocialSession.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GameCenterSocialSession.mm; sourceTree = "<group>"; };
 		6290E04918223DCC00A28FB9 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/GameKit.framework; sourceTree = DEVELOPER_DIR; };
 		6290E04B18223DDD00A28FB9 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
 		BD2636DF16CF5B7400CFE15F /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
@@ -1604,10 +1546,6 @@
 				420BBBBD1817416E00C7B720 /* lua_RenderTarget.h */,
 				420BBBBE1817416E00C7B720 /* lua_Scene.cpp */,
 				420BBBBF1817416E00C7B720 /* lua_Scene.h */,
-				420BBBC21817416E00C7B720 /* lua_SceneRenderer.cpp */,
-				420BBBC31817416E00C7B720 /* lua_SceneRenderer.h */,
-				420BBBC41817416E00C7B720 /* lua_SceneRendererForward.cpp */,
-				420BBBC51817416E00C7B720 /* lua_SceneRendererForward.h */,
 				420BBBC61817416E00C7B720 /* lua_ScreenDisplayer.cpp */,
 				420BBBC71817416E00C7B720 /* lua_ScreenDisplayer.h */,
 				420BBBC81817416E00C7B720 /* lua_ScriptController.cpp */,
@@ -1676,8 +1614,6 @@
 				420BBC071817416F00C7B720 /* lua_VertexFormatUsage.h */,
 				420BBC081817416F00C7B720 /* lua_VerticalLayout.cpp */,
 				420BBC091817416F00C7B720 /* lua_VerticalLayout.h */,
-				420BBC0A1817416F00C7B720 /* lua_VisibleSet.cpp */,
-				420BBC0B1817416F00C7B720 /* lua_VisibleSet.h */,
 			);
 			name = lua;
 			path = src/lua;
@@ -1707,7 +1643,6 @@
 			isa = PBXGroup;
 			children = (
 				420BBAA51817416D00C7B720 /* lua */,
-				42CC55331809A4EE00AAD8AD /* social */,
 				42CC52F71809A4EB00AAD8AD /* AbsoluteLayout.cpp */,
 				42CC52F81809A4EB00AAD8AD /* AbsoluteLayout.h */,
 				42CC52F91809A4EB00AAD8AD /* AIAgent.cpp */,
@@ -1908,10 +1843,6 @@
 				42CC55231809A4EE00AAD8AD /* Scene.h */,
 				42CC55241809A4EE00AAD8AD /* SceneLoader.cpp */,
 				42CC55251809A4EE00AAD8AD /* SceneLoader.h */,
-				42CC55261809A4EE00AAD8AD /* SceneRenderer.cpp */,
-				42CC55271809A4EE00AAD8AD /* SceneRenderer.h */,
-				42CC55281809A4EE00AAD8AD /* SceneRendererForward.cpp */,
-				42CC55291809A4EE00AAD8AD /* SceneRendererForward.h */,
 				42CC552A1809A4EE00AAD8AD /* ScreenDisplayer.cpp */,
 				42CC552B1809A4EE00AAD8AD /* ScreenDisplayer.h */,
 				42CC552C1809A4EE00AAD8AD /* ScriptController.cpp */,
@@ -1921,19 +1852,6 @@
 				42CC55301809A4EE00AAD8AD /* ScriptTarget.h */,
 				42CC55311809A4EE00AAD8AD /* Slider.cpp */,
 				42CC55321809A4EE00AAD8AD /* Slider.h */,
-				42CC55381809A4EE00AAD8AD /* SocialAchievement.cpp */,
-				42CC55391809A4EE00AAD8AD /* SocialAchievement.h */,
-				42CC553A1809A4EE00AAD8AD /* SocialChallenge.cpp */,
-				42CC553B1809A4EE00AAD8AD /* SocialChallenge.h */,
-				42CC553C1809A4EE00AAD8AD /* SocialController.cpp */,
-				42CC553D1809A4EE00AAD8AD /* SocialController.h */,
-				42CC553E1809A4EE00AAD8AD /* SocialPlayer.cpp */,
-				42CC553F1809A4EE00AAD8AD /* SocialPlayer.h */,
-				42CC55401809A4EE00AAD8AD /* SocialScore.cpp */,
-				42CC55411809A4EE00AAD8AD /* SocialScore.h */,
-				42CC55421809A4EE00AAD8AD /* SocialSession.h */,
-				42CC55431809A4EE00AAD8AD /* SocialSessionListener.cpp */,
-				42CC55441809A4EE00AAD8AD /* SocialSessionListener.h */,
 				42CC55451809A4EE00AAD8AD /* SpriteBatch.cpp */,
 				42CC55461809A4EE00AAD8AD /* SpriteBatch.h */,
 				42CC55471809A4EE00AAD8AD /* Stream.h */,
@@ -1970,7 +1888,6 @@
 				42CC55661809A4EE00AAD8AD /* VertexFormat.h */,
 				42CC55671809A4EE00AAD8AD /* VerticalLayout.cpp */,
 				42CC55681809A4EE00AAD8AD /* VerticalLayout.h */,
-				42CC55691809A4EE00AAD8AD /* VisibleSet.h */,
 			);
 			name = src;
 			path = gameplay;
@@ -1985,20 +1902,6 @@
 			name = Libraries;
 			sourceTree = "<group>";
 		};
-		42CC55331809A4EE00AAD8AD /* social */ = {
-			isa = PBXGroup;
-			children = (
-				6290E04318223C4A00A28FB9 /* GameCenterSocialSession.h */,
-				6290E04418223C4A00A28FB9 /* GameCenterSocialSession.mm */,
-				42CC55341809A4EE00AAD8AD /* GooglePlaySocialSession.cpp */,
-				42CC55351809A4EE00AAD8AD /* GooglePlaySocialSession.h */,
-				42CC55361809A4EE00AAD8AD /* ScoreloopSocialSession.cpp */,
-				42CC55371809A4EE00AAD8AD /* ScoreloopSocialSession.h */,
-			);
-			name = social;
-			path = src/social;
-			sourceTree = SOURCE_ROOT;
-		};
 		42CCD4AF146D811D00353661 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
@@ -2140,7 +2043,6 @@
 				42CC598A1809A4EF00AAD8AD /* Ray.cpp in Sources */,
 				420BBCC21817416F00C7B720 /* lua_Font.cpp in Sources */,
 				42CC56041809A4EF00AAD8AD /* gameplay-main-windows.cpp in Sources */,
-				42CC59BE1809A4EF00AAD8AD /* GooglePlaySocialSession.cpp in Sources */,
 				420BBC861817416F00C7B720 /* lua_Container.cpp in Sources */,
 				420BBC5A1817416F00C7B720 /* lua_AudioController.cpp in Sources */,
 				420BBE0E1817416F00C7B720 /* lua_Ray.cpp in Sources */,
@@ -2184,7 +2086,6 @@
 				42CC55881809A4EF00AAD8AD /* AnimationClip.cpp in Sources */,
 				420BBD921817416F00C7B720 /* lua_PhysicsCharacter.cpp in Sources */,
 				420BBE561817416F00C7B720 /* lua_ScriptController.cpp in Sources */,
-				42CC59A61809A4EF00AAD8AD /* SceneRenderer.cpp in Sources */,
 				420BBE261817416F00C7B720 /* lua_RenderStateCullFaceSide.cpp in Sources */,
 				420BBDA21817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */,
 				42CC59921809A4EF00AAD8AD /* Ref.cpp in Sources */,
@@ -2208,7 +2109,6 @@
 				42CC59201809A4EF00AAD8AD /* Model.cpp in Sources */,
 				420BBC161817416F00C7B720 /* lua_AIAgent.cpp in Sources */,
 				42CC59EE1809A4EF00AAD8AD /* TerrainPatch.cpp in Sources */,
-				42CC59DC1809A4EF00AAD8AD /* SocialSessionListener.cpp in Sources */,
 				42CC557C1809A4EF00AAD8AD /* AIState.cpp in Sources */,
 				42CC59001809A4EF00AAD8AD /* Material.cpp in Sources */,
 				420BBE921817416F00C7B720 /* lua_Theme.cpp in Sources */,
@@ -2230,11 +2130,9 @@
 				420BBD121817416F00C7B720 /* lua_ImageFormat.cpp in Sources */,
 				42CC55901809A4EF00AAD8AD /* AnimationTarget.cpp in Sources */,
 				42CC55D61809A4EF00AAD8AD /* Effect.cpp in Sources */,
-				42CC59D21809A4EF00AAD8AD /* SocialPlayer.cpp in Sources */,
 				42CC562C1809A4EF00AAD8AD /* Logger.cpp in Sources */,
 				420BBD761817416F00C7B720 /* lua_MouseMouseEvent.cpp in Sources */,
 				420BBE3E1817416F00C7B720 /* lua_RenderTarget.cpp in Sources */,
-				6290E04718223C4A00A28FB9 /* GameCenterSocialSession.mm in Sources */,
 				42CC56281809A4EF00AAD8AD /* Light.cpp in Sources */,
 				420BBD8E1817416F00C7B720 /* lua_Pass.cpp in Sources */,
 				42CC59041809A4EF00AAD8AD /* MaterialParameter.cpp in Sources */,
@@ -2257,7 +2155,6 @@
 				42CC5A061809A4EF00AAD8AD /* Transform.cpp in Sources */,
 				420BBEC21817416F00C7B720 /* lua_Vector4.cpp in Sources */,
 				420BBE1E1817416F00C7B720 /* lua_RenderStateAutoBinding.cpp in Sources */,
-				42CC59D61809A4EF00AAD8AD /* SocialScore.cpp in Sources */,
 				42CC559C1809A4EF00AAD8AD /* AudioController.cpp in Sources */,
 				42CC55BE1809A4EF00AAD8AD /* CheckBox.cpp in Sources */,
 				42CC5A0A1809A4EF00AAD8AD /* Vector2.cpp in Sources */,
@@ -2285,7 +2182,6 @@
 				420BBCAA1817416F00C7B720 /* lua_CurveInterpolationType.cpp in Sources */,
 				420BBD161817416F00C7B720 /* lua_Joint.cpp in Sources */,
 				420BBCCE1817416F00C7B720 /* lua_FontStyle.cpp in Sources */,
-				42CC59CA1809A4EF00AAD8AD /* SocialChallenge.cpp in Sources */,
 				420BBE8A1817416F00C7B720 /* lua_TextureSampler.cpp in Sources */,
 				420BBE5E1817416F00C7B720 /* lua_Slider.cpp in Sources */,
 				420BBDD61817416F00C7B720 /* lua_PhysicsGhostObject.cpp in Sources */,
@@ -2343,7 +2239,6 @@
 				42CC595E1809A4EF00AAD8AD /* PhysicsSpringConstraint.cpp in Sources */,
 				420BBC8E1817416F00C7B720 /* lua_Control.cpp in Sources */,
 				42CC59661809A4EF00AAD8AD /* PhysicsVehicleWheel.cpp in Sources */,
-				420BBE4E1817416F00C7B720 /* lua_SceneRendererForward.cpp in Sources */,
 				42CC594E1809A4EF00AAD8AD /* PhysicsGhostObject.cpp in Sources */,
 				420BBCA21817416F00C7B720 /* lua_ControlState.cpp in Sources */,
 				420BBE0A1817416F00C7B720 /* lua_RadioButton.cpp in Sources */,
@@ -2357,7 +2252,6 @@
 				420BBDD21817416F00C7B720 /* lua_PhysicsGenericConstraint.cpp in Sources */,
 				42CC592E1809A4EF00AAD8AD /* Pass.cpp in Sources */,
 				420BBC661817416F00C7B720 /* lua_AudioSourceState.cpp in Sources */,
-				42CC59AA1809A4EF00AAD8AD /* SceneRendererForward.cpp in Sources */,
 				420BBEB61817416F00C7B720 /* lua_Uniform.cpp in Sources */,
 				420BBD5A1817416F00C7B720 /* lua_MeshBatch.cpp in Sources */,
 				420BBDE61817416F00C7B720 /* lua_PhysicsSocketConstraint.cpp in Sources */,
@@ -2371,17 +2265,14 @@
 				42CC59FE1809A4EF00AAD8AD /* ThemeStyle.cpp in Sources */,
 				42CC59A21809A4EF00AAD8AD /* SceneLoader.cpp in Sources */,
 				42CC556C1809A4EF00AAD8AD /* AbsoluteLayout.cpp in Sources */,
-				42CC59C61809A4EF00AAD8AD /* SocialAchievement.cpp in Sources */,
 				42CC59181809A4EF00AAD8AD /* MeshPart.cpp in Sources */,
 				42CC55FA1809A4EF00AAD8AD /* gameplay-main-android.cpp in Sources */,
 				420BBE2E1817416F00C7B720 /* lua_RenderStateFrontFace.cpp in Sources */,
-				42CC59CE1809A4EF00AAD8AD /* SocialController.cpp in Sources */,
 				420BBC2A1817416F00C7B720 /* lua_AIState.cpp in Sources */,
 				420BBC721817416F00C7B720 /* lua_Bundle.cpp in Sources */,
 				420BBD061817416F00C7B720 /* lua_HeightField.cpp in Sources */,
 				420BBC3A1817416F00C7B720 /* lua_Animation.cpp in Sources */,
 				42CC55781809A4EF00AAD8AD /* AIMessage.cpp in Sources */,
-				42CC59C21809A4EF00AAD8AD /* ScoreloopSocialSession.cpp in Sources */,
 				420BBEA61817416F00C7B720 /* lua_Touch.cpp in Sources */,
 				420BBD661817416F00C7B720 /* lua_MeshPrimitiveType.cpp in Sources */,
 				420BBC7E1817416F00C7B720 /* lua_CameraType.cpp in Sources */,
@@ -2403,7 +2294,6 @@
 				42CC59461809A4EF00AAD8AD /* PhysicsFixedConstraint.cpp in Sources */,
 				420BBC7A1817416F00C7B720 /* lua_Camera.cpp in Sources */,
 				420BBCF61817416F00C7B720 /* lua_GameState.cpp in Sources */,
-				420BBEDA1817416F00C7B720 /* lua_VisibleSet.cpp in Sources */,
 				42CC55F21809A4EF00AAD8AD /* Game.cpp in Sources */,
 				420BBCA61817416F00C7B720 /* lua_Curve.cpp in Sources */,
 				420BBCFE1817416F00C7B720 /* lua_GestureGestureEvent.cpp in Sources */,
@@ -2427,7 +2317,6 @@
 				420BBCBA1817416F00C7B720 /* lua_FileSystem.cpp in Sources */,
 				420BBDC61817416F00C7B720 /* lua_PhysicsControllerListener.cpp in Sources */,
 				42CC590C1809A4EF00AAD8AD /* Matrix.cpp in Sources */,
-				420BBE4A1817416F00C7B720 /* lua_SceneRenderer.cpp in Sources */,
 				420BBDB21817416F00C7B720 /* lua_PhysicsCollisionShapeType.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -2449,7 +2338,6 @@
 				42CC598B1809A4EF00AAD8AD /* Ray.cpp in Sources */,
 				420BBCC31817416F00C7B720 /* lua_Font.cpp in Sources */,
 				42CC56051809A4EF00AAD8AD /* gameplay-main-windows.cpp in Sources */,
-				42CC59BF1809A4EF00AAD8AD /* GooglePlaySocialSession.cpp in Sources */,
 				420BBC871817416F00C7B720 /* lua_Container.cpp in Sources */,
 				420BBC5B1817416F00C7B720 /* lua_AudioController.cpp in Sources */,
 				420BBE0F1817416F00C7B720 /* lua_Ray.cpp in Sources */,
@@ -2494,7 +2382,6 @@
 				42CC55891809A4EF00AAD8AD /* AnimationClip.cpp in Sources */,
 				420BBD931817416F00C7B720 /* lua_PhysicsCharacter.cpp in Sources */,
 				420BBE571817416F00C7B720 /* lua_ScriptController.cpp in Sources */,
-				42CC59A71809A4EF00AAD8AD /* SceneRenderer.cpp in Sources */,
 				420BBE271817416F00C7B720 /* lua_RenderStateCullFaceSide.cpp in Sources */,
 				420BBDA31817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionPair.cpp in Sources */,
 				420BBD9B1817416F00C7B720 /* lua_PhysicsCollisionObjectCollisionListener.cpp in Sources */,
@@ -2518,7 +2405,6 @@
 				420BBC171817416F00C7B720 /* lua_AIAgent.cpp in Sources */,
 				42CC59211809A4EF00AAD8AD /* Model.cpp in Sources */,
 				42CC59EF1809A4EF00AAD8AD /* TerrainPatch.cpp in Sources */,
-				42CC59DD1809A4EF00AAD8AD /* SocialSessionListener.cpp in Sources */,
 				42CC557D1809A4EF00AAD8AD /* AIState.cpp in Sources */,
 				420BBE931817416F00C7B720 /* lua_Theme.cpp in Sources */,
 				420BBD0F1817416F00C7B720 /* lua_ImageControl.cpp in Sources */,
@@ -2540,10 +2426,8 @@
 				42CC55EF1809A4EF00AAD8AD /* Frustum.cpp in Sources */,
 				42CC55911809A4EF00AAD8AD /* AnimationTarget.cpp in Sources */,
 				42CC55D71809A4EF00AAD8AD /* Effect.cpp in Sources */,
-				42CC59D31809A4EF00AAD8AD /* SocialPlayer.cpp in Sources */,
 				420BBD771817416F00C7B720 /* lua_MouseMouseEvent.cpp in Sources */,
 				420BBE3F1817416F00C7B720 /* lua_RenderTarget.cpp in Sources */,
-				6290E04818223C4A00A28FB9 /* GameCenterSocialSession.mm in Sources */,
 				42CC562D1809A4EF00AAD8AD /* Logger.cpp in Sources */,
 				42CC56291809A4EF00AAD8AD /* Light.cpp in Sources */,
 				420BBD8F1817416F00C7B720 /* lua_Pass.cpp in Sources */,
@@ -2568,7 +2452,6 @@
 				420BBE1F1817416F00C7B720 /* lua_RenderStateAutoBinding.cpp in Sources */,
 				42CC5A1B1809A4EF00AAD8AD /* VertexFormat.cpp in Sources */,
 				42CC5A071809A4EF00AAD8AD /* Transform.cpp in Sources */,
-				42CC59D71809A4EF00AAD8AD /* SocialScore.cpp in Sources */,
 				42CC559D1809A4EF00AAD8AD /* AudioController.cpp in Sources */,
 				42CC55BF1809A4EF00AAD8AD /* CheckBox.cpp in Sources */,
 				420BBE231817416F00C7B720 /* lua_RenderStateBlend.cpp in Sources */,
@@ -2596,7 +2479,6 @@
 				420BBD171817416F00C7B720 /* lua_Joint.cpp in Sources */,
 				42CC59571809A4EF00AAD8AD /* PhysicsRigidBody.cpp in Sources */,
 				420BBCCF1817416F00C7B720 /* lua_FontStyle.cpp in Sources */,
-				42CC59CB1809A4EF00AAD8AD /* SocialChallenge.cpp in Sources */,
 				420BBE8B1817416F00C7B720 /* lua_TextureSampler.cpp in Sources */,
 				420BBE5F1817416F00C7B720 /* lua_Slider.cpp in Sources */,
 				420BBDD71817416F00C7B720 /* lua_PhysicsGhostObject.cpp in Sources */,
@@ -2652,7 +2534,6 @@
 				42CC595F1809A4EF00AAD8AD /* PhysicsSpringConstraint.cpp in Sources */,
 				420BBC8F1817416F00C7B720 /* lua_Control.cpp in Sources */,
 				42CC59671809A4EF00AAD8AD /* PhysicsVehicleWheel.cpp in Sources */,
-				420BBE4F1817416F00C7B720 /* lua_SceneRendererForward.cpp in Sources */,
 				42CC594F1809A4EF00AAD8AD /* PhysicsGhostObject.cpp in Sources */,
 				420BBCA31817416F00C7B720 /* lua_ControlState.cpp in Sources */,
 				420BBE0B1817416F00C7B720 /* lua_RadioButton.cpp in Sources */,
@@ -2666,7 +2547,6 @@
 				420BBDD31817416F00C7B720 /* lua_PhysicsGenericConstraint.cpp in Sources */,
 				42CC592F1809A4EF00AAD8AD /* Pass.cpp in Sources */,
 				420BBC671817416F00C7B720 /* lua_AudioSourceState.cpp in Sources */,
-				42CC59AB1809A4EF00AAD8AD /* SceneRendererForward.cpp in Sources */,
 				420BBEB71817416F00C7B720 /* lua_Uniform.cpp in Sources */,
 				420BBD5B1817416F00C7B720 /* lua_MeshBatch.cpp in Sources */,
 				420BBDE71817416F00C7B720 /* lua_PhysicsSocketConstraint.cpp in Sources */,
@@ -2680,17 +2560,14 @@
 				42CC59FF1809A4EF00AAD8AD /* ThemeStyle.cpp in Sources */,
 				42CC59A31809A4EF00AAD8AD /* SceneLoader.cpp in Sources */,
 				42CC556D1809A4EF00AAD8AD /* AbsoluteLayout.cpp in Sources */,
-				42CC59C71809A4EF00AAD8AD /* SocialAchievement.cpp in Sources */,
 				42CC59191809A4EF00AAD8AD /* MeshPart.cpp in Sources */,
 				42CC55FB1809A4EF00AAD8AD /* gameplay-main-android.cpp in Sources */,
 				420BBE2F1817416F00C7B720 /* lua_RenderStateFrontFace.cpp in Sources */,
-				42CC59CF1809A4EF00AAD8AD /* SocialController.cpp in Sources */,
 				420BBC2B1817416F00C7B720 /* lua_AIState.cpp in Sources */,
 				420BBC731817416F00C7B720 /* lua_Bundle.cpp in Sources */,
 				420BBD071817416F00C7B720 /* lua_HeightField.cpp in Sources */,
 				420BBC3B1817416F00C7B720 /* lua_Animation.cpp in Sources */,
 				42CC55791809A4EF00AAD8AD /* AIMessage.cpp in Sources */,
-				42CC59C31809A4EF00AAD8AD /* ScoreloopSocialSession.cpp in Sources */,
 				420BBEA71817416F00C7B720 /* lua_Touch.cpp in Sources */,
 				420BBD671817416F00C7B720 /* lua_MeshPrimitiveType.cpp in Sources */,
 				420BBC7F1817416F00C7B720 /* lua_CameraType.cpp in Sources */,
@@ -2712,7 +2589,6 @@
 				42CC59471809A4EF00AAD8AD /* PhysicsFixedConstraint.cpp in Sources */,
 				420BBC7B1817416F00C7B720 /* lua_Camera.cpp in Sources */,
 				420BBCF71817416F00C7B720 /* lua_GameState.cpp in Sources */,
-				420BBEDB1817416F00C7B720 /* lua_VisibleSet.cpp in Sources */,
 				42CC55F31809A4EF00AAD8AD /* Game.cpp in Sources */,
 				420BBCA71817416F00C7B720 /* lua_Curve.cpp in Sources */,
 				420BBCFF1817416F00C7B720 /* lua_GestureGestureEvent.cpp in Sources */,
@@ -2736,7 +2612,6 @@
 				420BBCBB1817416F00C7B720 /* lua_FileSystem.cpp in Sources */,
 				420BBDC71817416F00C7B720 /* lua_PhysicsControllerListener.cpp in Sources */,
 				42CC590D1809A4EF00AAD8AD /* Matrix.cpp in Sources */,
-				420BBE4B1817416F00C7B720 /* lua_SceneRenderer.cpp in Sources */,
 				420BBDB31817416F00C7B720 /* lua_PhysicsCollisionShapeType.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

+ 2 - 14
gameplay/src/Game.cpp

@@ -25,7 +25,7 @@ Game::Game()
       _clearDepth(1.0f), _clearStencil(0), _properties(NULL),
       _animationController(NULL), _audioController(NULL),
       _physicsController(NULL), _aiController(NULL), _audioListener(NULL),
-      _timeEvents(NULL), _scriptController(NULL), _socialController(NULL), _scriptListeners(NULL)
+      _timeEvents(NULL), _scriptController(NULL), _scriptListeners(NULL)
 {
     GP_ASSERT(__gameInstance == NULL);
     __gameInstance = this;
@@ -115,9 +115,6 @@ bool Game::startup()
     _scriptController = new ScriptController();
     _scriptController->initialize();
 
-    _socialController = new SocialController();
-    _socialController->initialize();
-
     // Load any gamepads, ui or physical.
     loadGamepads();
 
@@ -197,10 +194,7 @@ void Game::shutdown()
         SAFE_DELETE(_physicsController);
         _aiController->finalize();
         SAFE_DELETE(_aiController);
-
-        _socialController->finalize();
-        SAFE_DELETE(_socialController);
-
+        
         ControlFactory::finalize();
 
         // Note: we do not clean up the script controller here
@@ -231,7 +225,6 @@ void Game::pause()
         _audioController->pause();
         _physicsController->pause();
         _aiController->pause();
-        _socialController->pause();
     }
 
     ++_pausedCount;
@@ -255,7 +248,6 @@ void Game::resume()
             _audioController->resume();
             _physicsController->resume();
             _aiController->resume();
-            _socialController->resume();
         }
     }
 }
@@ -340,9 +332,6 @@ void Game::frame()
         // Audio Rendering.
         _audioController->update(elapsedTime);
 
-        // Social Update.
-        _socialController->update(elapsedTime);
-
         // Graphics Rendering.
         render(elapsedTime);
 
@@ -405,7 +394,6 @@ void Game::updateOnce()
     _aiController->update(elapsedTime);
     _audioController->update(elapsedTime);
     _scriptController->update(elapsedTime);
-    _socialController->update(elapsedTime);
 }
 
 void Game::setViewport(const Rectangle& viewport)

+ 0 - 12
gameplay/src/Game.h

@@ -9,7 +9,6 @@
 #include "AudioController.h"
 #include "AnimationController.h"
 #include "PhysicsController.h"
-#include "SocialController.h"
 #include "AIController.h"
 #include "AudioListener.h"
 #include "Rectangle.h"
@@ -259,16 +258,6 @@ public:
      */
     inline ScriptController* getScriptController() const;
 
-    /**
-     * Gets the social controller for managing control of social apis
-     * associated with the game.
-     *
-     * @return The script controller for this game.
-     *
-     * @script{ignore}
-     */
-    inline SocialController* getSocialController() const;
-
     /**
      * Gets the audio listener for 3D audio.
      * 
@@ -746,7 +735,6 @@ private:
     AudioListener* _audioListener;              // The audio listener in 3D space.
     std::priority_queue<TimeEvent, std::vector<TimeEvent>, std::less<TimeEvent> >* _timeEvents;     // Contains the scheduled time events.
     ScriptController* _scriptController;            // Controls the scripting engine.
-    SocialController* _socialController;		// Controls social aspect of the game.
     std::vector<ScriptListener*>* _scriptListeners; // Lua script listeners.
 
     // Note: Do not add STL object member variables on the stack; this will cause false memory leaks to be reported.

+ 0 - 5
gameplay/src/Game.inl

@@ -63,11 +63,6 @@ inline AIController* Game::getAIController() const
     return _aiController;
 }
 
-inline SocialController* Game::getSocialController() const
-{
-    return _socialController;
-}
-
 template <class T>
 void Game::renderOnce(T* instance, void (T::*method)(void*), void* cookie)
 {

+ 0 - 18
gameplay/src/SocialAchievement.cpp

@@ -1,18 +0,0 @@
-#include "Base.h"
-#include "SocialAchievement.h"
-
-namespace gameplay
-{
-
-SocialAchievement::SocialAchievement()
-    : value(0), total(0), percentCompleted(0.0f)
-{
-}
-
-SocialAchievement::~SocialAchievement()
-{
-}
-
-}
-
-

+ 0 - 65
gameplay/src/SocialAchievement.h

@@ -1,65 +0,0 @@
-#ifndef SOCIALACHIEVEMENT_H_
-#define SOCIALACHIEVEMENT_H_
-
-namespace gameplay
-{
-
-/**
- * Defines a social achievement in a game.
- *
- * @script{ignore}
- */
-class SocialAchievement
-{
-
-public:
-
-    /**
-     * The name of the achievement.
-     */
-    std::string name;
-
-    /**
-     * The title of the achievement.
-     */
-    std::string title;
-
-    /**
-     * The value of progress (0 to getTotal) representing the current unit value of completion.
-     */
-    unsigned int value;
-
-    /**
-     * The total value of progress needed to complete the achievement.
-     */
-    unsigned int total;
-
-    /**
-     * The percent that the achievement is complete. Equivalent to getValue() / getTotal() * 100.0f
-     */
-    float percentCompleted;
-
-    /**
-     * The date/time the achievement was achieved. (UTC string format "2013-06-27T07:40::05")
-     */
-    std::string dateTimeAchieved;
-
-    /**
-     * The provider handle for an achievement.
-     */
-    SocialAchievementHandle handle;
-
-    /**
-     * Constructor.
-     */
-    SocialAchievement();
-
-    /**
-     * Destructor.
-     */
-    ~SocialAchievement();
-};
-
-}
-
-#endif

+ 0 - 16
gameplay/src/SocialChallenge.cpp

@@ -1,16 +0,0 @@
-#include "Base.h"
-#include "SocialChallenge.h"
-
-namespace gameplay
-{
-
-SocialChallenge::SocialChallenge()
-    : state(INVALID), score(0.0f)
-{
-}
-
-SocialChallenge::~SocialChallenge()
-{
-}
-
-}

+ 0 - 86
gameplay/src/SocialChallenge.h

@@ -1,86 +0,0 @@
-#ifndef SOCIALCHALLENGE_H_
-#define SOCIALCHALLENGE_H_
-
-namespace gameplay
-{
-
-/**
- * Defines a social challenge between social players.
- *
- * @script{ignore}
- */
-class SocialChallenge
-{
-
-public:
-
-	/**
-	 * The challenge state.
-	 */
-    enum State
-    {
-        PENDING,
-        COMPLETE,
-        DECLINED,
-        INVALID
-    };
-
-    /**
-     * The name of the challenge.
-     */
-    std::string name;
-
-    /**
-     * The title of the challenge.
-     */
-    std::string title;
-
-    /**
-     * The name of the player issuing the challenge.
-     */
-    std::string issuedPlayerName;
-
-    /**
-     * The name of the player being challenged.
-     */
-    std::string challengedPlayerName;
-
-    /**
-     * The state of the challenge.
-     */
-    State state;
-
-    /**
-     * The score for the challenge.
-     */
-    float score;
-
-    /**
-     * The date/time the challenge was issued. (UTC string format "2013-06-27T07:40::05")
-     */
-    std::string dateTimeIssued;
-
-    /**
-     * The date/time the challenge was completed. (UTC string format "2013-06-27T07:40::05")
-     */
-    std::string dateTimeCompleted;
-
-    /**
-     * The provider handle for an challenge.
-     */
-    SocialChallengeHandle handle;
-
-    /**
-     * Constructor.
-     */
-    SocialChallenge();
-
-    /**
-     * Destructor.
-     */
-    ~SocialChallenge();
-};
-
-}
-
-#endif

+ 0 - 110
gameplay/src/SocialController.cpp

@@ -1,110 +0,0 @@
-#include "Base.h"
-#include "SocialController.h"
-#include "Game.h"
-#include "social/ScoreloopSocialSession.h"
-#include "social/GooglePlaySocialSession.h"
-#include "social/GameCenterSocialSession.h"
-
-namespace gameplay
-{
-
-SocialController::SocialController()
-    : _session(NULL)
-{
-}
-
-SocialController::~SocialController()
-{
-}
-
-void SocialController::initialize()
-{
-}
-
-void SocialController::finalize()
-{
-	if (_session)
-		_session->synchronizeAchievements();
-}
-
-void SocialController::pause()
-{
-	if (_session)
-		_session->synchronizeAchievements();
-}
-
-void SocialController::resume()
-{
-}
-
-void SocialController::update(float elapsedTime)
-{
-}
-
-bool SocialController::handleEvent(void *event)
-{
-	if (_session)
-		return _session->handleEvent(event);
-
-	return false;
-}
-
-void SocialController::authenticate(SocialSessionListener* listener)
-{
-#ifdef GP_USE_SOCIAL
-#if defined(__QNX__)
-    Properties* socialProperties = Game::getInstance()->getConfig()->getNamespace("social", true);
-    const char* providerStr = "";
-
-    if (socialProperties)
-    {
-    	providerStr = socialProperties->getString("provider");
-    }
-
-    if (strcmp(providerStr, "Scoreloop") == 0)
-    {
-        _session = ScoreloopSocialSession::authenticate(listener, socialProperties);
-    }
-    else
-    {
-        listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-    }
-#elif defined(__ANDROID__)
-    Properties* socialProperties = Game::getInstance()->getConfig()->getNamespace("social", true);
-    const char* providerStr = "";
-
-    if (socialProperties)
-    {
-    	providerStr = socialProperties->getString("provider");
-    }
-
-    if (strcmp(providerStr, "GooglePlay") == 0)
-    {
-        _session = GooglePlaySocialSession::authenticate(listener, socialProperties);
-    }
-    else
-    {
-        listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-    }
-#elif defined(__APPLE__)
-    Properties* socialProperties = Game::getInstance()->getConfig()->getNamespace("social", true);
-    const char* providerStr = "";
-
-    if (socialProperties)
-    {
-    	providerStr = socialProperties->getString("provider");
-    }
-
-    if (strcmp(providerStr, "GameCenter") == 0)
-    {
-        _session = GameCenterSocialSession::authenticate(listener, socialProperties);
-    }
-    else
-    {
-        listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-    }
-#endif
-#endif
-}
-
-}

+ 0 - 102
gameplay/src/SocialController.h

@@ -1,102 +0,0 @@
-#ifndef SOCIALCONTROLLER_H_
-#define SOCIALCONTROLLER_H_
-
-#include "Properties.h"
-#include "SocialSession.h"
-#include "SocialSessionListener.h"
-
-namespace gameplay
-{
-
-/**
- * Defines a class for controlling various back-end support for social capabilities.
- *
- * Back-end social providers include Friends, Leaderboards, Achievements and Multiplayer.
- * Social back-ends supported are Scoreloop, GameCenter and Google Play Game Services and Facebook.
- * Configuration for these are specified in game.config:
-
-  @verbatim
-    social
-    {
-         provider = Scoreloop | GooglePlay | GameCenter
-         id  = d346c484-12aa-49a2-a0a0-de2f87492d72
-         secret = aAa+DehBfyGO/CYaE3nWomgu7SIbWFczUih+Qwf3/n7u0y3nyq5Hag==
-         version = 1.0
-         language = en
-         currency = ASC
-         leaderboard_mappings
-         {
-             // Format: leaderboardId = provider value
-             easy = 0
-             medium = 1
-             hard = 2
-         }
-    }
- *
- * @script{ignore}
- */
-class SocialController
-{
-    friend class Game;
-
-public:
-
-    /**
-     * Asyncrhonously authenticates a new user session.
-     *
-     * @param listener The listener
-     */
-    void authenticate(SocialSessionListener* listener);
-
-    /**
-     * Handle the event from the event loop if needed.
-     */
-    bool handleEvent(void *event);
-
-private:
-
-    /**
-     * Constructor.
-     */
-    SocialController();
-
-    /**
-     * Destructor.
-     */
-    ~SocialController();
-
-    /**
-     * Callback for when the controller is initialized.
-     */
-    void initialize();
-
-    /*
-     * Callback for when the controller is finalized.
-     */
-    void finalize();
-
-    /**
-     * Pauses the controller.
-     */
-    void pause();
-
-    /**
-     * Resumes the controller.
-     */
-    void resume();
-
-    /**
-     * Callback for when the controller receives a frame update event.
-     */
-    void update(float elapsedTime);
-
-private:
-
-    SocialSession* _session;
-
-};
-
-}
-
-#endif
-

+ 0 - 17
gameplay/src/SocialPlayer.cpp

@@ -1,17 +0,0 @@
-#include "Base.h"
-#include "SocialPlayer.h"
-
-namespace gameplay
-{
-
-SocialPlayer::SocialPlayer()
-{
-}
-
-SocialPlayer::~SocialPlayer()
-{
-}
-
-}
-
-

+ 0 - 42
gameplay/src/SocialPlayer.h

@@ -1,42 +0,0 @@
-#ifndef SOCIALPLAYER_H_
-#define SOCIALPLAYER_H_
-
-namespace gameplay
-{
-
-/**
- * Defines a social player.
- *
- * This can either be the authenticated user, friend or community user (not friend yet...).
- *
- * @script{ignore}
- */
-class SocialPlayer
-{
-
-public:
-
-    /**
-     * The players friendly name.
-     */
-    std::string name;
-
-    /**
-     * The provider handle for a player.
-     */
-    SocialPlayerHandle handle;
-
-    /**
-     * Constructor
-     */
-    SocialPlayer();
-
-    /**
-     * Destructor
-     */
-    ~SocialPlayer();
-};
-
-}
-
-#endif

+ 0 - 18
gameplay/src/SocialScore.cpp

@@ -1,18 +0,0 @@
-#include "Base.h"
-#include "SocialScore.h"
-
-namespace gameplay
-{
-
-SocialScore::SocialScore()
-    : value(0.0f), rank(0)
-{
-}
-
-SocialScore::~SocialScore()
-{
-}
-
-}
-
-

+ 0 - 54
gameplay/src/SocialScore.h

@@ -1,54 +0,0 @@
-#ifndef SOCIALSCORE_H_
-#define SOCIALSCORE_H_
-
-namespace gameplay
-{
-
-/**
- * Defines an abstract class for a score that resides in a leaderboard.
- *
- * @script{ignore}
- */
-class SocialScore
-{
-public:
-
-    /**
-     * The value for the score.
-     */
-    float value;
-
-    /**
-     * The formatted value for the score.
-     */
-    std::string valueFormatted;
-
-    /**
-     * The rank index of the score within the leaderboard.
-     */
-    unsigned int rank;
-
-    /**
-     * The handle of the player that achieved the score
-     */
-    std::string playerName;
-
-    /**
-     * The score
-     */
-    SocialScoreHandle handle;
-
-    /**
-     * Constructor
-     */
-    SocialScore();
-
-    /**
-     * Destructor
-     */
-    ~SocialScore();
-};
-
-}
-
-#endif

+ 0 - 125
gameplay/src/SocialSession.h

@@ -1,125 +0,0 @@
-#ifndef SOCIALSESSION_H_
-#define SOCIALSESSION_H_
-
-#include "SocialSessionListener.h"
-#include "SocialPlayer.h"
-#include "SocialAchievement.h"
-#include "SocialScore.h"
-#include "SocialChallenge.h"
-#include "Properties.h"
-
-namespace gameplay
-{
-
-/**
- * Defines an abstract class for typical social game activities running with an authenticated session.
- *
- * @script{ignore}
- */
-class SocialSession
-{
-    friend class SocialController;
-
-public:
-
-    enum CommunityScope
-    {
-        COMMUNITY_SCOPE_FRIENDS,
-        COMMUNITY_SCOPE_ALL
-    };
-
-    enum TimeScope
-    {
-        TIME_SCOPE_TODAY,
-        TIME_SCOPE_WEEK,
-        TIME_SCOPE_ALL,
-    };
-
-    /**
-     * Gets the asynchronous response listener that registered for this session.
-     *
-     * @return The asynchronous response listener that registered for this session.
-     */
-    virtual SocialSessionListener* getListener() = 0;
-
-    virtual const SocialPlayer& getUser() const = 0;
-
-    virtual void loadFriends() = 0;
-
-    virtual void loadAchievements() = 0;
-
-    virtual void submitAchievement(const char* achievementId, unsigned int value, bool achieved=false) = 0;
-
-    virtual void incrementAchievement(const char* achievementId, unsigned int totalSteps=1) = 0;
-
-    virtual void synchronizeAchievements() = 0;
-
-    /**
-     * Asynchronously request the scores for the count where the player is in the middle.
-     *
-     * @param leaderboardId The leaderboard to get populated with the scores.
-     * @param community The community scope to filter the search list.
-     * @param time The time scope to filter teh search list.
-     * @param player The player to narrow the search around.
-     * @param count The number to scores return in the result.
-     */
-    virtual void loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, const SocialPlayer& player, unsigned int count) = 0;
-
-    /**
-     * Asynchronously request the scores for a specified leaderboard for this game.
-     *
-     * @param leaderboardId The leaderboard to get populated with the scores.
-     */
-    virtual void loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, unsigned int start, unsigned int count) = 0;
-
-    virtual void submitScore(const char* leaderboardId, float value) = 0;
-
-    virtual void submitChallenge(const SocialPlayer *player, float score, const char* leaderboardId=0, unsigned int wager=0) = 0;
-
-    virtual void submitAchievementChallenge(const SocialPlayer *player, const char* achievementId=0, unsigned int wager=0) = 0;
-
-    virtual void loadChallenges(bool showOpenChallengesOnly=true) = 0;
-
-    virtual void replyToChallenge(const SocialChallenge *challenge, bool accept) = 0;
-
-    virtual void loadSavedData(const char* key) = 0;
-
-    virtual void submitSavedData(const char* key, std::string data) = 0;
-
-    virtual void displayLeaderboard(const char* leaderboardId) const = 0;
-
-    virtual void displayAchievements() const = 0;
-
-    virtual void displayChallenges() const = 0;
-
-    virtual void displayChallengeSubmit(const SocialChallenge *challenge, float score) const = 0;
-
-    virtual void displayPopup(const char *string, const char *title=0) const = 0;
-
-    virtual bool handleEvent(void *event) { return true; }
-
-    virtual bool supportsChallenges() const = 0;
-
-    virtual bool supportsAchievementChallenges() const = 0;
-
-    virtual bool supportsMultiplayer() const = 0;
-
-    virtual bool supportsTurns() const = 0;
-
-protected:
-
-    /**
-     * Contructor
-     */
-    SocialSession() { }
-
-    /**
-     * Destructor
-     */
-    virtual ~SocialSession() { }
-
-};
-
-}
-
-#endif

+ 0 - 92
gameplay/src/SocialSessionListener.cpp

@@ -1,92 +0,0 @@
-#include "Base.h"
-#include "SocialSessionListener.h"
-
-namespace gameplay
-{
-SocialSessionListener::SocialSessionListener()
-{
-}
-
-SocialSessionListener::SocialSessionListener(const SocialSessionListener& copy)
-{
-}
-
-SocialSessionListener::~SocialSessionListener()
-{
-}
-
-void SocialSessionListener::authenticateEvent(ResponseCode code, SocialSession* session)
-{
-}
-
-void SocialSessionListener::loadFriendsEvent(ResponseCode code, std::vector<SocialPlayer> friends)
-{
-}
-
-void SocialSessionListener::loadAchievementsEvent(ResponseCode code, std::vector<SocialAchievement> achievements)
-{
-}
-
-void SocialSessionListener::synchronizeAchievementEvent(ResponseCode code)
-{
-}
-
-void SocialSessionListener::submitAchievementEvent(ResponseCode code)
-{
-}
-
-void SocialSessionListener::awardAchievedEvent(ResponseCode code, const SocialAchievement &achievement)
-{
-}
-
-void SocialSessionListener::loadScoresEvent(ResponseCode code, std::vector<SocialScore> scores)
-{
-}
-
-void SocialSessionListener::submitScoreEvent(ResponseCode code)
-{
-}
-
-void SocialSessionListener::submitChallengeEvent(ResponseCode code, const SocialChallenge &challenge)
-{
-}
-
-void SocialSessionListener::startChallengeEvent(ResponseCode code, const SocialChallenge &challenge)
-{
-}
-
-void SocialSessionListener::replyToChallengeEvent(ResponseCode code)
-{
-}
-
-void SocialSessionListener::loadChallengesEvent(ResponseCode code, std::vector<SocialChallenge> challenges)
-{
-}
-
-void SocialSessionListener::loadSavedDataEvent(ResponseCode code, std::string data)
-{
-}
-
-void SocialSessionListener::submitSavedDataEvent(ResponseCode code)
-{
-}
-
-void SocialSessionListener::uiEvent(ResponseCode code, std::string errorMessage)
-{
-}
-
-void SocialSessionListener::displayedLeaderboardEvent(ResponseCode code, std::string errorMessage)
-{
-}
-
-void SocialSessionListener::displayedAchievementsEvent(ResponseCode code, std::string errorMessage)
-{
-}
-
-void SocialSessionListener::displayedChallengesEvent(ResponseCode code, std::string errorMessage)
-{
-}
-
-}
-
-

+ 0 - 95
gameplay/src/SocialSessionListener.h

@@ -1,95 +0,0 @@
-#ifndef SOCIALSESSIONLISTENER_H_
-#define SOCIALSESSIONLISTENER_H_
-
-#include "SocialPlayer.h"
-#include "SocialAchievement.h"
-#include "SocialScore.h"
-#include "SocialChallenge.h"
-
-namespace gameplay
-{
-
-class SocialSession;
-
-/**
- * Defines a class for handling session responses to various session request.
- *
- * @script{ignore}
- */
-class SocialSessionListener
-{
-public:
-
-    /**
-     * Constructor
-     */
-    SocialSessionListener();
-
-    /**
-     * Constructor
-     */
-    SocialSessionListener(const SocialSessionListener& copy);
-
-    /**
-     * Destructor
-     */
-    virtual ~SocialSessionListener();
-
-    /**
-     * Response codes returned on listener events.
-     */
-    enum ResponseCode
-    {
-        SUCCESS = 0,
-        ERROR_INITIALIZATION,
-        ERROR_PENDING_RESPONSE,
-        ERROR_INVALID_USER,
-        ERROR_INVALID_ARG,
-        ERROR_SERVER,
-        ERROR_CANCELLED,
-        ERROR_NOT_SUPPORTED,
-        ERROR_UNKNOWN
-    };
-
-    virtual void authenticateEvent(ResponseCode code, SocialSession* session);
-
-    virtual void loadFriendsEvent(ResponseCode code, std::vector<SocialPlayer> friends);
-
-    virtual void loadAchievementsEvent(ResponseCode code, std::vector<SocialAchievement> achievements);
-
-    virtual void synchronizeAchievementEvent(ResponseCode code);
-
-    virtual void submitAchievementEvent(ResponseCode code);
-
-    virtual void awardAchievedEvent(ResponseCode code, const SocialAchievement &achievement);
-
-    virtual void loadScoresEvent(ResponseCode code, std::vector<SocialScore> scores);
-
-    virtual void submitScoreEvent(ResponseCode code);
-
-    virtual void submitChallengeEvent(ResponseCode code, const SocialChallenge &challenge);
-
-    virtual void startChallengeEvent(ResponseCode code, const SocialChallenge &challenge);
-
-    virtual void replyToChallengeEvent(ResponseCode code);
-
-    virtual void loadChallengesEvent(ResponseCode code, std::vector<SocialChallenge> challenges);
-
-    virtual void loadSavedDataEvent(ResponseCode code, std::string data);
-
-    virtual void submitSavedDataEvent(ResponseCode code);
-
-    virtual void uiEvent(ResponseCode code, std::string errorMessage="");
-
-    virtual void displayedLeaderboardEvent(ResponseCode code, std::string errorMessage="");
-
-    virtual void displayedAchievementsEvent(ResponseCode code, std::string errorMessage="");
-
-    virtual void displayedChallengesEvent(ResponseCode code, std::string errorMessage="");
-
-};
-
-}
-
-
-#endif

+ 0 - 8
gameplay/src/gameplay.h

@@ -108,11 +108,3 @@
 #include "AbsoluteLayout.h"
 #include "VerticalLayout.h"
 #include "FlowLayout.h"
-
-// Social
-#include "SocialController.h"
-#include "SocialSession.h"
-#include "SocialSessionListener.h"
-#include "SocialPlayer.h"
-#include "SocialAchievement.h"
-#include "SocialScore.h"

+ 0 - 208
gameplay/src/social/GameCenterSocialSession.h

@@ -1,208 +0,0 @@
-#if defined(__APPLE__) && defined(GP_USE_SOCIAL)
-
-#ifndef GAMECENTERSOCIALSESSION_H_
-#define GAMECENTERSOCIALSESSION_H_
-
-#include "SocialSession.h"
-
-namespace gameplay
-{
-    
-    /**
-     * Game Center implementation of SocialSession
-     *
-     * Note: ensure game.config has the following properties
-     *
-     @verbatim
-     social
-     {
-     provider = GameCenter
-
-     leaderboard_mappings
-     {
-     // Format: leaderboardId =  mode <unsigned int>
-     easy = 0
-     medium = 1
-     hard = 2
-     }
-     }
-     *
-     * Note:
-     *
-     * @script{ignore}
-     */
-    class GameCenterSocialSession : public SocialSession
-    {
-        friend class SocialController;
-        
-    public:
-        
-        /**
-         * @see SocialSession::getListener
-         */
-        SocialSessionListener* getListener();
-        
-        /**
-         * Initializes the session with the local client definition for this game.
-         *
-         * @param listener The listener for responses for this session
-         * @param properties The properties to initialize this session with for this game.
-         */
-        static SocialSession *authenticate(SocialSessionListener* listener, Properties* properties);
-        
-        /**
-         * @see SocialSession::getUser
-         */
-        const SocialPlayer& getUser() const;
-        
-        /**
-         * @see SocialSession::loadFriends
-         */
-        void loadFriends();
-        
-        /**
-         * @see SocialSession::loadAchievements
-         */
-        void loadAchievements();
-        
-        /**
-         * @see SocialSession::submitAchievement
-         */
-        void submitAchievement(const char* achievementId, unsigned int value, bool achieved=false);
-        
-        /**
-         * @see SocialSession::incrementAchievement
-         */
-        void incrementAchievement(const char* achievementId, unsigned int totalSteps=1);
-        
-        /**
-         * @see SocialSession::syncAchievements
-         */
-        void synchronizeAchievements();
-        
-        /**
-         * @see SocialSession::loadScores
-         */
-        void loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, const SocialPlayer& player, unsigned int count);
-        
-        /**
-         * @see SocialSession::loadScores
-         */
-        void loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, unsigned int start, unsigned int count);
-        
-        /**
-         * @see SocialSession::submitScore
-         */
-        void submitScore(const char* leaderboardId, float score);
-        
-        /**
-         * @see SocialSession::submitChallenge
-         */
-        void submitChallenge(const SocialPlayer *player, float score, const char* leaderboardId, unsigned int wager=0);
-        
-        /**
-         * @see SocialSession::submitAchievementChallenge
-         */
-        void submitAchievementChallenge(const SocialPlayer *player, const char* achievementId, unsigned int wager=0);
-        
-        /**
-         * @see SocialSession::loadChallenges
-         */
-        void loadChallenges(bool showOpenChallengesOnly=true);
-        
-        /**
-         * @see SocialSession::acceptChallenge
-         */
-        void replyToChallenge(const SocialChallenge *challenge, bool accept);
-        
-        /**
-         * @see SocialSession::requestSavedData
-         */
-        void loadSavedData(const char* key);
-        
-        /**
-         * @see SocialSession::submitSavedData
-         */
-        void submitSavedData(const char* key, std::string data);
-        
-        /**
-         * @see SocialSession::displayLeaderboard
-         */
-        void displayLeaderboard(const char* leaderboardId) const;
-        
-        /**
-         * @see SocialSession::displayAchievements
-         */
-        void displayAchievements() const;
-        
-        /**
-         * @see SocialSession::displayChallenges
-         */
-        void displayChallenges() const;
-        
-        /**
-         * @see SocialSession::displayChallengeSubmit
-         */
-        void displayChallengeSubmit(const SocialChallenge *challenge, float score) const;
-        
-        /**
-         * @see SocialSession::displayPopup
-         */
-        void displayPopup(const char *string, const char *title) const;
-        
-        /**
-         * @see SocialSession::supportsChallenges
-         */
-        bool supportsChallenges() const { return true; }
-        
-        /**
-         * @see SocialSession::supportsAchievementChallenges
-         */
-        bool supportsAchievementChallenges() const { return false; }
-        
-        /**
-         * @see SocialSession::supportsMultiplayer
-         */
-        bool supportsMultiplayer() const { return false; }
-        
-        /**
-         * @see SocialSession::supportsTurns
-         */
-        bool supportsTurns() const { return false; }
-        
-        
-    protected:
-        
-    private:
-        
-        /**
-         * Contructor
-         */
-        GameCenterSocialSession();
-        
-        /**
-         * Destructor
-         */
-        virtual ~GameCenterSocialSession();
-        
-        SocialAchievement* getAchievement(const char* achievementId);
-        const char* getMapping(const char *lookupId, const char *mapping);
-        void loadAchievementData();
-        void attachPlayerNameToScore(const char *playerName, SocialScore *score);
-        void showGameCenter(int startingScreen) const;
-
-        static GameCenterSocialSession* _session;
-        
-        SocialSessionListener* _listener;
-        Properties* _properties;
-        SocialPlayer _user;
-        std::vector<SocialPlayer> _friends;
-        std::vector<SocialAchievement> _achievements;
-        std::vector<SocialScore> _scores;
-        std::vector<SocialChallenge> _challenges;
-    };
-    
-}
-
-#endif
-#endif

+ 0 - 872
gameplay/src/social/GameCenterSocialSession.mm

@@ -1,872 +0,0 @@
-#if defined(__APPLE__) && defined(GP_USE_SOCIAL)
-
-#include "Base.h"
-#import "GameCenterSocialSession.h"
-#import <Foundation/Foundation.h>
-#import <GameKit/GameKit.h>
-
-@interface GameCenterController : NSObject
-+ (BOOL) isGameCenterAvailable;
-+ (void) resetAchievements;
-@end
-
-@implementation GameCenterController
-
-+ (BOOL) isGameCenterAvailable
-{
-	// check for presence of GKLocalPlayer API
-	Class gcClass = (NSClassFromString(@"GKLocalPlayer"));
-    BOOL osVersionSupported = TRUE;
-	
-#if TARGET_OS_IPHONE
-	// check if the device is running iOS 4.1 or later
-	NSString *reqSysVer = @"4.1";
-	NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
-	osVersionSupported = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);
-#endif
-	
-	return (gcClass && osVersionSupported);
-}
-
-+ (void) resetAchievements
-{
-    // Clear all progress saved on Game Center
-    [GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error)
-     {
-         if (error != nil)
-             NSLog(@"Error resetting achievmenets %@", error);
-         
-         NSLog(@"Reset all achievements to default");
-     }];
-}
-
-@end
-
-
-namespace gameplay {
-
-GameCenterSocialSession* GameCenterSocialSession::_session = NULL;
-
-
-GameCenterSocialSession::GameCenterSocialSession()
-: SocialSession(),
-_listener(NULL), _properties(NULL)
-{
-    // uncomment to reset the achievements for testing
- //   [GameCenterController resetAchievements];
-}
-
-GameCenterSocialSession::~GameCenterSocialSession()
-{
-}
-
-SocialSessionListener* GameCenterSocialSession::getListener()
-{
-    return _listener;
-}
-
-SocialSession *GameCenterSocialSession::authenticate(SocialSessionListener* listener, Properties* properties)
-{
-    if (!_session)
-    {
-		_session = new GameCenterSocialSession();
-		_session->_listener = listener;
-		_session->_properties = properties;
-        
-        if ([GameCenterController isGameCenterAvailable])
-        {
-            GKLocalPlayer *player = [GKLocalPlayer localPlayer];
-            [player authenticateWithCompletionHandler:^(NSError *error)
-            {
-                if (error == nil)
-                {
-                    BOOL authenticated = player.isAuthenticated;
-
-                    if (player.isAuthenticated)
-                    {
-                        _session->_user.handle = player;
-                        _session->_user.name = [player.displayName UTF8String];
-                        
-                        listener->authenticateEvent(SocialSessionListener::SUCCESS, _session);
-                    }
-                    else
-                    {
-                        listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-                    }
-                }
-                else
-                {
-                    NSLog(@"Error in authenticate: %@", error);
-                    
-                    if (error.code == GKErrorInvalidCredentials)
-                        listener->authenticateEvent(SocialSessionListener::ERROR_INVALID_ARG, NULL);
-                    if (error.code == GKErrorGameUnrecognized)
-                        listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-                    else if (error.code == GKErrorCommunicationsFailure)
-                        listener->authenticateEvent(SocialSessionListener::ERROR_SERVER, NULL);
-                    else if (error.code == GKErrorAuthenticationInProgress)
-                        listener->authenticateEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, NULL);
-                    else if (error.code == GKErrorCancelled)
-                        listener->authenticateEvent(SocialSessionListener::ERROR_CANCELLED, NULL);
-                    else
-                        listener->authenticateEvent(SocialSessionListener::ERROR_UNKNOWN, NULL);
-                }
-            }];
-        }
-        else
-        {
-            // The current device does not support Game Center.
-            NSLog(@"Current device does not support Game Center");
-            listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-        }
-    }
-    
-    return _session;
-}
-
-const SocialPlayer& GameCenterSocialSession::getUser() const
-{
-	return _user;
-}
-
-/**
- * @see SocialSession::loadFriends
- */
-void GameCenterSocialSession::loadFriends()
-{
-    GKLocalPlayer *lp = [GKLocalPlayer localPlayer];
-    if (lp.authenticated)
-    {
-        [lp loadFriendsWithCompletionHandler:^(NSArray *friendIDs, NSError *error)
-        {
-            _friends.clear();
-            
-            if (friendIDs != nil && friendIDs.count > 0)
-            {
-                [GKPlayer loadPlayersForIdentifiers:friendIDs withCompletionHandler:^(NSArray *players, NSError *error)
-                {
-                    if (error == nil)
-                    {
-                        if (players != nil)
-                        {
-                            // Process the array of GKPlayer objects.
-                            for (GKPlayer* friendPlayer in players)
-                            {
-                                SocialPlayer player;
-                                player.handle = friendPlayer;
-                                player.name = [friendPlayer.displayName UTF8String];
-                                _friends.push_back(player);
-                            }
-                        }
-                        
-                        _listener->loadFriendsEvent(SocialSessionListener::SUCCESS, _friends);
-                    }
-                    else
-                    {
-                        NSLog(@"Error in loadFriends: %@", error);
-                        
-                        if (error.code == GKErrorInvalidParameter || error.code == GKErrorInvalidPlayer)
-                            _listener->loadFriendsEvent(SocialSessionListener::ERROR_INVALID_ARG, _friends);
-                        else if (error.code == GKErrorCommunicationsFailure)
-                            _listener->loadFriendsEvent(SocialSessionListener::ERROR_SERVER, _friends);
-                        else if (error.code == GKErrorCancelled)
-                            _listener->loadFriendsEvent(SocialSessionListener::ERROR_CANCELLED, _friends);
-                        else
-                            _listener->loadFriendsEvent(SocialSessionListener::ERROR_UNKNOWN, _friends);
-                    }
-                    
-                }];
-            }
-            else
-            {
-                // user currently has 0 friends so just return the empty list back
-                _listener->loadFriendsEvent(SocialSessionListener::SUCCESS, _friends);
-            }
-        }];
-    }
-}
-
-void GameCenterSocialSession::loadAchievementData()
-{
-    [GKAchievement loadAchievementsWithCompletionHandler: ^(NSArray *awards, NSError *error)
-     {
-         if (error == nil)
-         {
-             NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-             [formatter setDateFormat:@"ddmmyyyy"];
-             // Optionally for time zone converstions
-             [formatter setTimeZone:[NSTimeZone timeZoneWithName:@"..."]];
-             
-             for (int i = 0; i < _achievements.size(); i++)
-             {
-                 for (GKAchievement* award in awards)
-                 {
-                     if (_achievements[i].name == [award.identifier UTF8String])
-                     {
-                         NSString *dateString = [formatter stringFromDate:award.lastReportedDate];
-                         
-                         _achievements[i].value = award.percentComplete;
-                         _achievements[i].percentCompleted = _achievements[i].value;
-                         _achievements[i].dateTimeAchieved = [dateString UTF8String];
-
-                         break;
-                     }
-                 }
-             }
-             
-             _listener->loadAchievementsEvent(SocialSessionListener::SUCCESS, _achievements);
-             
-             [formatter release];
-         }
-         else
-         {
-             NSLog(@"Error in loadAchievementData: %@", error);
-             
-             if (error.code == GKErrorInvalidParameter || error.code == GKErrorInvalidPlayer)
-                 _listener->loadAchievementsEvent(SocialSessionListener::ERROR_INVALID_ARG, _achievements);
-             else if (error.code == GKErrorCommunicationsFailure)
-                 _listener->loadAchievementsEvent(SocialSessionListener::ERROR_SERVER, _achievements);
-             else if (error.code == GKErrorCancelled)
-                 _listener->loadAchievementsEvent(SocialSessionListener::ERROR_CANCELLED, _achievements);
-             else
-                 _listener->loadAchievementsEvent(SocialSessionListener::ERROR_UNKNOWN, _achievements);
-         }
-     }];
-}
-    
-/**
- * @see SocialSession::loadAchievements
- */
-void GameCenterSocialSession::loadAchievements()
-{
-    [GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler: ^(NSArray *awards, NSError *error)
-     {
-         if (error == nil)
-         {
-             _achievements.clear();
-             
-             for (GKAchievementDescription* award in awards)
-             {
-                 SocialAchievement achievement;
-                 achievement.handle = award;
-                 
-                 achievement.name = [award.identifier UTF8String];
-                 achievement.title = [award.title UTF8String];
-                 achievement.value = 0;
-                 achievement.total = 100;
-                 achievement.percentCompleted = 0;
-                 
-                 _achievements.push_back(achievement);
-             }
-             
-             // we now have to load the achievement data to complete our achievement information
-             loadAchievementData();
-         }
-         else
-         {
-             NSLog(@"Error in loadAchievements: %@", error);
-             
-             if (error.code == GKErrorInvalidParameter || error.code == GKErrorInvalidPlayer)
-                 _listener->loadAchievementsEvent(SocialSessionListener::ERROR_INVALID_ARG, _achievements);
-             else if (error.code == GKErrorCommunicationsFailure)
-                 _listener->loadAchievementsEvent(SocialSessionListener::ERROR_SERVER, _achievements);
-             else if (error.code == GKErrorCancelled)
-                 _listener->loadAchievementsEvent(SocialSessionListener::ERROR_CANCELLED, _achievements);
-             else
-                 _listener->loadAchievementsEvent(SocialSessionListener::ERROR_UNKNOWN, _achievements);
-         }
-     }];
-}
-    
-SocialAchievement* GameCenterSocialSession::getAchievement(const char* achievementId)
-{
-    uint size = _achievements.size();
-    
-    for (uint i = 0; i < size; i++)
-    {
-        if (strcmp(_achievements[i].name.data(), achievementId) == 0)
-            return &_achievements[i];
-    }
-    return 0;
-}
-    
-const char* GameCenterSocialSession::getMapping(const char* identifier, const char *mapping)
-{
-    const char *mappedId = identifier;
-    
-    // Lookup the mapped achievementID if there is one
-    if (identifier != NULL && mapping != NULL)
-    {
-        Properties* mappings = _properties->getNamespace(mapping, true);
-        if (mappings)
-        {
-            mappedId = mappings->getString(identifier);
-            
-            // in case we couldn't find the id for some reason
-            if (mappedId == NULL)
-                mappedId = identifier;
-        }
-    }
-    
-    return mappedId;
-}
-
-/**
- * @see SocialSession::submitAchievement
- */
-void GameCenterSocialSession::submitAchievement(const char* achievementId, unsigned int value, bool achieved)
-{
-    const char *realAchievementId = getMapping(achievementId, "achievement_mappings");
-    SocialAchievement *award = getAchievement(realAchievementId);
-    NSString *achievementName = [[NSString alloc] initWithUTF8String:realAchievementId];
-    GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier: achievementName];
-    
-    if (achievement && award && award->percentCompleted < 100)
-    {
-        achievement.percentComplete = (achieved) ? 100 : value;
-        [achievement reportAchievementWithCompletionHandler:^(NSError *error)
-         {
-             if (error == nil)
-             {
-                 if (achieved)
-                 {
-                     NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-                     [formatter setDateFormat:@"ddmmyyyy"];
-                     // Optionally for time zone converstions
-                     [formatter setTimeZone:[NSTimeZone timeZoneWithName:@"..."]];
-                     
-                     NSString *dateString = [formatter stringFromDate:achievement.lastReportedDate];
-                     
-                     award->percentCompleted = achievement.percentComplete;
-                     award->value = achievement.percentComplete;
-                     award->dateTimeAchieved = [dateString UTF8String];
-
-                     _listener->awardAchievedEvent(SocialSessionListener::SUCCESS, *award);
-                     
-                     [formatter release];
-                 }
-                 else
-                 {
-                    _listener->submitAchievementEvent(SocialSessionListener::SUCCESS);
-                 }
-             }
-             else
-             {
-                 NSLog(@"Error in submitAchievement: %@", error);
-                 
-                 if (error.code == GKErrorInvalidParameter || error.code == GKErrorInvalidPlayer)
-                     _listener->submitAchievementEvent(SocialSessionListener::ERROR_INVALID_ARG);
-                 else if (error.code == GKErrorCommunicationsFailure)
-                     _listener->submitAchievementEvent(SocialSessionListener::ERROR_SERVER);
-                 else if (error.code == GKErrorCancelled)
-                     _listener->submitAchievementEvent(SocialSessionListener::ERROR_CANCELLED);
-                 else
-                     _listener->submitAchievementEvent(SocialSessionListener::ERROR_UNKNOWN);
-             }
-         }];
-    }
-}
-
-/**
- * @see SocialSession::incrementAchievement
- */
-void GameCenterSocialSession::incrementAchievement(const char* achievementId, unsigned int totalSteps)
-{
-    const char *realAchievementId = getMapping(achievementId, "achievement_mappings");
-    NSString *achievementName = [[NSString alloc] initWithUTF8String:realAchievementId];
-    GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier: achievementName];
-    SocialAchievement *award = getAchievement(realAchievementId);
-    
-    if (award && award->percentCompleted < 100)
-    {
-        double newPercent = ((award->percentCompleted/100.0f * totalSteps) + 1) / (float)totalSteps * 100;
-
-        achievement.percentComplete = newPercent;
-        [achievement reportAchievementWithCompletionHandler:^(NSError *error)
-         {
-             if (error == nil)
-             {
-                 award->percentCompleted = achievement.percentComplete;
-                 award->value = achievement.percentComplete;
-                 
-                 if (achievement.percentComplete == 100)
-                 {
-                     NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-                     [formatter setDateFormat:@"ddmmyyyy"];
-                     // Optionally for time zone converstions
-                     [formatter setTimeZone:[NSTimeZone timeZoneWithName:@"..."]];
-                     
-                     NSString *dateString = [formatter stringFromDate:achievement.lastReportedDate];
-                     award->dateTimeAchieved = [dateString UTF8String];
-                     
-                     _listener->awardAchievedEvent(SocialSessionListener::SUCCESS, *award);
-                     
-                     [formatter release];
-                 }
-                 else
-                 {
-                     _listener->submitAchievementEvent(SocialSessionListener::SUCCESS);
-                 }
-             }
-             else
-             {
-                 NSLog(@"Error in incrementAchievement: %@", error);
-                 
-                 if (error.code == GKErrorInvalidParameter || error.code == GKErrorInvalidPlayer)
-                     _listener->submitAchievementEvent(SocialSessionListener::ERROR_INVALID_ARG);
-                 else if (error.code == GKErrorCommunicationsFailure)
-                     _listener->submitAchievementEvent(SocialSessionListener::ERROR_SERVER);
-                 else if (error.code == GKErrorCancelled)
-                     _listener->submitAchievementEvent(SocialSessionListener::ERROR_CANCELLED);
-                 else
-                     _listener->submitAchievementEvent(SocialSessionListener::ERROR_UNKNOWN);
-             }
-         }];
-    }
-}
-
-/**
- * @see SocialSession::syncAchievements
- */
-void GameCenterSocialSession::synchronizeAchievements()
-{
-    // loadAchievements();
-}
-    
-void GameCenterSocialSession::attachPlayerNameToScore(const char *playerID, SocialScore *score)
-{
-    NSString* playerString = [NSString stringWithFormat:@"%s" , playerID];
-    
-    // have to look up the display name of the player given the playerID
-    [GKPlayer loadPlayersForIdentifiers: [NSArray arrayWithObject: playerString] withCompletionHandler:^(NSArray *players, NSError *error)
-     {
-         if (error != nil)
-         {
-             // Handle the error.
-         }
-         if (players != nil)
-         {
-             for (GKPlayer* player in players)
-             {
-                 if ([player.playerID isEqualToString: playerString])
-                 {
-                     score->playerName = [player.displayName UTF8String];
-                     break;
-                 }
-             }
-         }
-         
-         _listener->loadScoresEvent(SocialSessionListener::SUCCESS, _scores);
-     }];
-}
-
-/**
- * @see SocialSession::loadScores
- */
-void GameCenterSocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, unsigned int start, unsigned int count)
-{
-    const char *realLeaderboardId = getMapping(leaderboardId, "leaderboard_mappings");
-    
-    GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
-    if (leaderboardRequest != nil)
-    {
-        switch (community)
-        {
-            case SocialSession::COMMUNITY_SCOPE_ALL:
-                leaderboardRequest.playerScope = GKLeaderboardPlayerScopeGlobal;
-                break;
-            case SocialSession::COMMUNITY_SCOPE_FRIENDS:
-                leaderboardRequest.playerScope = GKLeaderboardPlayerScopeFriendsOnly;
-                break;
-        }
-        
-        switch (time)
-        {
-            case SocialSession::TIME_SCOPE_ALL:
-                leaderboardRequest.timeScope = GKLeaderboardTimeScopeAllTime;
-                break;
-            case SocialSession::TIME_SCOPE_TODAY:
-                leaderboardRequest.timeScope = GKLeaderboardTimeScopeToday;
-                break;
-            case SocialSession::TIME_SCOPE_WEEK:
-                leaderboardRequest.timeScope = GKLeaderboardTimeScopeWeek;
-                break;
-        }
-
-#if TARGET_OS_IPHONE
-        leaderboardRequest.identifier = [[NSString alloc] initWithUTF8String:realLeaderboardId];
-#endif
-        leaderboardRequest.range = NSMakeRange(start, start+count);
-        
-        [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error)
-         {
-             if (error == nil)
-             {
-                 if (scores != nil)
-                 {
-                     // Process the score information.
-                     _scores.clear();
-                     
-                     for (GKScore* gk_score in scores)
-                     {
-                         SocialScore score;
-                         score.handle = gk_score;
-                         score.rank = gk_score.rank;
-                         score.value = gk_score.value;
-                         score.valueFormatted = [gk_score.formattedValue UTF8String];
-                         score.playerName = [gk_score.playerID UTF8String];
-                         
-                         _scores.push_back(score);
-                         
-                         attachPlayerNameToScore([gk_score.playerID UTF8String], &_scores.back());
-                     }
-                 }
-             }
-             else
-             {
-                 NSLog(@"Error in loadScores: %@", error);
-                 
-                 if (error.code == GKErrorInvalidParameter || error.code == GKErrorInvalidPlayer)
-                     _listener->loadScoresEvent(SocialSessionListener::ERROR_INVALID_ARG, _scores);
-                 else if (error.code == GKErrorCommunicationsFailure)
-                     _listener->loadScoresEvent(SocialSessionListener::ERROR_SERVER, _scores);
-                 else if (error.code == GKErrorCancelled)
-                     _listener->loadScoresEvent(SocialSessionListener::ERROR_CANCELLED, _scores);
-                 else
-                     _listener->loadScoresEvent(SocialSessionListener::ERROR_UNKNOWN, _scores);
-                 
-                 _listener->loadScoresEvent(SocialSessionListener::ERROR_UNKNOWN, _scores);
-             }
-         }];
-    }
-}
-
-
-/**
- * @see SocialSession::loadScores
- */
-void GameCenterSocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, const SocialPlayer& player, unsigned int count)
-{
-    const char *realLeaderboardId = getMapping(leaderboardId, "leaderboard_mappings");
-    
-    GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
-    if (leaderboardRequest != nil)
-    {
-        switch (community)
-        {
-            case SocialSession::COMMUNITY_SCOPE_ALL:
-                leaderboardRequest.playerScope = GKLeaderboardPlayerScopeGlobal;
-                break;
-            case SocialSession::COMMUNITY_SCOPE_FRIENDS:
-                leaderboardRequest.playerScope = GKLeaderboardPlayerScopeFriendsOnly;
-                break;
-        }
-        
-        switch (time)
-        {
-            case SocialSession::TIME_SCOPE_ALL:
-                leaderboardRequest.timeScope = GKLeaderboardTimeScopeAllTime;
-                break;
-            case SocialSession::TIME_SCOPE_TODAY:
-                leaderboardRequest.timeScope = GKLeaderboardTimeScopeToday;
-                break;
-            case SocialSession::TIME_SCOPE_WEEK:
-                leaderboardRequest.timeScope = GKLeaderboardTimeScopeWeek;
-                break;
-        }
-        
-#if TARGET_OS_IPHONE
-        leaderboardRequest.identifier = [[NSString alloc] initWithUTF8String:realLeaderboardId];
-#endif
-        // first load all of the scores and find the player
-        [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error)
-         {
-             if (error == nil)
-             {
-                 if (scores != nil)
-                 {
-                     int rank;
-                     
-                     for (GKScore* gk_score in scores)
-                     {
-                         if (gk_score.playerID == ((GKPlayer *)player.handle).playerID)
-                         {
-                             rank = gk_score.rank;
-                             break;
-                         }
-                     }
-                     
-                     int start = rank - count / 2;
-                     if (start < 1)
-                         start = 1;
-                     
-                     // now launch another request and get the data back
-                     loadScores(leaderboardId, community, time, start, start + count);
-                 }
-             }
-             else
-             {
-                 NSLog(@"Error in loadScores: %@", error);
-                 
-                 if (error.code == GKErrorInvalidParameter || error.code == GKErrorInvalidPlayer)
-                     _listener->loadScoresEvent(SocialSessionListener::ERROR_INVALID_ARG, _scores);
-                 else if (error.code == GKErrorCommunicationsFailure)
-                     _listener->loadScoresEvent(SocialSessionListener::ERROR_SERVER, _scores);
-                 else if (error.code == GKErrorCancelled)
-                     _listener->loadScoresEvent(SocialSessionListener::ERROR_CANCELLED, _scores);
-                 else
-                     _listener->loadScoresEvent(SocialSessionListener::ERROR_UNKNOWN, _scores);
-                 
-                 _listener->loadScoresEvent(SocialSessionListener::ERROR_UNKNOWN, _scores);
-                 return;
-             }
-        }];
-    }
-}
-    
-/**
- * @see SocialSession::submitScore
- */
-void GameCenterSocialSession::submitScore(const char* leaderboardId, float score)
-{
-    const char *realLeaderboardId = getMapping(leaderboardId, "leaderboard_mappings");;
-    
-    NSString *leaderboardName = [[NSString alloc] initWithUTF8String:realLeaderboardId];
-    GKScore *scoreReporter = [[GKScore alloc] initWithCategory:leaderboardName];
-    scoreReporter.value = score;
-    scoreReporter.context = 0;
-    
-    [scoreReporter reportScoreWithCompletionHandler:^(NSError *error)
-    {
-        // Do something interesting here.
-        if (error == nil)
-        {
-            _session->getListener()->submitScoreEvent(SocialSessionListener::SUCCESS);
-        }
-        else
-        {
-            NSLog(@"Error in submitScore: %@", error);
-            
-            if (error.code == GKErrorScoreNotSet || error.code == GKErrorInvalidParameter)
-                _listener->submitScoreEvent(SocialSessionListener::ERROR_INVALID_ARG);
-            else if (error.code == GKErrorCommunicationsFailure)
-                _listener->submitScoreEvent(SocialSessionListener::ERROR_SERVER);
-            else
-                _listener->submitScoreEvent(SocialSessionListener::ERROR_UNKNOWN);
-        }
-    }];
-}
-
-/**
- * @see SocialSession::submitChallenge
- */
-void GameCenterSocialSession::submitChallenge(const SocialPlayer *player, float score, const char* leaderboardId, unsigned int wager)
-{
-    SocialChallenge challenge;
-
-    if (player)
-    {
-        GKScore *gkScore = [[GKScore alloc] init];
-        gkScore.value = score;
-        gkScore.context = 0;
-        
-        NSArray *challengedPlayer = [NSArray arrayWithObject: ((GKPlayer *)player->handle).playerID];
-        
-        if (challengedPlayer != nil)
-        {
-            [gkScore issueChallengeToPlayers:challengedPlayer message: @"You have been challenged"];
-            
-            
-            _listener->submitChallengeEvent(SocialSessionListener::SUCCESS, challenge);
-        }
-        else
-        {
-            _listener->submitChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, challenge);
-        }
-    }
-    else
-    {
-        _listener->submitChallengeEvent(SocialSessionListener::ERROR_INVALID_ARG, challenge);
-    }
-}
-    
-/**
- * @see SocialSession::submitChallenge
- */
-void GameCenterSocialSession::submitAchievementChallenge(const SocialPlayer *player, const char* achievementId, unsigned int wager)
-{
-    SocialChallenge challenge;
-    const char *realAchievementId = getMapping(achievementId, "achievement_mappings");
-    
-    NSString *achievementIdName = [[NSString alloc] initWithUTF8String:realAchievementId];
-    GKAchievement *gkAchievement = [[GKAchievement alloc] initWithIdentifier:achievementIdName];
-    NSArray *challengedPlayer = [NSArray arrayWithObject: ((GKPlayer *)player->handle).playerID];
-    
-    if (challengedPlayer != nil)
-    {
-        [gkAchievement selectChallengeablePlayerIDs: challengedPlayer withCompletionHandler:^(NSArray *challengeablePlayerIDs, NSError *error)
-         {
-             [gkAchievement issueChallengeToPlayers:challengeablePlayerIDs message: @"You have been challenged"];
-             
-             
-             _listener->submitChallengeEvent(SocialSessionListener::SUCCESS, challenge);
-         }];
-    }
-    else
-    {
-        _listener->submitChallengeEvent(SocialSessionListener::ERROR_INVALID_ARG, challenge);
-    }
-}
-
-/**
- * @see SocialSession::loadChallenges
- */
-void GameCenterSocialSession::loadChallenges(bool showOpenChallengesOnly)
-{
-    if (showOpenChallengesOnly == false)
-        NSLog(@"open challenges are only supported on IOS");
-    
-    [GKChallenge loadReceivedChallengesWithCompletionHandler:^(NSArray *challenges, NSError *error)
-    {
-        if (error == nil)
-        {
-            _challenges.clear();
-            
-            NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-            [formatter setDateFormat:@"ddmmyyyy"];
-            // Optionally for time zone converstions
-            [formatter setTimeZone:[NSTimeZone timeZoneWithName:@"..."]];
-            
-            for (GKChallenge* gk_challenge in challenges)
-            {
-                NSString *dateIssuedString = [formatter stringFromDate:gk_challenge.issueDate];
-                NSString *dateCompletedString = [formatter stringFromDate:gk_challenge.completionDate];
-                
-                SocialChallenge challenge;
-                
-                challenge.handle = gk_challenge;
-                
-                challenge.challengedPlayerName = [gk_challenge.receivingPlayerID UTF8String];
-                challenge.issuedPlayerName = [gk_challenge.issuingPlayerID UTF8String];
-                if ([gk_challenge isKindOfClass:[GKScoreChallenge class]])
-                {
-                    challenge.score = [[(GKScoreChallenge *)gk_challenge score] value];
-                }
-                
-                challenge.dateTimeIssued = [dateIssuedString UTF8String];
-                challenge.dateTimeCompleted = [dateCompletedString UTF8String];
-                
-                if (gk_challenge.state == GKChallengeStateCompleted)
-                    challenge.state = SocialChallenge::COMPLETE;
-                else if (gk_challenge.state == GKChallengeStateDeclined)
-                    challenge.state = SocialChallenge::DECLINED;
-                else if (gk_challenge.state == GKChallengeStatePending)
-                    challenge.state = SocialChallenge::PENDING;
-                else
-                    challenge.state = SocialChallenge::INVALID;
-                
-                _challenges.push_back(challenge);
-            }
-            
-            _listener->loadChallengesEvent(SocialSessionListener::SUCCESS, _challenges);
-            
-            [formatter release];
-        }
-        else
-        {
-            NSLog(@"Error in loadScores: %@", error);
-            
-            if (error.code == GKErrorInvalidParameter)
-                _listener->loadChallengesEvent(SocialSessionListener::ERROR_INVALID_ARG, _challenges);
-            else if (error.code == GKErrorChallengeInvalid)
-                _listener->loadChallengesEvent(SocialSessionListener::ERROR_INITIALIZATION, _challenges);
-            else if (error.code == GKErrorCommunicationsFailure)
-                _listener->loadChallengesEvent(SocialSessionListener::ERROR_SERVER, _challenges);
-            else if (error.code == GKErrorCancelled)
-                _listener->loadChallengesEvent(SocialSessionListener::ERROR_CANCELLED, _challenges);
-            else
-                _listener->loadChallengesEvent(SocialSessionListener::ERROR_UNKNOWN, _challenges);
-            
-            _listener->loadChallengesEvent(SocialSessionListener::ERROR_UNKNOWN, _challenges);
-        }
-    
-        // if we wanted to show the list of challenges we could call something like this
-        //[_viewController presentChallengeList: challenges];
-    }];
-}
-
-/**
- * @see SocialSession::acceptChallenge
- */
-void GameCenterSocialSession::replyToChallenge(const SocialChallenge *challenge, bool accept)
-{
-    // no equivalent in IOS
-}
-
-/**
- * @see SocialSession::requestSavedData
- */
-void GameCenterSocialSession::loadSavedData(const char* key)
-{
-    // TODO: implement with IOS cloud storage
-}
-
-/**
- * @see SocialSession::submitSavedData
- */
-void GameCenterSocialSession::submitSavedData(const char* key, std::string data)
-{
-    // TODO: implement with IOS cloud storage
-}
-  
-void GameCenterSocialSession::showGameCenter(int startingScreen) const
-{
-    GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];
-    if (gameCenterController != nil)
-    {
-        gameCenterController.viewState = (GKGameCenterViewControllerState)startingScreen;
-        
-#if TARGET_OS_IPHONE
-        id viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
-        gameCenterController.gameCenterDelegate = viewController;
-        [viewController presentViewController: gameCenterController animated: YES completion:nil];
-#else
-        GKDialogController *sdc = [GKDialogController sharedDialogController];
-        sdc.parentWindow = [[NSApplication sharedApplication] mainWindow];
-        [sdc presentViewController: gameCenterController];
-#endif
-
-    }
-}
-
-void GameCenterSocialSession::displayLeaderboard(const char* leaderboardId) const
-{
-    showGameCenter(GKGameCenterViewControllerStateLeaderboards);
-}
-
-void GameCenterSocialSession::displayAchievements() const
-{
-    showGameCenter(GKGameCenterViewControllerStateAchievements);
-}
-
-void GameCenterSocialSession::displayChallenges() const
-{
-    showGameCenter(GKGameCenterViewControllerStateChallenges);
-}
-
-void GameCenterSocialSession::displayChallengeSubmit(const SocialChallenge *challenge, float score) const
-{
-    return _listener->uiEvent(SocialSessionListener::ERROR_NOT_SUPPORTED);
-}
-
-void GameCenterSocialSession::displayPopup(const char *popupMessage, const char *title=0) const
-{
-    NSString* titleString = (title) ? [[NSString alloc] initWithUTF8String:title] : @"";
-    NSString* message = [[NSString alloc] initWithUTF8String:popupMessage];
-    
-    [GKNotificationBanner showBannerWithTitle: titleString message: message completionHandler:^{}];
-}
-
-}
-
-#endif

+ 0 - 194
gameplay/src/social/GooglePlaySocialSession.cpp

@@ -1,194 +0,0 @@
-#if defined(__ANDROID__) && defined(GP_USE_SOCIAL)
-
-#include "Base.h"
-#include "GooglePlaySocialSession.h"
-#include <android_native_app_glue.h>
-#include <android/log.h>
-
-namespace gameplay
-{
-
-// Externally referenced global variable.
-struct android_app* __state;
-
-GooglePlaySocialSession* GooglePlaySocialSession::_session = NULL;
-
-GooglePlaySocialSession::GooglePlaySocialSession()
-    : SocialSession(),
-      _listener(NULL), _properties(NULL), _pendingUserResponse(false), _pendingFriendsResponse(false),
-      _pendingScoresResponse(false), _pendingSubmitScoreResponse(false), _pendingAchievementResponse(false),
-      _pendingDataResponse(false),
-      _key(NULL)
-{
-    _userOp = USEROP_GET_LOCALUSER;
-}
-
-GooglePlaySocialSession::~GooglePlaySocialSession()
-{
-}
-
-SocialSessionListener* GooglePlaySocialSession::getListener()
-{
-    return _listener;
-}
-
-SocialSession *GooglePlaySocialSession::authenticate(SocialSessionListener* listener, Properties* properties)
-{
-#if 0
-    if (!_session)
-    {
-		_session = new GooglePlaySocialSession();
-		_session->_listener = listener;
-		_session->_properties = properties;
-
-		const char* gameId = properties->getString("id");
-		const char* gameSecret = properties->getString("secret");
-		const char* gameVersion = properties->getString("version");
-		const char* gameCurrency = properties->getString("currency");
-		const char* gameLanguage = properties->getString("language");
-	    android_app* state = __state;
-	
-		GP_ASSERT(state && state->activity && state->activity->vm);
-	    JavaVM* jvm = state->activity->vm;
-	    JNIEnv* env = NULL;
-	    jvm->GetEnv((void **)&env, JNI_VERSION_1_6);
-	    jint r = jvm->AttachCurrentThread(&env, NULL);
-	    if (r == JNI_ERR)
-	    {
-	        GP_ERROR("Failed to retrieve JVM environment to authenticate.");
-	        return 0;
-	    }
-	    GP_ASSERT(env);
-
-		jclass testClassHandle = env->FindClass("org/gameplay3d/lib/TestClass");
-		jmethodID computeMultHandle = env->GetMethodID(testClassHandle, "ComputeMult", "(FF)I");
-		jmethodID testClassCtor = env->GetMethodID(testClassHandle, "<init>", "()V");
-		jobject testClassInstance = env->NewObject(testClassHandle, testClassCtor);
-
-		jfloat a = 4.0f;
-		jfloat b = 0.5f;
-		jint result = env->CallIntMethod(testClassInstance, computeMultHandle, a, b);
-		fprintf(stderr, "the results is %d\n", result);
-
-		jvm->DetachCurrentThread();
-    }
-#endif
-
-    return _session;
-}
-
-const SocialPlayer& GooglePlaySocialSession::getUser() const
-{
-	return _user;
-}
-
-void GooglePlaySocialSession::loadFriends()
-{
-}
-
-void GooglePlaySocialSession::loadAchievementData()
-{
-
-}
-
-void GooglePlaySocialSession::loadAchievements()
-{
-
-}
-
-const SocialAchievement* GooglePlaySocialSession::getAchievement(const char* achievementId) const
-{
-    uint size = _achievements.size();
-
-    for (uint i = 0; i < size; i++)
-    {
-        if (strcmp(_achievements[i].name.data(), achievementId) == 0)
-            return &_achievements[i];
-    }
-    return 0;
-}
-
-void GooglePlaySocialSession::submitAchievement(const char* achievementId, unsigned int value, bool achieved)
-{
-
-}
-
-void GooglePlaySocialSession::incrementAchievement(const char* achievementId, unsigned int totalSteps)
-{
-
-}
-
-void GooglePlaySocialSession::synchronizeAchievements()
-{
-}
-
-void GooglePlaySocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, unsigned int start, unsigned int count)
-{
-
-}
-
-void GooglePlaySocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, const SocialPlayer& player, unsigned int count)
-{
-
-}
-
-void GooglePlaySocialSession::submitScore(const char* leaderboardId, float score)
-{
-
-}
-
-void GooglePlaySocialSession::submitChallenge(const SocialPlayer *player, float score, const char* leaderboardId, unsigned int wager)
-{
-    SocialChallenge challenge;
-    _listener->submitChallengeEvent(SocialSessionListener::ERROR_NOT_SUPPORTED, challenge);
-}
-
-void GooglePlaySocialSession::submitAchievementChallenge(const SocialPlayer *player, const char* achievementId, unsigned int wager)
-{
-    SocialChallenge challenge;
-    _listener->submitChallengeEvent(SocialSessionListener::ERROR_NOT_SUPPORTED, challenge);
-}
-
-void GooglePlaySocialSession::loadChallenges(bool showOpenChallengesOnly)
-{
-	_listener->loadChallengesEvent(SocialSessionListener::ERROR_NOT_SUPPORTED, _challenges);
-}
-
-
-void GooglePlaySocialSession::replyToChallenge(const SocialChallenge *challenge, bool accept)
-{
-}
-
-void GooglePlaySocialSession::loadSavedData(const char* key)
-{
-}
-
-void GooglePlaySocialSession::submitSavedData(const char* key, std::string data)
-{
-
-}
-
-void GooglePlaySocialSession::displayLeaderboard(const char* leaderboardId) const
-{
-}
-
-void GooglePlaySocialSession::displayAchievements() const
-{
-}
-
-void GooglePlaySocialSession::displayChallenges() const
-{
-}
-
-void GooglePlaySocialSession::displayChallengeSubmit(const SocialChallenge *challenge, float score) const
-{
-}
-
-void GooglePlaySocialSession::displayPopup(const char *popupMessage, const char *title) const
-{
-
-}
-
-}
-
-#endif

+ 0 - 234
gameplay/src/social/GooglePlaySocialSession.h

@@ -1,234 +0,0 @@
-#if defined(__ANDROID__) && defined(GP_USE_SOCIAL)
-
-#ifndef GOOGLEPLAYSOCIALSESSION_H_
-#define GOOGLEPLAYSOCIALSESSION_H_
-
-#include "SocialSession.h"
-
-namespace gameplay
-{
-
-/**
- * Google Play (game services) implementation of SocialSession
- *
- * Note: ensure game.config has the following properties
- *
-  @verbatim
-    social
-    {
-         provider = GooglePlay
-         id = d346c484-12aa-49a2-a0a0-de2f87492d72
-         secret = aAa+DehBfyGO/CYaE3nWomgu7SIbWFczUih+Qwf3/n7u0y3nyq5Hag==
-         version = 1.0
-         language = en
-         currency = ASC
-         leaderboard_mappings
-         {
-             // Format: leaderboardId =  mode <unsigned int>
-             easy = 0
-             medium = 1
-             hard = 2
-         }
-
-         achievement_mappings
-         {
-             // Format: myAchievementKey =  DestinationAchievementID
-             gameplay.spaceship.winchallenge = destination.spaceship.winchallengeid
-         }
-    }
- *
- * Note: Ensure your bar-descriptor.xml has:
- *
- * <action>read_device_identifying_information</action>
- *
- * @script{ignore}
- */
-class GooglePlaySocialSession : public SocialSession
-{
-    friend class SocialController;
-
-public:
-
-    /**
-      * @see SocialSession::getListener
-      */
-     SocialSessionListener* getListener();
-
-     /**
-      * Initializes the session with the local client definition for this game.
-      *
-      * @param listener The listener for responses for this session
-      * @param properties The properties to initialize this session with for this game.
-      */
-     static SocialSession *authenticate(SocialSessionListener* listener, Properties* properties);
-
-     /**
-      * @see SocialSession::getUser
-      */
-     const SocialPlayer& getUser() const;
-
-     /**
-      * @see SocialSession::loadFriends
-      */
-     void loadFriends();
-
-     /**
-      * @see SocialSession::loadAchievements
-      */
-     void loadAchievements();
-
-     /**
-      * @see SocialSession::submitAchievement
-      */
-     void submitAchievement(const char* achievementId, unsigned int value, bool achieved=false);
-
-     /**
-      * @see SocialSession::incrementAchievement
-      */
-     void incrementAchievement(const char* achievementId, unsigned int totalSteps=1);
-
-     /**
-      * @see SocialSession::syncAchievements
-      */
-     void synchronizeAchievements();
-
-     /**
-      * @see SocialSession::loadScores
-      */
-     void loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, const SocialPlayer& player, unsigned int count);
-
-     /**
-      * @see SocialSession::loadScores
-      */
-     void loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, unsigned int start, unsigned int count);
-
-     /**
-      * @see SocialSession::submitScore
-      */
-     void submitScore(const char* leaderboardId, float score);
-
-     /**
-      * @see SocialSession::submitChallenge
-      */
-     void submitChallenge(const SocialPlayer *player, float score, const char* leaderboardId, unsigned int wager=0);
-
-     /**
-      * @see SocialSession::submitAchievementChallenge
-      */
-     void submitAchievementChallenge(const SocialPlayer *player, const char* achievementId, unsigned int wager=0);
-
-     /**
-      * @see SocialSession::loadChallenges
-      */
-     void loadChallenges(bool showOpenChallengesOnly=true);
-
-     /**
-      * @see SocialSession::acceptChallenge
-      */
-     void replyToChallenge(const SocialChallenge *challenge, bool accept);
-
-    /**
-     * @see SocialSession::requestSavedData
-     */
-    void loadSavedData(const char* key);
-    
-    /**
-     * @see SocialSession::submitSavedData
-     */
-    void submitSavedData(const char* key, std::string data);
-    
-    /**
-     * @see SocialSession::displayLeaderboard
-     */
-    void displayLeaderboard(const char* leaderboardId) const;
-    
-    /**
-     * @see SocialSession::displayAchievements
-     */
-    void displayAchievements() const;
-    
-    /**
-     * @see SocialSession::displayChallenges
-     */
-    void displayChallenges() const;
-    
-    /**
-     * @see SocialSession::displayChallengeSubmit
-     */
-    void displayChallengeSubmit(const SocialChallenge *challenge, float score) const;
-    
-    /**
-     * @see SocialSession::displayPopup
-     */
-    void displayPopup(const char *string, const char *title) const;
-    
-    /**
-     * @see SocialSession::supportsChallenges
-     */
-    bool supportsChallenges() const { return true; }
-    
-    /**
-     * @see SocialSession::supportsAchievementChallenges
-     */
-    bool supportsAchievementChallenges() const { return false; }
-    
-    /**
-     * @see SocialSession::supportsMultiplayer
-     */
-    bool supportsMultiplayer() const { return false; }
-    
-    /**
-     * @see SocialSession::supportsTurns
-     */
-    bool supportsTurns() const { return false; }
-
-
-protected:
-
-private:
-
-    /**
-     * Contructor
-     */
-    GooglePlaySocialSession();
-
-    /**
-     * Destructor
-     */
-    virtual ~GooglePlaySocialSession();
-
-    const SocialAchievement* getAchievement(const char* achievementId) const;
-    void loadAchievementData();
-
-    static GooglePlaySocialSession* _session;
-
-    enum UserOp
-    {
-        USEROP_GET_LOCALUSER,
-        USEROP_WRITE_CONTEXT,
-        USEROP_READ_CONTEXT
-    };
-
-    SocialSessionListener* _listener;
-    Properties* _properties;
-    bool _pendingUserResponse;
-    bool _pendingFriendsResponse;
-    bool _pendingScoresResponse;
-    bool _pendingSubmitScoreResponse;
-    bool _pendingAchievementResponse;
-    bool _pendingDataResponse;
-    const char* _key;
-    std::string _data;
-    SocialPlayer _user;
-    UserOp _userOp;
-    std::vector<SocialPlayer> _friends;
-    std::vector<SocialAchievement> _achievements;
-    std::vector<SocialScore> _scores;
-    std::vector<SocialChallenge> _challenges;
-};
-
-}
-
-#endif
-
-#endif

+ 0 - 1419
gameplay/src/social/ScoreloopSocialSession.cpp

@@ -1,1419 +0,0 @@
-#if defined(__QNX__) && defined(GP_USE_SOCIAL)
-
-#include "Base.h"
-#include "ScoreloopSocialSession.h"
-#include <bps/dialog.h>
-
-namespace gameplay
-{
-
-ScoreloopSocialSession* ScoreloopSocialSession::_session = NULL;
-
-ScoreloopSocialSession::ScoreloopSocialSession()
-    : SocialSession(),
-      _listener(NULL), _properties(NULL), _pendingUserResponse(false), _pendingFriendsResponse(false),
-      _pendingScoresResponse(false), _pendingSubmitScoreResponse(false), _pendingAchievementResponse(false),
-      _pendingChallengeResponse(false), _pendingChallengesResponse(false), _pendingDataResponse(false),
-      _client(NULL), _uiClient(NULL), _userController(NULL), _usersController(NULL),
-      _localAchievementsController(NULL), _scoresController(NULL), _scoreController(NULL),
-      _challengeController(NULL), _challengesController(NULL), _key(NULL), _acceptedChallenge(NULL)
-{
-    pthread_cond_init(&_channelCond, NULL);
-    pthread_mutex_init(&_channelMutex, NULL);
-    _userOp = USEROP_GET_LOCALUSER;
-}
-
-ScoreloopSocialSession::~ScoreloopSocialSession()
-{
-#if 0
-	SC_Client_Release(_client);
-	SCUI_Client_Release(_uiClient);
-	SC_ScoresController_Release(_scoresController);
-	SC_ScoreController_Release(_scoreController);
-	SC_UserController_Release(_userController);
-	SC_UsersController_Release(_usersController);
-	SC_LocalAchievementsController_Release(_localAchievementsController);
-	SC_ChallengeController_Release(_challengeController);
-	SC_ChallengesController_Release(_challengesController);
-#endif
-}
-
-SocialSessionListener* ScoreloopSocialSession::getListener()
-{
-    return _listener;
-}
-
-void* ScoreloopSocialSession::platformEventCallback(void* data)
-{
-	fprintf(stderr, "platformEventCallback!\n");
-    _session = (ScoreloopSocialSession*)data;
-
-    int rc = bps_initialize();
-
-    if (rc == BPS_FAILURE)
-        GP_ERROR("ScoreloopSocialSession::platformEventHandler - bps_initialize failed.");
-
-//    pthread_mutex_lock(&_session->_channelMutex);
-//    pthread_mutex_unlock(&_session->_channelMutex);
-//   pthread_cond_signal(&_session->_channelCond);
-fprintf(stderr, "hello here\n");
-    bps_event_t* event = NULL;
-    while (true)
-    {
-    	fprintf(stderr, "weird stuff start loop\n");
-        rc = bps_get_event(&event, 0);
-        fprintf(stderr, "bps_get_event %d\n", rc);
-        if (rc == BPS_FAILURE)
-            GP_ERROR("ScoreloopSocialSession::platformEventHandler - bps_get_event failed.");
-fprintf(stderr, "we are in a bps loop here\n");
-     //   if (bps_event_get_domain(event) == SC_GetBPSEventDomain(&_session->_initData) || bps_event_get_domain(event) == SCUI_GetBPSEventDomain())
-        {
-        	fprintf(stderr, "found a bps event!\n");
-        	// can either be a scoreloop event or a ui event - need to handle both
-            if ((SC_HandleBPSEvent(&_session->_initData, event) == BPS_SUCCESS) || SCUI_Client_HandleEvent(_session->_uiClient, event))
-            	continue;
-        }
-    }
-    bps_shutdown();
-    return 0;
-}
-
-SocialSession *ScoreloopSocialSession::authenticate(SocialSessionListener* listener, Properties* properties)
-{
-    if (!_session)
-    {
-		_session = new ScoreloopSocialSession();
-		_session->_listener = listener;
-		_session->_properties = properties;
-
-		const char* gameId = properties->getString("id");
-		const char* gameSecret = properties->getString("secret");
-		const char* gameVersion = properties->getString("version");
-		const char* gameCurrency = properties->getString("currency");
-		const char* gameLanguage = properties->getString("language");
-
-		// Create thread for platform event handler needed by Scoreloop
-//		pthread_mutex_lock(&_session->_channelMutex);
-//		pthread_create(NULL, NULL, platformEventCallback, _session);
-//		pthread_cond_wait(&_session->_channelCond, &_session->_channelMutex);
-//		pthread_mutex_unlock(&_session->_channelMutex);
-
-		SC_InitData_Init(&_session->_initData);
-
-		SC_Error_t rc = SC_Client_New(&_session->_client, &_session->_initData, gameId, gameSecret, gameVersion, gameCurrency, gameLanguage);
-		if (rc != SC_OK)
-		{
-			listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-			return 0;
-		}
-
-		rc = SCUI_Client_NewWithCallback(&_session->_uiClient, _session->_client, ScoreloopSocialSession::uiCallback, _session);
-	    if (rc != SC_OK)
-	    {
-	    	listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-	    }
-
-		rc = SC_Client_CreateUserController(_session->_client, &_session->_userController, ScoreloopSocialSession::userCallback, _session);
-		if (rc != SC_OK)
-		{
-			listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-			return 0;
-		}
-
-		rc = SC_UserController_LoadUser(_session->_userController);
-		if (rc != SC_OK)
-		{
-			SC_UserController_Release(_session->_userController);
-			_session->_userController = NULL;
-			listener->authenticateEvent(SocialSessionListener::ERROR_INITIALIZATION, NULL);
-		}
-    }
-
-    return _session;
-}
-
-bool ScoreloopSocialSession::handleEvent(void *event)
-{
-#if 1
-	bps_event_t* bps_event = (bps_event_t *)event;
-
-	if (SC_HandleBPSEvent(&_session->_initData, bps_event) == BPS_SUCCESS)
-		return true;
-
-	if (SCUI_Client_HandleEvent(_session->_uiClient, bps_event))
-		return true;
-
-#endif
-    return false;
-}
-
-const SocialPlayer& ScoreloopSocialSession::getUser() const
-{
-	return _user;
-}
-
-void ScoreloopSocialSession::userCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-
-    switch (result)
-    {
-    	case SC_OK:
-        {
-            switch(session->_userOp)
-            {
-            	case USEROP_GET_LOCALUSER:
-                {
-                    session->_user.handle =  SC_UserController_GetUser(session->_userController);
-                    SC_String_h name = SC_User_GetLogin((SC_User_h)session->_user.handle);
-                    session->_user.name = SC_String_GetData(name);
-                    session->getListener()->authenticateEvent(SocialSessionListener::SUCCESS, session);
-                }
-                break;
-
-            	case USEROP_WRITE_CONTEXT:
-                {
-                    session->getListener()->submitSavedDataEvent(SocialSessionListener::SUCCESS);
-                }
-                break;
-
-            	case USEROP_READ_CONTEXT:
-                {
-                    SC_Context_h context = SC_User_GetContext((SC_User_h)session->_user.handle);
-                    SC_String_h str;
-                    SC_Error_t rc = SC_Context_Get(context, session->_key, &str);
-                    if (rc != SC_OK)
-                    {
-                        session->getListener()->loadSavedDataEvent(SocialSessionListener::ERROR_INVALID_ARG, "");
-                    }
-                    else
-                    {
-                        session->getListener()->loadSavedDataEvent(SocialSessionListener::SUCCESS, std::string(SC_String_GetData(str)));
-                    }
-                }
-                break;
-            }
-        }
-        break;
-
-    case SC_INVALID_USER_DATA:
-        {
-            switch(session->_userOp)
-            {
-                case USEROP_GET_LOCALUSER:
-                    session->getListener()->authenticateEvent(SocialSessionListener::ERROR_INVALID_USER, NULL);
-                    break;
-                case USEROP_WRITE_CONTEXT:
-                    session->getListener()->submitSavedDataEvent(SocialSessionListener::ERROR_INVALID_USER);
-                    break;
-                case USEROP_READ_CONTEXT:
-                    session->getListener()->loadSavedDataEvent(SocialSessionListener::ERROR_INVALID_USER, "");
-                    break;
-            }
-        }
-        break;
-
-    case SC_HTTP_SERVER_ERROR:
-        {
-            switch(session->_userOp)
-            {
-                case USEROP_GET_LOCALUSER:
-                    session->getListener()->authenticateEvent(SocialSessionListener::ERROR_SERVER, NULL);
-                    break;
-                case USEROP_WRITE_CONTEXT:
-                    session->getListener()->submitSavedDataEvent(SocialSessionListener::ERROR_SERVER);
-                    break;
-                case USEROP_READ_CONTEXT:
-                    session->getListener()->loadSavedDataEvent(SocialSessionListener::ERROR_SERVER, "");
-                    break;
-            }
-        }
-        break;
-
-    default:
-        {
-            switch(session->_userOp)
-            {
-                case USEROP_GET_LOCALUSER:
-                    session->getListener()->authenticateEvent(SocialSessionListener::ERROR_UNKNOWN, NULL);
-                    break;
-                case USEROP_WRITE_CONTEXT:
-                    session->getListener()->submitSavedDataEvent(SocialSessionListener::ERROR_UNKNOWN);
-                    break;
-                case USEROP_READ_CONTEXT:
-                    session->getListener()->loadSavedDataEvent(SocialSessionListener::ERROR_UNKNOWN, "");
-                    break;
-            }
-        }
-        break;
-    }
-
-    session->_pendingUserResponse = false;
-}
-
-
-static SC_Challenge_h challenge1 = 0;
-
-void ScoreloopSocialSession::uiCallback(void *cookie, SCUI_Result_t result, const void *data)
-{
-	ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-    SC_Error_t rc = SC_INVALID_ARGUMENT;
-
-    switch (result)
-    {
-		case SCUI_RESULT_OK:
-			session->getListener()->uiEvent(SocialSessionListener::SUCCESS);
-			break;
-
-		case SCUI_RESULT_ERROR:
-			if (data != NULL)
-				rc = *((SC_Error_t *)data);
-
-			session->getListener()->uiEvent(SocialSessionListener::SUCCESS, SC_MapErrorToStr(rc));
-			break;
-
-		case SCUI_RESULT_START_CHALLENGE:
-			{
-				fprintf(stderr, "START challenge\n");
-
-				// Get details of the Challenge from 'data' argument by casting it.
-				SocialChallenge &challenge = session->addChallenge((SC_Challenge_h)data);
-
-				session->getListener()->startChallengeEvent(SocialSessionListener::SUCCESS, challenge);
-			}
-			break;
-
-		default:
-			if (result == SCUI_RESULT_CANCEL)
-				session->getListener()->uiEvent(SocialSessionListener::ERROR_CANCELLED);
-			break;
-    }
-
-    fprintf(stderr, "UI result: %s\n", SCUI_MapResultCodeToStr(result));
-}
-
-void ScoreloopSocialSession::loadFriends()
-{
-    if (_pendingFriendsResponse)
-    {
-        _listener->loadFriendsEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, _friends);
-        return;
-    }
-    _pendingFriendsResponse = true;
-
-    // Create a scoreloop users controller (for finding friends)
-    SC_Error_t rc;
-    if (_usersController == NULL)
-    {
-        rc = SC_Client_CreateUsersController(_client, &_usersController, ScoreloopSocialSession::loadFriendsCallback, this);
-        if (rc != SC_OK)
-        {
-            _listener->loadFriendsEvent(SocialSessionListener::ERROR_INITIALIZATION, _friends);
-            return;
-        }
-    }
-    rc = SC_UsersController_LoadBuddies(_usersController, (SC_User_h)_user.handle);
-    if (rc != SC_OK)
-    {
-    	SC_UsersController_Release(_usersController);
-    	_usersController = NULL;
-    	_listener->loadFriendsEvent(SocialSessionListener::ERROR_INITIALIZATION, _friends);
-    }
-}
-
-void ScoreloopSocialSession::loadFriendsCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-    switch (result)
-    {
-		case SC_OK:
-			{
-				SC_UserList_h usersList = SC_UsersController_GetUsers(session->_usersController);
-				unsigned int usersCount = SC_UserList_GetCount(usersList);
-				session->_friends.clear();
-				for (unsigned int i = 0; i < usersCount; i++)
-				{
-					SocialPlayer player;
-					player.handle = SC_UserList_GetAt(usersList, i);
-					SC_UserController_GetUser(session->_userController);
-					SC_String_h name = SC_User_GetLogin((SC_User_h)player.handle);
-					player.name = SC_String_GetData(name);
-					session->_friends.push_back(player);
-				}
-				session->getListener()->loadFriendsEvent(SocialSessionListener::SUCCESS, session->_friends);
-			}
-			break;
-		case SC_INVALID_USER_DATA:
-			session->getListener()->loadFriendsEvent(SocialSessionListener::ERROR_INVALID_USER, session->_friends);
-			break;
-		case SC_HTTP_SERVER_ERROR:
-			session->getListener()->loadFriendsEvent(SocialSessionListener::ERROR_SERVER, session->_friends);
-			break;
-		default:
-			session->getListener()->loadFriendsEvent(SocialSessionListener::ERROR_UNKNOWN, session->_friends);
-			break;
-    }
-
-    session->_pendingFriendsResponse = false;
-}
-
-void ScoreloopSocialSession::loadAchievements()
-{
-    if (_pendingAchievementResponse)
-    {
-        _listener->loadAchievementsEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, _achievements);
-        return;
-    }
-    _pendingAchievementResponse = true;
-
-    SC_Error_t rc;
-
-    if (_localAchievementsController == NULL)
-    {
-		rc = SC_Client_CreateLocalAchievementsController(_client, &_localAchievementsController, ScoreloopSocialSession::loadAchievementsCallback, this);
-		if (rc != SC_OK)
-		{
-			_listener->loadAchievementsEvent(SocialSessionListener::ERROR_INITIALIZATION, _achievements);
-			_pendingAchievementResponse = false;
-			return;
-		}
-    }
-
-    if (SC_LocalAchievementsController_ShouldSynchronize(_localAchievementsController))
-    {
-        rc = SC_LocalAchievementsController_Synchronize(_localAchievementsController);
-        if (rc != SC_OK)
-        {
-            _listener->loadAchievementsEvent(SocialSessionListener::ERROR_INITIALIZATION, _achievements);
-            _pendingAchievementResponse = false;
-            return;
-        }
-    }
-    else
-    	ScoreloopSocialSession::loadAchievementsCallback(this, SC_OK);
-}
-
-void ScoreloopSocialSession::loadAchievementsCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-    switch (result)
-    {
-    	case SC_OK:
-			{
-				SC_AchievementList_h achievementsList = SC_LocalAchievementsController_GetAchievements(session->_localAchievementsController);
-				unsigned int achievementsCount = SC_AchievementList_GetCount(achievementsList);
-				session->_achievements.clear();
-				for (unsigned int i = 0; i < achievementsCount; i++)
-				{
-					SocialAchievement achievement;
-					achievement.handle = SC_AchievementList_GetAt(achievementsList, i);
-					SC_Award_h award = SC_Achievement_GetAward((SC_Achievement_h)achievement.handle);
-
-					SC_String_h id = SC_Award_GetIdentifier(award);
-					achievement.name = (id) ? SC_String_GetData(id) : "";
-					SC_String_h title = SC_Award_GetLocalizedTitle(award);
-					achievement.title = (title) ? SC_String_GetData(title) : "";
-					achievement.value = (unsigned int)SC_Achievement_GetValue((SC_Achievement_h)achievement.handle);
-					SC_String_h dateTime = SC_Achievement_GetDate((SC_Achievement_h)achievement.handle);
-					achievement.dateTimeAchieved = (dateTime) ? SC_String_GetData(dateTime) : "";
-					achievement.total = SC_Award_GetAchievingValue(award);
-					achievement.percentCompleted = achievement.value == 0 ? 0.0f : ((float)achievement.value / (float)achievement.total) * 100.f;
-
-					session->_achievements.push_back(achievement);
-				}
-				session->getListener()->loadAchievementsEvent(SocialSessionListener::SUCCESS, _session->_achievements);
-			}
-
-			break;
-		case SC_INVALID_USER_DATA:
-			session->getListener()->loadAchievementsEvent(SocialSessionListener::ERROR_INVALID_USER, _session->_achievements);
-			break;
-		case SC_HTTP_SERVER_ERROR:
-			session->getListener()->loadAchievementsEvent(SocialSessionListener::ERROR_SERVER, _session->_achievements);
-			break;
-		default:
-			session->getListener()->loadAchievementsEvent(SocialSessionListener::ERROR_UNKNOWN, _session->_achievements);
-			break;
-    }
-
-    session->_pendingAchievementResponse = false;
-}
-
-const SocialAchievement* ScoreloopSocialSession::getAchievement(const char* achievementId) const
-{
-	uint size = _achievements.size();
-
-	for (uint i = 0; i < size; i++)
-	{
-		if (strcmp(_achievements[i].name.data(), achievementId) == 0)
-			return &_achievements[i];
-	}
-	return 0;
-}
-
-void ScoreloopSocialSession::submitAchievement(const char* achievementId, unsigned int value, bool isAchieved)
-{
-    SC_Error_t rc;
-    if (_localAchievementsController == NULL)
-    {
-		rc = SC_Client_CreateLocalAchievementsController(_client, &_localAchievementsController, ScoreloopSocialSession::submitAchievementCallback, this);
-		if (rc != SC_OK)
-		{
-			_listener->submitAchievementEvent(SocialSessionListener::ERROR_INITIALIZATION);
-			return;
-		}
-    }
-
-    SC_Bool_t achieved = SC_FALSE;
-    if (isAchieved)
-    {
-    	rc = SC_LocalAchievementsController_SetAchievedValueForAwardIdentifier(_localAchievementsController, achievementId, &achieved);
-    }
-    else
-    {
-		rc = SC_LocalAchievementsController_SetValueForAwardIdentifier(_localAchievementsController, achievementId, value, &achieved);
-    }
-
-    if (rc != SC_OK)
-    {
-        _listener->submitAchievementEvent(SocialSessionListener::ERROR_INITIALIZATION);
-        return;
-    }
-
-    if (achieved == SC_TRUE)
-    {
-    	const SocialAchievement *achievement = getAchievement(achievementId);
-    	if (achievement)
-    		_listener->awardAchievedEvent(SocialSessionListener::SUCCESS, *achievement);
-
-    	fprintf(stderr, "AWARD ACHIEVED %s!!!\n", achievementId);
-    }
-}
-
-void ScoreloopSocialSession::incrementAchievement(const char* achievementId, unsigned int increment)
-{
-    SC_Error_t rc;
-    if (_localAchievementsController == NULL)
-    {
-		rc = SC_Client_CreateLocalAchievementsController(_client, &_localAchievementsController, ScoreloopSocialSession::submitAchievementCallback, this);
-		if (rc != SC_OK)
-		{
-			_listener->submitAchievementEvent(SocialSessionListener::ERROR_INITIALIZATION);
-			return;
-		}
-    }
-    SC_Bool_t achieved;
-	rc = SC_LocalAchievementsController_IncrementValueForAwardIdentifier(_localAchievementsController, achievementId, &achieved);
-
-    if (achieved == SC_TRUE)
-    {
-    	const SocialAchievement *achievement = getAchievement(achievementId);
-    	if (achievement)
-    		_listener->awardAchievedEvent(SocialSessionListener::SUCCESS, *achievement);
-    }
-
-    if (rc != SC_OK)
-    {
-        _listener->submitAchievementEvent(SocialSessionListener::ERROR_INITIALIZATION);
-        return;
-    }
-}
-
-void ScoreloopSocialSession::synchronizeAchievements()
-{
-    SC_Error_t rc;
-    if (_localAchievementsController == NULL)
-    {
-		rc = SC_Client_CreateLocalAchievementsController(_client, &_localAchievementsController, ScoreloopSocialSession::submitAchievementCallback, this);
-		if (rc != SC_OK)
-		{
-			_listener->submitAchievementEvent(SocialSessionListener::ERROR_INITIALIZATION);
-			_pendingAchievementResponse = false;
-			return;
-		}
-    }
-
-	if (SC_LocalAchievementsController_ShouldSynchronize(_localAchievementsController) == SC_TRUE)
-	{
-		_pendingAchievementResponse = true;
-
-fprintf(stderr, "we are attempting to synchronize our achievements\n");
-		rc = SC_LocalAchievementsController_Synchronize(_localAchievementsController);
-		if (rc != SC_OK)
-		{
-			_listener->submitAchievementEvent(SocialSessionListener::ERROR_INITIALIZATION);
-			_pendingAchievementResponse = false;
-			return;
-		}
-	}
-}
-
-void ScoreloopSocialSession::submitAchievementCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-
-    switch (result)
-    {
-		case SC_OK:
-			session->getListener()->submitAchievementEvent(SocialSessionListener::SUCCESS);
-			break;
-		case SC_INVALID_USER_DATA:
-			session->getListener()->submitAchievementEvent(SocialSessionListener::ERROR_INVALID_USER);
-			break;
-		case SC_HTTP_SERVER_ERROR:
-			session->getListener()->submitAchievementEvent(SocialSessionListener::ERROR_SERVER);
-			break;
-		default:
-			session->getListener()->submitAchievementEvent(SocialSessionListener::ERROR_UNKNOWN);
-			break;
-    }
-
-    session->_pendingAchievementResponse = false;
-}
-
-void ScoreloopSocialSession::loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, const SocialPlayer& player, unsigned int count)
-{
-    if (_pendingScoresResponse)
-     {
-         _listener->loadScoresEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, _scores);
-         return;
-     }
-    _pendingScoresResponse = true;
-
-    SC_Error_t rc;
-    if (_scoresController == NULL)
-    {
-        rc = SC_Client_CreateScoresController(_client, &_scoresController, ScoreloopSocialSession::loadScoresCallback, this);
-        if (rc != SC_OK)
-        {
-            _listener->loadScoresEvent(SocialSessionListener::ERROR_INITIALIZATION, _scores);
-            _pendingScoresResponse = false;
-            return;
-        }
-    }
-
-    // Lookup the mode to be mapped for the specified leader board id
-    if (leaderboardId != NULL)
-    {
-        Properties* leaderboardMappings = _properties->getNamespace("leaderboard_mappings", false);
-        if (leaderboardMappings)
-        {
-            int mode = leaderboardMappings->getInt(leaderboardId);
-            if (mode >=  0)
-            {
-                SC_ScoresController_SetMode(_scoresController, (unsigned int)mode);
-            }
-        }
-    }
-
-    // Set the search list filter
-    SC_ScoresSearchList_t searchList;
-    searchList.countrySelector = SC_COUNTRY_SELECTOR_ALL;
-    searchList.buddyhoodUser = (SC_User_h)_user.handle;
-
-    switch (community)
-    {
-		case COMMUNITY_SCOPE_FRIENDS:
-			searchList.usersSelector = SC_USERS_SELECTOR_BUDDYHOOD;
-			break;
-		case COMMUNITY_SCOPE_ALL:
-		default:
-			searchList.usersSelector = SC_USERS_SELECTOR_ALL;
-			break;
-    }
-    switch(time)
-    {
-		case TIME_SCOPE_TODAY:
-			searchList.timeInterval = SC_TIME_INTERVAL_24H;
-			break;
-		case TIME_SCOPE_WEEK:
-            searchList.timeInterval = SC_TIME_INTERVAL_7DAYS;
-            break;
-		case TIME_SCOPE_ALL:
-		default:
-            searchList.timeInterval = SC_TIME_INTERVAL_ALL;
-            break;
-    }
-    SC_ScoresController_SetSearchList(_scoresController, searchList);
-
-    // Specify the player and range count to get the scores around
-    SC_User_h user = (SC_User_h)player.handle;
-    rc = SC_ScoresController_LoadScoresAroundUser(_scoresController, (SC_User_h)_user.handle, count);
-    if (rc != SC_OK)
-    {
-        SC_ScoresController_Release(_scoresController);
-        _scoresController = NULL;
-        _listener->loadScoresEvent(SocialSessionListener::ERROR_INITIALIZATION, _scores);
-    }
-}
-
-void ScoreloopSocialSession::loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, unsigned int start, unsigned int count)
-{
-    if (_pendingScoresResponse)
-    {
-        _listener->loadScoresEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, _scores);
-        return;
-    }
-    _pendingScoresResponse = true;
-
-    SC_Error_t rc;
-    if (_scoresController == NULL)
-    {
-        rc = SC_Client_CreateScoresController(_client, &_scoresController, ScoreloopSocialSession::loadScoresCallback, this);
-        if (rc != SC_OK)
-        {
-            _listener->loadScoresEvent(SocialSessionListener::ERROR_INITIALIZATION, _scores);
-            _pendingScoresResponse = false;
-            return;
-        }
-    }
-
-    // Lookup the mode to be mapped for the specified leaderboard id
-    if (leaderboardId != NULL)
-    {
-        Properties* leaderboardMappings = _properties->getNamespace("leaderboard_mappings", false);
-        if (leaderboardMappings)
-        {
-
-            int mode = leaderboardMappings->getInt(leaderboardId);
-            if (mode >=  0)
-            {
-                SC_ScoresController_SetMode(_scoresController, (unsigned int)mode);
-            }
-        }
-    }
-
-    // Set the search list filter
-    SC_ScoresSearchList_t searchList;
-    searchList.countrySelector = SC_COUNTRY_SELECTOR_ALL;
-    searchList.buddyhoodUser = (SC_User_h)_user.handle;
-
-    switch (community)
-    {
-		case COMMUNITY_SCOPE_FRIENDS:
-			searchList.usersSelector = SC_USERS_SELECTOR_BUDDYHOOD;
-			break;
-		case COMMUNITY_SCOPE_ALL:
-		default:
-			searchList.usersSelector = SC_USERS_SELECTOR_ALL;
-			break;
-    }
-
-    switch (time)
-    {
-		case TIME_SCOPE_TODAY:
-			searchList.timeInterval = SC_TIME_INTERVAL_24H;
-			break;
-		case TIME_SCOPE_WEEK:
-			searchList.timeInterval = SC_TIME_INTERVAL_7DAYS;
-			break;
-		case TIME_SCOPE_ALL:
-		default:
-			searchList.timeInterval = SC_TIME_INTERVAL_ALL;
-			break;
-    }
-    SC_ScoresController_SetSearchList(_scoresController, searchList);
-
-    // Set the search range
-   SC_Range_t range;
-   range.offset = start;
-   range.length = count;
-   rc = SC_ScoresController_LoadScores(_scoresController, range);
-   if (rc != SC_OK)
-   {
-       SC_ScoresController_Release(_scoresController);
-       _scoresController = NULL;
-       _pendingScoresResponse = false;
-       _listener->loadScoresEvent(SocialSessionListener::ERROR_INITIALIZATION, _scores);
-   }
-}
-
-void ScoreloopSocialSession::loadScoresCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-    switch (result)
-    {
-    	case SC_OK:
-        {
-            SC_ScoreFormatter_h scoreFormatter = SC_Client_GetScoreFormatter(session->_client);
-
-            SC_ScoreList_h scoresList = SC_ScoresController_GetScores(session->_scoresController);
-            unsigned int scoresCount = SC_ScoreList_GetCount(scoresList);
-            session->_scores.clear();
-            for (unsigned int i = 0; i < scoresCount; i++)
-            {
-                SocialScore score;
-                score.handle = SC_ScoreList_GetAt(scoresList, i);
-                score.rank = SC_Score_GetRank((SC_Score_h)score.handle);
-                score.value = (float)SC_Score_GetResult((SC_Score_h)score.handle);
-                SC_String_h formatted;
-                SC_ScoreFormatter_FormatScore(scoreFormatter, (SC_Score_h)score.handle, SC_SCORE_FORMAT_DEFAULT, &formatted);
-                score.valueFormatted = SC_String_GetData(formatted);
-                SC_User_h player = SC_Score_GetUser((SC_Score_h)score.handle);
-                SC_String_h playerStr = SC_User_GetLogin(player);
-                score.playerName = SC_String_GetData(playerStr);
-                session->_scores.push_back(score);
-            }
-            session->getListener()->loadScoresEvent(SocialSessionListener::SUCCESS, session->_scores);
-        }
-        break;
-
-		case SC_INVALID_USER_DATA:
-			session->getListener()->loadScoresEvent(SocialSessionListener::ERROR_INVALID_USER, session->_scores);
-			break;
-		case SC_HTTP_SERVER_ERROR:
-			session->getListener()->loadScoresEvent(SocialSessionListener::ERROR_SERVER, session->_scores);
-			break;
-		default:
-			session->getListener()->loadScoresEvent(SocialSessionListener::ERROR_UNKNOWN, session->_scores);
-			break;
-    }
-
-    session->_pendingScoresResponse = false;
-}
-
-void ScoreloopSocialSession::submitScore(const char* leaderboardId, float value)
-{
-    if (_pendingSubmitScoreResponse)
-    {
-        _listener->submitScoreEvent(SocialSessionListener::ERROR_PENDING_RESPONSE);
-        return;
-    }
-    _pendingSubmitScoreResponse = true;
-
-    SC_Error_t rc;
-    rc = SC_Client_CreateScoreController(_client, &_scoreController, ScoreloopSocialSession::submitScoreCallback, this);
-    if (rc != SC_OK)
-    {
-        _listener->submitScoreEvent(SocialSessionListener::ERROR_INITIALIZATION);
-        _pendingSubmitScoreResponse = false;
-        return;
-    }
-
-    // Create a score to submit
-    SC_Score_h score;
-    rc = SC_Client_CreateScore(_client, &score);
-    if (rc != SC_OK)
-    {
-        _listener->submitScoreEvent(SocialSessionListener::ERROR_INITIALIZATION);
-        _pendingSubmitScoreResponse = false;
-        return;
-    }
-
-    // Set the leaderboard to associate this score with
-    if (leaderboardId != NULL)
-    {
-        Properties* leaderboardMappings = _properties->getNamespace("leaderboard_mappings", true);
-        if (leaderboardMappings)
-        {
-            int mode = leaderboardMappings->getInt(leaderboardId);
-            if (mode >=  0)
-            {
-                SC_Score_SetMode(score, (unsigned int)mode);
-            }
-        }
-    }
-
-    // Set the score value and submit the score
-    SC_Score_SetResult(score, value);
-    rc = SC_ScoreController_SubmitScore(_scoreController, score);
-    if (rc != SC_OK)
-    {
-         SC_ScoreController_Release(_scoreController);
-         _scoreController = NULL;
-         _pendingSubmitScoreResponse = false;
-         _listener->submitScoreEvent(SocialSessionListener::ERROR_INITIALIZATION);
-    }
-
-    if (_acceptedChallenge)
-    {
-        if (_pendingChallengeResponse)
-        {
-            _listener->submitChallengeEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, *_acceptedChallenge);
-            return;
-        }
-        _pendingChallengeResponse = true;
-
-    	rc = SC_ChallengeController_SubmitChallengeScore(_challengeController, score);
-    	if (rc != SC_OK)
-    	{
-    		_listener->submitChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, *_acceptedChallenge);
-    		return;
-    	}
-    	_acceptedChallenge = 0;
-    }
-
-    SC_Score_Release(score);
-}
-
-void ScoreloopSocialSession::submitScoreCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-    switch (result)
-    {
-		case SC_OK:
-			session->getListener()->submitScoreEvent(SocialSessionListener::SUCCESS);
-			break;
-		case SC_INVALID_USER_DATA:
-			session->getListener()->submitScoreEvent(SocialSessionListener::ERROR_INVALID_USER);
-			break;
-		case SC_HTTP_SERVER_ERROR:
-			session->getListener()->submitScoreEvent(SocialSessionListener::ERROR_SERVER);
-			break;
-		default:
-			session->getListener()->submitScoreEvent(SocialSessionListener::ERROR_UNKNOWN);
-			break;
-    }
-
-    session->_pendingSubmitScoreResponse = false;
-}
-
-void ScoreloopSocialSession::submitChallenge(const SocialPlayer *player, float score, const char* leaderboardId, unsigned int wager)
-{
-	SocialChallenge challenge;
-
-    if (_pendingChallengeResponse)
-    {
-        _listener->submitChallengeEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, challenge);
-        return;
-    }
-    _pendingChallengeResponse = true;
-
-	SC_Error_t rc;
-	SC_Challenge_h sc_challenge;
-	SC_Money_h stake = NULL;
-
-	if (!_challengeController)
-	{
-		rc = SC_Client_CreateChallengeController(_client, &_challengeController, ScoreloopSocialSession::submitChallengeCallback, this);
-	    if (rc != SC_OK)
-	    {
-	    	_listener->submitChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, challenge);
-	        return;
-	    }
-	}
-
-	rc = SC_Client_CreateMoney(_client, &stake, wager);
-    if (rc != SC_OK)
-	{
-		_listener->submitChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, challenge);
-		return;
-	}
-
-    if (stake == NULL)
-    {
-        SC_MoneyList_h moneyList = SC_Session_GetChallengeStakes(SC_Client_GetSession(_client));
-        /* Just pick the first stake here - if available */
-        if (SC_MoneyList_GetCount(moneyList) > 0)
-        {
-            stake = SC_MoneyList_GetAt(moneyList, 0);
-        }
-    }
-
-    if (stake == NULL)
-	{
-		_listener->submitChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, challenge);
-	}
-
-    // Lookup the mode to be mapped for the specified leaderboard id
-	int mode = 0;
-    if (leaderboardId != NULL)
-    {
-        Properties* leaderboardMappings = _properties->getNamespace("leaderboard_mappings", false);
-        if (leaderboardMappings)
-        {
-            mode = leaderboardMappings->getInt(leaderboardId);
-            if (mode >=  0)
-            {
-                SC_ScoresController_SetMode(_scoresController, (unsigned int)mode);
-            }
-        }
-    }
-
-	//Passing null as the contestant argument creates an open challenge.
-	//The contender is automatically equal to the current session user.
-    SC_User_h challenger = (player) ? (SC_User_h)player->handle : NULL;
-	rc = SC_Client_CreateChallenge(_client, stake, challenger, mode, 0, &sc_challenge);
-	if (rc != SC_OK)
-	{
-		_listener->submitChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, challenge);
-		return;
-	}
-
-	rc = SC_ChallengeController_SetChallenge(_challengeController, sc_challenge);
-	if (rc != SC_OK)
-	{
-		_listener->submitChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, challenge);
-		return;
-	}
-
-	SC_Score_h sc_score;
-	rc = SC_Client_CreateScore(_client, &sc_score);
-	if (rc != SC_OK)
-	{
-		//_listener->submitChallengeScoreEvent(SocialSessionListener::ERROR_INITIALIZATION);
-		return;
-	}
-
-	SC_Score_SetMode(sc_score, (unsigned int)mode);
-	SC_Score_SetResult(sc_score, score);
-
-	rc = SC_ChallengeController_SubmitChallengeScore(_challengeController, sc_score);
-	if (rc != SC_OK)
-	{
-		_listener->submitChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, challenge);
-		return;
-	}
-	SC_Score_Release(sc_score);
-
-//	_listener->submitChallengeEvent(SocialSessionListener::SUCESS, challenge);
-}
-
-/**
- * @see SocialSession::submitChallenge
- */
-void ScoreloopSocialSession::submitAchievementChallenge(const SocialPlayer *player, const char* achievementId, unsigned int wager)
-{
-	SocialChallenge challenge;
-    _listener->submitChallengeEvent(SocialSessionListener::ERROR_NOT_SUPPORTED, challenge);
-}
-
-void ScoreloopSocialSession::submitChallengeCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-
-    SocialChallenge challenge;
-
-fprintf(stderr, "issueChallengeCallback is called!\n");
-    switch (result)
-    {
-    	case SC_OK:
-			{
-				challenge.handle = SC_ChallengeController_GetChallenge(session->_challengeController);
-
-				SC_User_h user = SC_Challenge_GetContestant((SC_Challenge_h)challenge.handle);
-				SC_String_h playerStr = (user) ? SC_User_GetLogin(user) : NULL;
-				challenge.challengedPlayerName = (playerStr) ? SC_String_GetData(playerStr) : "";
-
-				user = SC_Challenge_GetContender((SC_Challenge_h)challenge.handle);
-				playerStr = (user) ? SC_User_GetLogin(user) : NULL;
-				challenge.issuedPlayerName = (playerStr) ? SC_String_GetData(playerStr) : "";
-
-				SC_Score_h score = SC_Challenge_GetContenderScore((SC_Challenge_h)challenge.handle);
-				challenge.score = (float)SC_Score_GetResult(score);
-				SC_String_h dateStr = SC_Challenge_GetCreatedAt((SC_Challenge_h)challenge.handle);
-				challenge.dateTimeIssued = (dateStr) ? SC_String_GetData(dateStr) : "";
-
-				if (SC_Challenge_IsComplete((SC_Challenge_h)challenge.handle))
-					challenge.state = SocialChallenge::COMPLETE;
-				else if (SC_Challenge_IsRejected((SC_Challenge_h)challenge.handle))
-					challenge.state = SocialChallenge::DECLINED;
-				else if (SC_Challenge_IsAssigned((SC_Challenge_h)challenge.handle))
-					challenge.state = SocialChallenge::PENDING;
-				else
-					challenge.state = SocialChallenge::INVALID;
-
-				fprintf(stderr, "%s challenged player %s on %s\n", challenge.issuedPlayerName.data(), challenge.challengedPlayerName.data(), challenge.dateTimeIssued.data());
-				fprintf(stderr, "score to beat is %lf current state is %d\n", challenge.score, challenge.state);
-
-				session->getListener()->submitChallengeEvent(SocialSessionListener::SUCCESS, challenge);
-			}
-        	break;
-		case SC_INVALID_USER_DATA:
-			fprintf(stderr, "Hey, who the heck got us in here?\n");
-			session->getListener()->submitChallengeEvent(SocialSessionListener::ERROR_INVALID_USER, challenge);
-			break;
-		case SC_HTTP_SERVER_ERROR:
-			session->getListener()->submitChallengeEvent(SocialSessionListener::ERROR_SERVER, challenge);
-			break;
-		default:
-			session->getListener()->submitChallengeEvent(SocialSessionListener::ERROR_UNKNOWN, challenge);
-			break;
-    }
-
-    session->_pendingChallengeResponse = false;
-}
-
-
-void ScoreloopSocialSession::replyToChallenge(const SocialChallenge *challenge, bool accept)
-{
-	if (!challenge)
-		return;
-
-    if (_pendingChallengeResponse)
-    {
-        _listener->replyToChallengeEvent(SocialSessionListener::ERROR_PENDING_RESPONSE);
-        return;
-    }
-    _pendingChallengeResponse = true;
-
-	SC_Error_t rc;
-
-	if (_challengeController)
-	{
-		SC_ChallengeController_Release(_challengeController);
-fprintf(stderr, "creating new challenge controller\n");
-		rc = SC_Client_CreateChallengeController(_client, &_challengeController, ScoreloopSocialSession::replyToChallengeCallback, this);
-	    if (rc != SC_OK)
-	    {
-	    	_listener->replyToChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION);
-	        return;
-	    }
-	}
-
-	rc = SC_ChallengeController_SetChallenge(_challengeController, challenge1); //(SC_Challenge_h)challenge->handle);
-	if (rc != SC_OK)
-	{
-		SC_ChallengeController_Release(_challengeController);
-		_challengeController = 0;
-		fprintf(stderr, "have error SetChallenge %d %s\n", rc, SC_MapErrorToStr(rc));
-		_listener->replyToChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION);
-		return;
-	}
-
-fprintf(stderr, "replyTochallenge %d\n", accept);
-	if (accept)
-	{
-		rc = SC_ChallengeController_AcceptChallenge(_challengeController);
-		_acceptedChallenge = challenge;
-	}
-	else
-	{
-		rc = SC_ChallengeController_RejectChallenge(_challengeController);
-	}
-
-	if (rc != SC_OK)
-	{
-		fprintf(stderr, "have error in accept/reject challenge %d %s\n", rc, SC_MapErrorToStr(rc));
-		SC_ChallengeController_Release(_challengeController);
-		_challengeController = 0;
-	//	_listener->issueChallengeEvent(SocialSessionListener::ERROR_INITIALIZATION, challenge);
-		return;
-	}
-}
-
-void ScoreloopSocialSession::replyToChallengeCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-
-fprintf(stderr, "replyToChallengeCallback is called!\n");
-    switch (result)
-    {
-    	case SC_OK:
-			session->getListener()->replyToChallengeEvent(SocialSessionListener::SUCCESS);
-        	break;
-		case SC_INVALID_USER_DATA:
-			session->_acceptedChallenge = 0;
-			session->getListener()->replyToChallengeEvent(SocialSessionListener::ERROR_INVALID_USER);
-			break;
-		case SC_HTTP_SERVER_ERROR:
-			session->_acceptedChallenge = 0;
-			session->getListener()->replyToChallengeEvent(SocialSessionListener::ERROR_SERVER);
-			break;
-		default:
-			session->_acceptedChallenge = 0;
-			session->getListener()->replyToChallengeEvent(SocialSessionListener::ERROR_UNKNOWN);
-			break;
-    }
-
-    session->_pendingChallengeResponse = false;
-
-    SC_ChallengeController_Release(session->_challengeController);
-    session->_challengeController = 0;
-}
-
-void ScoreloopSocialSession::loadChallenges(bool showOpenChallengesOnly)
-{
-    if (_pendingChallengesResponse)
-    {
-    	_listener->loadChallengesEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, _challenges);
-        return;
-    }
-    _pendingChallengesResponse = true;
-
-	int mode;
-	SC_Error_t rc;
-
-	if (!_challengesController)
-	{
-		rc = SC_Client_CreateChallengesController(_client, &_challengesController, ScoreloopSocialSession::loadChallengesCallback, this);
-	    if (rc != SC_OK)
-	    {
-	    	_listener->loadChallengesEvent(SocialSessionListener::ERROR_INITIALIZATION, _challenges);
-	    	_pendingChallengesResponse = false;
-	        return;
-	    }
-	}
-
-	if (showOpenChallengesOnly)
-		rc = SC_ChallengesController_LoadOpenChallenges(_challengesController);
-	else
-		rc = SC_ChallengesController_LoadChallengeHistory(_challengesController);
-
-    if (rc != SC_OK)
-    {
-    	_listener->loadChallengesEvent(SocialSessionListener::ERROR_INITIALIZATION, _challenges);
-       	_pendingChallengesResponse = false;
-        return;
-    }
-}
-
-SocialChallenge &ScoreloopSocialSession::addChallenge(SC_Challenge_h scoreloopChallenge)
-{
-	SocialChallenge challenge;
-
-	challenge.handle = scoreloopChallenge;
-
-	SC_User_h user = SC_Challenge_GetContestant((SC_Challenge_h)challenge.handle);
-	SC_String_h playerStr = (user) ? SC_User_GetLogin(user) : NULL;
-	challenge.challengedPlayerName = (playerStr) ? SC_String_GetData(playerStr) : "";
-
-	user = SC_Challenge_GetContender((SC_Challenge_h)challenge.handle);
-	playerStr = (user) ? SC_User_GetLogin(user) : NULL;
-	challenge.issuedPlayerName = (playerStr) ? SC_String_GetData(playerStr) : "";
-
-	SC_Score_h score = SC_Challenge_GetContenderScore((SC_Challenge_h)challenge.handle);
-	challenge.score = (score) ? (float)SC_Score_GetResult(score) : 0;
-	SC_String_h dateStr = SC_Challenge_GetCreatedAt((SC_Challenge_h)challenge.handle);
-	challenge.dateTimeIssued = (dateStr) ? SC_String_GetData(dateStr) : "";
-	dateStr = SC_Challenge_GetCompletedAt((SC_Challenge_h)challenge.handle);
-	challenge.dateTimeCompleted = (dateStr) ? SC_String_GetData(dateStr) : "";
-
-	if (SC_Challenge_IsComplete((SC_Challenge_h)challenge.handle))
-		challenge.state = SocialChallenge::COMPLETE;
-	else if (SC_Challenge_IsRejected((SC_Challenge_h)challenge.handle))
-		challenge.state = SocialChallenge::DECLINED;
-	else if (SC_Challenge_IsAssigned((SC_Challenge_h)challenge.handle))
-		challenge.state = SocialChallenge::PENDING;
-	else
-		challenge.state = SocialChallenge::INVALID;
-
-    _challenges.push_back(challenge);
-
-    return _challenges.back();
-}
-
-void ScoreloopSocialSession::loadChallengesCallback(void* cookie, SC_Error_t result)
-{
-    ScoreloopSocialSession* session = (ScoreloopSocialSession*)cookie;
-
-    switch (result)
-    {
-    	case SC_OK:
-        {
-        	SC_ChallengeList_h challengeList = SC_ChallengesController_GetChallenges(session->_challengesController);
-
-            unsigned int count = SC_ChallengeList_GetCount(challengeList);
-            session->_challenges.clear();
-
-            for (unsigned int i = 0; i < count; i++)
-            {
-            	SC_Challenge_h sc_challenge = SC_ChallengeList_GetAt(challengeList, i);
-            	session->addChallenge(sc_challenge);
-            }
-
-            session->getListener()->loadChallengesEvent(SocialSessionListener::SUCCESS, session->_challenges);
-        }
-        break;
-
-		case SC_INVALID_USER_DATA:
-			session->getListener()->loadChallengesEvent(SocialSessionListener::ERROR_INVALID_USER, session->_challenges);
-			break;
-		case SC_HTTP_SERVER_ERROR:
-			session->getListener()->loadChallengesEvent(SocialSessionListener::ERROR_SERVER, session->_challenges);
-			break;
-		default:
-			session->getListener()->loadChallengesEvent(SocialSessionListener::ERROR_UNKNOWN, session->_challenges);
-			break;
-    }
-
-    session->_pendingChallengesResponse = false;
-}
-
-void ScoreloopSocialSession::loadSavedData(const char* key)
-{
-    if (_pendingDataResponse)
-    {
-        _listener->loadSavedDataEvent(SocialSessionListener::ERROR_PENDING_RESPONSE, "");
-        return;
-    }
-
-    SC_Error_t rc = SC_UserController_LoadUserContext(_userController);
-    if (rc != SC_OK)
-    {
-        _listener->loadSavedDataEvent(SocialSessionListener::ERROR_INITIALIZATION, "");
-        return;
-    }
-    _pendingDataResponse = true;
-    _key = key;
-}
-
-void ScoreloopSocialSession::submitSavedData(const char* key, std::string data)
-{
-    if (_pendingDataResponse)
-    {
-        _listener->submitSavedDataEvent(SocialSessionListener::ERROR_PENDING_RESPONSE);
-        return;
-    }
-    _pendingDataResponse = true;
-
-    SC_Context_h context;
-    SC_Error_t rc = SC_Context_New(&context);
-    if (rc != SC_OK)
-    {
-        _listener->submitSavedDataEvent(SocialSessionListener::ERROR_INITIALIZATION);
-        return;
-    }
-    SC_String_h str;
-    rc = SC_String_New(&str, data.c_str());
-    if (rc != SC_OK)
-    {
-        _listener->submitSavedDataEvent(SocialSessionListener::ERROR_INITIALIZATION);
-        return;
-    }
-    SC_Context_Put(context, key, str);
-    SC_User_SetContext((SC_User_h)_user.handle, context);
-    SC_UserController_SetUser(_userController, (SC_User_h)_user.handle);
-    rc = SC_UserController_UpdateUserContext(_userController);
-    if (rc != SC_OK)
-    {
-        _listener->submitSavedDataEvent(SocialSessionListener::ERROR_INITIALIZATION);
-        return;
-    }
-}
-
-void ScoreloopSocialSession::displayLeaderboard(const char* leaderboardId) const
-{
-	SC_Error_t rc;
-	int mode = 0;
-
-    // Set the leaderboard to associate this leaderboard with
-    if (leaderboardId != NULL)
-    {
-        Properties* leaderboardMappings = _properties->getNamespace("leaderboard_mappings", true);
-        if (leaderboardMappings)
-        {
-            mode = leaderboardMappings->getInt(leaderboardId);
-        }
-    }
-
-	rc = SCUI_Client_SetLeadearboardFlags(_uiClient, SCUI_LEADERBOARD_FLAGS_SHOW_LIST_AROUND_USER);
-	if (rc != SC_OK)
-	{
-		_listener->uiEvent(SocialSessionListener::ERROR_INITIALIZATION, SC_MapErrorToStr(rc));
-		return;
-	}
-
-	rc = SCUI_Client_ShowLeaderboardView(_uiClient, mode, SCUI_LEADERBOARD_TYPE_GLOBAL, NULL);
-	if (rc != SC_OK)
-	{
-		_listener->uiEvent(SocialSessionListener::ERROR_INITIALIZATION, SC_MapErrorToStr(rc));
-	}
-}
-
-void ScoreloopSocialSession::displayAchievements() const
-{
-	SC_Error_t rc;
-
-	rc = SCUI_Client_SetAchievementFlags(_uiClient, SCUI_ACHIEVEMENT_FLAGS_DEFAULT);
-	if (rc != SC_OK)
-	{
-		_listener->uiEvent(SocialSessionListener::ERROR_INITIALIZATION, SC_MapErrorToStr(rc));
-		return;
-	}
-
-	rc = SCUI_Client_ShowAchievementsView(_uiClient);
-	if (rc != SC_OK)
-	{
-		_listener->uiEvent(SocialSessionListener::ERROR_INITIALIZATION, SC_MapErrorToStr(rc));
-	}
-}
-
-void ScoreloopSocialSession::displayChallenges() const
-{
-	fprintf(stderr, "displayChallenges has been called\n");
-    SC_Error_t rc = SC_NOT_IMPLEMENTED_YET;
-
-    rc = SCUI_Client_SetChallengeFlags(_uiClient, SCUI_CHALLENGE_FLAGS_DEFAULT);
-    if (rc != SC_OK)
-    {
-        fprintf(stderr, "Can't set challenge flags\n");
-        return;
-    }
-
-    char format[] = "%.2f";
-    rc = SCUI_Client_SetSimpleMoneyFormat(_uiClient, format);
-    if (rc != SC_OK)
-    {
-        fprintf(stderr, "Can't set money format\n");
-        return;
-    }
-
-    rc = SCUI_Client_ShowChallengesView(_uiClient);
-   // rc = SCUI_Client_ShowChallengeCreateView(_uiClient);
-    if (rc != SC_OK)
-    {
-        fprintf(stderr, "Failed to start a Challenges card! %s\n", SC_MapErrorToStr(rc));
-    }
-}
-
-void ScoreloopSocialSession::displayChallengeSubmit(const SocialChallenge *challenge, float score) const
-{
-	SC_Error_t rc = SC_NOT_IMPLEMENTED_YET;
-
-	if (!challenge)
-		return;
-
-	rc = SCUI_Client_SetChallengeFlags(_uiClient, SCUI_CHALLENGE_FLAGS_DEFAULT);
-    if (rc != SC_OK)
-    {
-    	fprintf(stderr, "Can't set challenge flags\n");
-        return;
-    }
-
-    char format[] = "%.2f";
-    rc = SCUI_Client_SetSimpleMoneyFormat(_uiClient, format);
-    if (rc != SC_OK)
-    {
-    	fprintf(stderr, "Can't set money format\n");
-        return;
-    }
-    fprintf(stderr, "just before setting the score\n");
-	SC_Score_h sc_score;
-	rc = SC_Client_CreateScore(_client, &sc_score);
-	if (rc != SC_OK)
-	{
-		//_listener->submitChallengeScoreEvent(SocialSessionListener::ERROR_INITIALIZATION);
-		return;
-	}
-
-	int mode = 0;
-	SC_Score_SetMode(sc_score, (unsigned int)mode);
-	SC_Score_SetResult(sc_score, score);
-    rc = SCUI_Client_ShowChallengeSubmitView(_uiClient, (SC_Challenge_h)challenge->handle, sc_score);
-    if (rc != SC_OK)
-    {
-    	fprintf(stderr, "Failed to start a Challenges card! %s\n", SC_MapErrorToStr(rc));
-    }
-}
-
-void ScoreloopSocialSession::displayPopup(const char *popupMessage, const char *title) const
-{
-	dialog_instance_t dialog = 0;
-
-	dialog_create_toast(&dialog);
-
-	dialog_set_group_id(dialog, "dialogId");
-
-	dialog_set_toast_position(dialog, DIALOG_POSITION_TOP_CENTER);
-	dialog_set_toast_message_text(dialog, popupMessage);
-    
-    if (title)
-        dialog_set_title_text(dialog, title);
-
-	dialog_show(dialog);
-}
-
-}
-
-#endif

+ 0 - 273
gameplay/src/social/ScoreloopSocialSession.h

@@ -1,273 +0,0 @@
-#if defined(__QNX__) && defined(GP_USE_SOCIAL)
-
-#ifndef SCORELOOPSOCIALSESSION_H_
-#define SCORELOOPSOCIALSESSION_H_
-
-#include "SocialSession.h"
-#include <scoreloop/sc_client.h>
-#include <scoreloop/scui_client.h>
-#include <scoreloop/sc_init.h>
-#include <pthread.h>
-
-namespace gameplay
-{
-
-/**
- * Scoreloop implementation of SocialSession
- *
- * Note: ensure game.config has the following properties
- *
-  @verbatim
-    social
-    {
-         provider = Scoreloop
-         id  = d346c484-12aa-49a2-a0a0-de2f87492d72
-         secret = aAa+DehBfyGO/CYaE3nWomgu7SIbWFczUih+Qwf3/n7u0y3nyq5Hag==
-         version = 1.0
-         language = en
-         currency = ASC
-         leaderboard_mappings
-         {
-             // Format: leaderboardId =  mode <unsigned int>
-             easy = 0
-             medium = 1
-             hard = 2
-         }
-    }
- *
- * Note: Ensure your bar-descriptor.xml has:
- *
- * <action>read_device_identifying_information</action>
- *
- * @script{ignore}
- */
-class ScoreloopSocialSession : public SocialSession
-{
-    friend class SocialController;
-
-public:
-
-    /**
-     * @see SocialSession::getListener
-     */
-    SocialSessionListener* getListener();
-
-    /**
-     * Initializes the session with the local client definition for this game.
-     *
-     * @param listener The listener for responses for this session
-     * @param properties The properties to initialize this session with for this game.
-     */
-    static SocialSession *authenticate(SocialSessionListener* listener, Properties* properties);
-
-    /**
-     * @see SocialSession::getUser
-     */
-    const SocialPlayer& getUser() const;
-
-    /**
-     * @see SocialSession::loadFriends
-     */
-    void loadFriends();
-
-    /**
-     * @see SocialSession::loadAchievements
-     */
-    void loadAchievements();
-
-    /**
-     * @see SocialSession::submitAchievement
-     */
-    void submitAchievement(const char* achievementId, unsigned int value, bool achieved=false);
-
-    /**
-     * @see SocialSession::incrementAchievement
-     */
-    void incrementAchievement(const char* achievementId, unsigned int totalSteps=1);
-
-    /**
-      * @see SocialSession::syncAchievements
-      */
-    void synchronizeAchievements();
-
-    /**
-     * @see SocialSession::loadScores
-     */
-    void loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, const SocialPlayer& player, unsigned int count);
-
-    /**
-     * @see SocialSession::loadScores
-     */
-    void loadScores(const char* leaderboardId, CommunityScope community, TimeScope time, unsigned int start, unsigned int count);
-
-    /**
-     * @see SocialSession::submitScore
-     */
-    void submitScore(const char* leaderboardId, float score);
-
-    /**
-      * @see SocialSession::submitChallenge
-      */
-    void submitChallenge(const SocialPlayer *player, float score, const char* leaderboardId, unsigned int wager=0);
-
-    /**
-       * @see SocialSession::submitAchievementChallenge
-       */
-     void submitAchievementChallenge(const SocialPlayer *player, const char* achievementId, unsigned int wager=0);
-
-    /**
-      * @see SocialSession::loadChallenges
-      */
-    void loadChallenges(bool showOpenChallengesOnly=true);
-
-    /**
-      * @see SocialSession::acceptChallenge
-      */
-    void replyToChallenge(const SocialChallenge *challenge, bool accept);
-
-    /**
-     * @see SocialSession::requestSavedData
-     */
-    void loadSavedData(const char* key);
-
-    /**
-     * @see SocialSession::submitSavedData
-     */
-    void submitSavedData(const char* key, std::string data);
-
-    /**
-     * @see SocialSession::displayLeaderboard
-     */
-    void displayLeaderboard(const char* leaderboardId) const;
-
-    /**
-     * @see SocialSession::displayAchievements
-     */
-    void displayAchievements() const;
-
-    /**
-     * @see SocialSession::displayChallenges
-     */
-    void displayChallenges() const;
-
-    /**
-     * @see SocialSession::displayChallengeSubmit
-     */
-    void displayChallengeSubmit(const SocialChallenge *challenge, float score) const;
-
-    /**
-     * @see SocialSession::displayPopup
-     */
-    void displayPopup(const char *string, const char *title) const;
-
-    /**
-     * @see SocialSession::supportsChallenges
-     */
-    bool supportsChallenges() const { return true; }
-
-    /**
-     * @see SocialSession::supportsAchievementChallenges
-     */
-    bool supportsAchievementChallenges() const { return false; }
-
-    /**
-     * @see SocialSession::supportsMultiplayer
-     */
-    bool supportsMultiplayer() const { return false; }
-
-    /**
-     * @see SocialSession::supportsTurns
-     */
-    bool supportsTurns() const { return false; }
-
-protected:
-
-    bool handleEvent(void *event);
-
-private:
-
-    /**
-     * Contructor
-     */
-    ScoreloopSocialSession();
-
-    /**
-     * Destructor
-     */
-    virtual ~ScoreloopSocialSession();
-
-    static void* platformEventCallback(void* data);
-
-    static void userCallback(void* cookie, unsigned int result);
-
-    static void uiCallback(void *cookie, SCUI_Result_t result, const void *data);
-
-    static void loadFriendsCallback(void* cookie, SC_Error_t result);
-
-    static void loadAchievementsCallback(void* cookie, SC_Error_t result);
-
-    static void submitAchievementCallback(void* cookie, SC_Error_t result);
-
-    static void submitChallengeCallback(void *cookie, SC_Error_t result);
-
-    static void replyToChallengeCallback(void *cookie, SC_Error_t result);
-
-    static void submittedChallengeScoreCallback(void *cookie, SC_Error_t result);
-
-    static void loadChallengesCallback(void *cookie, SC_Error_t result);
-
-    static void loadScoresCallback(void* cookie, SC_Error_t result);
-
-    static void submitScoreCallback(void* cookie, SC_Error_t result);
-
-    const SocialAchievement* getAchievement(const char* achievementId) const;
-
-    SocialChallenge &addChallenge(SC_Challenge_h challenge);
-
-    static ScoreloopSocialSession* _session;
-
-    enum UserOp
-    {
-        USEROP_GET_LOCALUSER,
-        USEROP_WRITE_CONTEXT,
-        USEROP_READ_CONTEXT
-    };
-
-    SocialSessionListener* _listener;
-    Properties* _properties;
-    bool _pendingUserResponse;
-    bool _pendingFriendsResponse;
-    bool _pendingScoresResponse;
-    bool _pendingSubmitScoreResponse;
-    bool _pendingAchievementResponse;
-    bool _pendingChallengeResponse;
-    bool _pendingChallengesResponse;
-    bool _pendingDataResponse;
-    SC_InitData_t _initData;
-    SC_Client_h _client;
-    SCUI_Client_h _uiClient;
-    SC_UserController_h _userController;
-    SC_UsersController_h _usersController;
-    SC_LocalAchievementsController_h _localAchievementsController;
-    SC_ScoresController_h _scoresController;
-    SC_ScoreController_h _scoreController;
-    SC_ChallengeController_h _challengeController;
-    SC_ChallengesController_h _challengesController;
-    pthread_cond_t _channelCond;
-    pthread_mutex_t _channelMutex;
-    const char* _key;
-    std::string _data;
-    SocialPlayer _user;
-    const SocialChallenge* _acceptedChallenge;
-    UserOp _userOp;
-    std::vector<SocialPlayer> _friends;
-    std::vector<SocialAchievement> _achievements;
-    std::vector<SocialScore> _scores;
-    std::vector<SocialChallenge> _challenges;
-};
-
-}
-
-#endif
-
-#endif

+ 0 - 8
samples/browser/sample-browser.xcodeproj/project.pbxproj

@@ -63,8 +63,6 @@
 		42CACBE116ADA466000D911A /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42F2377116AD99EA0019CAC9 /* libpng.a */; };
 		42CACBE216ADA468000D911A /* libvorbis.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42DFAB9B16AD90080000F342 /* libvorbis.a */; };
 		42CACBE516ADA473000D911A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 42DFAB2316AD8C1C0000F342 /* libz.dylib */; };
-		42CC5A2A1809A6D900AAD8AD /* SceneRendererSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC5A281809A6D900AAD8AD /* SceneRendererSample.cpp */; };
-		42CC5A2B1809A6D900AAD8AD /* SceneRendererSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CC5A281809A6D900AAD8AD /* SceneRendererSample.cpp */; };
 		42DFAABC16AD89670000F342 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42DFAABB16AD89670000F342 /* CoreMotion.framework */; };
 		42DFAAD416AD8A8C0000F342 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42DFAAD316AD8A8C0000F342 /* Foundation.framework */; };
 		42DFAB1F16AD8BBC0000F342 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42DFAB1B16AD8BBC0000F342 /* OpenAL.framework */; };
@@ -142,8 +140,6 @@
 		42C933231491A6E50098216A /* libvorbis.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbis.a; path = "../../external-deps/oggvorbis/lib/macosx/libvorbis.a"; sourceTree = "<group>"; };
 		42C9332A1491A7390098216A /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = "../../external-deps/png/lib/macosx/libpng.a"; sourceTree = "<group>"; };
 		42C9332D1491A7810098216A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
-		42CC5A281809A6D900AAD8AD /* SceneRendererSample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneRendererSample.cpp; sourceTree = "<group>"; };
-		42CC5A291809A6D900AAD8AD /* SceneRendererSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneRendererSample.h; sourceTree = "<group>"; };
 		42DFAABB16AD89670000F342 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
 		42DFAAD316AD8A8C0000F342 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
 		42DFAB1B16AD8BBC0000F342 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/OpenAL.framework; sourceTree = DEVELOPER_DIR; };
@@ -325,8 +321,6 @@
 				42BE773716A68D07008AFA65 /* PhysicsCollisionObjectSample.h */,
 				422FE592169690830062D1FE /* PostProcessSample.cpp */,
 				422FE593169690830062D1FE /* PostProcessSample.h */,
-				42CC5A281809A6D900AAD8AD /* SceneRendererSample.cpp */,
-				42CC5A291809A6D900AAD8AD /* SceneRendererSample.h */,
 				420D544E15FE430D00AD0B91 /* SpriteBatchSample.cpp */,
 				420D544F15FE430D00AD0B91 /* SpriteBatchSample.h */,
 				42DFABD216AD96F10000F342 /* TerrainSample.cpp */,
@@ -511,7 +505,6 @@
 				420D546615FE430D00AD0B91 /* MeshPrimitiveSample.cpp in Sources */,
 				420D546C15FE430D00AD0B91 /* SpriteBatchSample.cpp in Sources */,
 				420D546E15FE430D00AD0B91 /* Sample.cpp in Sources */,
-				42CC5A2A1809A6D900AAD8AD /* SceneRendererSample.cpp in Sources */,
 				420D547015FE430D00AD0B91 /* TextSample.cpp in Sources */,
 				420D547215FE430D00AD0B91 /* TextureSample.cpp in Sources */,
 				420D547415FE430D00AD0B91 /* TriangleSample.cpp in Sources */,
@@ -541,7 +534,6 @@
 				420D546715FE430D00AD0B91 /* MeshPrimitiveSample.cpp in Sources */,
 				420D546D15FE430D00AD0B91 /* SpriteBatchSample.cpp in Sources */,
 				420D546F15FE430D00AD0B91 /* Sample.cpp in Sources */,
-				42CC5A2B1809A6D900AAD8AD /* SceneRendererSample.cpp in Sources */,
 				420D547115FE430D00AD0B91 /* TextSample.cpp in Sources */,
 				420D547315FE430D00AD0B91 /* TextureSample.cpp in Sources */,
 				420D547515FE430D00AD0B91 /* TriangleSample.cpp in Sources */,

+ 0 - 85
samples/browser/src/SceneRendererSample.cpp

@@ -1,85 +0,0 @@
-#include "SceneRendererSample.h"
-#include "SamplesGame.h"
-
-#if defined(ADD_SAMPLE)
-    ADD_SAMPLE("Scene", "SceneRenderer", SceneRendererSample, 3);
-#endif
-
-SceneRendererSample::SceneRendererSample() : _font(NULL), _scene(NULL)
-{
-}
-
-void SceneRendererSample::initialize()
-{
-    setMultiTouch(true);
-
-    _font = Font::create("res/common/arial.gpb");
-    _scene = Scene::load("res/common/sample.scene");
-    _renderer = SceneRendererForward::create();
-
-    // Test de-activating a node.
-    Node* pipe = _scene->findNode("pipe");
-    pipe->setActive(false);
-    _scene->getActiveCamera()->setAspectRatio(getAspectRatio());
-
-    // TODO: Remove this automatically Do this in the forward renderer
-    _scene->visit(this, &SceneRendererSample::initializeMaterials);
-}
-
-bool SceneRendererSample::initializeMaterials(Node* node)
-{
-    // TODO: Remove this automatically Do this in the forward renderer
-    Model* model = node->getModel();
-    if (model)
-    {
-        Material* material = model->getMaterial();
-        // For this sample we will only bind a single light to each object in the scene.
-        MaterialParameter* colorParam = material->getParameter("u_directionalLightColor[0]");
-        colorParam->setValue(Vector3(0.75f, 0.75f, 0.75f));
-        MaterialParameter* directionParam = material->getParameter("u_directionalLightDirection[0]");
-        directionParam->setValue(Vector3(0, -1, 0));
-    }
-    return true;
-}
-
-void SceneRendererSample::finalize()
-{
-    SAFE_RELEASE(_font);
-}
-
-void SceneRendererSample::update(float elapsedTime)
-{
-    _scene->update(elapsedTime);
-}
-
-void SceneRendererSample::render(float elapsedTime)
-{
-    clear(CLEAR_COLOR_DEPTH, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0);
-
-    _renderer->render(_scene);
-
-    drawFrameRate(_font, Vector4(0, 0.5f, 1, 1), 5, 1, getFrameRate());
-}
-
-void SceneRendererSample::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
-{
-    switch (evt)
-    {
-    case Touch::TOUCH_PRESS:
-        if (x < 75 && y < 50)
-        {
-            // Toggle Vsync if the user touches the top left corner
-            setVsync(!isVsync());
-            return;
-        }
-        break;
-    case Touch::TOUCH_RELEASE:
-        break;
-    case Touch::TOUCH_MOVE:
-        break;
-    };
-}
-
-void SceneRendererSample::keyEvent(Keyboard::KeyEvent evt, int key)
-{
-}

+ 0 - 35
samples/browser/src/SceneRendererSample.h

@@ -1,35 +0,0 @@
-#ifndef SCENERENDERERSAMPLE_H_
-#define SCENERENDERERSAMPLE_H_
-
-#include "gameplay.h"
-#include "Sample.h"
-
-using namespace gameplay;
-
-/**
- * Sample to show case the SceneRenderer
- */
-class SceneRendererSample : public Sample
-{
-public:
-
-    SceneRendererSample();
-
-protected:
-    void initialize();
-    void finalize();
-    void update(float elapsedTime);
-    void render(float elapsedTime);
-    void touchEvent(Touch::TouchEvent event, int x, int y, unsigned int contactIndex);
-    void keyEvent(Keyboard::KeyEvent evt, int key);
-
-private:
-
-    bool initializeMaterials(Node* node);
-
-    Font* _font;
-    Scene* _scene;
-    SceneRenderer* _renderer;
-};
-
-#endif

+ 0 - 45
samples/spaceship/game.config

@@ -5,48 +5,3 @@ window
     height = 720
     fullscreen = false
 }
-
-social
-{
-     provider = Scoreloop
-     id  = ca02880e-9698-4a39-99d8-0117bee2b0e4
-     secret = H/6hp8lK8Aff9w6dVsikxVoqPxbyEqy653Dfj7akjNloHZd+ykAxOw==
-     version = 1.0
-     language = en
-     currency = DOJ
-     leaderboard_mappings
-     {
-         // Format: leaderboardId =  mode <unsigned int>
-         # Game Center
-#         leaderboard = grp.spaceship.leaderboard
-     }
-     
-     achievement_mappings
-     {
-         // Format: internalId = externalId <string>
-     
-         # Scoreloop 
-         gameplay.spaceship.firsttime = rim.spaceship.firsttime
-         gameplay.spaceship.cleanrun = rim.spaceship.cleanrun
-         gameplay.spaceship.under20 = rim.spaceship.under20         
-         gameplay.spaceship.under17 = rim.spaceship.under17
-         gameplay.spaceship.under16 = rim.spaceship.under16
-         gameplay.spaceship.tentimes = rim.spaceship.tentimes
-         gameplay.spaceship.fiftytimes = rim.spaceship.fiftytimes
-         gameplay.spaceship.hundredtimes = rim.spaceship.hundredtimes
-         gameplay.spaceship.challenge = rim.spaceship.challenge
-         gameplay.spaceship.winchallenge = rim.spaceship.winchallenge
-
-		  # Game Center
-#         gameplay.spaceship.firsttime = grp.gameplay.spaceship.firsttime
-#         gameplay.spaceship.cleanrun = grp.gameplay.spaceship.cleanrun
-#         gameplay.spaceship.under20 = grp.gameplay.spaceship.under20         
-#         gameplay.spaceship.under17 = grp.gameplay.spaceship.under17
-#         gameplay.spaceship.under16 = grp.gameplay.spaceship.under16
-#         gameplay.spaceship.tentimes = grp.gameplay.spaceship.tentimes
-#         gameplay.spaceship.fiftytimes = grp.gameplay.spaceship.fiftytimes
-#         gameplay.spaceship.hundredtimes = grp.gameplay.spaceship.hundredtimes
-#         gameplay.spaceship.challenge = grp.gameplay.spaceship.challenge
-#         gameplay.spaceship.winchallenge = grp.gameplay.spaceship.winchallenge
-     }
-}

BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.challenge.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.challenge.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.cleanrun.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.cleanrun.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.fiftytimes.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.fiftytimes.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.firsttime.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.firsttime.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.hundredtimes.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.hundredtimes.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.tentimes.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.tentimes.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under16.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under16.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under17.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under17.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under20.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.under20.unachieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.winchallenge.achieved.png


BIN
samples/spaceship/scoreloop/SLAwards.bundle/Award.rim.spaceship.winchallenge.unachieved.png


+ 0 - 1
samples/spaceship/scoreloop/SLAwards.bundle/Info.json

@@ -1 +0,0 @@
-{"achievable_list_identifier":"390244a1-5ef1-495f-be00-33b56b0f4e0e","awards":[{"counterMin":0,"counterRange":1,"identifier":"rim.spaceship.firsttime","rewardMoney":{"amount":500,"currency":"DOJ"}},{"counterMin":0,"counterRange":1,"identifier":"rim.spaceship.cleanrun","rewardMoney":{"amount":1000,"currency":"DOJ"}},{"counterMin":0,"counterRange":1,"identifier":"rim.spaceship.under20","rewardMoney":{"amount":1000,"currency":"DOJ"}},{"counterMin":0,"counterRange":1,"identifier":"rim.spaceship.under17","rewardMoney":{"amount":1500,"currency":"DOJ"}},{"counterMin":0,"counterRange":1,"identifier":"rim.spaceship.under16","rewardMoney":{"amount":3000,"currency":"DOJ"}},{"counterMin":0,"counterRange":10,"identifier":"rim.spaceship.tentimes","rewardMoney":{"amount":500,"currency":"DOJ"}},{"counterMin":0,"counterRange":50,"identifier":"rim.spaceship.fiftytimes","rewardMoney":{"amount":1000,"currency":"DOJ"}},{"counterMin":0,"counterRange":100,"identifier":"rim.spaceship.hundredtimes","rewardMoney":{"amount":2000,"currency":"DOJ"}},{"counterMin":0,"counterRange":1,"identifier":"rim.spaceship.challenge","rewardMoney":{"amount":1000,"currency":"DOJ"}},{"counterMin":0,"counterRange":1,"identifier":"rim.spaceship.winchallenge","rewardMoney":{"amount":2000,"currency":"DOJ"}}]}

+ 0 - 20
samples/spaceship/scoreloop/SLAwards.bundle/en.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"Award.rim.spaceship.firsttime.title" = "First Time For Everything";
-"Award.rim.spaceship.firsttime.description" = "Played the game for the first time.";
-"Award.rim.spaceship.cleanrun.title" = "Clean Run";
-"Award.rim.spaceship.cleanrun.description" = "Don't hit anything.";
-"Award.rim.spaceship.under20.title" = "Under 20!";
-"Award.rim.spaceship.under20.description" = "Beat the game in under 20 seconds.";
-"Award.rim.spaceship.under17.title" = "Warp Speed";
-"Award.rim.spaceship.under17.description" = "Beat the game in under 17 seconds";
-"Award.rim.spaceship.under16.title" = "Ludicrous Speed";
-"Award.rim.spaceship.under16.description" = "Beat the game in under 16 seconds.";
-"Award.rim.spaceship.tentimes.title" = "Ten Times the Fun";
-"Award.rim.spaceship.tentimes.description" = "Play the game 10 times.";
-"Award.rim.spaceship.fiftytimes.title" = "The Golden Years";
-"Award.rim.spaceship.fiftytimes.description" = "Play the game 50 times.";
-"Award.rim.spaceship.hundredtimes.title" = "The Century Mark";
-"Award.rim.spaceship.hundredtimes.description" = "Play the game 100 times.";
-"Award.rim.spaceship.challenge.title" = "Challenge!";
-"Award.rim.spaceship.challenge.description" = "Challenge a friend to a game.";
-"Award.rim.spaceship.winchallenge.title" = "And the winner is...";
-"Award.rim.spaceship.winchallenge.description" = "Win a challenge.";

+ 1 - 401
samples/spaceship/src/SpaceshipGame.cpp

@@ -64,9 +64,7 @@ static const char *leaderboardName = "leaderboard";
 SpaceshipGame::SpaceshipGame()
     : _scene(NULL), _cameraNode(NULL), _shipGroupNode(NULL), _shipNode(NULL), _propulsionNode(NULL), _glowNode(NULL),
       _stateBlock(NULL), _font(NULL), _throttle(0), _shipTilt(0), _finished(true), _finishedTime(0), _pushing(false), _time(0),
-       _glowDiffuseParameter(NULL), _shipSpecularParameter(NULL), _spaceshipSound(NULL), _socialSession(NULL), _currentChallenge(NULL),
-       _challengedPlayer(NULL), _hitSomething(false), _wonChallenge(false), _createdChallenge(false), _creatingChallenge(false), _hasAcceptedChallenge(false),
-       _menu(NULL), _challengeForm(NULL), _friendsContainer(NULL), _challengeContainer(NULL)
+       _glowDiffuseParameter(NULL), _shipSpecularParameter(NULL), _spaceshipSound(NULL)
 {
 }
 
@@ -106,26 +104,6 @@ void SpaceshipGame::initialize()
     // Create font
     _font = Font::create("res/airstrip.gpb");
 
-    // Create menu.
-    _menu = Form::create("res/menu.form");
-    _menu->setEnabled(true);
-
-    _challengeForm = Form::create("res/challenge.form");
-    _challengeForm->setEnabled(false);
-
-    // Listen for menu-button click events.
-    _menu->getControl("reset")->addListener(this, Control::Listener::CLICK);
-    _menu->getControl("leaderboard")->addListener(this, Control::Listener::CLICK);
-    _menu->getControl("achievements")->addListener(this, Control::Listener::CLICK);
-    _menu->getControl("challenges")->addListener(this, Control::Listener::CLICK);
-
-    _challengeForm->getControl("challengeanyone")->addListener(this, Control::Listener::CLICK);
-    _challengeForm->getControl("refreshChallenges")->addListener(this, Control::Listener::CLICK);
-    _challengeForm->getControl("back")->addListener(this, Control::Listener::CLICK);
-
-    _friendsContainer = static_cast<Container*>(_challengeForm->getControl("friendsList"));
-    _challengeContainer = static_cast<Container*>(_challengeForm->getControl("challengeList"));
-
     // Store camera node
     _cameraNode = _scene->findNode("camera1");
 
@@ -133,9 +111,6 @@ void SpaceshipGame::initialize()
     _initialShipPos = _shipGroupNode->getTranslation();
     _initialShipRot = _shipGroupNode->getRotation();
     _initialCameraPos = _cameraNode->getTranslation();
-
-    if (getSocialController())
-    	getSocialController()->authenticate(this);
 }
 
 void SpaceshipGame::initializeSpaceship()
@@ -255,8 +230,6 @@ void SpaceshipGame::finalize()
     SAFE_RELEASE(_font);
     SAFE_RELEASE(_stateBlock);
     SAFE_RELEASE(_scene);
-    SAFE_RELEASE(_menu);
-    SAFE_RELEASE(_challengeForm);
 }
 
 void SpaceshipGame::update(float elapsedTime)
@@ -279,9 +252,6 @@ void SpaceshipGame::update(float elapsedTime)
 		{
             _backgroundSound->stop();
         	_throttle = 0.0f;
-
-        	postScore(_time);
-        	updateAchievements(_time);
 		}
     }
 
@@ -388,12 +358,6 @@ void SpaceshipGame::update(float elapsedTime)
     // Modify ship glow effect based on the throttle
     _glowDiffuseParameter->setValue(Vector4(1, 1, 1, _throttle * ENGINE_POWER));
     _shipSpecularParameter->setValue(SPECULAR - ((SPECULAR-2.0f) * _throttle));
-
-    if (_menu->isEnabled())
-        _menu->update(elapsedTime);
-
-    if (_challengeForm->isEnabled())
-    	_challengeForm->update(elapsedTime);
 }
 
 void SpaceshipGame::handleCollisions(float t)
@@ -459,7 +423,6 @@ void SpaceshipGame::handleCollisions(float t)
             _finished = true;
             _finishedTime = getAbsoluteTime();
             _pushing = false;
-            _menu->setEnabled(true);
         }
     }
 }
@@ -505,14 +468,6 @@ void SpaceshipGame::render(float elapsedTime)
 
     // Draw game text (yellow)
     drawText();
-
-    // Draw menu
-    if (_menu->isEnabled())
-        _menu->draw();
-
-    // Draw menu
-    if (_challengeForm->isEnabled())
-    	_challengeForm->draw();
 }
 
 void SpaceshipGame::drawSplash(void* param)
@@ -590,360 +545,5 @@ void SpaceshipGame::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int
     }
 }
 
-void SpaceshipGame::controlEvent(Control* control, EventType evt)
-{
-    // Handle UI events.
-    switch (evt)
-    {
-		case Listener::CLICK:
-			if (strcmp(control->getId(), "reset") == 0)
-			{
-				// Play again.
-				_menu->setEnabled(false);
-				if (_creatingChallenge)
-				{
-					_creatingChallenge = false;
-					_challengedPlayer = 0;
-				}
-				resetGame();
-			}
-			else if (strcmp(control->getId(), "back") == 0)
-			{
-				_challengeForm->setEnabled(false);
-				_menu->setEnabled(true);
-			}
-			else if (_socialSession && strcmp(control->getId(), "leaderboard") == 0)
-			{
-				// Display the leaderboard.
-				_socialSession->displayLeaderboard(leaderboardName);
-			}
-			else if (_socialSession && strcmp(control->getId(), "achievements") == 0)
-			{
-				// Display the achievements.
-				_socialSession->displayAchievements();
-			}
-			else if (_socialSession && strcmp(control->getId(), "challenges") == 0)
-			{
-				// Display the challenges.
-				_socialSession->displayChallenges();
-			//	_menu->setEnabled(false);
-			//	_challengeForm->setEnabled(true);
-			}
-			else if (strcmp(control->getId(), "challengeanyone") == 0)
-			{
-				_challengedPlayer = 0;
-				_challengeForm->setEnabled(false);
-				_creatingChallenge = true;
-				resetGame();
-			}
-			else if (strncmp(control->getId(), "friend_", 7) == 0)
-			{
-				char *player = strchr((char *)control->getId(), '_');
-				player++;
-				fprintf(stderr, "searching for player %s\n", player);
-				_challengedPlayer = getPlayer(player);
-				_challengeForm->setEnabled(false);
-				_creatingChallenge = true;
-				resetGame();
-			}
-			else if (_socialSession && strcmp(control->getId(), "refreshChallenges") == 0)
-			{
-				_socialSession->loadChallenges(true);
-			}
-			else if (_socialSession && strncmp(control->getId(), "openchallenge_", 14) == 0)
-			{
-				char *challengeName = strchr((char *)control->getId(), '_');
-				challengeName++;
-				const SocialChallenge *challenge = getChallenge(challengeName);
-			//	_challengeForm->setEnabled(false);
-				if (challenge)
-				{
-					_hasAcceptedChallenge = true;
-					_socialSession->replyToChallenge(challenge, true);
-					_challengeForm->setEnabled(false);
-					resetGame();
-				}
-			}
-			break;
-        default:
-            break;
-    }
-}
-
-void SpaceshipGame::postScore(double result)
-{
-	if (_socialSession)
-	{
-		_socialSession->submitScore(leaderboardName, result);
-
-		if (_creatingChallenge)
-		{
-			_socialSession->submitChallenge(_challengedPlayer, result);
-			_creatingChallenge = false;
-            _createdChallenge = true;
-			_challengedPlayer = 0;
-		}
-		else if (_hasAcceptedChallenge)
-		{
-			if (_currentChallenge)
-				_socialSession->displayChallengeSubmit(_currentChallenge, result);
-
-			_currentChallenge = 0;
-			_hasAcceptedChallenge = false;
-		}
-	}
-}
-
-void SpaceshipGame::updateAchievements(double time)
-{
-	// go through our achievements and update them accordingly
-	if (_socialSession)
-	{
-		// increase the game count awards
-		_socialSession->incrementAchievement("gameplay.spaceship.firsttime", 1);
-		_socialSession->incrementAchievement("gameplay.spaceship.tentimes", 10);
-		_socialSession->incrementAchievement("gameplay.spaceship.fiftytimes", 50);
-		_socialSession->incrementAchievement("gameplay.spaceship.hundredtimes", 100);
-
-		// clean run award
-		if (!_hitSomething)
-			_socialSession->submitAchievement("gameplay.spaceship.cleanrun", 100, true);
 
-		if (time < 16)
-			_socialSession->submitAchievement("gameplay.spaceship.under16", 100, true);
 
-		if (time < 17)
-			_socialSession->submitAchievement("gameplay.spaceship.under17", 100, true);
-
-		if (time < 20)
-			_socialSession->submitAchievement("gameplay.spaceship.under20", 100, true);
-
-        if (_createdChallenge)
-            _socialSession->submitAchievement("gameplay.spaceship.challenge", 100, true);
-
-        if (_wonChallenge)
-            _socialSession->submitAchievement("gameplay.spaceship.winchallenge", 100, true);
-
-		_socialSession->synchronizeAchievements();
-	}
-}
-
-const SocialPlayer *SpaceshipGame::getPlayer(const char *name) const
-{
-	for (unsigned int i = 0; i < _friends.size(); i++)
-	{
-		if (strcmp(_friends[i].name.data(), name) == 0)
-			return &_friends[i];
-	}
-
-	return 0;
-}
-
-const SocialChallenge *SpaceshipGame::getChallenge(const char *date) const
-{
-	for (unsigned int i = 0; i < _challenges.size(); i++)
-	{
-		if (strcmp(_challenges[i].dateTimeIssued.data(), date) == 0)
-			return &_challenges[i];
-	}
-
-	return 0;
-}
-
-void SpaceshipGame::authenticateEvent(ResponseCode code, SocialSession* session)
-{
-	fprintf(stderr, "authentication FINISHED\n");
-
-	if (code == SUCCESS)
-	{
-		_socialSession = session;
-		_socialSession->loadFriends();
-	}
-	else
-    {
-		fprintf(stderr, "Error authenticating the social session %d\n", code);
-    }
-}
-
-void SpaceshipGame::loadFriendsEvent(ResponseCode code, std::vector<SocialPlayer> friends)
-{
-	if (code == SUCCESS)
-	{
-		_friends.clear();
-		_friends = friends;
-
-		buildFriendsChooser();
-
-		for (unsigned int i = 0 ; i < _friends.size(); i++)
-		{
-			fprintf(stderr, "Friend %d is %s\n", i, _friends[i].name.data());
-		}
-
-		_socialSession->loadAchievements();
-	}
-	else
-	{
-		fprintf(stderr, "Error loading friends\n");
-	}
-}
-
-void SpaceshipGame::loadAchievementsEvent(ResponseCode code, std::vector<SocialAchievement> achievements)
-{
-	if (code == SUCCESS)
-	{
-		for (unsigned int i = 0 ; i < achievements.size(); i++)
-		{
-			fprintf(stderr, "Achievement %d is %s\n", i, achievements[i].name.data());
-		}
-	}
-	else
-    {
-		fprintf(stderr, "Error loading achievements %d\n", code);
-    }
-}
-
-void SpaceshipGame::submitAchievementEvent(ResponseCode code)
-{
-}
-
-void SpaceshipGame::synchronizeAchievementEvent(ResponseCode code)
-{
-}
-
-void SpaceshipGame::awardAchievedEvent(ResponseCode code, const SocialAchievement &achievement)
-{
-	if (code == SUCCESS)
-	{
-		char message[256];
-		sprintf(message, "You've earned the %s award.", achievement.title.data());
-
-		_socialSession->displayPopup(message);
-	}
-}
-
-void SpaceshipGame::loadScoresEvent(ResponseCode code, std::vector<SocialScore> scores)
-{
-	if (code == SUCCESS)
-	{
-        for (unsigned int i = 0 ; i < scores.size(); i++)
-		{
-			fprintf(stderr, "Score %d for %s is %lf\n", i, scores[i].playerName.data(), scores[i].value);
-		}
-	}
-	else
-    {
-		fprintf(stderr, "Error loading scores %d\n", code);
-    }
-}
-
-void SpaceshipGame::submitScoreEvent(ResponseCode code)
-{
-	_socialSession->loadScores(leaderboardName, SocialSession::COMMUNITY_SCOPE_ALL, SocialSession::TIME_SCOPE_ALL, 1, 20);
-}
-
-void SpaceshipGame::submitChallengeEvent(ResponseCode code, const SocialChallenge &challenge)
-{
-    fprintf(stderr, "created challenge successfully\n");
-    _createdChallenge = true;
-}
-
-void SpaceshipGame::startChallengeEvent(ResponseCode code, const SocialChallenge &challenge)
-{
-	if (code == SUCCESS)
-	{
-		_hasAcceptedChallenge = true;
-		_currentChallenge = &challenge;
-		_menu->setEnabled(false);
-		resetGame();
-	}
-}
-
-void SpaceshipGame::replyToChallengeEvent(ResponseCode code)
-{
-}
-
-void SpaceshipGame::loadChallengesEvent(ResponseCode code, std::vector<SocialChallenge> challenges)
-{
-	if (code == SUCCESS)
-	{
-		_challenges.clear();
-		_challenges = challenges;
-
-		buildChallengeChooser();
-
-		for (unsigned int i = 0 ; i < challenges.size(); i++)
-		{
-            if (challenges[i].state == SocialChallenge::COMPLETE)
-                _wonChallenge = true;
-
-			fprintf(stderr, "Challenge score %lf issued on %s by %s for %s.  Status %d\n", challenges[i].score, challenges[i].dateTimeIssued.c_str(), challenges[i].issuedPlayerName.c_str(), challenges[i].challengedPlayerName.c_str(), challenges[i].state);
-		}
-	}
-	else
-    {
-		fprintf(stderr, "Error loading challenges %d\n", code);
-    }
-}
-
-void SpaceshipGame::loadSavedDataEvent(ResponseCode code, std::string data)
-{
-}
-
-void SpaceshipGame::submitSavedDataEvent(ResponseCode code)
-{
-}
-
-void SpaceshipGame::buildFriendsChooser()
-{
-	Theme* theme = _challengeForm->getTheme();
-	Theme::Style* buttonStyle = theme->getStyle("buttonStyle");
-
-	if (!_friendsContainer) return;
-
-	const size_t size = _friends.size();
-	for (size_t i = 0; i < size; ++i)
-	{
-		char buf[128];
-		sprintf(buf, "friend_%s", _friends[i].name.data());
-		Button* button = Button::create(buf, buttonStyle);
-		button->setText(_friends[i].name.data());
-		button->setPosition(0, 110*(i+1));
-		button->setWidth(400);
-		button->setHeight(100);
-		button->addListener(this, Control::Listener::CLICK);
-		_friendsContainer->addControl(button);
-		button->release();
-	}
-}
-
-void SpaceshipGame::buildChallengeChooser()
-{
-	if (!_challengeContainer) return;
-#if 0
-	const std::vector<Control*> controls = _challengeContainer->getControls();
-	if (controls.size() > 1)
-	{
-		for (int i = controls.size() - 1; i >= 0; i--)
-			_challengeContainer->removeControl(i);
-	}
-#endif
-
-	Theme* theme = _challengeForm->getTheme();
-	Theme::Style* buttonStyle = theme->getStyle("buttonStyle");
-
-	const size_t size = _challenges.size();
-
-	for (size_t i = 0; i < size; ++i)
-	{
-		char buf[128];
-		sprintf(buf, "openchallenge_%s", _challenges[i].dateTimeIssued.data());
-		Button* button = Button::create(buf, buttonStyle);
-		button->setText(_challenges[i].issuedPlayerName.data());
-		button->setPosition(0, 110*i);
-		button->setWidth(400);
-		button->setHeight(100);
-		button->addListener(this, Control::Listener::CLICK);
-		_challengeContainer->addControl(button);
-		button->release();
-	}
-}

+ 1 - 114
samples/spaceship/src/SpaceshipGame.h

@@ -8,7 +8,7 @@ using namespace gameplay;
 /**
  * Spaceship game.
  */
-class SpaceshipGame : public Game, public SocialSessionListener, public Control::Listener
+class SpaceshipGame : public Game
 {
 public:
 
@@ -55,80 +55,6 @@ protected:
     void render(float elapsedTime);
 
 
-    /**
-     * @see SocialSessionListener::authenticateEvent
-     */
-    void authenticateEvent(ResponseCode code, SocialSession* session);
-
-    /**
-     * @see SocialSessionListener::loadFriendsEvent
-     */
-    void loadFriendsEvent(ResponseCode code, std::vector<SocialPlayer> friends);
-
-    /**
-     * @see SocialSessionListener::loadAchievementsEvent
-     */
-    void loadAchievementsEvent(ResponseCode code, std::vector<SocialAchievement> achievements);
-
-    /**
-     * @see SocialSessionListener::submitAchievementEvent
-     */
-    void synchronizeAchievementEvent(ResponseCode code);
-
-    /**
-     * @see SocialSessionListener::sumbitAchievementEvent
-     */
-    void submitAchievementEvent(ResponseCode code);
-
-    /**
-     * @see SocialSessionListener::awardAchievedEvent
-     */
-    void awardAchievedEvent(ResponseCode code, const SocialAchievement &achievement);
-
-    /**
-     * @see SocialSessionListener::loadScoresEvent
-     */
-    void loadScoresEvent(ResponseCode code, std::vector<SocialScore> scores);
-
-    /**
-     * @see SocialSessionListener::submitScoreEvent
-     */
-    void submitScoreEvent(ResponseCode code);
-
-    /**
-     * @see SocialSessionListener::submitChallengeEvent
-     */
-    void submitChallengeEvent(ResponseCode code, const SocialChallenge &challenge);
-
-    /**
-     * @see SocialSessionListener::startChallengeEvent
-     */
-    void startChallengeEvent(ResponseCode code, const SocialChallenge &challenge);
-
-    /**
-      * @see SocialSessionListener::replyToChallengeEvent
-      */
-    void replyToChallengeEvent(ResponseCode code);
-
-    /**
-     * @see SocialSessionListener::loadChallengesEvent
-     */
-    void loadChallengesEvent(ResponseCode code);
-
-    /**
-     * @see SocialSessionListener::loadChallengesEvent
-     */
-    void loadChallengesEvent(ResponseCode code, std::vector<SocialChallenge> challenges);
-
-    /**
-     * @see SocialSessionListener::loadSavedDataEvent
-     */
-    void loadSavedDataEvent(ResponseCode code, std::string data);
-
-    /**
-     * @see SocialSessionListener::submitSavedDataEvent
-     */
-    void submitSavedDataEvent(ResponseCode code);
 
 private:
 
@@ -180,28 +106,6 @@ private:
      */
     void drawText();
 
-    /**
-     * Posts score.
-     */
-    void postScore(double result);
-
-    /**
-     * Update the achievements.
-     */
-    void updateAchievements(double time);
-
-    /**
-     * @see ControlListener::controlEvent
-     */
-    void controlEvent(Control* control, EventType evt);
-
-    const SocialPlayer *getPlayer(const char *name) const;
-
-    const SocialChallenge *getChallenge(const char *date) const;
-
-    void buildFriendsChooser();
-
-    void buildChallengeChooser();
 
     // Scene variables
     Scene* _scene;
@@ -242,24 +146,7 @@ private:
     AudioSource* _backgroundSound;
     AudioSource* _spaceshipSound;
 
-    // Social
-    SocialSession* _socialSession;
-    const SocialChallenge* _currentChallenge;
-    const SocialPlayer* _challengedPlayer;
-    std::vector<SocialPlayer> _friends;
-    std::vector<SocialChallenge> _challenges;
     bool _hitSomething;
-    bool _wonChallenge;
-    bool _createdChallenge;
-    bool _creatingChallenge;
-    bool _hasAcceptedChallenge;
-
-    // End-game Menu
-    Form* _menu;
-    Form* _challengeForm;
-    Container* _friendsContainer;
-    Container* _challengeContainer;
-
 };
 
 #endif