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 
 
NWNX-Speech
Goto page 1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
redils



Joined: 13 Jan 2005
Posts: 27

PostPosted: Sun Jan 23, 2005 8:14    Post subject: NWNX-Speech Reply with quote

I'd like to know more about NWNX-Speech's impact on performances.
Back to top
View user's profile Send private message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Sun Jan 23, 2005 9:10    Post subject: Reply with quote

I run the speech check fucntion at 0.2 seconds. Call me crazy... but I do. In a small mod I dont see any performance hit from this. Maybe (and a I do mean maybe... I am not sure) in a large mod with lots of people talking at once I may see the mod heartbeat take 7 or 8 seconds to come around again instead of 6.
Back to top
View user's profile Send private message
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Mon Jan 24, 2005 22:07    Post subject: Reply with quote

Ok, I've got a question. The readme says that the plugin has to run with root privs so it can bind to the network interface. Can that be done by just making the nwnx_speech.so file SUID root? Because I am not keen on the idea of having to run the nwserver application as root just to make this work....

Anyone know?

--Dave
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Mon Jan 24, 2005 23:20    Post subject: Reply with quote

I have no idea. You could try that out. The plugin needs rights to be able to access the network interfaces. If you can set those on another way, please let me know so I can update the documentation Smile.
Back to top
View user's profile Send private message Visit poster's website
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Tue Jan 25, 2005 1:12    Post subject: Reply with quote

Naw, no love there. Sad I tried setting nwn_speech.so and even nwnx2.so as SUID root, but all I got for my effort was a core dump. I'm not real happy at the prospect of running my nwserver application as root, but I suppose it's not that much of a security risk - it's not like someone could crash the server process and be sitting in a shell.

So, I was running this in a test directory to see how things would work. Started it up, and got:

$ sudo ./nwrun
>>>Starting at Mon Jan 24 13:14:01 PST 2005<<<

NWNX2lib: Init
NWNX2lib: org SetString() at 0x81e5210, new SetString() at 0x4001f038
* Parsing configuration...
NWN Extender v2.5.3-rc1
(c) 2004 by the APS/NWNX Linux Conversion Group
Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
and Jeroen Broekhuizen
visit us at http://www.avlis.org

* Loading modules...
[HASHSET] SetDebugLevel(1) called. Current value=0
HASHSET plugin Registerred.
[FUNCTIONS] SetDebugLevel(1) called. Current value=0
FUNCTIONS plugin Registerred.
[MNX] SetDebugLevel(1) called. Current value=0
MNX plugin Registerred.
[Database] SetDebugLevel(1) called. Current value=0
[Database] SetDebugLevel(2) called. Current value=1
ODBC plugin Registerred.
[Speech] SetDebugLevel(1) called. Current value=0
SPEECH plugin Registerred.
* NWNX2 activated.
Neverwinter Nights Server
Build:8066
Copyright BioWare Corp 1998-2004

Server: Loading...
Server: Running...

Server: Loading module {blah, dots, etc}
Server: Module loaded
INIT: valid ret=0x081f42fc


So far, so good. Look in the nwn_speech.txt log file:

$ cat nwnx_speech.txt
NWNX2 Speech version 0.1.1 for Linux.
Copyright 2005 (C) Jeroen Broekhuizen
Connecting to database nwntest
o Connected to database
9. eth0 (Nodescription available)
9. any (Pseudo-device that captures on all interfaces)
9. lo (Nodescription available)
o Successfully open adapter eth0.
o pcap_datalink successfull.
o netmask successfull.
o set glocal.
o pcap_compile success full.
o Listening on eth0...
seems to be hanging here .. Sad
o Speech by ip: 216.239.8.125:5120 : we ready?
o Speech by ip: 67.137.249.86:10106 : yes
o Speech by ip: 67.181.147.186:5120 : as ready as I can be Smile
o Speech by ip: 67.181.147.186:5120 : you guys RP people?
o Speech by ip: 216.239.8.125:5120 : I tryto be, i really like it
o Speech by ip: 216.239.8.125:5120 : ?
o Speech by ip: 67.137.249.86:10106 : ???
o Speech by ip: 216.239.8.125:5120 : dikd we want to check for a dragon?
o Speech by ip: 67.137.249.86:10106 : yes
o Speech by ip: 67.137.249.86:10106 : ok
o Speech by ip: 67.181.147.186:5120 : sounds painful
o Speech by ip: 216.239.8.125:5120 : only a wyrmling


Now this was before I ran the "Talus Speech Setup" module. Here, it's just a copy of my main game module (which has not yet had the talus .erf file imported into it), but it's running in my test server directory, which listens on port 5125, not the standard 5121 of the main game server. What's with the "seems to be hanging here Sad" message?

Now then, I start up the setup module:

$ sudo ./nwrun
>>>Starting at Mon Jan 24 14:21:03 PST 2005<<<

NWNX2lib: Init
NWNX2lib: org SetString() at 0x81e5210, new SetString() at 0x4001f038
* Parsing configuration...
NWN Extender v2.5.3-rc1
(c) 2004 by the APS/NWNX Linux Conversion Group
Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
and Jeroen Broekhuizen
visit us at http://www.avlis.org

* Loading modules...
[HASHSET] SetDebugLevel(1) called. Current value=0
HASHSET plugin Registerred.
[FUNCTIONS] SetDebugLevel(1) called. Current value=0
FUNCTIONS plugin Registerred.
[MNX] SetDebugLevel(1) called. Current value=0
MNX plugin Registerred.
[Database] SetDebugLevel(1) called. Current value=0
[Database] SetDebugLevel(2) called. Current value=1
ODBC plugin Registerred.
[Speech] SetDebugLevel(1) called. Current value=0
SPEECH plugin Registerred.
* NWNX2 activated.
Neverwinter Nights Server
Build:8066
Copyright BioWare Corp 1998-2004

Server: Loading...
Server: Running...

Server: Loading module "Talus Speech Setup"...
Server: Module loaded
NWNX!INIT enforcement disabled, using 0x081f42fc


Still looks good (I had to set the "don't enforce NWNX!INIT" setting in nwnx2.ini, since he's using an older version of APS in his module). Again, looks ok. Checking the nwn_speech.txt file, I find:

# cat nwnx_speech.txt
o Successfully open adapter eth0.
o pcap_datalink successfull.
o netmask successfull.
o set glocal.
o pcap_compile success full.
o Listening on eth0...
seems to be hanging here .. Sad
o Player : 'dguntner' joined with IP: 192.168.0.101:5120
o dguntner:5120 -> :5125 says "blah blah blah"
o dguntner:5120 -> :5125 says "blah blah blah"
o Player : 'dguntner' joined with IP: 192.168.0.101:5120
o dguntner:5120 -> :5125 says "*help*"
o dguntner:5120 -> :5125 says "*help*"


Again, what's with the "seems to be hanging here Sad" message? What does it think is hanging?

Some other questions: I typed "*help*" as the readme in the talus system archive says to do. It doesn't say what is supposed to happen when you type it. But from within the module where I typed it, nothing happened. What is it supposed to do, and do you have any suggestions as to why it didn't do whatever? This was inside the speech setup module.

Also, why (how?? Smile) does it listen to what *both* the main and test servers are listening to? Is there a way to restrict it to just listen to the server application that it's running on? Something like a "port=5125" option that can be put in the [Speech] section of nwnx2.ini?

And what about the database tables being used? Do they just grow forever until your database sucks up all available disk space, or does this thing automatically get rid of old entries?

Are there scripting commands provided by this system that lets you log the output to your main nwnserverLog1.txt file? And which would then let you send output to a DM's chat window (a'la the way the DMFI listening stuff outputs what NPCs hear)?

I suspect that as I delve further into this, I'll figure out the answers to some of these. But in case I won't, I figured I'd better ask now. Smile

Thanks!

--Dave
Back to top
View user's profile Send private message
NoMercy



Joined: 03 Jan 2005
Posts: 123
Location: UK

PostPosted: Tue Jan 25, 2005 2:27    Post subject: Reply with quote

Though it's delving a bit on the linux heavy side I found this: http://killa.net/infosec/acls/ would probably be a right pain to get working espically since the latest 2.4 kernel is a few revisions on from the latest patch on the page, but there might be other ACL systems which allow non-root access to packet sockets.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Tue Jan 25, 2005 5:41    Post subject: Reply with quote

Does anyone have a listing of what [Speech] options can go into the nwnx2.ini file? In particular, I'd sure like to know how to set the "servername" name that's going to be in that particular column of the database row.... Smile

--Dave
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Jan 25, 2005 9:27    Post subject: Reply with quote

If you let the server run with root privileges, I would suggest using a chrooted environment, or even user mode linux.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Tue Jan 25, 2005 10:28    Post subject: Reply with quote

Heh.. that was just a debug line which I forgot to remove Very Happy. I will do that soon, when I will port the new non-database functionality to the linux speech module.

Everything seems to run normal as it receives the talke strings from people. So, you are on the good way! The Talus NWScripts take care of the database. They fetch a line from the database and immediately removes it. Then it will process the line and does what requested.

You should run Talus demo module which can create the database entries neccessary and then import the ERF in your own module and place a placeable (see documentation) somewhere in your module. Finally set up the onload (I think Wink) script. The servername is just written to the database in case of a multi server environment.
Back to top
View user's profile Send private message Visit poster's website
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Tue Jan 25, 2005 11:01    Post subject: Reply with quote

JeroenB wrote:
Heh.. that was just a debug line which I forgot to remove Very Happy. I will do that soon, when I will port the new non-database functionality to the linux speech module.


Um, what was just a debug line?

Quote:
Everything seems to run normal as it receives the talke strings from people. So, you are on the good way! The Talus NWScripts take care of the database. They fetch a line from the database and immediately removes it. Then it will process the line and does what requested.

You should run Talus demo module which can create the database entries neccessary and then import the ERF in your own module and place a placeable (see documentation) somewhere in your module. Finally set up the onload (I think Wink) script. The servername is just written to the database in case of a multi server environment.


I *do* have a multi server environment. Go back and read my earlier message. Smile I have a test server on the machine, as well as the main server. They live in two separate directories. But somehow, while running the Talus Speech Setup module (which is the demo module) on the test server (which listens on port 5125), I noticed in the nwn_speech.txt log file that it was also capturing text going through the main server, which listens on port 5121 (the regular port). Like I said, I'd really like it if there was some kind of port= parameter for the [Speech] section of nwnx2.ini, so that I can tell it to just listen to the one server port. As to the "servername" thing, here's the problem: The demo Speech Setup module is NOT getting anything from the database and deleting it. The reason is this: The listener is writing to the database with a blank "servername" field/column. In the lds_speech_db script, it does a:

string sServer=GetModuleName();

which in the demo module is "Talus Speech Setup". As a result, its call to:

"select {blah} from nwn_speech where servername = '"+sServer+"'"

doesn't find anything that matches.

This is why I'm asking if there's a way to tell the nwnx_speech.so plugin what to put in that last "servername" column when it does its insert into the table. I tried doing a:

servername=Talus Speech Setup

and a:

module=Talus Speech Setup

in the [Speech] section of nwnx2.ini just as a wild guess, but they didn't do anything. So if there's a way to do this, could you please tell me what it is? And if there isn't currently, could you add it? Smile

BTW, is there any kind of documentation that lists what the various types of messages are? One of the things it store is a numeric message type, which ends up being 1, 4, 14, etc. It would be nice to know what those codes mean.

Thanks.

--Dave
Back to top
View user's profile Send private message
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Tue Jan 25, 2005 11:02    Post subject: Reply with quote

Papillon wrote:
If you let the server run with root privileges, I would suggest using a chrooted environment, or even user mode linux.


I'd love to. How? Very Happy

--Dave
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Tue Jan 25, 2005 16:46    Post subject: Reply with quote

dguntner wrote:
JeroenB wrote:
Heh.. that was just a debug line which I forgot to remove Very Happy. I will do that soon, when I will port the new non-database functionality to the linux speech module.


The "seems to be hanging here .. " line was used for debugging.

The server name is what is listed in the Server window. If you don't fill in a name, there won't appear a name in the database (I am not sure if you ment that you gave the server the "Talus .." name). If you have filled in a Server Name, then something is obviously wrong Wink

And no, there currently is no option for disabling one server yet in the sources as the original code didn't have it either. I might be able to add it but that will happen then when I will port the new changes of the windows version to Linux which will happen at earliest next week.
Back to top
View user's profile Send private message Visit poster's website
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Tue Jan 25, 2005 20:25    Post subject: Reply with quote

JeroenB wrote:
dguntner wrote:
JeroenB wrote:
Heh.. that was just a debug line which I forgot to remove Very Happy. I will do that soon, when I will port the new non-database functionality to the linux speech module.


The "seems to be hanging here .. " line was used for debugging.


Oh, ok. Smile

Quote:

The server name is what is listed in the Server window. If you don't fill in a name, there won't appear a name in the database (I am not sure if you ment that you gave the server the "Talus .." name). If you have filled in a Server Name, then something is obviously wrong Wink


Um, what Server window are you talking about? Not sure I'm following you here. I start my Linux stand alone server from a shell prompt (command line). There is no "window" for me to fill in with anything. The nwnx_speech.so plugin is doing INSERTs into the database with a "servername" field that is blank. But the module is doing a SELECT from that database, and it has a line which says:

string sServer=GetModuleName();

If you edit module properties, you will see on the Basic tab an entry called Name. In the case of the Talus Speech Setup demo module, that value is set to "Talus Speech Setup." So when the module does its SELECT, it's doing it with a servername value of "Talus Speech Setup."

Now obviously, the work around would be to change that above line in the module to:

string sServer="";

And in fact I've already verified that it works. Now that's all find and well and good, but if I'm running my main server module, and then start up the test server with a new version of that module to do some testing before making it live on the main server, nwnx_speech.so is going to be listening to both of them and recording to the database. Problem is, many times when I do this kind of testing, I just use the same database. If I were using two different databases, it wouldn't matter because nwnx2.so in each server would be writting to two different databases, and there'd be no crossover problems. However, if they're both pointing to the same database, then you have both of the plugins dumping to the same database, that both modules are looking at. I'm afraid that at this point you cold end up with the test server module grabbing something that was stored there, and now the main server doesn't see it, and you've got players wondering why their emotes, etc., aren't working right.

Thus, my desire for an option in nwnx2.ini in the [Speech] section which lets me set what the "servername" is going to be that that instance of nwnx_speech.so is going to be writing to the database.

I.E., in server/main/nwnx2.ini, under [Speech], have "servername=Main Server" and in server/test/nwnx2.ini have "servername=Test Server" - then the plugin uses that when writing to the database. The test and main modules can then both share the same database and they won't interfere with each other.

I hope that more clearly explains what my concern is. Smile

Quote:

And no, there currently is no option for disabling one server yet in the sources as the original code didn't have it either. I might be able to add it but that will happen then when I will port the new changes of the windows version to Linux which will happen at earliest next week.


If by that you mean no ability to tell it which port to listen to, that's ok. It would be nice to be able to do that, but it's not criticial. However, I do consider the ability to set what it's going to use as a "servername" column when it does its INSERT to be more critical, for the reasons I mention above. Any chance that can be added at some point? Smile

--Dave
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Wed Jan 26, 2005 11:24    Post subject: Reply with quote

Quote:
Um, what Server window are you talking about? Not sure I'm following you here. I start my Linux stand alone server from a shell prompt (command line). There is no "window" for me to fill in with anything. The nwnx_speech.so plugin is doing INSERTs into the database with a "servername" field that is blank. But the module is doing a SELECT from that database, and it has a line which says:


Um, I was talking about the NWServer main window.. but I just remembered that under Linux the server hasn't got a window Laughing

What do you give as servername parameter? In the nwnstartup.sh is this option listed and you should have a valid name for it. If you don't supply this option with a valid name the GetServerName will ofcourse return an empty string as there is no server name.

Quote:
Now obviously, the work around would be to change that above line in the module to:

string sServer="";


This is a bad workaround in your case as you (soon) have 2 servers listening. With an empty string the wrong server can fetch the message from the database which is not expected. Thats where the server name comes for. Then the scripts will only fetch rows mentioned for that server.

But I will see if I can add such a functionality to the plugin some time. I am now to busy with studying, so I will probably have some time next week.
Back to top
View user's profile Send private message Visit poster's website
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Wed Jan 26, 2005 12:25    Post subject: Reply with quote

JeroenB wrote:
Quote:
Um, what Server window are you talking about? Not sure I'm following you here. I start my Linux stand alone server from a shell prompt (command line). There is no "window" for me to fill in with anything. The nwnx_speech.so plugin is doing INSERTs into the database with a "servername" field that is blank. But the module is doing a SELECT from that database, and it has a line which says:


Um, I was talking about the NWServer main window.. but I just remembered that under Linux the server hasn't got a window Laughing

What do you give as servername parameter? In the nwnstartup.sh is this option listed and you should have a valid name for it. If you don't supply this option with a valid name the GetServerName will ofcourse return an empty string as there is no server name.


Here's how I start the module:

Code:

#!/bin/bash
#

mod="CHAINMAIL_Beta"

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/mysql
export LD_PRELOAD=./nwnx2.so
./nwserver -module "$mod" "$@"
unset LD_PRELOAD


As you can see, I'm setting the -module parameter where it starts the server. So I don't know why the plugin is drawing a blank....



Quote:
Quote:
Now obviously, the work around would be to change that above line in the module to:

string sServer="";


This is a bad workaround in your case as you (soon) have 2 servers listening. With an empty string the wrong server can fetch the message from the database which is not expected. Thats where the server name comes for. Then the scripts will only fetch rows mentioned for that server.


Uh, yea. I thought I mentioned that. Smile This being my concern. Now, I'm pretty sure that if I'm running two databases, one for each module, I don't think it will be a problem. However, there are many times when I'm testing a new version of a module and just using the same database is more convenient. That's what concerns me.

Quote:

But I will see if I can add such a functionality to the plugin some time. I am now to busy with studying, so I will probably have some time next week.


Thanks, that would be tremendously useful.

--Dave
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Page 1 of 7

 
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