logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Persistent Object - HB Resolution?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Jul 28, 2011 14:28    Post subject: Persistent Object - HB Resolution? Reply with quote

Hey VirusMan -
On Bioware Forums, Funky or someone - maybe even yourself, mentioned something about you working on a plugin that would resolve the issue of Low Priority Heartbeats , such as spells etc, not firing.


Did anything ever come of this?

Is there going to be a Windows Release?
Pretty Please?????? Very Happy
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Jul 28, 2011 15:12    Post subject: Reply with quote

Low priority heartbeats? Spells not firing?
I've never seen or heard about this problem. If you have a test module that can reproduce the problem, please send it.
There was a bug with clock freezing, and it has been fixed with last NWNX Fixes update (Linux only):
http://nwn.virusman.ru/trac/nwnx2-linux/changeset/377/trunk/plugins/fixes
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Jul 28, 2011 22:01    Post subject: Reply with quote

I may have described the issue in-accurately.


The issue is that large modules suffer from the issue where low priority heartbeats, such as the storm of vengeance spell heartbeat, do not fire on their own, without the use of Pseudo Heartbeats to force the heartbeat to fire.


Perhaps this is linked to the Module Time issue?

Would the AIUpdate hook fix such an issue as I have described?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Jul 28, 2011 23:09    Post subject: Reply with quote

Yes, the time freeze fix may also fix these issues.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jul 29, 2011 0:01    Post subject: Reply with quote

Cool
Would the same function you have in the fixes, work in the windows version?


I am just getting IDA installed now again...
If the function implimentation is likely to be the same, I should be able to update the memory locations for windows version (assuming they are labeled in the IDB)
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jul 29, 2011 2:27    Post subject: Reply with quote

Hey Virus.

I have a dll building with no errors.

Can you confirm if this function will work?

Its exactly how it was taken from the linux one, I just dont know whether there is a better hooking function out there.


Code:

void d_redirect (long from, long to, unsigned char *d_ret_code, long len=0)
{
   // enable write to code pages
   d_enable_write (from);
   // copy orig code stub to our "ret_code"
   len = len ? len : sizeof(d_jmp_code)-1; // - trailing 0x00
   intlen = len;
   memcpy ((void *) d_ret_code, (const void *) from, len);
   // make ret code
   *(long *)(d_jmp_code + 1) = from + len;
   memcpy ((char *) d_ret_code + len, (const void *) d_jmp_code, 6);
   // make hook code
   *(long *)(d_jmp_code + 1) = to;
   memcpy ((void *) from, (const void *) d_jmp_code, 6);
}




Do the variables in this function need to be replaced with win32 equivelants?

Do you have a hook function lying around off hand?

The way I am calling this is via.

Code:

   if(fixes.ini_aiUPDATE)
   {
      d_redirect((unsigned long)CNWSModule__AIUpdate, (unsigned long)CNWSModule__AIUpdate_hook, d_ret_code_mai, 9);
      *(dword*)&CNWSModule__AIUpdate_R = (dword)&d_ret_code_mai;
   }


Im still pretty fresh to c++.
I learn a little, then have a long break, and all that I learn goes out the window. lol


I updated the memory location for the module aiupdate to be 004D1D00
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group