Dedicated server welcome & commands

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Dedicated server welcome & commands

Post by Whos »

Hi. I want to improve the welcome and typing commands on my server. I want to do, so that the server writes the information as PM and shows to all where is client..Can someone write me some code autopilot.tcl which is responsible for that?

I marked interesting parts of the greeting from n-ice.org server.


Anyone knows how to do this and could you help me?
Thank,
Last edited by Whos on 28 Feb 2010 20:17, edited 1 time in total.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Dedicated server welcome & commands

Post by Zuu »

Your location can often be determined from your IP-number. It is not fool-prof but it works in many cases. Yes, you are looking for a program/script called Autopilot or ap+. These programs run "around" your dedicated server and talks with the dedicated server console to read the messages from the server when someone joins and send messages to that person.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: Dedicated server welcome & commands

Post by Whos »

Zuu wrote:Your location can often be determined from your IP-number. It is not fool-prof but it works in many cases. Yes, you are looking for a program/script called Autopilot or ap+. These programs run "around" your dedicated server and talks with the dedicated server console to read the messages from the server when someone joins and send messages to that person.
Lol, read my posts more carefully. I've installed the autopilot and I can give simple commands type !commands, but I want so as server to say this as a personal message.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Dedicated server welcome & commands

Post by Zuu »

I've checked up this for ap+, if you use plain autopilot it might be implemented differently.

Customize autopilot/scripts/callback/on_game_join.example.tcl and remove ".example" in the file name. You will have to find out yoursef how to do the correct whois lookups and implement that in the tcl language. (I don't know tcl myself)

Or why not ask the server owner of that server if you can get his code modifications to the greeting script?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: Dedicated server welcome & commands

Post by Whos »

OK, I have the "on_game_join.tcl", but does not working.
Last edited by Whos on 08 Feb 2010 03:23, edited 1 time in total.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Dedicated server welcome & commands

Post by Zuu »

How is it not workning? Exact error messages are much more useful than "it is not working".

If you post your tcl file then maybe you can get better help.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Dedicated server welcome & commands

Post by dihedral »

http://wiki.openttdcoop.org/Autopilot/ap+

that's all the documentation there is, + the example files, + tcl manuals

good luck ;-)
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: Dedicated server welcome & commands

Post by Whos »

Zuu wrote:How is it not workning? Exact error messages are much more useful than "it is not working".

If you post your tcl file then maybe you can get better help.
Look at code:

Code: Select all

Autopilot engaged
Starting new game: 'xxx'
Landscape: temperate
Dimensions: 256x256
Starting year: 1830
players
server_info
clients
echo doneclientcount
Current/maximum clients:     0/255
Current/maximum companies:   0/15
Current/maximum spectators:  0/20
Client #1  name: 'xxx'  company: 255  IP: 0.0.0.0
doneclientcount
pause
Game paused.
*** whos has joined the game
*** Game paused (connecting client)
*** Game unpaused (client connected)
[All] whos: !help
say_client 0 "Avaible commands:"
say_client 0 "!help     -- this help"
say_client 0 "!version  -- version of the server bot"
say_client 0 "!admin    -- request an admin to join the game"
say_client 0 "---"
dbg: [net] [rcon] client-id 3 executed: 'clients'
dbg: [net] [rcon] client-id 3 executed: 'clients'
clients
clients
Client #1  name: 'xxx'  company: 255  IP: 0.0.0.0
Client #3  name: 'whos'  company: 255  IP:  ;)
There's no MOTD or "error message" after i joined to the server. There's nothing. :P . And the 'simple commands' not working always, I don't know why autopilot not always check my client_id, sometimes it is "0" (above code), sometimes wrong ID (!). :( .



As you can see, I using the standard tcl code from SVN source (from site above reported by dihedral).


Image


Thanks for help,
sorry for the long-awaited answer. :wink: .
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Dedicated server welcome & commands

Post by dihedral »

interesting - thanks for those details!
i'm not sure i'll spot the issue right away, but i'll look into it.

note though, that a message in private will not work if you have not been greeted in private either :-P

also - if you are on a linux system (as i can see :-P) perhaps you might like to have a look at avignon
this is a project aimed at redesigning autopilot from scratch.
http://codecubes.org

