Multiplayer logging

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
Prof
Engineer
Engineer
Posts: 15
Joined: 19 Jan 2006 00:28

Multiplayer logging

Post by Prof »

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.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

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"
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Prof
Engineer
Engineer
Posts: 15
Joined: 19 Jan 2006 00:28

Post by Prof »

Nice - I'll give that script a try.


But even so - the advantages of having live logging supported by the game server I feel should be realised in an ace online game such as this :wink:

I already mentioned that using logging in conjunction with rcon can be quite a powerful basis for an admin tool.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

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?
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Prof
Engineer
Engineer
Posts: 15
Joined: 19 Jan 2006 00:28

Post by Prof »

Brianetta wrote:Eliza anybody?
http://www.alicebot.org/ :wink:
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

Prof wrote:
Brianetta wrote:Eliza anybody?
http://www.alicebot.org/ :wink:
Cool. I can have an intelligent Online conversation at last...
:twisted:
Prof
Engineer
Engineer
Posts: 15
Joined: 19 Jan 2006 00:28

Post by Prof »

So, can anyone tell me if server-side logging is planned for OttD?

I'm sure it would help it sell itself as an online game - its part of the 'standard online-game' feature set :wink:
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

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:

Code: Select all

mkfifo chatpipe ; (  grep "^.All" chatpipe | awk '{print(strftime("%d/%m/%Y %H:%M:%S",systime()) " " $0)}' > chatlog ) & ./autopilot | tee chatpipe
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!
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

Is there a reason OTTD doesn't do the logging itself? The ability is there (it can already make a log for the dedicated server relating to typed in commands). I don't see it being that hard to add a few more strings to it.
Prof
Engineer
Engineer
Posts: 15
Joined: 19 Jan 2006 00:28

Post by Prof »

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.
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 3 guests