OpenTTD Source  20241121-master-g67a0fccfad
social_integration.cpp File Reference

Base implementation of social integration support. More...

#include "stdafx.h"
#include "social_integration.h"
#include "3rdparty/openttd_social_integration_api/openttd_social_integration_api.h"
#include "debug.h"
#include "fileio_func.h"
#include "library_loader.h"
#include "rev.h"
#include "string_func.h"
#include "signature.h"
#include "safeguards.h"

Go to the source code of this file.

Data Structures

class  InternalSocialIntegrationPlugin
 Container to track information per plugin. More...
 
class  SocialIntegrationFileScanner
 Helper for scanning for files with SocialIntegration as extension. More...
 

Functions

template<typename T , typename... Ts>
static void PluginCall (std::unique_ptr< InternalSocialIntegrationPlugin > &plugin, T func, Ts... args)
 Wrapper to call a function pointer of a plugin if it isn't a nullptr. More...
 

Variables

static std::vector< std::unique_ptr< InternalSocialIntegrationPlugin > > _plugins
 List of loaded plugins.
 
static std::set< std::string > _loaded_social_platform
 List of Social Platform plugins already loaded. Used to prevent loading a plugin for the same Social Platform twice.
 

Detailed Description

Base implementation of social integration support.

Definition in file social_integration.cpp.

Function Documentation

◆ PluginCall()

template<typename T , typename... Ts>
static void PluginCall ( std::unique_ptr< InternalSocialIntegrationPlugin > &  plugin,
func,
Ts...  args 
)
static

Wrapper to call a function pointer of a plugin if it isn't a nullptr.

Parameters
pluginPlugin to call the function pointer on.
funcFunction pointer to call.

Definition at line 173 of file social_integration.cpp.

Referenced by SocialIntegration::EventEnterMainMenu(), SocialIntegration::EventEnterMultiplayer(), SocialIntegration::EventEnterScenarioEditor(), SocialIntegration::EventEnterSingleplayer(), SocialIntegration::EventJoiningMultiplayer(), SocialIntegration::RunCallbacks(), and SocialIntegration::Shutdown().