Skip to content

Commit

Permalink
Updated log spacing + removed @
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanaris4 authored and Tanaris4 committed Nov 18, 2010
1 parent a192a51 commit e4392f3
Show file tree
Hide file tree
Showing 76 changed files with 421 additions and 358 deletions.
2 changes: 1 addition & 1 deletion Classes/ActionMenusController.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ - (NSMenu*)createInteractMenu {
[item setIndentationLevel: 0];
[item setTag: 1];
[interactMenu addItem: item];
//PGLog( @"interact menu %@", mobController);
//PGLog(@"interact menu %@", mobController);
for(Mob *mob in [mobController mobsWithinDistance:8 levelRange:NSMakeRange(0,255) includeElite:YES includeFriendly:YES includeNeutral:YES includeHostile:NO]) {
item = [[[NSMenuItem alloc] initWithTitle: [NSString stringWithFormat: @"%@", [mob name]] action: nil keyEquivalent: @""] autorelease];
[item setTag: [mob entryID]];
Expand Down
46 changes: 23 additions & 23 deletions Classes/AuraController.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (void)showAurasPanel {
*/

- (NSArray*)aurasForUnit: (Unit*)unit idsOnly: (BOOL)IDs {
// PGLog( @"Loading for unit: %@ (0x%X)", unit, [unit baseAddress]);
// PGLog(@"Loading for unit: %@ (0x%X)", unit, [unit baseAddress]);
UInt32 validAuras = 0;
MemoryAccess *wowMemory = [controller wowMemoryAccess];
if(!unit || !wowMemory || ![playerController playerIsValid:self])
Expand All @@ -121,11 +121,11 @@ - (NSArray*)aurasForUnit: (Unit*)unit idsOnly: (BOOL)IDs {
// we're overflowing. try the backup.
if ( validAuras == 0xFFFFFFFF) {
[wowMemory readAddress: ([unit baseAddress] + BaseField_Auras_OverflowValidCount) Buffer: (Byte*)&validAuras BufLength: sizeof(validAuras)];
PGLog( @"[Auras] Lot of auras! Switching to backup!");
PGLog(@"[Auras] Lot of auras! Switching to backup!");
}

if ( validAuras <= 0 || validAuras > 500 ) {
PGLog( @"[Auras] Not a valid aura count %d", validAuras);
PGLog(@"[Auras] Not a valid aura count %d", validAuras);
return nil;
}

Expand All @@ -137,12 +137,12 @@ - (NSArray*)aurasForUnit: (Unit*)unit idsOnly: (BOOL)IDs {
if([wowMemory loadDataForObject: self atAddress: ([unit baseAddress] + BaseField_Auras_OverflowPtr1) Buffer: (Byte*)&newAddr BufLength: sizeof(newAddr)] && newAddr) {
aurasAddress = newAddr;
} else {
PGLog( @"[Auras] Error finding aura overflow pointer.");
PGLog(@"[Auras] Error finding aura overflow pointer.");
return nil;
}
}

//PGLog( @"[Auras] Address start: 0x%X", aurasAddress);
//PGLog(@"[Auras] Address start: 0x%X", aurasAddress);


int i;
Expand All @@ -154,16 +154,16 @@ - (NSArray*)aurasForUnit: (Unit*)unit idsOnly: (BOOL)IDs {
if([wowMemory loadDataForObject: self atAddress: (aurasAddress) + i*sizeof(aura) Buffer:(Byte*)&aura BufLength: sizeof(aura)]) {
aura.bytes = CFSwapInt32HostToLittle(aura.bytes);

//PGLog( @"[auras] Bytes: %d", aura.bytes);
//PGLog( @"[Auras] 0x%X Entry ID: %d", (aurasAddress) + i*sizeof(aura), aura.entryID);
//PGLog(@"[auras] Bytes: %d", aura.bytes);
//PGLog(@"[Auras] 0x%X Entry ID: %d", (aurasAddress) + i*sizeof(aura), aura.entryID);

// skip empty buckets
if(aura.entryID == 0) continue;

// As of 3.1.0 - I don't think expiration is needed, if you remove the buff, it sets that memory space to 0
// skip expired buffs; they seem to linger until the space is needed for something else
/*if((currentTime > aura.expiration) && (aura.expiration != 0)) {
PGLog( @"%d is expired (%d).", aura.entryID, aura.expiration);
PGLog(@"%d is expired (%d).", aura.entryID, aura.expiration);
continue;
}*/

Expand Down Expand Up @@ -201,7 +201,7 @@ - (NSArray*)aurasForUnit: (Unit*)unit idsOnly: (BOOL)IDs {
duration: aura.duration
expiration: aura.expiration]];

//PGLog( @"Found aura %d.", aura.entryID);
//PGLog(@"Found aura %d.", aura.entryID);
}
}

Expand Down Expand Up @@ -239,7 +239,7 @@ - (BOOL)unit: (Unit*)unit hasAuraNamed: (NSString*)spellName {
NSRange range = [[spell name] rangeOfString: spellName
options: NSCaseInsensitiveSearch | NSAnchoredSearch | NSDiacriticInsensitiveSearch];
if(range.location != NSNotFound) {
//PGLog( @"Found player buff '%@' at index %d.", spellName, i);
//PGLog(@"Found player buff '%@' at index %d.", spellName, i);
return aura.stacks ? aura.stacks : YES;
}
}
Expand All @@ -255,7 +255,7 @@ - (BOOL)unit: (Unit*)unit hasBuffNamed: (NSString*)spellName {
NSRange range = [[spell name] rangeOfString: spellName
options: NSCaseInsensitiveSearch | NSAnchoredSearch | NSDiacriticInsensitiveSearch];
if(range.location != NSNotFound) {
//PGLog( @"Found player buff '%@' at index %d.", spellName, i);
//PGLog(@"Found player buff '%@' at index %d.", spellName, i);
return aura.stacks ? aura.stacks : YES;
}
}
Expand All @@ -270,7 +270,7 @@ - (BOOL)unit: (Unit*)unit hasDebuffNamed: (NSString*)spellName {
NSRange range = [[spell name] rangeOfString: spellName
options: NSCaseInsensitiveSearch | NSAnchoredSearch | NSDiacriticInsensitiveSearch];
if(range.location != NSNotFound) {
//PGLog( @"Found player buff '%@' at index %d.", spellName, i);
//PGLog(@"Found player buff '%@' at index %d.", spellName, i);
return aura.stacks ? aura.stacks : YES;
}
}
Expand Down Expand Up @@ -350,7 +350,7 @@ - (BOOL)playerHasBuff: (unsigned)spellID {
for(i=0; i<PLAYER_BUFF_SLOTS; i++) {
if(auras[i] == 0) continue;
if(auras[i] == spellID) {
//PGLog( @"Found player buff %d at index %d.", spellID, i);
//PGLog(@"Found player buff %d at index %d.", spellID, i);
return YES;
}
}
Expand All @@ -367,7 +367,7 @@ - (BOOL)playerHasDebuff: (unsigned)spellID {
for(i=0; i<PLAYER_DEBUFF_SLOTS; i++) {
if(auras[i] == 0) continue;
if(auras[i] == spellID) {
//PGLog( @"Found player debuff %d at index %d.", spellID, i);
//PGLog(@"Found player debuff %d at index %d.", spellID, i);
return YES;
}
}
Expand All @@ -388,7 +388,7 @@ - (BOOL)playerHasBuffNamed: (NSString*)spellName {
NSRange range = [[spell name] rangeOfString: spellName
options: NSCaseInsensitiveSearch | NSAnchoredSearch | NSDiacriticInsensitiveSearch];
if(range.location != NSNotFound) {
//PGLog( @"Found player buff '%@' at index %d.", spellName, i);
//PGLog(@"Found player buff '%@' at index %d.", spellName, i);
return YES;
}
}
Expand All @@ -410,7 +410,7 @@ - (BOOL)playerHasDebuffNamed: (NSString*)spellName {
NSRange range = [[spell name] rangeOfString: spellName
options: NSCaseInsensitiveSearch | NSAnchoredSearch | NSDiacriticInsensitiveSearch];
if(range.location != NSNotFound) {
//PGLog( @"Found player debuff '%@' at index %d.", spellName, i);
//PGLog(@"Found player debuff '%@' at index %d.", spellName, i);
return YES;
}
}
Expand Down Expand Up @@ -573,7 +573,7 @@ - (void)scanAllBuffs: (id)sender {
NSArray *petAuras = [self aurasForUnit: [playerController pet] idsOnly: YES];
NSArray *tarAuras = [self aurasForUnit: [mobController playerTarget] idsOnly: YES];

// PGLog( @"%d buffs on player", [newAuras count]);
// PGLog(@"%d buffs on player", [newAuras count]);

// gather all buffs
/*unsigned buffs[PLAYER_BUFF_SLOTS];
Expand Down Expand Up @@ -615,7 +615,7 @@ - (void)scanAllBuffs: (id)sender {
}*/

// report status
// PGLog( @"Player has %d buffs and %d debuffs.", [buffsArray count], [debuffsArray count]);
// PGLog(@"Player has %d buffs and %d debuffs.", [buffsArray count], [debuffsArray count]);

// check for buff losses
for(Aura *aura in _auras) {
Expand All @@ -632,7 +632,7 @@ - (void)scanAllBuffs: (id)sender {
if( !foundAura && (aura.entryID > 0) && (aura.entryID <= MaxSpellID) ) {
Spell *spell = [spellController spellForID: [NSNumber numberWithUnsignedInt: aura.entryID]];
if(spell) {
// PGLog( @"::: %@ fades from you.", spell);
// PGLog(@"::: %@ fades from you.", spell);
[[NSNotificationCenter defaultCenter] postNotificationName: BuffFadeNotification
object: self
userInfo: [NSDictionary dictionaryWithObject: spell forKey: @"Spell"]];
Expand Down Expand Up @@ -666,7 +666,7 @@ - (void)scanAllBuffs: (id)sender {
// reload the spell name if we dont have it
Spell *spell = [spellController spellForID: auraID];
if(spell) {
// PGLog( @"::: You gain %@.", spell);
// PGLog(@"::: You gain %@.", spell);
[[NSNotificationCenter defaultCenter] postNotificationName: BuffGainNotification
object: self
userInfo: [NSDictionary dictionaryWithObject: spell forKey: @"Spell"]];
Expand All @@ -676,7 +676,7 @@ - (void)scanAllBuffs: (id)sender {
}
[pluginController performEvent:E_PLAYER_AURA_GAINED withObject:spell];
} else {
// PGLog( @"[Auras] Failed to create valid spell from ID %@.", num);
// PGLog(@"[Auras] Failed to create valid spell from ID %@.", num);
}
}

Expand Down Expand Up @@ -723,7 +723,7 @@ - (void)scanAllBuffs: (id)sender {
Spell *spell = [spellController spellForID: num];
if( spell && (![spell name] || ![[spell name] length])) {
[spell reloadSpellData];
// PGLog( @"Loading pet spell %@", num);
// PGLog(@"Loading pet spell %@", num);
}
if(spell){
[pluginController performEvent:E_PET_AURA_GAINED withObject:spell];
Expand All @@ -741,7 +741,7 @@ - (void)scanAllBuffs: (id)sender {
Spell *spell = [spellController spellForID: num];
if( spell && (![spell name] || ![[spell name] length])) {
[spell reloadSpellData];
// PGLog( @"Loading target spell %@", num);
// PGLog(@"Loading target spell %@", num);
}
if(spell){
[pluginController performEvent:E_TARGET_AURA_GAINED withObject:spell];
Expand Down
26 changes: 13 additions & 13 deletions Classes/BindingsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ - (void)getKeyBindings{
// loop through all structs!
while ( [memory loadDataForObject: self atAddress: structPointer Buffer: (Byte*)&bindingStruct BufLength: sizeof(bindingStruct)] && bindingStruct.nextBinding > 0x0 && !(bindingStruct.nextBinding & 0x1) ){

//PGLog( @"[Bindings] Struct found at 0x%X", structPointer);
//PGLog(@"[Bindings] Struct found at 0x%X", structPointer);

// initiate our variables
NSString *key = nil;
Expand All @@ -204,21 +204,21 @@ - (void)getKeyBindings{

if ( [memory loadDataForObject: self atAddress: bindingStruct.keyPointer Buffer: (Byte *)&tmpKey BufLength: sizeof(tmpKey)-1] ){
key = [NSString stringWithUTF8String: tmpKey];
//PGLog( @"[Bindings] Key %@ found at 0x%X", key, bindingStruct.keyPointer);
//PGLog(@"[Bindings] Key %@ found at 0x%X", key, bindingStruct.keyPointer);
}

if ( [memory loadDataForObject: self atAddress: bindingStruct.cmdPointer Buffer: (Byte *)&tmpCmd BufLength: sizeof(tmpCmd)-1] ){
cmd = [NSString stringWithUTF8String: tmpCmd];
//PGLog( @"[Bindings] Command %@ found at 0x%X", cmd, bindingStruct.cmdPointer);
//PGLog(@"[Bindings] Command %@ found at 0x%X", cmd, bindingStruct.cmdPointer);
}

// add it
if ( [key length] && [cmd length] ){
//PGLog( @"%@ -> %@", key, cmd);
//PGLog(@"%@ -> %@", key, cmd);
[_bindings setObject:cmd forKey:key];
}

//PGLog( @"[Bindings] Code %d for %@", [chatController keyCodeForCharacter:key], key);
//PGLog(@"[Bindings] Code %d for %@", [chatController keyCodeForCharacter:key], key);

// we already made it through the list! break!
if ( firstStruct == bindingStruct.nextBinding ){
Expand Down Expand Up @@ -277,7 +277,7 @@ - (void)convertToAscii{
// remove the previous commands
[allCodes removeAllObjects];

//PGLog( @"[Bindings] Command: %@ %@", [_bindings objectForKey:key], key);
//PGLog(@"[Bindings] Command: %@ %@", [_bindings objectForKey:key], key);

// this will tell us where the "-" is in our string!
int i, splitIndex = -1;
Expand All @@ -300,7 +300,7 @@ - (void)convertToAscii{

/*NSString *binding = [[_bindings objectForKey:key] lowercaseString];
if ( [binding isEqualToString:[[NSString stringWithFormat:@"MULTIACTIONBAR1BUTTON1"] lowercaseString]] ){
PGLog( @" %@", command1);
PGLog(@" %@", command1);
}*/
}
// 2 commands
Expand Down Expand Up @@ -383,9 +383,9 @@ - (void)convertToAscii{
if ( [unknownCodes count] ){
for ( NSString *cmd in unknownCodes ){
if ( ![_commandToAscii objectForKey:cmd] ){
PGLog( @"[Bindings] Unable to find code for %@, report it to Tanaris4!", cmd);
PGLog(@"[Bindings] Unable to find code for %@, report it to Tanaris4!", cmd);
}
//PGLog( @" \@\"%@\",", cmd);
//PGLog(@" \@\"%@\",", cmd);
}
}
}
Expand Down Expand Up @@ -483,20 +483,20 @@ - (void)mapBindingsToKeys{
}
// no binding /cry
else{
PGLog( @"No valid key binding found for %@", binding);
PGLog(@"No valid key binding found for %@", binding);
}
}
}

- (BOOL)executeBindingForKey:(NSString*)key{

PGLog( @"Executing %@", key);
PGLog(@"Executing %@", key);

NSDictionary *dict = [_bindingsToCodes objectForKey:key];

// special case! Try for a backup!
if ( !dict && [key isEqualToString:BindingPrimaryHotkey] ){
PGLog( @"No code found for %@, searching for %@", key, BindingPrimaryHotkeyBackup);
PGLog(@"No code found for %@, searching for %@", key, BindingPrimaryHotkeyBackup);
dict = [_bindingsToCodes objectForKey:BindingPrimaryHotkeyBackup];
}

Expand All @@ -516,7 +516,7 @@ - (BOOL)executeBindingForKey:(NSString*)key{
return YES;
}
else{
PGLog( @"[Bindings] Unable to find binding for %@", key);
PGLog(@"[Bindings] Unable to find binding for %@", key);
}

return NO;
Expand Down
2 changes: 1 addition & 1 deletion Classes/ChatController.m
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ - (void)pressHotkey: (int)hotkey withModifier: (unsigned int)modifier {
if(keyUp) CFRelease(keyUp);
// CFRelease(source);
} else {
PGLog( @"invalid source with hotkey %d", hotkey);
PGLog(@"invalid source with hotkey %d", hotkey);
}
}

Expand Down
Loading

0 comments on commit e4392f3

Please sign in to comment.