I need some program structure advice...

Ask questions about cheating in any games you would like. Does not need to pertain to MicroMacro.
Post Reply
Message
Author
Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

I need some program structure advice...

#1 Post by Exempt » Fri Aug 10, 2012 6:07 pm

I didn't really know what to ask for this problem I'm having.

What I've so far is a DLL that I inject that hooks D3d with the Azo Starter Kit 3.0b then I added in my own hook to the packet recv function in the game. Both of these are working fine my main issue is using them together.

When a update packet come into the game I have a update function to setup the struct for my use...The part I'm working with is items on the ground like armor/gold/w/e drops from kills. It's wierd but the way it works is it'll only show the top 3 items in a pile on the ground. If this is only 1 item(in a single pile) op is 0x01, otherwise it's op is 0x02 which will show the top 3 items.

Code: Select all

if(opCall == 0x01) //There is 1 item on the round.
			{
				uint16 xLoc = BytesToInt<uint16>(&packet[pos+2]);
				uint16 yLoc = BytesToInt<uint16>(&packet[pos+4]);
				itemId[0] = BytesToInt<uint16>(&packet[pos+6]);
				pos += 8;
				//printf("X: %i. Y: %i, ID: %i\n", xLoc, yLoc, itemId[0]);
			}
			else if(opCall == 0x02) //More then 1 item on the ground.
			{
				uint16 xLoc = BytesToInt<uint16>(&packet[pos+2]);
				uint16 yLoc = BytesToInt<uint16>(&packet[pos+4]);
				itemId[0] = BytesToInt<uint16>(&packet[pos+6]);
				itemId[1] = BytesToInt<uint16>(&packet[pos + 8]);
				itemId[2] = BytesToInt<uint16>(&packet[pos + 10]);
				//printf("X: %i, Y: %i, ID: %i, ID2: %i, ID3: %i\n", xLoc, yLoc, itemId[0], itemId[1], itemId[2]);
				pos += 12;
			}
Now with the D3D hooks I'm using the endScene function to draw text to the screen. I'm needing a way to store the ground items from the packet to a map or something then in endScene draw text over the pile of items with details abotu what's in it. I've managed to get a flicker of the name over the pile but wasn't doing to well with std::maps.

What would be the best way to store the items ID, x, y where I can edit it fast. These packets are updates several times a second and they'll come and go quickly.

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: I need some program structure advice...

#2 Post by Administrator » Sat Aug 11, 2012 12:14 am

If you can, a normal 1D array, linked list, vector, or something of the sort would be nice. Use a small struct to hold the different variables and I see no issues with that.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests