x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] What is the lifetime of IOnlineSubsystem and it's SessionInterface?

What are the lifetimes of these online system objects? I'm working on a basic lobby manager class, and looking at ShooterGame for some examples. ShooterGame is constantly checking to see if they are valid. If I check once during initialization, can I be guaranteed that they will be around for the lifetime of my GameInstance object?

Product Version: Not Selected
Tags:
more ▼

asked Sep 07 '16 at 08:19 PM in Using UE4

avatar image

Answers.Archive STAFF
1.9k 209 316 689

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Sep 07 '16 at 08:19 PM by AndrewHurley for the following reason:

The question is answered, right answer was accepted


1 answer: sort voted first

Hi Brock,

ShooterGame is just being safe with the validity checks. It's always possible that a call to IOnlineSubsystem::Get() could return null if no OSS modules are found, which can happen if they're not compiled in to your project (such as if don't specify dependencies in Build.cs files). If you can guarantee that an appropriate OSS module will exist for your project, it should be valid for the entire time between calls to FOnlineSubsystemModule::GetOnlineSubsystem() (called by IOnlineSubsystem::Get()) and FOnlineSubsystemModule::DestroyOnlineSubsystem() (called by IOnlineSubsystem::Destroy() and IOnlineSubsystem::ReloadDefaultSubsystem()).

The pattern for the standard OSS implementations is to create their interface objects (including the session interface) in their Init() function and destroy them in their Shutdown() function. Just be careful because not all subsystems may implement every interface, and I can't guarantee that all future and/or third-party OSS implementations will continue to follow the same pattern.

more ▼

answered Sep 07 '16 at 08:19 PM

avatar image

Answers.Archive STAFF
1.9k 209 316 689

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question