Skip to main content

Overview - Manage friends - (Unity module)

Last updated on June 12, 2024

Introduction

In any online environment, it's important to be able to manage and control who your friends are. This module shows you how to unfriend, block players, and unblock players.

Prerequisites

In order to complete this module, you will need:

  • To have completed the following module:

  • The Byte Wars tutorialmodules branch checked out in your local Byte Wars Unity project repository.

  • To force enable this module by adding the following code to the Assets/Resources/Modules/TutorialModuleConfig.json file:

      {
    "enableModulesOverride": true,
    "forceEnabledModules": ["ManagingFriends"],
    "forceDisabledOtherModules" : true,
    }

Learning objectives

At the end of this module, you will understand how to implement:

  • Blocking and unblocking players.
  • Displaying a list of blocked players.
  • Unfriending a friend.

Preview

At the end of this module, your project will look like the images below with the following logs:

Block a friend demo Unity Byte Wars manage friends

Success to block a player
Successfully block a user with an ID {UserID}

Unfriend a friend demo Unity Byte Wars manage friends

Success to unfriend
Successfully unfriend a friend with an ID {UserID}

Get blocked player list demo Unity Byte Wars manage friends

Success to load blocked users, total blocked users {count}

Unblock a player demo Unity Byte Wars manage friends

Success to unblock a player