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 
 
xp_srvadmin - script functions for ban/boot/shutdown/etc
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Pepe66



Joined: 29 Jun 2009
Posts: 2

PostPosted: Sat Jul 25, 2009 17:08    Post subject: Reply with quote

ShutdownNwn2server() works for me on patch 1.23 final (pre-hotfix) and NWNX 1.0.9.
Same for BroadcastServerMessage().

I have not tested the other functions.

p.s. I do agree that being able to to password and un-password the server would be a useful addition. It would allow us to prevent people from logging in after a 'server restart in x minutes' message.
Also the possibility to change the max player number could be useful for that purpose.
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Mon Jul 27, 2009 5:33    Post subject: Reply with quote

Added untested functionality to set the player, DM, and admin (server admin console - you probably don't use it) passwords, as per the server GUI. These don't persist across restarts.

Code:
void SetPlayerPassword(string sPlayerPassword);
void SetDMPassword(string sDMPassword);
void SetAdminPassword(string sAdminPassword);


(As per the server GUI, setting an empty password disables that password in general. Internally, this does the same thing as setting those options in the server GUI, so the behavior should be the same.)

Let me know if it doesn't work and I'll investigate further. This should be compatible with all nwn2 versions unless control IDs get reordered in the server GUI dialog, which seems unlikely.

Source is on my branch on virusman's SVN.
Back to top
View user's profile Send private message
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Mon Jul 27, 2009 21:16    Post subject: Reply with quote

Nice !

For my problem, i have two server running on the same pc with both its NWNX plugin (and both nwnx having srvadmin)

What is wierd , is that my import module is working fine for restart, the command is passed to the plugin and server is restarted.

But on the play module, the identic function is sent, and then nothing happen, doesn't seem to be catched by the srvadmin plugin, it's the same for the leto command wich aren't catched on the play server.

Could it be a nwnx conflict ? I'll try to do more testing (shuting down the working nwnx to try the play alone)
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Wed Jul 29, 2009 2:06    Post subject: Reply with quote

PNJ:

xp_srvadmin explicitly goes out of its way to support multiple server instances running on the same computer, even on the same desktop.

This really sounds to me like either a configuration issue or a problem with the NWNX core itself. I'd tend towards configuration issue at first bet. (Are you sure that both instances of nwn2server has their own userprofile tree, or via -home their own subsection of that tree?)
Back to top
View user's profile Send private message
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Thu Aug 06, 2009 21:01    Post subject: Reply with quote

Thanks for this plugin Smile

I saw it since some time and I just try it.

It works great and now I can protect the server with a password during the loading time (many persistants entities to load).

I use this thanks to propose an add Very Happy, as the possibility to change the server name Smile It will be uselfull to name the server as loading when it loads.


Last edited by Master_Prince on Fri Aug 07, 2009 0:28; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Thu Aug 06, 2009 21:12    Post subject: Reply with quote

Master_Prince wrote:
Thanks for this plugin Smile

I saw it since some time and I just try it.

It works great and now I can't protect the server with a password during the loading time (many persistants entities to load).



You can't? What went wrong? Or was that a typo?

Master_Prince wrote:


I use this thanks to propose an add Very Happy, as the possibility to change the server name Smile It will be uselfull to name the server as loading when it loads.


The server should already show up differently visually (red for passworded) unless you already require a password normally. Is that a sufficient cue?
Back to top
View user's profile Send private message
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Fri Aug 07, 2009 0:31    Post subject: Reply with quote

Sorry, it was a mistake, I wont to write " I can " and not " I can't "

It works great ^^

Yes, the server will appears in red but the players can think that it's a new rull then that's just loading session.

But it's not very important Smile
Back to top
View user's profile Send private message Visit poster's website
Caos81



Joined: 13 Apr 2008
Posts: 9

PostPosted: Wed Jan 06, 2010 16:57    Post subject: Reply with quote

First of all, thank you Skywing.
Second, couldn't it be possible to add Item Level Restriction toggle? It seems to be the last missing checkbox and I'd really appreciate it Razz

Thank you again Smile
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Thu Jan 07, 2010 1:24    Post subject: Reply with quote

I can add some code to toggle the ILR checkbox but I'll need you to test the build out and make sure that works.
Back to top
View user's profile Send private message
Caos81



Joined: 13 Apr 2008
Posts: 9

PostPosted: Thu Jan 07, 2010 15:36    Post subject: Reply with quote

Skywing wrote:
I can add some code to toggle the ILR checkbox but I'll need you to test the build out and make sure that works.


It would be an honor and privilege for me helping you with tests. Very Happy
Back to top
View user's profile Send private message
0100010



Joined: 11 Jan 2012
Posts: 7

PostPosted: Wed Jan 11, 2012 9:21    Post subject: Reply with quote

Skywing, Can this, or nwn2_srvutil be updated to include the ability to set the Server's game difficulty, and tell it to save the server (with need to specify save game name and slot number, also have to handle the overwrite confirmation popup, but assume that overwrite was desired)


I can use nwnx_controller to run nwn2server as a service, but nwn2_srvutil cant find or doesn't permission to inject into it. Likely because the server was launched by the controller process, so permissions might be an issue. I've not gone much beyond that yet.

In order to similate a SP mod (with NWNX support) as a loaded server instance, I need to seamles let the players connect and do functions normally available to them in an SP game. Most notably, Saveing the game and using the game options to set the difficulty. (both of these can be intercepted with gui scripting, and thus sent off to a NWNX plugin to to the actual task.)
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Wed Jan 11, 2012 10:27    Post subject: Reply with quote

I'll look into it; this would just be a matter of controlling the spinner for difficulty adjustments.
Back to top
View user's profile Send private message
0100010



Joined: 11 Jan 2012
Posts: 7

PostPosted: Mon Apr 16, 2012 2:19    Post subject: Reply with quote

I looked at the IDs so am going toward an update to this, Although I may just try replacing the entire plugin with Interop calls from a CLR script.

However, xp_srvadmin, as is will not work is used against nwserver when launched form nwnx4_controller *without* the -interactive argument set.

This is because it create no window. No window means no window handle and can't get to the MFC GetDLGItem calls to find the gui components to send the messages to.

if nwnx4_controller could opener nwn2server with WindowStyle hidden the handles would still be available. (I believe it simply doesn't create a window at all when interactive is not specified)

At the moment, Im forced to use the -interactive setting and then as soon as I obtain a valid handle I send it the message to hide the window. However if the module being loaded is large this can cause the nwserver to sit on screen for several seconds before it finally processed my hide request.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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