.. image:: ../Images/communityhub_icon.png :align: center :scale: 75 % ************* Community Hub ************* **Community Hub** is a global term. It represents all the elements (UI panels, technologies, features...) which help bring players together. We want to spread these concepts across all our games, websites, communication channels... in order to make the players enjoy a better experience through all the Asmodee galaxy. Setup ===== ``CommunityHubLauncher`` is a required component of ``CoreApplication``. .. image:: ../Images/communityhub_1.jpg :align: center :scale: 75 % *note:* If you don't want to benefit from the **Community Hub** in your game, simply keep the ``autoLaunch`` to false. You can also manually call ``LaunchCommunityHub`` and ``StopCommunityHub`` methods. Starting the **Community Hub** results in adding a ``CommunityHub`` component to the ``CoreApplication`` and add a ``CommunityHubLayout`` as a child. Monitor Online Status ===================== ``CommunityHub`` helps with monitoring the online status of your game. * Network Reachability .. code:: csharp public bool IsNetworkReachable; public event Action networkReachabilityDidChange; * Public Scope Token .. code:: csharp public bool HasPublicScopeToken; public event Action publicScopeTokenDidChange; * Private Scope Token .. code:: csharp public bool HasPrivateScopeToken; public event Action privateScopeTokenDidChange; * Scalable Server Session .. code:: csharp public bool IsConnectedToScalableServer; public event Action scalableServerConnectionDidChange; Require Online Status ===================== You can also request for a specific online status. The SDK will try to meet your requirements, eventually prompt the SSO to the player, then call you back. .. code:: csharp CoreApplication.Instance.CommunityHub.RequireOnlineStatus(typeof(InternetConnectionWithPrivateScopeTokenRequiredStatus), () => { // Success }, () => { // Failure }); Available status are: * ``InternetConnectionStatus`` * ``InternetConnectionWithPublicScopeTokenStatus`` * ``InternetConnectionWithPrivateScopeTokenOptionalStatus`` * ``InternetConnectionWithPrivateScopeTokenRequiredStatus`` will prompt the SSO * ``InternetConnectionWithScalableServerConnectionOptionalStatus`` * ``InternetConnectionWithScalableServerConnectionRequiredStatus`` will prompt the SSO You can provide your own status by subclassing ``RequiredOnlineStatus``. Community Hub Content ===================== The **Community Hub** can handle a set of ``CommunityHubContent``. Provide a 2D panel and let the system automatically layout the window. .. code:: csharp LoginBannerContent content = new LoginBannerContent(); CommunityHub hub = CoreApplication.Instance.CommunityHub; hub.AddContent(content); ... hub.RemoveContent(content); Layout ------ Your game will run on a diversity of devices, and displayed on screen which differs in size and aspect ratio. We tried to address this variety in a way that will fit most games. .. image:: ../Images/communityhublayout_1.jpg :align: center :scale: 25 % We rely highly on `Preferences `_ to detect the current configuration. A content can be either a *header* or a *tab*. Headers are stacked from to top right corner of the screen, they are displayed as is. Tabs are resized to fit the green part presented below. If several tabs are available, a tab bar appears to choose the current one. **Red:** CommunityHubContent.Layout.Header, **Green:** CommunityHubContent.Layout.Tab * Small Display Mode .. image:: ../Images/communityhublayout_2.jpg :align: center :scale: 50 % * Regular / Big Display Mode .. image:: ../Images/communityhublayout_3.jpg :align: center :scale: 50 % Refer to `AutoLayoutRectTransform `_ to prevent your game's user interface from being overlapped. Provided content ---------------- In the Unity SDK we begin to provide applicative components to help with sharing common features across all games: .. toctree:: loginbanner useraccount playerslists chat Skinning -------- All the prefabs are referenced through a ``CommunityHubSkin`` scriptable object. You can make you own version and provide it to the ``CommunityHubLauncher`` component. If you don't provide a skin file the SDK default on CommunityHubDefaultSkin.asset. Make your own content --------------------- You may consider using this system to display your own custom **Community Hub Content**. For example, if you want to display a game log, or a quick rules reference, it could be integrated this way.