View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Dec 30, 2010 4:35 Post subject: this is what I have so far |
|
|
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 |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Dec 30, 2010 4:55 Post subject: |
|
|
I can confirm that it works.
However, it seems to have crashed the server as well, with no error message.
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 |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Dec 30, 2010 6:01 Post subject: Solved it!! |
|
|
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 |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Sun Jan 02, 2011 1:21 Post subject: |
|
|
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 |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Sun Jan 02, 2011 2:01 Post subject: test it |
|
|
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 |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Sun Jan 02, 2011 5:33 Post subject: |
|
|
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 |
|
|
Greyfort
Joined: 20 Jul 2010 Posts: 66
|
Posted: Wed Jan 05, 2011 10:57 Post subject: |
|
|
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 |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Wed Jan 05, 2011 14:48 Post subject: |
|
|
Is linux not free? Open Source?
http://www.linux.org/
Yeah, it is, you can download it for free. |
|
Back to top |
|
|
Greyfort
Joined: 20 Jul 2010 Posts: 66
|
Posted: Fri Jan 07, 2011 2:35 Post subject: |
|
|
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 |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Jan 07, 2011 15:05 Post subject: |
|
|
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 |
|
|
Greyfort
Joined: 20 Jul 2010 Posts: 66
|
Posted: Thu Jan 13, 2011 7:24 Post subject: |
|
|
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 |
|
|
DaMouse404
Joined: 07 May 2009 Posts: 1
|
Posted: Sun Jan 30, 2011 19:31 Post subject: |
|
|
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 |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Mon Jan 31, 2011 20:52 Post subject: |
|
|
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 |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Mon Jan 31, 2011 20:55 Post subject: |
|
|
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 |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Tue Feb 01, 2011 11:56 Post subject: |
|
|
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 |
|
|
|
|
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
|