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 
 
nwnx_structs woes, help needed

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
xorbaxian



Joined: 18 Dec 2007
Posts: 45

PostPosted: Fri Jul 21, 2017 23:16    Post subject: nwnx_structs woes, help needed Reply with quote

greetings,

i'm running nwniab on windows xp. so far, everything under nwnx-lin has run fine this way, right out of the box. however, i'm getting some strange issues w/the nwnx_structs plugin.

i'm interested in using the 'GetEffectInteger()' function. unfortunately, the function isn't returning anything.

here's a snippet of my neverscript driver program -
Code:
        SendMessageToPC(GetFirstPC(), "EFFECT INTEGERS:");
        int n = GetEffectNumIntegers(eff);
        int i;
        for (i = 0; i < n; i++)
            SendMessageToPC(GetFirstPC(), "    " + IntToString(i) + ": " + IntToString(GetEffectInteger(eff, i)));


what i get on the screen is -

Code:
EFFECT INTEGERS:


i.e., nothing at all. i thought maybe the plugin supplied w/nwniab might be backdated, so i got what i think is the newest release, from http://dl.hgweb.org/nwnx/nwnx_structs-2.1.tar.gz. i installed it in my nwniab and nwnx seems to run fine w/it, but i'm still having the same problem.

here's what the nwnx2 log file shows me -
Code:
NWN Extender v2.7.1-dev
--------------------------------
SQLITE plugin registered.
Address: B72CE600
SPELLS plugin registered.
Address: B72C4584
HASHSET plugin registered.
Address: B6140580
ODBC plugin registered.
Address: B6130160
EVENTS plugin registered.
Address: B5EEA520
LETO plugin registered.
Address: B6125B20
CHAT plugin registered.
Address: B5E1B380
RESMAN plugin registered.
Address: B5E129A0
WEAPONS plugin registered.
Address: B5E09E8C
FIXES plugin registered.
Address: B5DF9B40
FUNCS plugin registered.
Address: B5DEE144
STRUCTS plugin registered.
Address: B5DDD3A0
FUNCSEXT plugin registered.
Address: B5DCFE0C
SYSTEM plugin registered.
Address: B5EDAE50
* NWNX2 activated.
name='oX3_Skin'
name='oX3_Skin'
name='AIIntruderObj'
name='HenchLastSpellTarget'
name='LastTarget'
name='NWNX!STRUCTS!GETNUMINTEGERS'
NWNX!INIT enforcement disabled, using 0x082041ec
* Library STRUCTS!GETNUMINTEGERS found: B5DDD3A0
name='NWNX!STRUCTS!GETNUMINTEGERS'
* Library STRUCTS!GETNUMINTEGERS found: B5DDD3A0
name='NWNX!STRUCTS!GETNUMINTEGERS'
* Library STRUCTS!GETNUMINTEGERS found: B5DDD3A0
name='NWNX!STRUCTS!GETNUMINTEGERS'
* Library STRUCTS!GETNUMINTEGERS found: B5DDD3A0
name='oX3_Skin'

...so it seems that the structs package is being loaded, and nwnx finds the plugin.

here's the contents of the nwnx_structs log file -
Code:
found struct hook at 0x0825e839
Request: "GETNUMINTEGERS"
Params:  "          "
Request: "GETNUMINTEGERS"
Params:  "          "
Request: "GETNUMINTEGERS"
Params:  "          "
Request: "GETNUMINTEGERS"
Params:  "          "

...so it seems like the plugin is being called correctly each time [there are 4 effects in the chain that i'm investigating] -- but what happens then? for whatever reason, the function call is returning 0.

can someone shed some light on this ?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat Jul 22, 2017 18:59    Post subject: Reply with quote

considering the feedback you got from sendmessage, try replace the getnumintegers by 9, it seems the problem is that the getnumintegers returns 0 (which should not happen of course...)
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
xorbaxian



Joined: 18 Dec 2007
Posts: 45

PostPosted: Sun Jul 23, 2017 20:28    Post subject: Reply with quote

thanks for the quick reply, shadooow ! Smile

yes, that works -- for this particular test case. i'm wondering if there might be a case where simply reading several values this way could result in a read of an out-of-bounds memory location and crash the server. i've searched around for some documentation on the aurora effect structure and the 'CGameEffects' structure mentioned in the nwnx_structs.nss comments, couldn't find anything. what are your thoughts on this ?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Jul 23, 2017 20:57    Post subject: Reply with quote

xorbaxian wrote:
thanks for the quick reply, shadooow ! Smile

yes, that works -- for this particular test case. i'm wondering if there might be a case where simply reading several values this way could result in a read of an out-of-bounds memory location and crash the server. i've searched around for some documentation on the aurora effect structure and the 'CGameEffects' structure mentioned in the nwnx_structs.nss comments, couldn't find anything. what are your thoughts on this ?

Settings high th integer could cause this as we don't know if there is a limit. Possibly the same can be done if trying to read too high integer.

Cannot see why should this happen outside of this case though unless the plugin's way of doing this itself is wrong. (I was studying nwnx_structs for some time but went for completely different approach for my own plugin, safer one).
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
xorbaxian



Joined: 18 Dec 2007
Posts: 45

PostPosted: Mon Jul 24, 2017 23:18    Post subject: Reply with quote

ShaDoOoW wrote:
(I was studying nwnx_structs for some time but went for completely different approach for my own plugin, safer one).
ah well now that sounds interesting. Smile have you finished it ? is it usable ?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Mon Jul 24, 2017 23:22    Post subject: Reply with quote

xorbaxian wrote:
ShaDoOoW wrote:
(I was studying nwnx_structs for some time but went for completely different approach for my own plugin, safer one).
ah well now that sounds interesting. Smile have you finished it ? is it usable ?

yes, here, but its for windows only...
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
xorbaxian



Joined: 18 Dec 2007
Posts: 45

PostPosted: Tue Jul 25, 2017 20:52    Post subject: Reply with quote

ah. well. in that case, kudos, and may your ongoing quest to vanquish the boojums of windoze meet w/continued success ! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support 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