-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTIXboxLiveEngine.h
More file actions
69 lines (59 loc) · 3.25 KB
/
TIXboxLiveEngine.h
File metadata and controls
69 lines (59 loc) · 3.25 KB
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
66
67
68
69
//
// TIXboxLiveEngine.h
// TIXboxLiveEngine
//
// Created by Tom Irving on 21/10/2010.
// Copyright 2010 Tom Irving. All rights reserved.
//
#import "TIXboxLiveUser.h"
#import "TIXboxLiveFriend.h"
#import "TIXboxLiveMessage.h"
#import "TIXboxLiveEngineConnection.h"
extern NSString * const TIXboxLiveEngineConnectionBlockKey;
extern NSString * const TIXboxLiveEngineConnectionMessageKey;
extern NSString * const TIXboxLiveEngineConnectionRecipientsKey;
extern NSString * const TIXboxLiveEngineConnectionGamertagKey;
extern NSString * const TIXboxLiveEngineConnectionGameKey;
extern NSString * const TIXboxLiveEngineConnectionTaskIdentifierKey;
extern NSString * const TIXboxLiveEngineDidSignInNotificationName;
extern NSString * const TIXboxLiveEngineDidSignOutNotificationName;
extern NSString * const TIXboxLiveEngineSignInFailedNotificationName;
extern NSString * const TIXboxLiveEngineStateChangedNotificationName;
typedef enum {
TIXboxLiveEngineErrorCodeIncorrectEmailPassword = -1,
TIXboxLiveEngineErrorCodeSiteDown = -2,
TIXboxLiveEngineErrorCodeMessageSendingError = -3,
TIXboxLiveEngineErrorCodeTermsOfUse = -4,
TIXboxLiveEngineErrorCodeTimeout = NSURLErrorTimedOut,
TIXboxLiveEngineErrorCodeUnknownError = -6,
TIXboxLiveEngineErrorCodeParseError = -7,
} TIXboxLiveEngineErrorCode;
typedef void (^TIXboxLiveEngineSignOutBlock)(BOOL userInstigated);
typedef void (^TIXboxLiveEngineLogBlock)(TIXboxLiveEngineConnection * connection, NSString * response);
@class TIXboxLiveGame;
@interface TIXboxLiveEngine : NSObject
@property (nonatomic, strong) TIXboxLiveUser * user;
@property (nonatomic, readonly) BOOL signedIn;
@property (nonatomic, readonly) BOOL signingIn;
@property (nonatomic, readonly) BOOL loadingFriends;
@property (nonatomic, readonly) BOOL loadingGames;
@property (nonatomic, readonly) BOOL loadingMessages;
@property (nonatomic, readonly) BOOL loadingRecentPlayers;
@property (nonatomic, readonly, copy) NSString * email;
@property (nonatomic, readonly, copy) NSString * password;
@property (nonatomic, readonly, copy) NSString * cookieHash;
@property (nonatomic, copy) TIXboxLiveEngineSignOutBlock signOutBlock;
@property (nonatomic, copy) TIXboxLiveEngineLogBlock logBlock;
- (void)signInWithEmail:(NSString *)email password:(NSString *)password callback:(TIXboxLiveEngineConnectionBlock)block;
- (void)signOut;
- (void)getFriendsWithCallback:(TIXboxLiveEngineFriendsBlock)callback;
- (void)getRecentPlayersWithCallback:(TIXboxLiveEngineRecentPlayersBlock)callback;
- (void)getFriendsOfFriend:(NSString *)gamertag callback:(TIXboxLiveEngineFriendsOfFriendBlock)callback;
- (void)sendFriendRequestToGamer:(NSString *)gamertag callback:(TIXboxLiveEngineFriendRequestBlock)callback;
- (void)getGamesWithCallback:(TIXboxLiveEngineGamesBlock)callback;
- (void)getAchievementsForGame:(TIXboxLiveGame *)game callback:(TIXboxLiveEngineAchievementsBlock)callback;
- (void)getGamesComparedWithGamer:(NSString *)gamertag callback:(TIXboxLiveEngineGamesBlock)callback;
- (void)getAchievementsComparisonsForGame:(TIXboxLiveGame *)game callback:(TIXboxLiveEngineAchievementsBlock)callback;
- (void)getMessagesWithCallback:(TIXboxLiveEngineMessagesBlock)callback;
- (void)sendMessage:(NSString *)message recipients:(NSArray *)recipients callback:(TIXboxLiveEngineMessageSentBlock)callback;
@end