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: Sun Jan 30, 2005 10:13    Post subject: Reply with quote

Right now school is just starting, and I have a big project for Exodus in the works, (our custom guild system) but once the dust settles on that I want to migrate Exodus over to NWNX2. To make that possible/easier I'm going to create an NWN-FF plugin for NWNX2 which will include all the custom NWN-FF stuff including a reset function. Be patient and watch here, I'll post it when I'm through, unless someone else gets to it first.
_________________
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
Remy



Joined: 20 Jan 2005
Posts: 6

PostPosted: Wed Feb 16, 2005 21:04    Post subject: Reply with quote

Found a kludgy method... Get Process Viewer for Windows:

http://www.teamcti.com/pview/index.htm

Assuming you have the NWNX-Leto plugin, I did something similar to the following in the module on load script:

DelayCommand(600.0, SetLocalString(GetModule(), "NWNX!LETO!SCRIPT", "<system: 'cmd /c full_path_to_pv/pv.exe /c nwserver.exe'>") );

This will send the WM_CLOSE signal as discussed earlier in this thread. Surprisingly, the confirmation popup window for when there are still players on the did not appear.

Some tweaking of the pv arguments will be necessary if you run multiple instances of nwserver on a single system. Hopefully I got the syntax right since I'm reducing the code that I used to the bare minimum example.
Back to top
View user's profile Send private message
Chreelister



Joined: 07 Mar 2005
Posts: 2

PostPosted: Mon Mar 07, 2005 7:13    Post subject: Reply with quote

I have tried and tried to get that kludgy method to work and can't.

Could you Remy, explain it in more detail for total noobs like me Smile.

Well anyway I have Windows, so I put the 2 dll files of NWNX-Leto in my nwn folder to get the NWNX-Leto to work. I downloaded PrcView and put it in a folder named PrcView. And put this line in my on_moduleload script.

DelayCommand(600.0, SetLocalString(GetModule(), "NWNX!LETO!SCRIPT", "<system: 'cmd /c prcview/pv.exe /c nwserver.exe'>") );

That looks like a good idea to use PrcView to shutdown the server via NWNX-Leto, that way you can use DelayCommand like you did and you can give warnings and have a server reset clock. If I use the Task Scheduler, then I can't do none of this.
Back to top
View user's profile Send private message
Remy



Joined: 20 Jan 2005
Posts: 6

PostPosted: Sun Mar 13, 2005 21:14    Post subject: Reply with quote

I confirmed that this works for me in the module on load script:

Quote:
DelayCommand(30.0f, SetLocalString(GetModule(), "NWNX!LETO!SCRIPT", "<system:'cmd /c c:/temp/pv.exe -c nwserver.exe'>"));


You used a relative path for pv. Have you tried the full path to pv? Yes, we use DelayCommand() calls to also warn our players about the reset. You won't see the "The server has gone down. Your server-side character has been saved." message when you use direct connect on a server with this reset method.
Back to top
View user's profile Send private message
Chreelister



Joined: 07 Mar 2005
Posts: 2

PostPosted: Wed Mar 30, 2005 8:20    Post subject: Reply with quote

I still can't get this work, I have tried this and tried this and have tried hundreds of different ways that look very similiar to this and none of them work. May I ask what operating system you are using? Because the server will be going to Win XP from Win 98, don't know if that'll make a difference or not. I am pretty sure Leto is working because I put in a command.com in a line similiar to that one and it did pop up the ms-dos box.

Well anyway, does anyone else know of an idea to get this to work or some kind of DelayCommand or an outside time based program that resets the server. I was using NWMan and it worked well, but I can't now with NWNX 2, that I am aware of. IMO, not being able to reset the server on a timed basis is making me want to switch back or try something else, that has this very important feature to it.
Back to top
View user's profile Send private message
Remy



Joined: 20 Jan 2005
Posts: 6

PostPosted: Sat Apr 16, 2005 17:00    Post subject: Reply with quote

XP Pro. can u post the resulting letoscript and any related output from either your nwserverlog or nwnx leto log? it's hard to tell what is happening for you. also what is the full path for pv.exe for you?
Back to top
View user's profile Send private message
Moonunit921



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

PostPosted: Sat Nov 12, 2005 0:58    Post subject: Reply with quote

