Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social rich presence plugins #8952

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Social rich presence plugins #8952

wants to merge 10 commits into from

Conversation

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 5, 2021

Motivation / Problem

There's long been interest in being able to "broadcast" your status of playing OpenTTD and possibly being in a multiplayer server, to friends on Discord and similar social platforms. This is even more relevant with the recent Steam release, where features that could allow friends to join your current game, or you to directly send invites, would be popular.

Description

This PR adds a generic interface for OpenTTD to load a "social plugin", an external dynamic library that implements whatever integration. This PR does not integrate with anything in itself. This level of indirection is to avoid having to potentially link OpenTTD directly with proprietary libraries that might not be compatible with GPL.

A proof-of-concept integration for Discord is here: https://github.com/nielsmh/ottd-discord

Limitations

Can only load one social plugin currently, it might be better to support loading and updating any number of social plugins, for example to have Steam and Discord integrations active at the same time.

Needs a per-platform loader for the social plugins, that finds and loads the dynamic libraries. Currently only implemented for Win32.

Support for game invites is not complete, some more specification is needed there.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')
src/network/social_plugin_api.h Outdated Show resolved Hide resolved
src/network/social_presence.cpp Outdated Show resolved Hide resolved
src/network/social_presence.h Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants