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 
 
Send Server Message to Multiple Servers

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



Joined: 03 Nov 2009
Posts: 49

PostPosted: Wed Nov 11, 2009 22:40    Post subject: Send Server Message to Multiple Servers Reply with quote

This may be more trouble than it's worth, but I figured I would ask the experts to see what you guys think. Wink

Does anyone know if an NWNx plugin exists or can be created to pass a server message or chat message to multiple servers?

I know this can be done without any special plugins in a heterogeneous environment with a group of servers that all have the same database path. And I know how to do it in such an environment.

But...I need to be able to do this in an environment that does not have a shared database path. So...I was wondering if anyone had any idea/knowledge of how this might be done...or if it is even possible within reason.

Alternatively...Is it possible to have ONE shared database file accessible by all servers while keeping all the other databases unique per server?

I know...it's a weird request. The goal is to have the server that triggers the reset plugin, which kills all servers, also be able to send a notification to all servers. If it's out of reach then nevermind. But if something exists that might work with some tweaking, I'd like to check it out.
_________________
* illegible scribble *
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Thu Nov 12, 2009 0:54    Post subject: Reply with quote

MySQL (via nwnx_odbc) with the same database?
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Thu Nov 12, 2009 2:45    Post subject: Reply with quote

That's how we do it.

Funky
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Nov 13, 2009 13:07    Post subject: Cron Jobs etc Reply with quote

You dont even necessarily need them to be sharing the same database.

I once created a Fairy Companion, for a First Person Physics Sandbox game called Garrys Mod.

I added Network capability, and the ability for the Fairys to receive and send private messages even cross servers.


The way I did this, was through one database which was being used by all servers, however, in the case of Neverwinter nights, you may not want 'other' servers having access to your nwnx database.

Thats where you impliment a sort of Daemon protocol (im just picking terminology out of my head here)


mySQL allows for local privilages per table, within a database,

so....

You could either
1. Add a public table to your nwnx nwn database, which will allow edits from any host, and with a public username and password.

2. Impliment a CronJob on a php server, which will read the data from a servers nwnx database, and then post it via another query, to another nwnx database. So, in effect, its not another nwn server that is accessing your nwnx database, its actually a php script, that you have control off, and can trust.

I've actually explored the possiblity of using method 2, for things such as Vaultster etc.
You could, in theory, make a php website, where people could freely register their PW's on, eg - ip address, description, name etc.
And then a php cron job, sends everyones PW's to everyone else.

(Note - You can even add a second cron job, which verifies the Server Details via a udp query - this can retrieve details like - Amount of players online, if the server is online, if the server requires a password etc, and a small description of the server. - If the server was offline, you might want it to be excluded from peoples Databases. - Or just update it to say that the server is offline.)

Eg - 50 People register, so 50 people all receive a datastream via mySQL query, into their public nwn nwnx database table, which then holds a list of PW Server details. Then, via a nwn dialogue, you can choose which pwServer you wish to join.

All of this is do-able, Its remarkably similar in principle to a cross server travel stargate system I was working on for Garrys Mod too.


I use the second method, mainly for Forum Interactivity with my Server.
Eg - Someone Registers on the Forum, if they add their public CDKEY, it allows them to buy items in our forum, and receive them ingame.
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Fri Nov 13, 2009 18:23    Post subject: Reply with quote

That works too, of course, but I assumed he has control over and trusts both servers. If not, then sure, time for fun with scripts.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
maddogfargo



Joined: 03 Nov 2009
Posts: 49

PostPosted: Mon Dec 21, 2009 20:34    Post subject: Reply with quote

Zebranky wrote:
MySQL (via nwnx_odbc) with the same database?


Thanks for the input guys. I think Funky also mentioned part of this on the Higher Ground forums. Really appreciate the advice.

I guess what I need to know at this point is, can you have/enable more than one database config in NWNx?

For example, use an existing SQLite for local/per server data but also use a MySQL ODBC database link for the inter-server public messages?

If not, it looks like the only option would be to convert EVERYTHING (* read daunting task) in all the mods I'm hosting (What can I say...I like variety Wink ) to use MySQL, which would be a tremendous amount of work for me to do alone.

But, it's become less of an issue now anyway. I've set a 24hour reset time which is much more manageable for players. Besides, our player base isnt so large that it is a major issue. So perhaps the small benefit/convenience doesn't justify the large amount of work, which I'd end up doing solo anyway. And frankly, I'd REALLY rather build onto new than try to fix/convert old.

*DING* Idea...

It might be possible to create a small 'Check Reset Time' mod on each server, point the player vault to the apropriate folder and the database to a shared timer database. Not ideal since it would require players to login to check the time, but still better than nothing. Confused
_________________
* illegible scribble *
Back to top
View user's profile Send private message
maddogfargo



Joined: 03 Nov 2009
Posts: 49

PostPosted: Mon Dec 21, 2009 20:58    Post subject: Reply with quote

Zebranky wrote:
That works too, of course, but I assumed he has control over and trusts both servers. If not, then sure, time for fun with scripts.


Yep...all 10+ servers are on one physical box with a 2nd backup available for failover/load (Average load hovers around 15-25%). Hardly an enterprise level setup, more a SOHO type enthusiast gig really. But it's been 'home' for NWN on and off for the past 4-5 years or so. Wink
_________________
* illegible scribble *
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Tue Dec 22, 2009 1:00    Post subject: Reply with quote

maddogfargo wrote:
I guess what I need to know at this point is, can you have/enable more than one database config in NWNx?

Currently, no. I have a hunch that if you recompiled nwnx_odbc with some other name replacing ODBC, that would be sufficient. Completely untested, though.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
maddogfargo



Joined: 03 Nov 2009
Posts: 49

PostPosted: Tue Dec 22, 2009 2:06    Post subject: Reply with quote

Zebranky wrote:
maddogfargo wrote:
I guess what I need to know at this point is, can you have/enable more than one database config in NWNx?

Currently, no. I have a hunch that if you recompiled nwnx_odbc with some other name replacing ODBC, that would be sufficient. Completely untested, though.


Yeah, but that is more a work-around and knowing my insatiable desire to 'try it and see if it works' I'll probably end up breaking something. Laughing Although...it might be a good plugin... Hm...

* brainsmoke *
_________________
* illegible scribble *
Back to top
View user's profile Send private message
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