News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Change to logging to show IP address/player name for all statements

Started by Ashley, March 20, 2011, 06:14:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ashley

I'd hope that this would be a fairly minor change, but it'd really help with administering a server. I tend to run my Simutrans servers on debug level 2 since that gives enough information without overwhelming the logging.

Whenever any player performs an action we get logging like this:

Warning: nwc_tool_t::rdwr:#011rdwr id=6 client=3 plnr=9 pos=157,239,2 wkzid=8218 defpar=b,403,57,-2,162 init=1 exec=1 flags=0

The wkzid value seems to be a unique ID for each possible action, e.g. 8224 is a chat message. plnr is the player number, client is the entry in the connected clients list etc.

It'd be much more useful if the logging also included the name of the player as it is displayed in-game alongside the IP address of the connected client. E.g.:

Warning: nwc_tool_t::rdwr:#011rdwr id=6 client=3 ipaddr=12.34.56.78 plnr=9 plname=H-Trans pos=157,239,2 wkzid=8218 defpar=b,403,57,-2,162 init=1 exec=1 flags=0

If this were implemented I could easily write a script that parses the log file to track the names of players in game (by referencing the plnr verses plname) and the IP addresses of clients connecting in. These would allow for banning troublesome players using a firewall to prevent connections.

Obviously more extensive administrative functions need to be added but as a quick measure to implement this would make life a lot easier :)
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.