-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPSN Access.m
More file actions
32 lines (24 loc) · 748 Bytes
/
PSN Access.m
File metadata and controls
32 lines (24 loc) · 748 Bytes
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
#import <Foundation/Foundation.h>
#import "PSNAccess.h"
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString * username = @"your_psn_here";
printf("Logging in as %s", [username UTF8String]);
char password[512];
printf("Password: ");
fgets(password, 512, stdin);
password[strlen(password) - 1] = 0;
NSString * pwd = [NSString stringWithUTF8String:password];
if (!PSNLogin(username, pwd)) {
NSLog(@"Login incorrect.");
return -1;
}
NSArray * friends = friendsList(fetchFriendList());
NSLog(@"%@", friends);
for (NSString * friend in friends) {
NSLog(@"%@: %@", friend, friendGame(friendInfo(friend)));
}
PSNLogout();
[pool drain];
return 0;
}