# UE4 incompatible\_unique\_net\_id

**URL:** <https://forums.unrealengine.com/t/ue4-incompatible_unique_net_id/450088>\
**Category:** Platform & Builds\
**Tags:** dedicated-server, Steam, multiplayer-shooter, unreal-engine, UE4, question\
**Created:** [June 3, 2019, 9:08pm UTC](https://forums.unrealengine.com/t/ue4-incompatible_unique_net_id/450088 "2019-06-03T21:08:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RahulSode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RahulSode](https://forums.unrealengine.com/u/RahulSode)\
**Post date:** [June 3, 2019, 9:08pm UTC](https://forums.unrealengine.com/t/ue4-incompatible_unique_net_id/450088/1 "2019-06-03T21:08:32Z")

</div>

Hi,  
I am STUCK ,  
How to connect to a dedicated server with OnlinesubsystemNULL from a client with OnlinesubsystemSteam

---

<div class="post-metadata">

**Author:** ![chris-gong](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chris-gong/32/1106462_2.png) [@chris-gong](https://forums.unrealengine.com/u/chris-gong)\
**Post date:** [July 24, 2020, 1:24am UTC](https://forums.unrealengine.com/t/ue4-incompatible_unique_net_id/450088/2 "2020-07-24T01:24:55Z")

</div>

Make sure that you’re passing a valid value for the `UniqueId` parameter to the server’s game mode class’ `PreLogin` function. This function gets called every time a client connects to the server and it checks if the `UniqueId` parameter passed is “valid”, but it also checks if the type of the id’s type is the same as the online subsystem that is being used by the server. In your case, the online subsystem used in the client and server are different. Here’s the source code for the `PreLogin` function to give some more clarity,

```
 void AGameModeBase::PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage)
 {
     // Login unique id must match server expected unique id type OR No unique id could mean game doesn't use them
     const bool bUniqueIdCheckOk = (!UniqueId.IsValid() || (UniqueId.GetType() == UOnlineEngineInterface::Get()->GetDefaultOnlineSubsystemName()));
     if (bUniqueIdCheckOk)
     {
         ErrorMessage = GameSession->ApproveLogin(Options);
     }
     else
     {
         ErrorMessage = TEXT("incompatible_unique_net_id");
     }
 
     FGameModeEvents::GameModePreLoginEvent.Broadcast(this, UniqueId, ErrorMessage);
 }
```

---

<div class="post-metadata">

**Author:** ![D3lanK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@D3lanK](https://forums.unrealengine.com/u/D3lanK)\
**Post date:** [December 11, 2020, 12:03am UTC](https://forums.unrealengine.com/t/ue4-incompatible_unique_net_id/450088/3 "2020-12-11T00:03:38Z")

</div>

The subsystems need to match. If you do NULL on both sides, you need to connect via raw IP, if you do steam on both sides, then you need to connect using the command line open SteamID

[OnlineSubsystemSteam]  
bUseSteamNetworking=false  
… other stuff

[/Script/Engine.GameEngine]  
!NetDriverDefinitions=ClearArray  
NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName="/Script/OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")  
+NetDriverDefinitions=(DefName=“DemoNetDriver”,DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")

[OnlineSubsystem]  
DefaultPlatformService=Steam  
… other stuff

DO NOT HAVE  
[PacketHandlerComponents]  
[/Script/OnlineSubsystemSteam.SteamNetDriver

I then had to hack the engine in PendingNetGame.cpp by commenting out the following line  
//Connection-\>PlayerId = LocalPlayer-\>GetPreferredUniqueNetId();  
In order to fix the incompatible\_unique\_net\_id disconnect.

WARNING: I have zero clue what other ramifications there are having a default PlayerId, but I know that’s whats happening if you run the game via editor or run the game without the steam client running.

---

<div class="post-metadata">

**Author:** ![DarkRod](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DarkRod](https://forums.unrealengine.com/u/DarkRod)\
**Post date:** [October 9, 2022, 1:26pm UTC](https://forums.unrealengine.com/t/ue4-incompatible_unique_net_id/450088/4 "2022-10-09T13:26:16Z")

</div>

same problem ☹

---

<div class="post-metadata">

**Author:** ![Suundumused](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/suundumused/32/599389_2.png) [@Suundumused](https://forums.unrealengine.com/u/Suundumused)\
**Post date:** [February 14, 2023, 5:34am UTC](https://forums.unrealengine.com/t/ue4-incompatible_unique_net_id/450088/5 "2023-02-14T05:34:31Z")

</div>

it can fix, i think: [GameModeBase](https://steamcore.eeldev.com/docfiles/incompatible_unique_net_id/)
