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_funcs for windows
Goto page Previous  1, 2, 3 ... 18, 19, 20 ... 27, 28, 29  Next
 
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 Dec 30, 2010 4:35    Post subject: this is what I have so far Reply with quote

Im gonna give this a try,
let me know if you spot any mistakes, or issues with how I implimented this.

Its been a while since I made any nwnx dll stuff etc.

Code:

int CNWNXFuncs::BootWithMessage() {
   int iMsg = 0;
   sscanf(Params, "%d", &iMsg);
   CNWSObject *obj = (CNWSObject*)oObject;
   nwn_objid_t plID = obj->obj_generic.obj_id;
   CNWSPlayer* pPlayer = ((*NWN_AppManager)->app_server)->GetClientObjectByObjectId(plID);
   uint32_t pID = pPlayer->pl_id;
   CNetLayer* netlayer = (*NWN_AppManager)->app_server->srv_internal->srv_network;
   netlayer->BootPlayerWithMessage(pID,iMsg);   
}
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Dec 30, 2010 4:55    Post subject: Reply with quote

I can confirm that it works.
However, it seems to have crashed the server as well, with no error message.
Sad

Event viewer had this

Faulting application nwserver.exe, version 1.6.9.0, faulting module unknown, version 0.0.0.0, fault address 0x003cd0f8


Code:

int            (__thiscall *CNetLayer__DisconnectPlayer)(CNetLayer *pTHIS, uint32_t plyer, int iMsg)  = (int (__thiscall *)(CNetLayer *pTHIS, uint32_t plyer, int iMsg))0x0041F490;


int CNetLayer_s::BootPlayerWithMessage(uint32_t PlayerID, int iVal){
   return CNetLayer__DisconnectPlayer(this,PlayerID,iVal);
}


It must be getting this far at least, if the crash was occuring before this, then the log wouldnt have got wrote, rite?
And I wouldnt have been booted, with the message 'Half-Orc' on my screen (I used the value of 44 to get that one)
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Dec 30, 2010 6:01    Post subject: Solved it!! Reply with quote

Code:

int            (__thiscall *CNetLayer__DisconnectPlayer)(CNetLayer *pTHIS, uint32_t plyer,uint32_t iMsg, int iConst)  = (int (__thiscall *)(CNetLayer *pTHIS, uint32_t plyer,uint32_t iMsg, int iConst))0x0041F490;



int CNetLayer_s::BootPlayerWithMessage(uint32_t PlayerID, uint32_t iVal){
   return CNetLayer__DisconnectPlayer(this,PlayerID,iVal,1);
   //return NULL;
   //return CNetLayer__DisconnectPlayer(PlayerID, iVal, 1);
}




and this in Funcs_def
Code:

int CNWNXFuncs::BootWithMessage() {
   int iMsg = 0;
   sscanf(Params, "%d", &iMsg);
   CNWSObject *obj = (CNWSObject*)oObject;
   nwn_objid_t plID = obj->obj_generic.obj_id;
   CNWSPlayer* pPlayer = ((*NWN_AppManager)->app_server)->GetClientObjectByObjectId(plID);
   if(pPlayer != NULL)
   {
   uint32_t pID = pPlayer->pl_id;
   CNetLayer* netlayer = (*NWN_AppManager)->app_server->srv_internal->srv_network;
   
   netlayer->BootPlayerWithMessage(pID,iMsg);
   return 1;
   }
   return 0;
}


I had forgot the lesson that I was taught by Zebranky via pm about a year ago, about how the pThis var in the declarations is something additional that you need to put in.

So, when I saw the declaration in IDA, I assumed, and forgot, that the first unsigned long var, was the CNetLayer itself, doh....

I have it working now, without the crash.

I basically just had to change the declaration, and change the int in it, to be static with a value of 1.... have no idea what it does, but thats how it was done in the original nwnx_functions
Back to top
View user's profile Send private message
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Sun Jan 02, 2011 1:21    Post subject: Reply with quote

Has anyone else had problems with crashes? I'm running the server on Windows 7 64bit. Players can log in fine but DMs crash the server occasionally.

There's no calls being made to modify stats/attributes/whatever for DMs but thought that maybe there's a problem with the plug-in itself running on a 64 bit system.

If it's not this plug-in, does anyone know which other one it might be?

We have the following:

nwnx_chat
nwnx_events
nwnx_fixes
nwnx_funcs
nwnx_hashset
nwnx_leto
nwnx_odbc
nwnx_profiler
nwnx_resetplugin
nwnx_resman


My money's on the resman but I'm not entirely sure. Will give it a shot next time we reload.

Thanks for any help. Loving this plug-in and so are my players!
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Sun Jan 02, 2011 2:01    Post subject: test it Reply with quote

The Only way to find out what is causing it, is to do some trial and error.

Remove all plugins - Log in as DM - Does it Crash
Add a plugin back to the nwn folder - Log in as DM - Does it crash


Repeat the process until you find the culprit.

If it is a plugin that is causing it, it would probably be something related to events that fire for DM login's specifically.

Check your onClient enter script, and see if you have any code that gets run for DM's and not for Normal Players, and make sure there are no obvious errors.
Back to top
View user's profile Send private message
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Sun Jan 02, 2011 5:33    Post subject: Reply with quote

Yeah, was afraid that was the only solution. I've quadruple checked all of the module events, and especially the OnEnter script but none of them fire for DMs.

Will have to do the trial and error run at some point. Thanks for your help.
Back to top
View user's profile Send private message
Greyfort



Joined: 20 Jul 2010
Posts: 66

PostPosted: Wed Jan 05, 2011 10:57    Post subject: Reply with quote

I have a piece of code that uses the Linux nwnx_structs

function:
GetItemPropertyDurationRemaining()

is there any windows version of these struct files ? as described in this...

forum link:
http://www.nwnx.org/phpBB2/viewtopic.php?t=818

This plugin allows reading and manipulation of values not normally exposed in engine structures. Right now it supports Effect and Item Property structures.

NWNX Structs plugin 2.1
http://dl.hgweb.org/nwnx/nwnx_structs-2.1.tar.gz


Fix bug with GetEffectDurationRemaining() and GetItemPropertyDurationRemaining() not returning the correct time for long-lasting effects



Older Versions
http://www.intertex.net/~zac/nwnx/nwnx_structs-2.0.tar.gz


Renamed CalculateEffectDurationBasis() to CalculateStructDurationBasis()
Added GetItemPropertyDuration()
Added GetItemPropertyDurationRemaining()
Added GetItemPropertyInteger()
Added SetItemPropertyInteger()
Added GetItemPropertySpellId()
Added SetItemPropertySpellId()

I sure could use them would make storeing custom item by resref rather then object, and I surely cant go and buy Linux LOL
Please let me know if there is one out there.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jan 05, 2011 14:48    Post subject: Reply with quote

Is linux not free? Open Source?

http://www.linux.org/

Yeah, it is, you can download it for free.
Back to top
View user's profile Send private message
Greyfort



Joined: 20 Jul 2010
Posts: 66

PostPosted: Fri Jan 07, 2011 2:35    Post subject: Reply with quote

So I can get free linux to set up my pc and run a nwn server with it?

That is what your saying here

Is linux not free? Open Source? Baaleos

http://www.linux.org/

Yeah, it is, you can download it for free.

i have dial up so downloading it is not a option, I was hoping there was a windows version of the plugin or maybe a nwnx_func
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jan 07, 2011 15:05    Post subject: Reply with quote

Yes - you can download the linux operating system for free, and install and run it.


If you are having problems downloading due to Dial Up.
Might I suggest you check out
Internet Download Manager (google it)

It allows you to stop, resume downloads, and can increase download speeds considerably.

You get it free for 30 days, or you can purchase a license and get it for life.


But on another note - Are you sure your dial up connection is sufficient to host a nwserver?
Back to top
View user's profile Send private message
Greyfort



Joined: 20 Jul 2010
Posts: 66

PostPosted: Thu Jan 13, 2011 7:24    Post subject: Reply with quote

Is anyone currently working on nwnx_funcs to have the above described functions: and repasted here...

Renamed CalculateEffectDurationBasis() to CalculateStructDurationBasis()
Added GetItemPropertyDuration()
Added GetItemPropertyDurationRemaining()
Added GetItemPropertyInteger()
Added SetItemPropertyInteger()
Added GetItemPropertySpellId()
Added SetItemPropertySpellId()


from the linux nwnx_structs

if possible I would like to keep my pc with windows/for testing and such.
please let me know if someone is working on them I dont mind waiting.

Thanks for the linux info Baaleos, I will look into that and will have to set up another PC for it on a Broad band line to run a server to handle large numbers. But curently I can host a server with dial up but 7 people are the max it can handle
Back to top
View user's profile Send private message
DaMouse404



Joined: 07 May 2009
Posts: 1

PostPosted: Sun Jan 30, 2011 19:31    Post subject: Reply with quote

Hey,

I tried using the SetEvent feature on a critter and it firstly didn't work but then when I tried to read back the event using GetEvent my server crashed. Any ideas?

-DaMouse
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Jan 31, 2011 20:52    Post subject: Reply with quote

Embarassed I'm back ...hopefully. We moved, no internet, etc.

Anyways, I've updated the package on sourceforge and the code on the repository with the latest stuff I had.

I'm gonna try and read through the posts of the previous months to get up to speed, but if somebody could post a list of bugs and nonworking functions I'd be grateful.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Jan 31, 2011 20:55    Post subject: Reply with quote

DaMouse404 wrote:
Hey,

I tried using the SetEvent feature on a critter and it firstly didn't work but then when I tried to read back the event using GetEvent my server crashed. Any ideas?

-DaMouse


Can you post the line of code that you're using? There were/are some mixed up constants for the events. I might have to change the filter for the script name too...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue Feb 01, 2011 11:56    Post subject: Reply with quote

The only ones that spring to mind, based on previous posts I have seen,
are people saying that

SetEvent and GetEvent dont work - even though it works for me.
SetTrapGeometry - I recall this apparently having issues?


Also I posted a function above, which might be useful to be added to your svn - so I dont need to manually edit your own code.

Code:

int CNetLayer_s::BootPlayerWithMessage(uint32_t PlayerID, uint32_t iVal)



Also - I see in your svn code, that you have PossessNPC etc added in, did you ever get this to work without server crashes?
eg - Possess creature -> Creature Levels up for some reason, -> and various other actions cause server to crash.

I only mention it because I had fooled around with it at one point and never got it to work either.
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
Goto page Previous  1, 2, 3 ... 18, 19, 20 ... 27, 28, 29  Next
Page 19 of 29

 
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