I'm wondering if Asmodae was able to get the plugin to work, or anyone duplicate that idea? It seems like the way to go. I'd love to have an auto reset as well so I don't have to do it by hand, but I don't think I have the cranial capacity to code a plugin, even with the tutorial NWNX2 For Dummies.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Sat Nov 12, 2005 1:42    Post subject: Reply with quote

Moonunit921 wrote:
I'm wondering if Asmodae was able to get the plugin to work, or anyone duplicate that idea? It seems like the way to go. I'd love to have an auto reset as well so I don't have to do it by hand, but I don't think I have the cranial capacity to code a plugin, even with the tutorial NWNX2 For Dummies.


http://www.nwnx.org/phpBB2/viewtopic.php?t=235
_________________
Member Shadow of Iniquity development team
Back to top
View user's profile Send private message
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Fri Nov 18, 2005 17:33    Post subject: Reply with quote

Moonunit921 wrote:
I'm wondering if Asmodae was able to get the plugin to work, or anyone duplicate that idea? It seems like the way to go. I'd love to have an auto reset as well so I don't have to do it by hand, but I don't think I have the cranial capacity to code a plugin, even with the tutorial NWNX2 For Dummies.


Haha, I've been out of the NWN scene for a while. Though now we are looking at building for NWN2 and have some good ideas... although I'm hesitant to go forward without NWNX in some form or other Very Happy.

I'm making this my next priority though, I won't claim its original, but I'll rip apart code untill I have a reset plugin for NWNX. (no time frame gaurantees though Razz)
_________________
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: Sun Nov 20, 2005 20:21    Post subject: Reply with quote

Ok, I have the plugin compiled into a .dll, NWNX is working but the nwnx.txt log gives me the following error:
"Error: can not find creation function in nwnx_resetplugin.dll"

I've poked through some of the NWNX code and found where that error is being generated, but can't figure out why. I used the demoplugin project (renaming files and such) as my environment. The only thing different I'm doing is using Visual Studio .NET (as that's what I have at my school).

This is my header: NWNXresetplugin.h
Code:

#if !defined(RESETPLUGIN_H_)
#define RESETPLUGIN_H_

#include "..\NWNXDLL\NWNXBase.h"

class CNWNXResetplugin : public CNWNXBase 
{
public:
   CNWNXResetplugin();
   virtual ~CNWNXResetplugin();

   BOOL OnCreate(const char* LogDir);
   char* OnRequest(char *gameObject, char* Request, char* Parameters);
   BOOL OnRelease();

   void WriteLogHeader();
};

#endif


I'm obviously missing something, but I've gone back through the tutorial and demo plugins about a dozen times now and can't find the difference.
_________________
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: Sun Nov 20, 2005 20:28    Post subject: Reply with quote

Also, during the build I get these two warnings:

Code:

LINK : warning LNK4089: all references to 'PSAPI.DLL' discarded by /OPT:REF
LINK : warning LNK4089: all references to 'USER32.dll' discarded by /OPT:REF

_________________
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: Sun Nov 20, 2005 23:51    Post subject: Reply with quote

Ok, sorry about the above, totally left out the demoplugin.cpp file that defines the entry point of the dll.
_________________
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: Mon Nov 21, 2005 1:56    Post subject: Reply with quote

Allright, its done!

I tell you what, getting this working was an exhilerating experience. Lots of fun.

I hope its usefull for you folks, I'll post the link from nwvault once it is approved and posted.

In the mean time, it can be downloaded from here:

[EDIT: LINK REMOVED]

Let me know if you find any problems.
_________________
Nepenthe - An NWN2 Persistant World, coming to a planet near you. http://www.nepentheonline.com


Last edited by Asmodae on Mon Nov 28, 2005 23:32; edited 1 time in total
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: Mon Nov 21, 2005 22:28    Post subject: Reply with quote

Heh, congrats. Now on to plugin support for your users Smile
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Asmodae



Joined: 07 Jan 2005
Posts: 55

PostPosted: Mon Nov 21, 2005 23:14    Post subject: Reply with quote

The trickiest part was figuring out how to make VS .net know I wanted a .dll as the tutorial assumes you know that already. Razz

Once that was done, the actual code was a piece of proverbial cake. I tell you what, NWNX is a masterpiece. I really do hope that it can be made to function for NWN2.

Thanks to all the NWNX crew for this great tool.
_________________
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 -> General Discussion All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 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