X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fthecheat;a=blobdiff_plain;f=CheatClient.m;fp=CheatClient.m;h=dac94e20f618e6331c6667a651ec71654c71dc17;hp=a4ebd973951a20b84847bff717f13f8a3065f5d7;hb=e8d51183acdd2410a38dcf8f0efbf7c30cd6c581;hpb=fcdfb47212ad3d7f8ec8ae115ccf4f30b7ace383 diff --git a/CheatClient.m b/CheatClient.m index a4ebd97..dac94e2 100644 --- a/CheatClient.m +++ b/CheatClient.m @@ -10,7 +10,7 @@ #import "CheatClient.h" -#import "MyDocument.h" +#import "SessionController.h" @implementation CheatClient @@ -65,7 +65,7 @@ if ( (sockfd = socket( identifier.sa_family, SOCK_STREAM, 0 )) == -1 ) { - NSLog( @"ERROR: socket() failed" ); + CMLog( @"ERROR: socket() failed" ); [rootProxy clientError:@"Network Error" message:@"Attempt to connect to server failed."]; return; } @@ -80,7 +80,7 @@ { close( sockfd ); - NSLog( @"ERROR: connect() failed" ); + CMLog( @"ERROR: connect() failed" ); [rootProxy clientError:@"Network Error" message:@"Attempt to connect to server failed."]; return; } @@ -95,7 +95,7 @@ { close( sockfd ); - NSLog( @"ERROR: connect() failed" ); + CMLog( @"ERROR: connect() failed" ); [rootProxy clientError:@"Network Error" message:@"Attempt to connect to server failed."]; return; } @@ -115,11 +115,11 @@ if ( sockfd == -1 ) { - NSLog( @"ERROR: can't run when not connected" ); + CMLog( @"ERROR: can't run when not connected" ); return; } - NSLog( @"CLIENT start" ); + CMLog( @"CLIENT start" ); for (;;) { @@ -127,7 +127,7 @@ { if ( result != 0 && result != -1 ) { - NSLog( @"ERROR: incomplete header received" ); + CMLog( @"ERROR: incomplete header received" ); close( sockfd ); break; } @@ -137,25 +137,25 @@ if ( !VerifyChecksum( header.checksum ) ) { - NSLog( @"ERROR: checksum verification failed" ); + CMLog( @"ERROR: checksum verification failed" ); close( sockfd ); break; } - //NSLog( @"CLIENT message %i/%i/%i", header.checksum, header.function, header.size ); + //CMLog( @"CLIENT message %i/%i/%i", header.checksum, header.function, header.size ); if ( header.size != 0 ) { if ( (bytes = (char *)malloc( header.size )) == NULL ) { - NSLog( @"ERROR: failed to allocate buffer for reading a network packet" ); + CMLog( @"ERROR: failed to allocate buffer for reading a network packet" ); close( sockfd ); break; } if ( (result = ReadBuffer( sockfd, bytes, header.size )) != header.size ) { - NSLog( @"ERROR: failed to read the data of a network packet; only read %i bytes out of %i", result, header.size ); + CMLog( @"ERROR: failed to read the data of a network packet; only read %i bytes out of %i", result, header.size ); free( bytes ); close( sockfd ); break; @@ -223,7 +223,7 @@ [rootProxy clientDisconnected]; - NSLog( @"CLIENT close" ); + CMLog( @"CLIENT close" ); }