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 
 
Help requested for new windows plugin - Killserver

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Mon Apr 25, 2005 15:56    Post subject: Help requested for new windows plugin - Killserver Reply with quote

I thought I'd take a shot at a graceful means to shutdown the nwn server for restarts. After, looking through the nwn standalone server install directory I noticed the nwnpid file. Sweet, the server leaves it's PID. So doing a little research on the MSDN web site I found an example that looks like it would work.

The plan:
1) read in the PID from the file
2) get the handle to the process
3) terminate the process

Sounds simple and elegant enough. However, when I make a call to the OpenProcess function I keep getting a return error of invalid parameter. I pretty much cut and pasted from the example I found and looked at the manual page for this function and can't see why I'm getting an invalid parameter. Any help/suggestions would be appreciated. Below is a zip file with my source code.

http://home.comcast.net/~xildjian/Killserver.zip

Thanks,
_________________
Member Shadow of Iniquity development team
Back to top
View user's profile Send private message
Moonunit921



Joined: 10 Sep 2005
Posts: 11
Location: The Yawning Portal Tavern, Waterdeep

PostPosted: Sun Nov 13, 2005 17:55    Post subject: Reply with quote

Have you solved this problem yet?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Nov 15, 2005 21:03    Post subject: Reply with quote

An alternative way might be to just call
Code:
exit(0);

somewhere in your plugin.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Wed Nov 16, 2005 3:13    Post subject: Reply with quote

Nope, haven't looked at it since I asked for help.

Wouldn't exit(0) refer to the plugin and not the nwn server?
_________________
Member Shadow of Iniquity development team
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Nov 18, 2005 21:11    Post subject: Reply with quote

exit(0) terminates the process, and nwnx and it's plugins are part of the nwn server process....
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Tue Nov 22, 2005 18:04    Post subject: Reply with quote

Papillon wrote:
exit(0) terminates the process, and nwnx and it's plugins are part of the nwn server process....


I'll have to try that when I get a chance, that would be to easy if it works. But, will it restart the server as expected or just shut everything down?
_________________
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 16:08    Post subject: Reply with quote

I put together a plugin that accomplishes this, look at this post:

http://www.nwnx.org/phpBB2/viewtopic.php?t=89&postdays=0&postorder=asc&start=15

Let me know if it works for you.
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development 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