Automated message

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
User avatar
Qu@rks
Route Supervisor
Route Supervisor
Posts: 498
Joined: 26 Mar 2006 23:16
Location: Berlin, Germany
Contact:

Automated message

Post by Qu@rks »

Alright what I wanna do is this: I am running a server which also has an automated welcome message. Now the question: Is there a way to have the server give out a message every let's say 10 minutes? Would be an awesome way of reminding people of different things, e.g. fairplay, set company password etc.
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Automated message

Post by dihedral »

there are 2 ways i can think of

one would be if you patch the source to run a script file every year (1. jan)

the other would require you to be using a *nix system where you have the ability to send kill signals, run the dedicated server using a modified version of autopilot, which will run custom tcl commands according to your kill signal...

i.e. for my auto upgrading server, i send kill -s USR1 and it creates a save game for me. that way i can schedule exactly what time i want a save game to occure + i can add revision numbers and timestamps etc.
however this does require a *nix system and running the server dedicated.
User avatar
Qu@rks
Route Supervisor
Route Supervisor
Posts: 498
Joined: 26 Mar 2006 23:16
Location: Berlin, Germany
Contact:

Re: Automated message

Post by Qu@rks »

Sounds very complicated ;)
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Automated message

Post by dihedral »

open src/network/network_server.cpp
add
IConsoleCmdExec("exec scripts/on_yearly.scr 0");
to the function
void NetworkServerYearlyLoop()


here's a patch against trunk... http://pub.dihedral.de/openttd/r13691_s ... early.diff ;-)
(it's server side only... you dont need it on the clients!) :-P
it should work on other version (like 0.6.x)
User avatar
Qu@rks
Route Supervisor
Route Supervisor
Posts: 498
Joined: 26 Mar 2006 23:16
Location: Berlin, Germany
Contact:

Re: Automated message

Post by Qu@rks »

I'll try my best!
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest