View previous topic :: View next topic |
Author |
Message |
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
|
Back to top |
|
|
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
Posted: Wed Nov 23, 2005 18:05 Post subject: |
|
|
Awesome, congrats on getting this done. I'm curious as to how you did this different from my approach. But, like everything in the software world there is more than 1 way to skin the cat.
Gonna check this out as soon as I get home from work
Thanks again for getting this working. _________________ Member Shadow of Iniquity development team |
|
Back to top |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Wed Nov 23, 2005 19:28 Post subject: |
|
|
No problem. As for how, well.. I kinda cheated and borrowed code I knew worked. Its mentioned above that NWN-FF had a function that accomplished what we wanted, so I looked at how he did it. Turns out he didn't write it either, just used a pre-released library. So that's what I did, gave credit, etc.
If interested, all the source is included and you can gander at it. Someone on the vault mentioned they were having trouble with it, so let me know if it works for you or if there are issues.
Good luck and have fun!
Asmodae _________________ Nepenthe - An NWN2 Persistant World, coming to a planet near you. http://www.nepentheonline.com |
|
Back to top |
|
|
Baldorcete
Joined: 05 Jan 2005 Posts: 6
|
Posted: Wed Nov 23, 2005 22:17 Post subject: |
|
|
I dont know if this is correct, but:
With SetLocalString(GetModule(),"NWNX!RESETPLUGIN!SHUTDOWN",""); nothing hapens. No reset.
with SetLocalString(GetModule(),"NWNX!RESETPLUGIN!SHUTDOWN","1"); the server crashes, NWNX2 notices it, and restart it.
If this is the intended behaivour, you should correct the readme. If not, i don't know what is hapening, but is working. Thanks. |
|
Back to top |
|
|
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
Posted: Thu Nov 24, 2005 0:04 Post subject: |
|
|
I believe I see an error that is causing the server to crash and not shut down gracefully.
Ln 59 and 60 should be swapped in file NWNXResetplugin.cpp
It's usually not a good idea to delete a null variable. _________________ Member Shadow of Iniquity development team |
|
Back to top |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Thu Nov 24, 2005 4:19 Post subject: |
|
|
Thanks for the info, I'll check that out and update the readme accordingly. _________________ Nepenthe - An NWN2 Persistant World, coming to a planet near you. http://www.nepentheonline.com |
|
Back to top |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Thu Nov 24, 2005 5:16 Post subject: |
|
|
Xildjian - You are right about deleting pointers, but that didn't make a difference. I did find a default delay value of 60 seconds, which was why it took so long to terminate the process.
Baldorcete - Thanks for the catch. My testing code had a value to be passed, and it seems that NWNX doesn't catch it if that string is empty. I've updated the readme accordingly.
The new version on the vault should have a much shorter time before the process dies (2 seconds).
Happy gaming!
- Asmodae _________________ Nepenthe - An NWN2 Persistant World, coming to a planet near you. http://www.nepentheonline.com |
|
Back to top |
|
|
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
Posted: Mon Nov 28, 2005 18:15 Post subject: |
|
|
I played with this over the weekend. Works great, great job!
Thanks again. _________________ Member Shadow of Iniquity development team |
|
Back to top |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Mon Nov 28, 2005 23:33 Post subject: |
|
|
Thanks for the feedback, I appreciate it.
Also I've taken down the link on my personal webspace, nwvault has everything up and running properly so that is the place to get this plugin if interested.
- Asmodae _________________ Nepenthe - An NWN2 Persistant World, coming to a planet near you. http://www.nepentheonline.com |
|
Back to top |
|
|
Mask
Joined: 20 Mar 2005 Posts: 12
|
Posted: Sat Dec 03, 2005 2:49 Post subject: |
|
|
Quote: | Posted by Asmodae at 2005-11-22 13:35:40
Hrm, a little more information would be good. What OS? I should mention this will only work on windows. And its been tested on windows XP. Another caveat, it takes about 30-60 seconds for the server process to time out and windows to clean it up. So after you execute the script, wait a few and see if it times out. |
Don't suppose support for Linux has been put in since then, or there's any plans of expanding it? _________________ DM Mask
Legacy of Netheril |
|
Back to top |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Sat Dec 03, 2005 4:27 Post subject: |
|
|
I'm not exactly against that. While I am familiar with *nix running a freeBSD server myself... I know positively nill about developing for linux and how NWNX would support plugins in that environment. I had to learn plenty It would make killing the process easier as there's a command to do that already
Any thoughts on NWNX plugins for *nix anyone? _________________ Nepenthe - An NWN2 Persistant World, coming to a planet near you. http://www.nepentheonline.com |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Dec 03, 2005 13:05 Post subject: |
|
|
The linux distribution contains a small version of the functions plugin, which could server as a base for your own plugin. I guess it isn't much more complicated than the demo plugin on windows. _________________ Papillon |
|
Back to top |
|
|
pinknapkins
Joined: 25 Dec 2005 Posts: 9
|
Posted: Sun Jan 08, 2006 19:57 Post subject: |
|
|
At the risk of sounding ignorant... how do you change the amount of time until the reset occurs, say I want to reboot the server every 6 hours...?
EDIT: Nevermind... blood just started to circulate to the brain again. Seems to be functioning normally again. |
|
Back to top |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Thu Jun 08, 2006 20:48 Post subject: |
|
|
**** fast forward to now ****
There were some posts here with code in them and some discussion of better ways to implement the shutdown plugin. I would be grateful if people would repost the information... thanks.
- Asmodae _________________ Nepenthe - An NWN2 Persistant World, coming to a planet near you. http://www.nepentheonline.com |
|
Back to top |
|
|
Drakken05
Joined: 12 Jun 2006 Posts: 3
|
Posted: Mon Jun 12, 2006 5:46 Post subject: |
|
|
I have had some trouble getting the reset plugin to work. I have noticed that the instructions state to:
"in NWscript call SetLocalString(GetModule(),"NWNX!RESETPLUGIN!SHUTDOWN","1") to shutdown the nwserver process. (note that there has to be a value in the string or the variable doesn't get set and the request won't get processed."
What exactly is the NWscript? Once I edit it, how do I change it to crash the server every 6 hours so NWNX2 can restart it?
I admit that I am a n00b to this level , but I am learning. Any information you provide me will be extremely helpful.
Warm Regards,
Drakken
www.WrathofZero.com |
|
Back to top |
|
|
|