Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri May 24, 2019 1:58 pm

All times are UTC




Post new topic  Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Sun Mar 17, 2019 10:41 am 
Offline
Engineer
Engineer
User avatar

Joined: Sun Mar 17, 2019 10:35 am
Posts: 4
Location: Istanbul
Hello everyone!
Since you are re-building the game, I think you can take Discord integration. I am sure that they'll support you!
These are the links that may help you:
https://discordapp.com
https://discordapp.com/rich-presence
https://discordapp.com/verification


Top
   
PostPosted: Sun Mar 17, 2019 11:16 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 22, 2005 7:31 pm
Posts: 6511
Location: Wakefield, West Yorkshire
That reminds me, Discord used to recognise when i was playing OpenTTD, it no longer does :(

_________________
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!


Top
   
PostPosted: Sun Mar 17, 2019 1:06 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Mar 17, 2019 10:35 am
Posts: 4
Location: Istanbul
Redirect Left wrote:
That reminds me, Discord used to recognise when i was playing OpenTTD, it no longer does :(


I noticed that too. I must select .exe file manually everytime I open the game.


Top
   
PostPosted: Mon Mar 18, 2019 3:37 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Wed Jan 08, 2003 11:09 pm
Posts: 480
Location: Denmark
The suggestion has been raised before. The consensus last year was that we don't want integration for specific platforms built in to OpenTTD itself, but may be open to having some general method of querying game status.


Top
   
PostPosted: Mon Mar 18, 2019 3:49 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Mar 17, 2019 10:35 am
Posts: 4
Location: Istanbul
jfs wrote:
The suggestion has been raised before. The consensus last year was that we don't want integration for specific platforms built in to OpenTTD itself, but may be open to having some general method of querying game status.

That could be super cool!


Top
   
PostPosted: Tue Mar 19, 2019 3:13 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7350
we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Tue Mar 19, 2019 3:23 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9266
Location: Sol d
Eddi wrote:
we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.


Quite right:

There exists a python script which connects to the admin port and communicates ingame to IRC.
https://dev.openttdcoop.org/projects/soap/repository and a fork at https://github.com/ropenttd/suds

This surely can be changed to talk to discord, too, especially as there is a ready-made python API: https://discordpy.readthedocs.io/en/latest/api.html

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Tue Mar 19, 2019 3:25 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Mar 17, 2019 10:35 am
Posts: 4
Location: Istanbul
planetmaker wrote:
Eddi wrote:
we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.


Quite right:

There exists a python script which connects to the admin port and communicates ingame to IRC.
https://dev.openttdcoop.org/projects/soap/repository and a fork at https://github.com/ropenttd/suds

This surely can be changed to talk to discord, too, especially as there is a ready-made python API: https://discordpy.readthedocs.io/en/latest/api.html


But there is just little problem. I don't know how to code. I just wanted to come out with an idea.


Top
   
PostPosted: Tue Mar 19, 2019 3:37 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Wed Jan 08, 2003 11:09 pm
Posts: 480
Location: Denmark
Eddi wrote:
we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.

Is the admin port usable (or useful) when you are on the main menu? In a singleplayer game? Joined as a client in multiplayer?
The goal here is not to query information about a multiplayer game you are hosting, but to query information about which game you are playing, possibly including server address of a multiplayer session you have joined. Also, from within the IM client (be it Discord or anything else) instruct a running OpenTTD to join a specific server, or to allow friends to request to join your game, still from within their IM client.


Top
   
PostPosted: Tue Mar 19, 2019 4:50 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9266
Location: Sol d
jfs wrote:
Eddi wrote:
we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.

Is the admin port usable (or useful) when you are on the main menu? In a singleplayer game? Joined as a client in multiplayer?
The goal here is not to query information about a multiplayer game you are hosting, but to query information about which game you are playing, possibly including server address of a multiplayer session you have joined. Also, from within the IM client (be it Discord or anything else) instruct a running OpenTTD to join a specific server, or to allow friends to request to join your game, still from within their IM client.


The admin port only works when OpenTTD runs in server mode (why would you externally control your single-player session?). As such: it is not useful nor even usable at all in main menu as in that case no server is running.

In server mode it can query many game states, including player and map info as well as interactions between them. It is possible to use it as some kind of command-logging; while it does not have every game action available, it can get those via a game script which can have an interface to the admin port as well.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Tue Mar 19, 2019 5:14 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Wed Jan 08, 2003 11:09 pm
Posts: 480
Location: Denmark
Yep exactly. The idea behind an IM client integration is not to query the status of a game server, but to report what the user is doing with the game, whether that's just having it open, playing alone, or playing multiplayer.


Top
   
PostPosted: Tue Mar 19, 2019 5:53 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Fri Apr 14, 2017 3:51 pm
Posts: 153
Location: Czech Republic
there is a path Openttd -> libOTTDAdmin2 -> SUDS bot (Supybot) -> IRC
  -> Discord, I tried to start it, but I couldn't make it completely, too complicated ...

_________________
Owner and admin of servers:Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779), Experimental games 04 (92.63.57.152:3679), Experimental games 05 (92.63.57.152:3579).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS


Top
   
PostPosted: Tue Mar 19, 2019 7:05 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 22, 2005 7:31 pm
Posts: 6511
Location: Wakefield, West Yorkshire
I've recently been working with Node to create my Discord bot for my gameserver (not OpenTTD related, San Andreas Multiplayer). So i can give some pointers on how to make the Discord connections, although i woludn't know how to read the OTTD data without looking into it, and then it should be aasy to word into human readable sentences.

The issue I have found, as i was converting from an IRC to a Discord bot. Discord, unlike IRC, doesn't have limitless lines. It is throttles quite heavily, so if your OpenTTD instance outputs lines rapidly, you may get your bot throttled. May not be an issue for OpenTTD, but my IRC bot was spewing out 5+ lines per 10 seconds, which Discord does not like. So be wary of those limit in Discord, compared to IRC.

_________________
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!


Top
   
PostPosted: Wed Mar 20, 2019 11:26 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9266
Location: Sol d
Redirect Left wrote:
I've recently been working with Node to create my Discord bot for my gameserver (not OpenTTD related, San Andreas Multiplayer). So i can give some pointers on how to make the Discord connections, although i woludn't know how to read the OTTD data without looking into it, and then it should be aasy to word into human readable sentences.

The issue I have found, as i was converting from an IRC to a Discord bot. Discord, unlike IRC, doesn't have limitless lines. It is throttles quite heavily, so if your OpenTTD instance outputs lines rapidly, you may get your bot throttled. May not be an issue for OpenTTD, but my IRC bot was spewing out 5+ lines per 10 seconds, which Discord does not like. So be wary of those limit in Discord, compared to IRC.


Do you possibly feel like making discord integration into soap / suds? That bot currently connects to IRC. However the detour via IRC is not necessary as in python one can directly connect to discord, too.
Links to repos are at viewtopic.php?f=32&t=84974#p1219543

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.