command going direct to logfiles

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

command going direct to logfiles

Postby ZyanKLee » Tue Jun 24, 2008 10:14 pm

hey,
is there some way to send a "command" directly to the logfile of the nexuiz dedicated server?

something like:

:command:parameter1:parameter2
or
/command parameter1 parameter2
or something like that?

those commands would be parsed by a script and handled accordingly.

or can someone think of another solution? like using rcon for it ... but allowing everyone to use those command(s) but none else.
ZyanKLee
Alien
 
Posts: 151
Joined: Sun Feb 18, 2007 8:58 pm
Location: Germany

Postby [-z-] » Tue Jun 24, 2008 11:00 pm

In 2.4 restricted rcon was introduced.

related cvars
[-z-]
Site Admin and Nexuiz Ninja
 
Posts: 1794
Joined: Mon Nov 13, 2006 12:20 am
Location: Florida

Postby ZyanKLee » Tue Jun 24, 2008 11:24 pm

thanks for that info.

can I define custom command names that execute some external script with those restricted rcon commands?
ZyanKLee
Alien
 
Posts: 151
Joined: Sun Feb 18, 2007 8:58 pm
Location: Germany

Postby [-z-] » Tue Jun 24, 2008 11:33 pm

ZyanKLee wrote:thanks for that info.

can I define custom command names that execute some external script with those restricted rcon commands?


Yep, you can achieve this using aliases.
[-z-]
Site Admin and Nexuiz Ninja
 
Posts: 1794
Joined: Mon Nov 13, 2006 12:20 am
Location: Florida

Postby ZyanKLee » Tue Jun 24, 2008 11:44 pm

I feel misunderstood ... or I am to dumb to understand :-/

I want players to be able to register with my stats script while they are on the server.

they should be able to hack something into their nex-console that contains their email address, so the "system" (in real a perl script triggered by the player-command) can send them an email with their password (and btw update the database with those information).
ZyanKLee
Alien
 
Posts: 151
Joined: Sun Feb 18, 2007 8:58 pm
Location: Germany

Postby [-z-] » Tue Jun 24, 2008 11:54 pm

Sorry, I missed the 'external' part.

I don't know of any commands for the external execution of a script, unless "exec" works with perl, in which case you can pass their email as a get parameter (my_script.pl?email=z@lovestoplaynexuiz.com).

If this fails, I believe the only way to get this done is with a server-side mod.

Having them register in the console is a strange method. Have you considered a web application?

Is your statistics script currently active?
[-z-]
Site Admin and Nexuiz Ninja
 
Posts: 1794
Joined: Mon Nov 13, 2006 12:20 am
Location: Florida

Postby ZyanKLee » Wed Jun 25, 2008 12:07 am

yeah, I thought about registering online - but I wanted to add a little small security feature.
I want to give only players with those name the possibility to register as them.

ermm ... the question I thought of was:
how to make sure noone else registers with a players name?

the best that I came up with was this ingame-command.
well perhaps I just use web-registration.


there is an "alpha" version running at http://games.nwn-server.de
please feel free to comment it


edit: I had to shut down the svn-browser - I saw that some mysql-information was in the code ... need to fix this tomorrow, then I will bring the code-browser back online. :evil:
ZyanKLee
Alien
 
Posts: 151
Joined: Sun Feb 18, 2007 8:58 pm
Location: Germany

Postby Xeno » Wed Jun 25, 2008 4:04 am

I think all attempts by a player to use the "cmd <something>" command is registered by the server and added to the log. You could pipe the log to your script and parse it from there. Sorry either if I'm mistaken or if I've misunderstood your first question.


I can't think of any way to prevent players from abusing nick registration though. Why not just create some signup form that gives each player a unique ID and creates a password. When the player wants his stats to be tracked, he could enter "cmd <id> <password>" on the server (assuming that works), and let your script check it against the database then start stat-logging. That way you don't have to worry about nicknames really, plus players who change their name can change it on the server since the id remains the same.
Xeno
peregrinus originis incognitae
 
Posts: 396
Joined: Wed Nov 15, 2006 10:42 pm

Postby ZyanKLee » Wed Jun 25, 2008 8:57 am

Xeno The Blind wrote:I think all attempts by a player to use the "cmd <something>" command is registered by the server and added to the log. You could pipe the log to your script and parse it from there. Sorry either if I'm mistaken or if I've misunderstood your first question.


I can't think of any way to prevent players from abusing nick registration though. Why not just create some signup form that gives each player a unique ID and creates a password. When the player wants his stats to be tracked, he could enter "cmd <id> <password>" on the server (assuming that works), and let your script check it against the database then start stat-logging. That way you don't have to worry about nicknames really, plus players who change their name can change it on the server since the id remains the same.


Thats a nice idea.
I will give it a really deep thought. But I think that this is much more complicated than the present version. For example because I then need to track joins and parts as well and need to keep track of all players currently online. My script at present does only evaluate the match over ":scores:*"


But: I like this idea, and I guess I will give it a try ... next month, after I finished 0.2.
ZyanKLee
Alien
 
Posts: 151
Joined: Sun Feb 18, 2007 8:58 pm
Location: Germany

Postby Xeno » Wed Jun 25, 2008 9:36 am

ZyanKLee wrote:
Xeno The Blind wrote:I think all attempts by a player to use the "cmd <something>" command is registered by the server and added to the log. You could pipe the log to your script and parse it from there. Sorry either if I'm mistaken or if I've misunderstood your first question.


I can't think of any way to prevent players from abusing nick registration though. Why not just create some signup form that gives each player a unique ID and creates a password. When the player wants his stats to be tracked, he could enter "cmd <id> <password>" on the server (assuming that works), and let your script check it against the database then start stat-logging. That way you don't have to worry about nicknames really, plus players who change their name can change it on the server since the id remains the same.


Thats a nice idea.
I will give it a really deep thought. But I think that this is much more complicated than the present version. For example because I then need to track joins and parts as well and need to keep track of all players currently online. My script at present does only evaluate the match over ":scores:*"


But: I like this idea, and I guess I will give it a try ... next month, after I finished 0.2.



How are you doing it now? Just parsing the log for names and scores? Btw, are you tracking everyone on your server? I'd suggest ignoring all names beginning with ^4^2 as that's become a convention for those wishing to not be tracked (used by the {} and DCC servers at least).

For my suggestion above though, you might have to follow a few extra things, but it shouldn't be that difficult since there aren't that many different messages (I already wrote a scrip to track the flag status from a console pipe, for example). In your case, you'd need to track name changes, joins and exits, which shouldn't be too much. You're then in a position to track more detailed stats (favorite weapon, most kills with %w, most frags in a row), and people won't have to wait for the match to finish to get their stats registered if they want to leave (or have to worry about joining a match late because they're afraid of having a low score at the end).
Xeno
peregrinus originis incognitae
 
Posts: 396
Joined: Wed Nov 15, 2006 10:42 pm

Next

Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron