Take a look at this

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

User avatar
vzmule
Contributing Member
Contributing Member
Posts: 378
Joined: Thu Mar 13, 2003 11:56 pm

Take a look at this

Post by vzmule » Thu May 15, 2003 12:59 am

Take a look at the following and leave input please. Using WinXP, the current spawninfo structs in mq.h/exts2.cpp work great, however using the exact same build on WinME, it shows all kinds of false LD flags in the zone. So...I set out to change the code and came up with the following which fixes the problem on WinME and works great on XP as well. Input please.


CURRENT SPAWNINFO STRUCT

Code: Select all

typedef struct _SPAWNINFO {

/*0x000*/   BYTE    Unknown0x000;

/*0x001*/   CHAR    Name[64];

/*0x041*/   BYTE    Unknown0x041[7];

/*0x048*/   FLOAT   SpeedZ;

/*0x04c*/   FLOAT   Heading;

/*0x050*/   FLOAT   X;

/*0x054*/   FLOAT   SpeedX;      //Unsure about this one, it's definately a directional speed.

/*0x058*/   FLOAT   Y;

/*0x05c*/   FLOAT   Z;

/*0x060*/   FLOAT   Unknown0x060;

/*0x064*/   FLOAT   SpeedRun;    // Confirmed

/*0x068*/   FLOAT   SpeedY;

/*0x06c*/   BYTE    Unknown0x06c[4];

/*0x070*/   FLOAT   SpeedHeading;   

/*0x074*/   FLOAT   CameraAngle;   //128=up, -128=down

/*0x078*/   BYTE    Unknown0x078[12];

/*0x084*/   PACTORINFO   pActorInfo;

/*0x088*/   BYTE    Unknown0x088[5];

[b]/*0x08d*/   BYTE    NPC; //0=PC or 1=NPC[/b]

/*0x08e*/   BYTE    Unknown0x08e;

/*0x08f*/   BYTE    LFG;

/*0x090*/   BYTE    Unknown0x090[76];

/*0x0dc*/   DWORD   Zone;

/*0x0e0*/   DWORD   Unknown0x0e0;    // Pointer of some sort?

/*0x0e4*/   struct  _SPAWNINFO *pNext;

/*0x0e8*/   PCHARINFO   pCharInfo;

/*0x0ec*/   BYTE    Unknown0x0ec[4];

/*0x0f0*/   struct  _SPAWNINFO *pPrev;

/*0x0f4*/   DWORD   Unknown0x0f4;

/*0x0f8*/   CHAR    Lastname[32];

/*0x118*/   BYTE    Unknown0x118[8];

/*0x120*/   FLOAT   Unknownf0x120;

/*0x124*/   FLOAT   Unknownf0x124;      // Possible ModelHeightOffset

/*0x128*/   FLOAT   Unknownf0x128;      // Possible CameraHeightOffset

/*0x12c*/   FLOAT   Unknownf0x12c;

/*0x130*/   FLOAT   Unknownf0x130;      

/*0x134*/   BYTE    Type;

/*0x135*/   BYTE    Light;

/*0x136*/   BYTE    Unknown0x136[2];

/*0x138*/   DWORD   Unknown0x138;      // **

/*0x13c*/   BYTE    Level;

/*0x13d*/   BYTE    Unknown0x13d;      

/*0x13e*/   BYTE    Gender;            // ??

/*0x13f*/   BYTE    Unknown0x13f;

/*0x140*/   BYTE    HideMode;         //1=hidden 2=invis? 3=invis versus undead 4=invis v animals

/*0x141*/   BYTE    StandState;

/*0x142*/   BYTE    Class;

/*0x143*/   BYTE    Unknown0x143;      

/*0x144*/   BYTE    Unknown0x144;

/*0x145*/   BYTE    Unknown0x145;

/*0x146*/   BYTE    GM;

/*0x147*/   BYTE    Unknown0x147;      //Fluxuates

/*0x148*/   DWORD   SpawnID;

/*0x14c*/   DWORD   MasterID;

/*0x150*/   DWORD   Race;

/*0x154*/   DWORD   Anon;

/*0x158*/   DWORD   AARank;

/*0x15c*/   DWORD   AFK;

/*0x160*/   DWORD   VisType;

/*0x164*/   DWORD   HPCurrent;

/*0x168*/   BYTE    Unknown0x168[8];

/*0x170*/   DWORD   Deity;            // ?

/*0x174*/   DWORD   HPMax;

/*0x178*/   DWORD   GuildID;

/*0x17c*/   BYTE    Unknown0x17c[23];

[b]/*0x193*/   BYTE    Linkdead;[/b]

/*0x194*/   BYTE    Unknown0x194[6];

} SPAWNINFO, *PSPAWNINFO;

MY MODIFIED SPAWNINFO STRUCT:

Code: Select all

typedef struct _SPAWNINFO {
/*0x000*/   BYTE    Unknown0x000;
/*0x001*/   CHAR    Name[64];
/*0x041*/   BYTE    Unknown0x041[7];
/*0x048*/   FLOAT   SpeedZ;
/*0x04c*/   FLOAT   Heading;
/*0x050*/   FLOAT   X;
/*0x054*/   FLOAT   SpeedX;      //Unsure about this one, it's definately a directional speed.
/*0x058*/   FLOAT   Y;
/*0x05c*/   FLOAT   Z;
/*0x060*/   FLOAT   Unknown0x060;
/*0x064*/   FLOAT   SpeedRun;    // Confirmed
/*0x068*/   FLOAT   SpeedY;
/*0x06c*/   BYTE    Unknown0x06c[4];
/*0x070*/   FLOAT   SpeedHeading;   
/*0x074*/   FLOAT   CameraAngle;   //128=up, -128=down
/*0x078*/   BYTE    Unknown0x078[12];
/*0x084*/   PACTORINFO   pActorInfo;
/*0x088*/   BYTE    Unknown0x088[5];
[b]/*0x08d*/   BYTE    Linkdead;[/b]
/*0x08e*/   BYTE    Unknown0x08e;
/*0x08f*/   BYTE    LFG;
/*0x090*/   BYTE    Unknown0x090[76];
/*0x0dc*/   DWORD   Zone;
/*0x0e0*/   DWORD   Unknown0x0e0;    // Pointer of some sort?
/*0x0e4*/   struct  _SPAWNINFO *pNext;
/*0x0e8*/   PCHARINFO   pCharInfo;
/*0x0ec*/   BYTE    Unknown0x0ec[4];
/*0x0f0*/   struct  _SPAWNINFO *pPrev;
/*0x0f4*/   DWORD   Unknown0x0f4;
/*0x0f8*/   CHAR    Lastname[32];
/*0x118*/   BYTE    Unknown0x118[8];
/*0x120*/   FLOAT   Unknownf0x120;
/*0x124*/   FLOAT   Unknownf0x124;      // Possible ModelHeightOffset
/*0x128*/   FLOAT   Unknownf0x128;      // Possible CameraHeightOffset
/*0x12c*/   FLOAT   Unknownf0x12c;
/*0x130*/   FLOAT   Unknownf0x130;      
/*0x134*/   BYTE    Type;
/*0x135*/   BYTE    Light;
/*0x136*/   BYTE    Unknown0x136[2];
/*0x138*/   DWORD   Unknown0x138;      // **
/*0x13c*/   BYTE    Level;
/*0x13d*/   BYTE    Unknown0x13d;      
/*0x13e*/   BYTE    Gender;            // ??
/*0x13f*/   BYTE    Unknown0x13f;
/*0x140*/   BYTE    HideMode;         //1=hidden 2=invis? 3=invis versus undead 4=invis v animals
/*0x141*/   BYTE    StandState;
/*0x142*/   BYTE    Class;
/*0x143*/   BYTE    Unknown0x143;      
/*0x144*/   BYTE    Unknown0x144;
/*0x145*/   BYTE    Unknown0x145;
/*0x146*/   BYTE    GM;
/*0x147*/   BYTE    Unknown0x147;      //Fluxuates
/*0x148*/   DWORD   SpawnID;
/*0x14c*/   DWORD   MasterID;
/*0x150*/   DWORD   Race;
/*0x154*/   DWORD   Anon;
/*0x158*/   DWORD   AARank;
/*0x15c*/   DWORD   AFK;
/*0x160*/   DWORD   VisType;
/*0x164*/   DWORD   HPCurrent;
/*0x168*/   BYTE    Unknown0x168[8];
/*0x170*/   DWORD   Deity;            // ?
/*0x174*/   DWORD   HPMax;
/*0x178*/   DWORD   GuildID;
/*0x17c*/   BYTE    Unknown0x17c[23];
[b]/*0x193*/   BYTE    Unknown0x193;[/b]
/*0x194*/   BYTE    Unknown0x194[6];
} SPAWNINFO, *PSPAWNINFO;

and:

CURRENT SPAWNINFO IN EXTS2.CPP

Code: Select all

dprintf("\n\n\n");
    KPs(Name);
	KPf(SpeedZ);
	KPf(Heading);
	KPf(X);
	KPf(SpeedRun);
	KPf(Y);
	KPf(Z);
	KPf(SpeedHeading);
	KPf(SpeedX);
	KPf(SpeedY);
	[b]KP(Unknown108);[/b]
	KPf(CameraAngle);
	KP(pActorInfo);
	[b]KP(NPC);[/b]
	KP(LFG);
	KP(Zone);
	KP(pNext);
	KP(pCharInfo);
	KP(pPrev);
    KPs(Lastname);
	KP(Type);
	KP(Light);
	KP(Level);
	KP(Gender);
	KP(HideMode);
	KP(StandState);
	KP(Class);
	KP(GM);
	KP(SpawnID);
	KP(Race);
	KP(Anon);
	KP(AARank);
	KP(AFK);
	KP(VisType);
	KP(HPCurrent);
	KP(Deity);
	KP(HPMax);
	KP(GuildID);
	KP(Linkdead);
}

MY EXTS2.CPP SPAWNINFO

Code: Select all

dprintf("\n\n\n");
    KPs(Name);
	KPf(SpeedZ);
	KPf(Heading);
	KPf(X);
	KPf(SpeedRun);
	KPf(Y);
	KPf(Z);
	KPf(SpeedHeading);
	KPf(SpeedX);
	KPf(SpeedY);
	[b]KP(Unknown0x06c);[/b]
	KPf(CameraAngle);
	KP(pActorInfo);
	KP(LFG);
	KP(Zone);
	KP(pNext);
	KP(pCharInfo);
	KP(pPrev);
    KPs(Lastname);
	KP(Type);
	KP(Light);
	KP(Level);
	KP(Gender);
	KP(HideMode);
	KP(StandState);
	KP(Class);
	KP(GM);
	KP(SpawnID);
	KP(Race);
	KP(Anon);
	KP(AARank);
	KP(AFK);
	KP(VisType);
	KP(HPCurrent);
	KP(Deity);
	KP(HPMax);
	KP(GuildID);
	KP(Linkdead);
}

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Thu May 15, 2003 1:20 am

Does "/who npc" still work properly with this change? If so, then I'd be willing to test it and make modifications since the LD flag is really a throwaway variable.


Did you try making the modifications suggested by EqMule in this thread? http://macroquest2.com/phpBB2/viewtopic.php?t=2232

I'm fairly sure that those modifications will stop the /who crashes, not sure if it will help with your ME problems or not. I don't think they've made it yet to CVS, though, should be there shortly.

User avatar
vzmule
Contributing Member
Contributing Member
Posts: 378
Joined: Thu Mar 13, 2003 11:56 pm

Post by vzmule » Thu May 15, 2003 1:36 am

Yes, the /who npc still works great with these changes on both Win ME and XP.

I haven't experienced the /who crashes people have posted about.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Thu May 15, 2003 3:20 am

Made the changes, and it seems to work great! I think that 'NPC' was guesswork if I'm not mistaken. Silly me, I forgot that /who npc was done using spawninfo->Type.

Either way, adjusted and updated on thread http://macroquest2.com/phpBB2/viewtopic ... 4122#14122 ..I'll include with update for DKAA in the next couple days.