enjoy.
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: Dedicated server welcome & commands

Post by Whos »

I've installed the Avignon, but I do not know how to configure it.
I seen this:

Code: Select all

[2010-02-13 05:14:04] [console] [notice] Avignon Console engaged
[2010-02-13 05:14:04] [irc] [error] irc module not enabled, refusing to connect
[2010-02-13 05:14:04] [plugin] [notice] [Alias] loaded version 0.1
[2010-02-13 05:14:04] [plugin] [notice] [DemoPlugin] loaded version 0.1
And I don't know what's next I must to do.

Image
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Dedicated server welcome & commands

Post by dihedral »

hehehe :-P

config is in the config folder, copy default.ini to user.ini, and edit user.ini

on the avignon console you can enter 'load OpenTTD'... and have a look at the readme.txt in extensions/apps/OpenTTD :-P
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: Dedicated server welcome & commands

Post by Whos »

dihedral wrote:hehehe :-P

config is in the config folder, copy default.ini to user.ini, and edit user.ini

on the avignon console you can enter 'load OpenTTD'... and have a look at the readme.txt in extensions/apps/OpenTTD :-P
Thanks. But I've next problem. What's now? :( .... It can't find file.

Code: Select all

19:11:54^xxx@Avignon.console$ load OpenTTD

[2010-02-13 19:12:29] [plugin]  [notice]    [OpenTTD] loaded version 0.1
loaded OpenTTD v0.1

19:12:29^xxxAvignon.console$ openttd start

OpenTTD executable not found at './openttd/openttd' in '/home/xxx/openttd2'
Image
Last edited by Whos on 13 Feb 2010 20:37, edited 1 time in total.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4761
Joined: 09 Sep 2007 05:03
Location: home

Re: Dedicated server welcome & commands

Post by Alberth »

No idea what you are doing, but judging from the icons, 'openttd' is a file, thus ./openttd/openttd is not going to work.

Try changing that to './openttd'
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: Dedicated server welcome & commands

Post by Whos »

Alberth, I can't change name of the main file. :) .
lol, on my server all of scripts (autopilot, avignon...) working incorrectly. :( .
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9420
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Dedicated server welcome & commands

Post by planetmaker »

I don't quite follow where you put what.

On our public server (ap+) the dir structure works this way:

./publicserver (that's where we compile openttd in via make bundle, then "cp -Rf bundle/* autopilot")
./publicserver/autopilot

Also in autopilot.tcl you find the line

Code: Select all

if {[set openttd [::ap::config::get autopilot command]] == {} } {
        set openttd {./openttd}
}
Which you obviously could adjust to your needs. Default is to look for the openttd binary in the same dir as autopilot.tcl is.
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Dedicated server welcome & commands

Post by dihedral »

sorry Whos, i do not really like private messages as a reply to a topic!
also: no! i will not configure your avignon copy or ap+ copy via remote desktop for you!!

my personal guess is that the part of the code is looking for openttd in a seperate folder named openttd, which holds the standard openttd folder structure, hence trying to start openttd/openttd
just might be worth a try, don't you think?

further more, i want to point out that 1. avignon is still alpha (however, i have meat enough people who have managed a fairly straight forward setup)

but what i can read out of your thread, is that there seems to be a higher need for some usable docs ;-)
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: Dedicated server welcome & commands

Post by Whos »

dihedral wrote:my personal guess is that the part of the code is looking for openttd in a seperate folder named openttd, which holds the standard openttd folder structure, hence trying to start openttd/openttd
just might be worth a try, don't you think?
Sorry, but I don't understand you. Can you explain that simplier?
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Dedicated server welcome & commands

Post by dihedral »

i am sorry - i have no clue where you fail to understanding that avignon seems to be looking for another folder named openttd in which you have the openttd binary!
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: Dedicated server welcome & commands

Post by Whos »

O.K., it works. Really thanks for assistance, dihedral. ;) .

Would you be so nice and help me reach my goal (first post)? Sorry, but i don't know where I can set a callback.
I hope that I don't abuse your patience?
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Dedicated server welcome & commands

Post by dihedral »

i think this might help you: http://codecubes.org/wiki/Avignon/Plugin
shout when you need help
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 6 guests