View previous topic :: View next topic |
Author |
Message |
Sylvhar
Joined: 28 Jan 2007 Posts: 3
|
Posted: Sun Jan 28, 2007 16:49 Post subject: NWN2 clientside 'communication' with external applications |
|
|
The issue I'm looking for is a way to get the Client NWN2 (running on a PW) to generate some sort of output an external process/application could pick up / react on it. Either in direct communication between the two or passing things over a medium (like writing a file, or in a file etc.). And here's the point to hopefully get some hints here
Because as far as my knowledge of NWN Client goes (not very deeply though), the only thing that I've came up thinking on this matter is the clientside nwn logfile. That way is a bit clumsy, though.
I'll try to explain a bit deeper, what I'm thinking of:
Player log onto our PW. On a defined InGame Event we trigger a defined String which the NWN2 Client writes in its clientside logfile. Meanwhile an external (selfwritten) application runs too on the Client. This application scans through that logfile and by finding the stated String it reacts as if that string was a command to that application, which will be doing than its own... stuff
now, probably someone knows a possibly better way doing this? I don't know if the NWN2 client maybe "offers" some other features, which one could use.
And if we must stay by that way with the clientlog, issues for triggering clientloggin arises as next step. I'm not exactly sure, what the client is actually really logging. All sorts of telling the characts InGame do, yes ok that's clear. But it would than also be nice (but not imperative), if we could find a way to 'smuggle' that string in the clientlog without popping it up during play of that character and only annoying players with that
All NWN-script commands for logging messages (generating logfile output) are as far as I know serverside (if running a PW), right?
Ah and yes, I'm also a bit thumbling testing these sorts of logging mechanics on one (my) local machine - cause running a serverinstance an joining locally too gets to write all in the same logfile, which makes things difficult to tell if its logging on client or on server. Any suggestions here would also be really nice
And no, don't worry, we dont have "doing havoc" on clientmachines in mind It's for a feature we're thinking on for our PW and for our (known) PW-Players. |
|
Back to top |
|
|
Katy
Joined: 16 Jan 2007 Posts: 17
|
Posted: Sun Jan 28, 2007 17:40 Post subject: |
|
|
You could just write your information out to a database, using the MySQL plugin, and have your other application also access that database to retrieve the appropriate data.
I'm sure there are examples all over the place; a quick google found me this example of connecting to a MySQL database with a C# program. |
|
Back to top |
|
|
Sylvhar
Joined: 28 Jan 2007 Posts: 3
|
Posted: Sun Jan 28, 2007 17:54 Post subject: |
|
|
Thanks for your searching. Database would be nice (and so much easier, I know) - but can only be used Serverside (which we're doing already for quit a bit of stuff). But the thing is to get the Client, connected to our PW-Server, to do on its localmachine those outputs. So we can't call from our serverside module database connectivity on the client. (and in addition, if it would be possible - it would be also too much of a hassle getting all Players to set up and run database services on their machines.)
Sadly we can't take that way....
and btw as little uh, correction to my first post:
nevermind what I asked about logfile sharing of Server and Client on my localmachine - that is no problem anymore |
|
Back to top |
|
|
xaltos
Joined: 03 Jun 2006 Posts: 31 Location: Germany
|
Posted: Mon Jan 29, 2007 0:47 Post subject: |
|
|
There are other ways as well.
You can write a program that 'listen' to the NWN2 IP traffic and searches for a pattern.
Or your local program open an own IP port and the server sends a IP message via NWNx4 plugin to your client. ( you can get the IP via NWN2 script functions )
But don't underestimate the security feeling of the players.
At least I always had a bad feeling , if I need to install a program on my local PC , that permanent communicate with a server, that comes more or less from an unknown person.
So a unknown own IP protocol is maybe not the best way to handle this.
what kind of work do you plan to do with your program ? _________________ xaltos
NWN2_Audolo |
|
Back to top |
|
|
Sylvhar
Joined: 28 Jan 2007 Posts: 3
|
Posted: Mon Jan 29, 2007 20:25 Post subject: |
|
|
hm, yes scanning IP-packets would be a possibility. Or the idea with the separate connection. Personally I would prefer the second one more But your thoughts about security feelings are true either. It shouldn't load on too much of a burden on this aspect, or at least as little as possible.
What we're thinking of doing with all this is a sort of "just-in-time" download of game-ressources. Especially concering Area-Data in NWN2. So that for example a Player enters an Area, its four neighbour areas were to be compared with the Server. If there is newer Data on the Server (or even Data at all were the client hasn't got an area for example), the mentioned tool would download the newer Data and "schuffle" it to the game on clientside.
So that Players haven't got to care about synchronising the Data on their own and worldchanges could be made neater aswell. Open Issue of course would be also, what reaction the Game shows with this sort of "datamanipulation" during runtime.
Jo, we're still in mindmapping stage on this whole matter |
|
Back to top |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Mon Jan 29, 2007 21:04 Post subject: |
|
|
Hmm. Intriguing idea.
I could see implementing this with a NWNX plugin. Simplified scenario:
Setup:
- User Joe logs in. Not that we may be able to get this notification in script before the user enters any actual areas.
- on login, the new plugin is invoked, and establishes a connection to the client.
- Let's say the starting area (area A) has three connected areas B, C, and D. This is tracked onthe server side; once area A is entered and a connection established, the server invokes the new plugin, telling it the names/resrefs of the connected areas.
- Once hte player goes to use a transition out of area A, the new plugin is queried first. If it confirms that the player has received (or already has) the newest versions of the needed files, then the transition works normally. (This would require a custom transition script)
- If the area is not loaded yet, the player is informed that the area is still loading and that they must wait.
I could see ways to streamline this further, but the basic idea here should be doable.
To answer the direct question asked above: As far as I know, we can't do any client side logging.
edit: Drawbacks: would require client to have a port open for the autoupdater; unless it client engineered to poll the server plugin for updates at regular intervals.
Another issue: this would not work as is if multiple players were behind NAT; so perhaps polling is the best option (poll with IP address and player name). _________________ Khalidine, a NWN2 persistent world
Looking for volunteers. |
|
Back to top |
|
|
|
|
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
|