Created
May 5, 2014 01:59
-
-
Save photofroggy/5680b231a8d55e076c3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PFYPacket *pkt = [PFYPacket fromNSData:data]; | |
if([[pkt cmd] isEqualToString:@"dAmnServer"]) { | |
NSLog(@"Connected to dAmnServer %@",[pkt param]); | |
NSString *pkt = @"login photofroggy\npk=*****************\n\0"; | |
[socket writeData:[pkt dataUsingEncoding:NSUTF8StringEncoding] withTimeout:-1 tag:2]; | |
} | |
if([[pkt cmd] isEqualToString:@"login"]) { | |
if(![[pkt argument:@"e"] isEqualToString:@"ok"]) { | |
NSLog(@"Login failed"); | |
return; | |
} | |
NSLog(@"Logged in as %@", [pkt param]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment