-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTIXboxLiveEngineConnection.h
65 lines (59 loc) · 3.62 KB
/
TIXboxLiveEngineConnection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// TIXboxLiveEngineConnection.h
// TIXboxLiveEngine
//
// Created by Tom Irving on 21/10/2010.
// Copyright 2010 Tom Irving. All rights reserved.
//
#define TIXboxLiveEngineConnectionTypeIsLogin(type) (type == TIXboxLiveEngineConnectionTypeGetLogin || type == TIXboxLiveEngineConnectionTypePostLogin ||\
type == TIXboxLiveEngineConnectionTypePostAuth)
#define TIXboxLiveEngineConnectionTypeIsPrimaryGet(type) (type == TIXboxLiveEngineConnectionTypeGetFriends || type == TIXboxLiveEngineConnectionTypeGetGames ||\
type == TIXboxLiveEngineConnectionTypeGetMessages || type == TIXboxLiveEngineConnectionTypeGetRecentPlayers)
#define TIXboxLiveEngineConnectionTypeIsFriends(type) (type == TIXboxLiveEngineConnectionTypeGetFriends ||\
type == TIXboxLiveEngineConnectionTypeGetFriendsVerification)
#define TIXboxLiveEngineConnectionTypeIsGames(type) (type == TIXboxLiveEngineConnectionTypeGetGames || type == TIXboxLiveEngineConnectionTypeGetGamesVerification)
#define TIXboxLiveEngineConnectionTypeIsRecentPlayers(type) (type == TIXboxLiveEngineConnectionTypeGetRecentPlayers ||\
type == TIXboxLiveEngineConnectionTypeGetRecentPlayersVerification)
typedef enum {
TIXboxLiveEngineConnectionTypeGetLogin = 0,
TIXboxLiveEngineConnectionTypePostLogin,
TIXboxLiveEngineConnectionTypePostAuth,
TIXboxLiveEngineConnectionTypeGetBasicGamerInfo,
TIXboxLiveEngineConnectionTypeGetGamerProfile,
TIXboxLiveEngineConnectionTypeChangeGamerProfile,
TIXboxLiveEngineConnectionTypeGetFriendGamerTile,
TIXboxLiveEngineConnectionTypeGetFriendGamerInfo,
TIXboxLiveEngineConnectionTypeGetFriendsVerification,
TIXboxLiveEngineConnectionTypeGetFriends,
TIXboxLiveEngineConnectionTypeGetMessages,
TIXboxLiveEngineConnectionTypeGetGames,
TIXboxLiveEngineConnectionTypeGetGamesVerification,
TIXboxLiveEngineConnectionTypeGetAchievements,
TIXboxLiveEngineConnectionTypeGetRecentPlayers,
TIXboxLiveEngineConnectionTypeGetRecentPlayersVerification,
TIXboxLiveEngineConnectionTypeGetFriendsOfFriend,
TIXboxLiveEngineConnectionTypeGetGameComparisons,
TIXboxLiveEngineConnectionTypeGetAchievementComparisons,
TIXboxLiveEngineConnectionTypeSendMessage,
TIXboxLiveEngineConnectionTypeSendFriendRequest,
TIXboxLiveEngineConnectionTypeGetMessageBody,
TIXboxLiveEngineConnectionTypeGetMessageImage,
TIXboxLiveEngineConnectionTypeGetTileImage,
} TIXboxLiveEngineConnectionType;
@class TIXboxLiveGame;
typedef void (^TIXboxLiveEngineConnectionBlock)(NSError * error);
typedef void (^TIXboxLiveEngineFriendsBlock)(NSError * error, NSArray * onlineFriends, NSArray * offlineFriends, NSArray * friendRequests);
typedef void (^TIXboxLiveEngineGamesBlock)(NSError * error, NSString * gamertag, NSArray * games);
typedef void (^TIXboxLiveEngineAchievementsBlock)(NSError * error, TIXboxLiveGame * game, NSArray * achievements);
typedef void (^TIXboxLiveEngineRecentPlayersBlock)(NSError * error, NSArray * players);
typedef void (^TIXboxLiveEngineFriendsOfFriendBlock)(NSError * error, NSString * gamertag, NSArray * friends);
typedef void (^TIXboxLiveEngineMessagesBlock)(NSError * error, NSArray * messages);
typedef void (^TIXboxLiveEngineFriendRequestBlock)(NSError * error, NSString * gamertag);
typedef void (^TIXboxLiveEngineMessageSentBlock)(NSError * error, NSArray * recipients);
@interface TIXboxLiveEngineConnection : NSURLConnection
@property (nonatomic, assign) TIXboxLiveEngineConnectionType type;
@property (nonatomic, copy) id callback;
@property (nonatomic, strong) NSDictionary * userInfo;
@property (nonatomic, strong) NSNumber * backgroundTaskIdentifier;
@property (nonatomic, readonly) NSString * typeDescription;
@end