GameCenterManager.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // GameCenterManager.h
  3. // gameCenterDemo
  4. //
  5. // Created by 蒋龙 on 2020/7/1.
  6. // Copyright © 2020 com.youloft.cq. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @protocol GameCenterManagerDelegate <NSObject>
  11. @optional
  12. /// 登录GameCenter回调
  13. /// @param msgDic 回调字典
  14. -(void)loginGameCenterDidCompleteWithDic:(NSDictionary *)msgDic;
  15. /// 上传分数回调
  16. /// @param msgDic 回调字典
  17. -(void)uploadHighScoreDidCompleteWithDic:(NSDictionary *)msgDic;
  18. /// 下载GameCenter 某一排行榜中的分数及排名情况回调,code参数来判定状态,为200表示登录成功,非200 登录失败
  19. /// @param msgDic 回调字典
  20. -(void)downLoadHighScoreDidCompleteWithDic:(NSDictionary *)msgDic;
  21. /// 系统排行榜页面被关闭
  22. -(void)systomGameCenterDidClose;
  23. /// 上传存档回调,code参数来判定状态,为200表示登录成功,非200 登录失败
  24. /// @param msgDic 回调字典
  25. -(void)upLoadArchiveDidCompleteWithDic:(NSDictionary *)msgDic;
  26. /// 下载全部存档回调,code参数来判定状态,为200表示登录成功,非200 登录失败
  27. /// @param msgDic 回调字典
  28. -(void)downLoadArchiveDidCompleteWithDic:(NSDictionary *)msgDic;
  29. /// 下载单个存档回调,code参数来判定状态,为200表示登录成功,非200 登录失败
  30. /// @param msgDic 回调字典
  31. /// @param archiveName 存档名称
  32. -(void)downLoadOneArchiveDidCompleteWithDic:(NSDictionary *)msgDic archiveName:(NSString *)archiveName;
  33. /// 删除存档回调,code参数来判定状态,为200表示登录成功,非200 登录失败
  34. /// @param msgDic 回调字典
  35. -(void)deleteArchiveDidCompleteWithDic:(NSDictionary *)msgDic;
  36. /// 解决存档冲突回调,code参数来判定状态,为200表示登录成功,非200 登录失败
  37. /// @param msgDic 回调字典
  38. -(void)resolveConflictingOfArchiveDidCompleteWithDic:(NSDictionary *)msgDic;
  39. @end
  40. @interface GameCenterManager : NSObject
  41. /// 回调协议
  42. @property (nonatomic, weak) id<GameCenterManagerDelegate> delegate;
  43. + (instancetype)shareM;
  44. ///登录 验证授权
  45. -(void)authPlayer;
  46. ///显示排行榜 可以跳转到自定的 game 排行榜 和 跳转到那个时间段
  47. - (void)ShowSystomGameCenterWithLeaderboardId:(nullable NSString *)leaderboardId time:(int)timeType;
  48. //下载本人 game center 某一排行榜中的分数信息
  49. - (void)downLoadHighScoreWithTime:(int)timeType leaderboardId:(NSString *)leaderboardId;
  50. ///获取排行榜信息 下载game center 某一排行榜中的分数及排名情况
  51. - (void)downLoadHighScoreWithTime:(int)timeType leaderboardId:(NSString *)leaderboardId count:(int)count;
  52. ///上传最高分至对应排行榜
  53. -(void)saveHighScoreWithLeaderboardId:(NSString *)leaderboardId score:(long long)score;
  54. ///上传存档至GameCenter
  55. -(void)uploadAcriveWithDataStr:(NSString *)dataStr name:(NSString *)name;
  56. ///下载所有存档
  57. -(void)fetchAllSavedGames;
  58. /// 下载单个存档
  59. /// @param name 存档名称
  60. -(void)loadSaveData:(NSString *)name;
  61. ///删除存档
  62. -(void)deleteSavedGamesWithName:(NSString *)name;
  63. ///解决存档冲突
  64. -(void)resolveConflictingSavedGames:(NSString *)dataStr name:(NSString *)name;
  65. @end
  66. NS_ASSUME_NONNULL_END