Giter Club home page Giter Club logo

playfab-unreal-cpp-matchmaking's Introduction

PlayFab C++ Matchmaking

In this Repo we got an example on how to make a pretty basic Matchmaking module, using the PlayFab SDK.

Before start explaining the code...

I am considering that you have already imported the plugin into your project, defined the Title ID of your title in your Plugin Settings, have authenticated your player before the request, and have already registered the queue in PlayFab Dashboard.

I really enjoy making my code in modules, and this Repo is one of them. If you want to get to know why, I am adding this link with the explanation.

Dependencies

First we need to add our module dependencies. For this module we will be using:

  • "PlayFabCommon",
  • "PlayFabCpp",
  • "Core"
  • "Engine"
  • "CoreUObject"

So, add this a line like this:

PublicDependencyModuleNames.AddRange(new []{"Core","CoreUObject", "Engine", "YourProjectName", "PlayFabCommon", "PlayFabCpp"});

In your *.Build.cs File.

You will also need a

Exposing functions as Async Nodes in Unreal Engine

When working with PlayFab, most of the features that we are building are exposed to blueprints to be used with widgets. The JSON Response of the HTTP Requests are desserialized to a model Struct and passed as a delegate with relevant data for us, programmers to use. The bindings of these delegates can get pretty messy in blueprints, and as we never want to make Spaghetti code, I strongly suggest you to use Blueprint Async Action Base to code your PlayFab Features. This Link shows you how to create it.

The Service Class

In this Repo, the service class is the one responsible for executing the PlayFab Feature that we are implementing (Matchmaking). Here, I bind the delegates of PlayFab using BindUObject. This Link might help you to understand Delegates if you are not familiar with it.

The following image illustrates the Matchmaking process

Testing

In order to test, you will need to launch two different game processes, authenticate with two different accounts, and call UMatchmakingService::MatchmakingService in another class (or blueprint).

  • The WorldContextObject Parameter will be automatically assigned by UFUNCTION Macro.
  • The OwnerID is the returned as Entity ID by the authentication Process.
  • The QueueName is the queue name you registered in your PlayFab Dashboard.

playfab-unreal-cpp-matchmaking's People

Contributors

cordeiroandre avatar

Stargazers

 avatar

Watchers

 avatar

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.