Coder Social home page Coder Social logo

dibridge's Introduction

OpenTTD

Table of contents

1.0) About

OpenTTD is a transport simulation game based upon the popular game Transport Tycoon Deluxe, written by Chris Sawyer. It attempts to mimic the original game as closely as possible while extending it with new features.

OpenTTD is licensed under the GNU General Public License version 2.0, but includes some 3rd party software under different licenses. See the section "Licensing" below for details.

1.1) Downloading OpenTTD

OpenTTD can be downloaded from the official OpenTTD website.

Both 'stable' and 'nightly' versions are available for download:

  • most people should choose the 'stable' version, as this has been more extensively tested
  • the 'nightly' version includes the latest changes and features, but may sometimes be less reliable

OpenTTD is also available for free on Steam, GOG.com, and the Microsoft Store. On some platforms OpenTTD will be available via your OS package manager or a similar service.

1.2) OpenTTD gameplay manual

OpenTTD has a community-maintained wiki, including a gameplay manual and tips.

1.3) Supported platforms

OpenTTD has been ported to several platforms and operating systems.

The currently supported platforms are:

  • Linux (SDL (OpenGL and non-OpenGL))
  • macOS (universal) (Cocoa)
  • Windows (Win32 GDI / OpenGL)

Other platforms may also work (in particular various BSD systems), but we don't actively test or maintain these.

1.3.1) Legacy support

Platforms, languages and compilers change. We'll keep support going on old platforms as long as someone is interested in supporting them, except where it means the project can't move forward to keep up with language and compiler features.

We guarantee that every revision of OpenTTD will be able to load savegames from every older revision (excepting where the savegame is corrupt). Please report a bug if you find a save that doesn't load.

1.4) Installing and running OpenTTD

OpenTTD is usually straightforward to install, but for more help the wiki includes an installation guide.

OpenTTD needs some additional graphics and sound files to run.

For some platforms these will be downloaded during the installation process if required.

For some platforms, you will need to refer to the installation guide.

1.4.1) Free graphics and sound files

The free data files, split into OpenGFX for graphics, OpenSFX for sounds and OpenMSX for music can be found at:

Please follow the readme of these packages about the installation procedure. The Windows installer can optionally download and install these packages.

1.4.2) Original Transport Tycoon Deluxe graphics and sound files

If you want to play with the original Transport Tycoon Deluxe data files you have to copy the data files from the CD-ROM into the baseset/ directory. It does not matter whether you copy them from the DOS or Windows version of Transport Tycoon Deluxe. The Windows install can optionally copy these files.

You need to copy the following files:

  • sample.cat
  • trg1r.grf or TRG1.GRF
  • trgcr.grf or TRGC.GRF
  • trghr.grf or TRGH.GRF
  • trgir.grf or TRGI.GRF
  • trgtr.grf or TRGT.GRF

1.4.3) Original Transport Tycoon Deluxe music

If you want the Transport Tycoon Deluxe music, copy the appropriate files from the original game into the baseset folder.

  • TTD for Windows: All files in the gm/ folder (gm_tt00.gm up to gm_tt21.gm)
  • TTD for DOS: The GM.CAT file
  • Transport Tycoon Original: The GM.CAT file, but rename it to GM-TTO.CAT

1.5) Add-on content / mods

OpenTTD features multiple types of add-on content, which modify gameplay in different ways.

Most types of add-on content can be downloaded within OpenTTD via the 'Check Online Content' button in the main menu.

Add-on content can also be installed manually, but that's more complicated; the OpenTTD wiki may offer help with that, or the OpenTTD directory structure guide.

1.5.1) Social Integration

OpenTTD has the ability to load plugins to integrate with Social Platforms like Steam, Discord, etc.

To enable such integration, the plugin for the specific platform has to be downloaded and stored in the social_integration folder.

See OpenTTD's website, under Downloads, for what plugins are available.

1.6) OpenTTD directories

OpenTTD uses its own directory structure to store game data, add-on content etc.

For more information, see the directory structure guide.

1.7) Compiling OpenTTD

If you want to compile OpenTTD from source, instructions can be found in COMPILING.md.

2.0) Contact and Community

'Official' channels

'Unofficial' channels

2.1) Multiplayer games

You can play OpenTTD with others, either cooperatively or competitively.

See the multiplayer documentation for more details.

2.2) Contributing to OpenTTD

We welcome contributors to OpenTTD. More information for contributors can be found in CONTRIBUTING.md

2.3) Reporting bugs

Good bug reports are very helpful. We have a guide to reporting bugs to help with this.

Desyncs in multiplayer are complex to debug and report (some software development skils are required). Instructions can be found in debugging and reporting desyncs.

2.4) Translating

OpenTTD is translated into many languages. Translations are added and updated via the online translation tool.

3.0) Licensing

OpenTTD is licensed under the GNU General Public License version 2.0. For the complete license text, see the file 'COPYING.md'. This license applies to all files in this distribution, except as noted below.

The squirrel implementation in src/3rdparty/squirrel is licensed under the Zlib license. See src/3rdparty/squirrel/COPYRIGHT for the complete license text.

The md5 implementation in src/3rdparty/md5 is licensed under the Zlib license. See the comments in the source files in src/3rdparty/md5 for the complete license text.

The fmt implementation in src/3rdparty/fmt is licensed under the MIT license. See src/3rdparty/fmt/LICENSE.rst for the complete license text.

The nlohmann json implementation in src/3rdparty/nlohmann is licensed under the MIT license. See src/3rdparty/nlohmann/LICENSE.MIT for the complete license text.

The OpenGL API in src/3rdparty/opengl is licensed under the MIT license. See src/3rdparty/opengl/khrplatform.h for the complete license text.

The catch2 implementation in src/3rdparty/catch2 is licensed under the Boost Software License, Version 1.0. See src/3rdparty/catch2/LICENSE.txt for the complete license text.

The icu scriptrun implementation in src/3rdparty/icu is licensed under the Unicode license. See src/3rdparty/icu/LICENSE for the complete license text.

The monocypher implementation in src/3rdparty/monocypher is licensed under the 2-clause BSD and CC-0 license. See src/3rdparty/monocypher/LICENSE.md for the complete license text.

The OpenTTD Social Integration API in src/3rdparty/openttd_social_integration_api is licensed under the MIT license. See src/3rdparty/openttd_social_integration_api/LICENSE for the complete license text.

4.0 Credits

See CREDITS.md

dibridge's People

Contributors

dependabot[bot] avatar glx22 avatar stormcone avatar truebrain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dibridge's Issues

Puppet disconnection issues?

While this bridge seems to run stable on low traffic Discord channels, I see a lot of puppet disconnection issues on a more busy channel and subsequent dropping of messages IRC side. Since both the bridge and the IRC server are one the very same machine it can't be network connection issues.

The logs are overflowing with messages like this:

Sep 17 09:29:41 hpthin VelorenIRCBridge[106818]: 2022-09-17 09:29:41 INFO     [dibridge.irc_puppet.Sharp[GMT2]] Connecting to IRC from 2001:db8:100::1d90:2a6c:2954 ...
Sep 17 09:29:41 hpthin VelorenIRCBridge[106818]: 2022-09-17 09:29:41 INFO     [dibridge.irc_puppet.Zodurus] Connecting to IRC from 2001:db8:100::f81b:1d76:319e ...
Sep 17 09:29:41 hpthin VelorenIRCBridge[106818]: 2022-09-17 09:29:41 WARNING  [dibridge.irc_puppet.Mati_C8] Disconnected from IRC
Sep 17 09:29:41 hpthin VelorenIRCBridge[106818]: 2022-09-17 09:29:41 WARNING  [dibridge.irc_puppet.tenki] Disconnected from IRC

Any suggestion how I can investigate the cause of this further? Restarting the bridge always seems to help for a while.

option to ignore certain users?

Sometimes there is a bot that for example posts link previews on the IRC side, and that is a bit annoying to bridge to Discord.

Maybe you could add a simple ignore option with a list of nicks?

Thanks.

Strange spamming to mentions and only partial message relay from Discord

Strange error on a popular Discord channel... it all looked fine IRC side which is why it too a while to notice. And a restart of the bridge temporarily fixed it.

On the Discord side it started adding multiple mentions of a single specific user to messages coming from IRC side. Also not all messages came through to the IRC side anymore.

Only error I could find in the logs is this:

Sep 16 17:02:43 hpthin python3[104082]: 2022-09-16 17:02:43 WARNING  [dibridge.irc_puppet.] Disconnected from IRC
Sep 16 17:02:43 hpthin python3[104082]: 2022-09-16 17:02:43 ERROR    [asyncio] Exception in callback _SelectorSocketTransport._call_connection_lost(None)
Sep 16 17:02:43 hpthin python3[104082]: handle: <Handle _SelectorSocketTransport._call_connection_lost(None)>
Sep 16 17:02:43 hpthin python3[104082]: Traceback (most recent call last):
Sep 16 17:02:43 hpthin python3[104082]:   File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
Sep 16 17:02:43 hpthin python3[104082]:     self._context.run(self._callback, *self._args)
Sep 16 17:02:43 hpthin python3[104082]:   File "/usr/lib/python3.10/asyncio/selector_events.py", line 975, in _call_connection_lost
Sep 16 17:02:43 hpthin python3[104082]:     super()._call_connection_lost(exc)
Sep 16 17:02:43 hpthin python3[104082]:   File "/usr/lib/python3.10/asyncio/selector_events.py", line 733, in _call_connection_lost
Sep 16 17:02:43 hpthin python3[104082]:     self._protocol.connection_lost(exc)
Sep 16 17:02:43 hpthin python3[104082]:   File "/home/dibridge/.local/lib/python3.10/site-packages/irc/client_aio.py", line 82, in connection_lost
Sep 16 17:02:43 hpthin python3[104082]:     self.connection.disconnect()
Sep 16 17:02:43 hpthin python3[104082]:   File "/home/dibridge/.local/lib/python3.10/site-packages/irc/client_aio.py", line 214, in disconnect
Sep 16 17:02:43 hpthin python3[104082]:     self._handle_event(Event("disconnect", self.server, "", [message]))
Sep 16 17:02:43 hpthin python3[104082]:   File "/home/dibridge/.local/lib/python3.10/site-packages/irc/client.py", line 376, in _handle_event
Sep 16 17:02:43 hpthin python3[104082]:     self.reactor._handle_event(self, event)
Sep 16 17:02:43 hpthin python3[104082]:   File "/home/dibridge/.local/lib/python3.10/site-packages/irc/client.py", line 922, in _handle_event
Sep 16 17:02:43 hpthin python3[104082]:     result = handler.callback(connection, event)
Sep 16 17:02:43 hpthin python3[104082]:   File "/home/dibridge/.local/lib/python3.10/site-packages/irc/client.py", line 1159, in _dispatcher
Sep 16 17:02:43 hpthin python3[104082]:     method(connection, event)
Sep 16 17:02:43 hpthin python3[104082]:   File "/opt/dibridge/dibridge/irc_puppet.py", line 87, in on_disconnect
Sep 16 17:02:43 hpthin python3[104082]:     self._pinger_task.cancel()
Sep 16 17:02:43 hpthin python3[104082]: AttributeError: 'NoneType' object has no attribute 'cancel'

Which tells me nothing too be honest :(

Any idea?

I improved logging a bit and will try to catch the error again in the next few days.

Puppets without ipv6 trick / webirc support?

I run my own IRC server and can allow-list this bridge to permit as many connections as it wants from one IP, but the readme makes it sound like real puppets only work with the ipv6 trick?

It would make the setup much easier in the case of a self-hosted IRCd.

Thanks for making this bridge btw, looks very good otherwise :)

Feature request: add option to relay Discord bots to IRC

Any chance for the bridge to also relay messages from other bots? Maybe optional?

Because right now it seems to totally ignore them.

We have a channel where someone else also set up a Matrix to Discord bridge and messages coming in through that bridge are totally ignored. However the Matrix bridge seems to see the bot users from dibridge fine, so I guess that means it is possible to enable it the other way around too.

grafik

Thanks!

Feature request: option to force nicknames on IRC to have a certain postfix

I noticed that on Discord side the bridge ends up tagging people with usernames like "normal" and "lot" just by typing these words in a chat.

Obviously this is mainly a result of people choosing common english words as usernames, but it is still a bit annoying.

So not sure if there is a way to avoid this, or maybe it could be changed that the bridge only explicitly tags people on the Discord side when "@" is put in front of the username?

Running multiple instances of dibridge? User-tag customizaton?

@TrueBrain

This bridge is not really meant to bridge more than one channel, as it will create new puppets for every channel.

So I was planning to run multiple instances by creating seperate systemd service files with different bot names and channel settings, but the above quote got me wondering about Discord user-names.

In the single instance setup a discord user will just get Examplename[d] and because of the [d] it is unlikely to clash with existing IRC user nicks.

But assuming you run two dibridge instances and the same person on Discord joins those two bridged channels... now both dibridge instances will try to create a puppet called Examplename[d] which obviously the IRC server will not allow.

I don't really see an easy solution to this, but as workaround one could maybe allow customizing the [d] tag? So that one instance adds [channel1] and the other [channel2] or so to the name?

Priviledged intents required

When I try to use the Discord bot credentials from my working Matterbridge (working with user-spoofing and all) with dibridge it crashes with the following error:

discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

I suspect it is requesting some additional permissions that have not been set by the Discord channel owner (not me), but since Matterbridge works fine with the same credentials, I guess dibridge is asking for additional ones it does not really need?

If it is needed after all, which one might it be?

I think this tutorial was followed: https://github.com/42wim/matterbridge/wiki/Discord-bot-setup

Some issues with puppet username to discord username translations

I noticed at least 2 issues.

Firstly the regex on https://github.com/OpenTTD/dibridge/blob/main/dibridge/irc.py#L144 fails if puppet username contains []
https://discord.com/channels/142724111502802944/1008473233844097104/1010288501742383104
image vs https://weblogs.openttd.org/openttd/2022/08/19.html#204548-124

22:45:48 <glx> my irc client will highlight for both glx and glx[d] (because I used a lazy method) but on discord only the [d] version will trigger
22:46:32 <glx> glx[d]: only this format

and https://discord.com/channels/142724111502802944/1008473233844097104/1010329543644549200
image
vs https://weblogs.openttd.org/openttd/2022/08/19.html#232854-146

01:28:54 <glx> let's try glxd
01:29:04 <glx> and discord notified

Secondly, puppet username may be translated when it's unwanted https://discord.com/channels/142724111502802944/1008473233844097104/1011205826792407081
image vs https://weblogs.openttd.org/openttd/2022/08/22.html#093056-72

11:30:56 <peter1138> https://fuzzle.org/~petern/ottd/diagstations.png
11:30:58 <peter1138> Such old.
11:31:58 <peter1138> https://fuzzle.org/~petern/ottd/stbr3.png
11:31:59 <peter1138> Hehe

--irc-channel adds # automatically, but should not.

I tried:

--irc-channel #examplechannel

An was surprised that it didn't understand the channel.

--irc-channel "#examplechannel"

Works but joins ##examplechannel

So in the end the working version is --irc-channel examplechannel

But the # is part of the channel name and should not be added automatically. Also undocumented ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.