LogoLogo
  • ReneVerse Tour
    • ๐Ÿ‘‹Welcome to ReneVerse
      • ๐Ÿง Smart Ads & Branded Objects
      • ๐Ÿ“ˆAdvertising Demand via ReneVerse
      • ๐Ÿ”ฎThe Portal
      • ๐ŸงฐThe SDKs
  • Getting Started
    • ๐Ÿš€Getting Started with ReneVerse
    • ๐Ÿ“Registering as a New User
    • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆCreating a New Organization
    • ๐Ÿ‘ฅInvite Members to Your Team
  • Publisher Flow
    • ๐Ÿ•น๏ธPublisher Overview
    • โšกQuick Start Guide
    • ๐Ÿ’พRegistering Your Game & Generating API Keys
    • ๐ŸงฉSDK Integration
      • ๐Ÿ› ๏ธUnity
        • ๐Ÿ”งUnity SDK Setup
        • ๐Ÿ”จ[WIP] Using the Unity SDK
          • ๐ŸฅžBatch Serve Ad
      • ๐ŸŽฎUnreal Engine
        • โš™๏ธUE SDK Setup
        • ๐Ÿ”ฉUsing the UE SDK
      • ๐ŸŒPhaser 3
        • ๐Ÿ’ซPhaser Quick Start
        • ๐ŸงชAPI Reference
          • ๐ŸชuseReneVerse
          • ๐Ÿ“ŠuseTracking
        • ๐Ÿ’ปFull Implementation (Code)
    • ๐ŸŽฏDefining Placeholders in the Portal
      • ๐Ÿ–ผ๏ธCreating Ad Surfaces in the Portal
      • ๐ŸŽ๏ธCreating Branded Object Placements in the Portal
    • ๐Ÿ“ฒAds.txt
  • Advertiser Flow
    • Advertiser Overview
    • Creating Ad Campaign
    • Managing Brands
      • Creating Branded Collections
      • Brand Creation
      • Asset Creation
    • Adding Ads to Campaign
    • Creating Branded Assets
  • Download
    • Unity SDK
    • Unreal Engine SDK
    • Phaser NPM Package
Powered by GitBook
LogoLogo

ReneVerse

  • Website
  • Sign Up
  • Book a demo

Download

  • Unity SDK
  • Unreal Engine SDK
  • Phaser NPM

Links

  • Blog
  • About
  • Play Demo
  • FAQs

Socials

  • LinkedIn
  • X (Twitter)
  • YouTube

ยฉ 2025 ReneVerse

On this page
  1. Publisher Flow
  2. Player Authentication

Game Connect

Last updated 1 year ago

GameConnect gives your users advantages of using playing the game as long as they are logged in the system. The difference with Email & Password Login is that the user should admitting the logging in attempt on the Reneverse website:

The ReneAPIManager class is a utility class that manages connections and interactions with the ReneVerse API. It provides several static methods to initialize the API, handle user authentication, connect to games, and perform various other operations.

Methods: GameConnect and GameConnectWithUserName

Method: GameConnect

Signature:

public static async Task<bool> GameConnect(string email)

Description: The GameConnect method connects to the ReneVerse game using the provided email. This connection requires user authorization on the ReneVerse website.

Parameters:

  • email (string): The email address of the user. This email must be registered on the ReneVerse website.

Returns:

  • Task<bool>: A task representing the asynchronous operation. The task result is a boolean indicating whether the connection was successful.

Method: GameConnectWithUserName

Signature:

public static async Task<bool> GameConnectWithUserName(string userName)

Description: The GameConnectWithUserName method connects to the ReneVerse game using the provided username. This connection also requires user authorization on the ReneVerse website.

Parameters:

  • userName (string): The username of the user. This username must be registered on the ReneVerse website.

Returns:

  • Task<bool>: A task representing the asynchronous operation. The task result is a boolean indicating whether the connection was successful.

Usage

The GameConnect and GameConnectWithUserName methods can be called from any script within the Unity project. Typically, they would be called when the user attempts to connect to the game through the game's user interface.

Example Usage in Unity

Here's an example of how to use the GameConnect and GameConnectWithUserName methods within a Unity script. This example assumes you have a basic UI setup with input fields for the email or username and a button to trigger the connection process.

  1. Create a Connection UI:

    • Add Input Fields for email or username.

    • Add a Button for the connection action.

  2. Attach a Script to the Button:

    csharpCopy codeusing UnityEngine;
    using UnityEngine.UI;
    using ReneVerse;
    
    public class ConnectionManager : MonoBehaviour
    {
        public InputField emailInputField;
        public InputField userNameInputField;
        public Text statusText;
    
        public async void OnConnectButtonClicked()
        {
            string email = emailInputField.text;
            string userName = userNameInputField.text;
            
            bool connectionSuccessful;
            if (!string.IsNullOrEmpty(email))
            {
                connectionSuccessful = await ReneAPIManager.GameConnect(email);
            }
            else
            {
                connectionSuccessful = await ReneAPIManager.GameConnectWithUserName(userName);
            }
    
            if (connectionSuccessful)
            {
                statusText.text = "Connection successful! Please authorize on the ReneVerse website.";
                // Proceed to the next scene or game state
                // Now players have the benefits of logging in
            }
            else
            {
                statusText.text = "Connection failed. Please check your credentials or registration status.";
            }
        }
    }
  3. Initialize the ReneVerse API: Ensure that the API is initialized before calling the connection methods. This can be done in the Start method of a Unity script or any other appropriate place in your game.

    csharpCopy codevoid Start()
    {
        ReneAPIManager.InitializeAPI();
    }

Detailed Explanation

Initialization

Before calling the GameConnect or GameConnectWithUserNamemethod, it is crucial to initialize the ReneVerse API. The InitializeAPI method sets up the API using the credentials stored in the ReneAPICreds in the Reneverse Window that Rene Sdk Provides (Shift + R/ Window -> Reneverse Settings).

Handling Game Connection

The GameConnect and GameConnectWithUserName methods utilize the GameAPI class to send a connection request to the ReneVerse backend. Upon sending the request, users need to authorize the connection on the ReneVerse website.

public static async Task<bool> GameConnect(string email)
{
    GameAPI gameAPI = api.Game();
    return await gameAPI.Connect(email);
}

public static async Task<bool> GameConnectWithUserName(string userName)
{
    GameAPI gameAPI = api.Game();
    return await gameAPI.ConnectWithUserName(userName);
}

Customization

Developers can customize the connection implementation as needed. For instance, input parameters can be gathered through different UI elements, such as text fields or dropdowns. The process of integrating the connection functionality into the game's flow is flexible and can be adapted to fit various design requirements.

Summary

The ReneAPIManager.GameConnect and ReneAPIManager.GameConnectWithUserName methods provide a straightforward way to connect to the ReneVerse game environment in Unity games. These methods require user authorization through the ReneVerse website, ensuring secure connections. By following the steps outlined above, developers can easily integrate connection functionality into their games, allowing users to connect using their registered email or username. The methods are asynchronous and return a boolean indicating the success of the connection attempt, enabling developers to handle successful and failed connections appropriately within their game.

Once GameConnect happens, the user should confirm it on the website