Multiplayer logging
Moderator: OpenTTD Developers
Multiplayer logging
Many game servers implement a server-side logging feature, which logs player joins, various player actions (for a game such as this, only "big" actions, perhaps, such as creating a company, buying shares, heavy use of landscaping tools in a short period of time, etc), player quits, player chat, etc etc.
The game server can then normally be configured to either buffer log entries and then write them to the logfile at its own discretion, or write them to the logfile as the events happen.
In conjunction with rcon, external programs can then read this log file and react to things happening on the server.
I, for example, use this method to keep those who use bad language in chat off Call of Duty servers.
I, personally, think that such a feature (if not already implemented) would be of great use to server admins; tools can then be written to assist in the administration of an OpenTTD server.
The game server can then normally be configured to either buffer log entries and then write them to the logfile at its own discretion, or write them to the logfile as the events happen.
In conjunction with rcon, external programs can then read this log file and react to things happening on the server.
I, for example, use this method to keep those who use bad language in chat off Call of Duty servers.
I, personally, think that such a feature (if not already implemented) would be of great use to server admins; tools can then be written to assist in the administration of an OpenTTD server.
My autopilot script is already working in this direction. Events such as land modification and company dealings are not knowable from the console, but joins, parts and chats certainly are.
Details are in the OpenTTD General forum thread, "Dedicated server autopilot"
Details are in the OpenTTD General forum thread, "Dedicated server autopilot"
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
rcon or not, the autopilot could respond to anything it reads in the in-game chat, and can do anything that the tcl language can do - including modifying web pages, chatting on an IRC server, emailing somebody or whatever. It can also type commands in, and chat to other players.
Eliza anybody?
Eliza anybody?
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Something like this?
This wasn't going to be how I announced this in public, but hey, it works. There were some teething problems at first.
I'm not distributing that version, by the way. I'm not 100% happy with the approach I used.
If you want a chat log in a file, and have Linux with the usual suite of command line utils (plus Expect) on which to run the server, the following command will run the game with an autopilot, and also log all public game chat to the file chatlog. The command should all be one line:
Everything up to and including the first semicolon can be removed after the first run.
In fact, even if you don't have Expect or autopilot, you can just replace autopilot with openttd -D and get chat logging from a regular dedicated server console. Magic!
This wasn't going to be how I announced this in public, but hey, it works. There were some teething problems at first.
I'm not distributing that version, by the way. I'm not 100% happy with the approach I used.
If you want a chat log in a file, and have Linux with the usual suite of command line utils (plus Expect) on which to run the server, the following command will run the game with an autopilot, and also log all public game chat to the file chatlog. The command should all be one line:
Code: Select all
mkfifo chatpipe ; ( grep "^.All" chatpipe | awk '{print(strftime("%d/%m/%Y %H:%M:%S",systime()) " " $0)}' > chatlog ) & ./autopilot | tee chatpipe
In fact, even if you don't have Expect or autopilot, you can just replace autopilot with openttd -D and get chat logging from a regular dedicated server console. Magic!
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
After seeing the other 'log' entries from previous posts here, it might be an idea to print them differently in order to make them easier to parse (and perhaps with more info per line) - for example,
C:1:player:hi there
(C = chat, slot 1, player's name, chat text)
or something along those lines...
Brianetta - in response to autopilot, I've just setup a dedicated server here, and the output to the console is *very* limited - this of course impacts on the capabilities of your script.
C:1:player:hi there
(C = chat, slot 1, player's name, chat text)
or something along those lines...
Brianetta - in response to autopilot, I've just setup a dedicated server here, and the output to the console is *very* limited - this of course impacts on the capabilities of your script.
Who is online
Users browsing this forum: No registered users and 4 guests