View previous topic :: View next topic |
Author |
Message |
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Sun Jan 30, 2005 10:13 Post subject: |
|
|
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 |
|
|
Remy
Joined: 20 Jan 2005 Posts: 6
|
Posted: Wed Feb 16, 2005 21:04 Post subject: |
|
|
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 |
|
|
Chreelister
Joined: 07 Mar 2005 Posts: 2
|
Posted: Mon Mar 07, 2005 7:13 Post subject: |
|
|
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 .
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 |
|
|
Remy
Joined: 20 Jan 2005 Posts: 6
|
Posted: Sun Mar 13, 2005 21:14 Post subject: |
|
|
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 |
|
|
Chreelister
Joined: 07 Mar 2005 Posts: 2
|
Posted: Wed Mar 30, 2005 8:20 Post subject: |
|
|
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 |
|
|
Remy
Joined: 20 Jan 2005 Posts: 6
|
Posted: Sat Apr 16, 2005 17:00 Post subject: |
|
|
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 |
|
|
Moonunit921
Joined: 10 Sep 2005 Posts: 11 Location: The Yawning Portal Tavern, Waterdeep
|
Posted: Sat Nov 12, 2005 0:58 Post subject: |
|
|
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 |
|
|
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
Posted: Sat Nov 12, 2005 1:42 Post subject: |
|
|
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 |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Fri Nov 18, 2005 17:33 Post subject: |
|
|
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 .
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 ) _________________ 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: Sun Nov 20, 2005 20:21 Post subject: |
|
|
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 |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Sun Nov 20, 2005 20:28 Post subject: |
|
|
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 |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Sun Nov 20, 2005 23:51 Post subject: |
|
|
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 |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Mon Nov 21, 2005 1:56 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Mon Nov 21, 2005 22:28 Post subject: |
|
|
Heh, congrats. Now on to plugin support for your users _________________ Papillon |
|
Back to top |
|
|
Asmodae
Joined: 07 Jan 2005 Posts: 55
|
Posted: Mon Nov 21, 2005 23:14 Post subject: |
|
|
The trickiest part was figuring out how to make VS .net know I wanted a .dll as the tutorial assumes you know that already.
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 |
|
|
|