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 
 
Function idea: Shutdown server
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Wed Nov 23, 2005 16:09    Post subject: Reply with quote

Ok, the link is up on the vault now.

http://nwvault.ign.com/View.php?view=Other.Detail&id=1018
_________________
Nepenthe - An NWN2 Persistant World, coming to a planet near you. http://www.nepentheonline.com
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Wed Nov 23, 2005 18:05    Post subject: Reply with quote

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 Smile

Thanks again for getting this working.
_________________
Member Shadow of Iniquity development team
Back to top
View user's profile Send private message
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Wed Nov 23, 2005 19:28    Post subject: Reply with quote

No problem. As for how, well.. I kinda cheated and borrowed code I knew worked. Smile 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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Baldorcete



Joined: 05 Jan 2005
Posts: 6

PostPosted: Wed Nov 23, 2005 22:17    Post subject: Reply with quote

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
View user's profile Send private message
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Thu Nov 24, 2005 0:04    Post subject: Reply with quote

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
View user's profile Send private message
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Thu Nov 24, 2005 4:19    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Thu Nov 24, 2005 5:16    Post subject: Reply with quote

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. Smile 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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Mon Nov 28, 2005 18:15    Post subject: Reply with quote

I played with this over the weekend. Works great, great job!

Thanks again.
_________________
Member Shadow of Iniquity development team
Back to top
View user's profile Send private message
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Mon Nov 28, 2005 23:33    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Mask



Joined: 20 Mar 2005
Posts: 12

PostPosted: Sat Dec 03, 2005 2:49    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Sat Dec 03, 2005 4:27    Post subject: Reply with quote

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 Smile

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Dec 03, 2005 13:05    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
pinknapkins



Joined: 25 Dec 2005
Posts: 9

PostPosted: Sun Jan 08, 2006 19:57    Post subject: Reply with quote

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
View user's profile Send private message
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Thu Jun 08, 2006 20:48    Post subject: Reply with quote

**** 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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Drakken05



Joined: 12 Jun 2006
Posts: 3

PostPosted: Mon Jun 12, 2006 5:46    Post subject: Reply with quote

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 Embarassed , but I am learning. Any information you provide me will be extremely helpful.

Warm Regards,
Drakken

www.WrathofZero.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
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