FPlayTimeLimitImpl

Implementation of [IOnlinePlayTimeLimit](API\Plugins\OnlineSubsystem\Interfaces\IOnlinePlayTimeLimit)

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

PlayTimeLimit

Header

/Engine/Plugins/Online/OnlineFramework/Source/PlayTimeLimit/Public/PlayTimeLimitImpl.h

Include

#include "PlayTimeLimitImpl.h"

Syntax

class FPlayTimeLimitImpl : public IOnlinePlayTimeLimit

Remarks

Implementation of IOnlinePlayTimeLimit

Variables

Name Description

Protected variable

TArray< FOnline...

 

ConfigRates

Configuration to control notification rate at different levels of play time

Protected variable

double

 

LastTickLogicTime

Last time we performed tick logic

Public variable

OnRequestCreate...

 

OnRequestCreateUser

Protected variable

FDelegateHandle

 

TickHandle

Delegate for callbacks to Tick

Protected variable

TArray< FPlayTi...

 

Users

List of users we are monitoring

Protected variable

FWarnUserPlayTi...

 

WarnUserPlayTimeDelegate

Delegate used to display a warning to the user about their play time

Constructors

Name Description

Public function

FPlayTimeLimitImpl()

Default constructor

Destructors

Name Description

Public function Virtual

~FPlayTimeLimitImpl()

Destructor

Functions

Name Description

Public function

void

 

DumpState()

Dump state to log

Public function Static

FPlayTimeLim...

 

Get()

Get the singleton

Public function Const

const FOnlin...

 

GetConfigEntry

(
    const int32 PlayTimeMinutes
)

Get the config entry that corresponds to the number of minutes played

Public function

void

 

Initialize()

Initialize

Public function

void

 

MockUser

(
    const FUniqueNetId& UserId,
    const bool bHasTimeLimit,
    const double CurrentPlayTimeMinutes
)

Override a user's play time For testing the system without needing to potentially wait hours - waiting to accumulate time and waiting for the time to reset

Public function

void

 

NotifyNow()

Cheat function to trigger the notification to players of their play time immediately

Public function

void

 

RegisterUser

(
    const FUniqueNetId& NewUser
)

Register a user to monitor their play time

Public function

void

 

Shutdown()

Shutdown

Public function

bool

 

Tick

(
    float Delta
)

Tick - update users and execute warn time delegates

Public function

void

 

UnregisterUser

(
    const FUniqueNetId& UserId
)

Unregister a user

Protected function Const

void

 

UpdateNextNotificationTime

(
    FPlayTimeLimitUser& User,
    const int32 PlayTimeMinutes
)

Update the next notification time for a user based on their current play time

Overridden from IOnlinePlayTimeLimit

Name Description

Public function Virtual

int32

 

GetPlayTimeMinutes

(
    const FUniqueNetId& UserId
)

Get the play time in minutes for the user

Public function Virtual

float

 

GetRewardRate

(
    const FUniqueNetId& UserId
)

Get the reward amount multiplier for the user Expected to start at 1.0 (full rewards), and is reduced based on their play time

Public function Virtual

FWarnUserPla...

 

GetWarnUserPlayTimeDelegate()

Delegate called when a warning should be displayed to the user. See FWarnUserPlayTimeDelegate

Public function Virtual

bool

 

HasTimeLimit

(
    const FUniqueNetId& UserId
)

Begin IOnlinePlayTimeLimit.

Typedefs

Name

Description

OnRequestCreateUserDelegate

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback