# Help on networking -\> IOnlineSubsystem:;Get() always return null.

**URL:** <https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 20, 2014, 7:19am UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695 "2014-05-20T07:19:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![KillerPenguin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killerpenguin/32/1005607_2.png) [@KillerPenguin](https://forums.unrealengine.com/u/KillerPenguin)\
**Post date:** [May 20, 2014, 7:19am UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/1 "2014-05-20T07:19:07Z")

</div>

I’m trying to follow networking code from the shooter demo. However, when I call **IOnlineSubsystem::Get()** in my own project, it always returns nothing.  
Do I have to initialize it first or do something before hand? I couldn’t find such code in the sample so I’m kinda stucked. (Not to mention that most networks API pages are blanks.)

Would really appreciate it if someone can give me some pointer…

Best,

---

<div class="post-metadata">

**Author:** ![UnrealEverything](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealEverything](https://forums.unrealengine.com/u/UnrealEverything)\
**Post date:** [May 20, 2014, 8:31am UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/2 "2014-05-20T08:31:50Z")

</div>

Hi, I just recently subscribed so this might be completely wrong.  
Could this be related to some ini setting? There are a number of things in the Shooter Game 4.1\Config\DefaultEngine.ini that seem to be related to the OnlineSubsystem.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 20, 2014, 10:45am UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/3 "2014-05-20T10:45:18Z")

</div>

**[FONT=Comic Sans MS]Welcome to Unreal 4, UnrealEverything!!!**

❤

Rama

---

<div class="post-metadata">

**Author:** ![Overwrite\_Games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/overwrite_games/32/88710_2.png) [@Overwrite\_Games](https://forums.unrealengine.com/u/Overwrite_Games)\
**Post date:** [May 20, 2014, 11:26am UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/4 "2014-05-20T11:26:11Z")

</div>

Hey there KillerPenguin ^^

UnrealEverything is correct 🙂 You also have to enable OnlineSubsystem in your Game.Build.cs file like this:

```auto

      PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore", "HTTP", "OnlineSubsystem"}); <--- add "OnlineSubsystem" if not present :)

      PrivateDependencyModuleNames.AddRange(new string] {});

	// Uncomment if you are using Slate UI
	// PrivateDependencyModuleNames.Add("Slate");
		
	// Uncomment if you are using online features
	//PrivateDependencyModuleNames.Add("OnlineSubsystem"); <--- Uncomment this line

```

rescan your solution and you should be able to use it now 🙂 (The rescan is just in case Intellisense plays up, if you’re already able to access OnlineSubsystem then you may not have to follow this step 😛 )

MrNexy

---

<div class="post-metadata">

**Author:** ![KillerPenguin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killerpenguin/32/1005607_2.png) [@KillerPenguin](https://forums.unrealengine.com/u/KillerPenguin)\
**Post date:** [May 20, 2014, 11:02pm UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/5 "2014-05-20T23:02:34Z")

</div>

Gosh I remember reading about it when I was adding slate.

Thx! ^^;

---

<div class="post-metadata">

**Author:** ![KillerPenguin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killerpenguin/32/1005607_2.png) [@KillerPenguin](https://forums.unrealengine.com/u/KillerPenguin)\
**Post date:** [May 20, 2014, 11:41pm UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/6 "2014-05-20T23:41:50Z")

</div>

Hmm I added and rescan+rebuild the codes as follow:

> [@](#):
>
> PublicDependencyModuleNames.AddRange(new string] { “Core”, “CoreUObject”, “Engine”,“InputCore”,“OnlineSubsystem”,“OnlineSubsystemUtils”});  
> PrivateDependencyModuleNames.AddRange(new string] { “Slate”, “OnlineSubsystem”});

I still get nothing from IOnlineSubsystem::Get() though.

Worse yet, when I called:

> [@](#):
>
> IOnlineSubsystem\* mOnlineSubSystem = IOnlineSubsystem::Get();  
> check(mOnlineSubSystem);

It totally crashes UT4. Is there anything else I need to do first here?

ps. What’s this Sockets modules for though? Shouldn’t that also handle connection via UDP port? (What’s the point of IOnlineSubsystem then if I’m not connecting to Facebook etc…?)

---

<div class="post-metadata">

**Author:** ![Ryan\_Gerleve](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Gerleve](https://forums.unrealengine.com/u/Ryan_Gerleve)\
**Post date:** [May 21, 2014, 10:01pm UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/7 "2014-05-21T22:01:33Z")

</div>

> [@KillerPenguin;54279](#):
>
> … Is there anything else I need to do first here?

Hey Killer,

I realize this setup may be a bit confusing. The OnlineSubsystem module has some basic, common functionality that is shared between the concrete online subsystem implementations. These implementations are separate modules themselves, and must also be included in your dependencies. I recommend starting with OnlineSubsystemNull, as this will allow you to test multiplayer with multiple instances on one machine as well as over multiple machines on a LAN. Take a look at how ShooterGame includes OnlineSubsystemNull and OnlineSubsystemSteam.

Also, you may need to add

```auto

[OnlineSubsystem]
DefaultPlatformService=Null

```

in your DefaultEngine.ini config file (if you use something other than OnlineSubsystemNull though, change this line appropriately!).

> [@KillerPenguin;54279](#):
>
> ps. What’s this Sockets modules for though? Shouldn’t that also handle connection via UDP port? (What’s the point of IOnlineSubsystem then if I’m not connecting to Facebook etc…?)

The Sockets module does handle the low-level UDP (and TCP) connections. The online subsystems expose higher-level, usually platform-specific features and services, such as achievements, leaderboards, friends, etc.

---

<div class="post-metadata">

**Author:** ![KillerPenguin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killerpenguin/32/1005607_2.png) [@KillerPenguin](https://forums.unrealengine.com/u/KillerPenguin)\
**Post date:** [May 22, 2014, 12:24am UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/8 "2014-05-22T00:24:09Z")

</div>

Yes, I got it OnlineSubsystem working now. All that was missing was the proper DefaultEngine.ini config.

World be nice if you could get those network documents clear up though… Very hard to work with right now.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d988515c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d988515c](https://forums.unrealengine.com/u/anonymous_user_d988515c)\
**Post date:** [July 24, 2015, 12:07am UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/10 "2015-07-24T00:07:32Z")

</div>

Hello,  
I fully agree with KillerPenguin. OnlineSubsystem is really tricky to set up and there is no proper tutorial/documentation about it. would be nice if anyone from Unreal crew took their time and broke it down in “HowTo” document.

---

<div class="post-metadata">

**Author:** ![MadeInAm3rica](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MadeInAm3rica](https://forums.unrealengine.com/u/MadeInAm3rica)\
**Post date:** [April 17, 2023, 11:30pm UTC](https://forums.unrealengine.com/t/help-on-networking-ionlinesubsystem-get-always-return-null/4695/12 "2023-04-17T23:30:40Z")

</div>

Does it work in 5.1 ?
