How do I force the editor to play as ListenServer?

Hi, i’ve been dealing with some annoying NetNode states. Whenever, I Launch a game with 1 client and no dedicated server, the editor runs the game:
NetNode = NM_Standalone.

The problem with this mode is that none of my OnRep_functions get called breaking my gameplay. My current workaround is to run 2 clients which gives me the Primary player as the NM_ListenServer and the other player as NM_Client. However, I’m stuck with always playing with 2 players. I’m unable to disconnect the 2nd player as it closes out both instances.

I’m also just starting to work on some networking profiling, but I really need to just run one player.

Recap of questions:

  1. How do I force the editor to play a single client as a ListenServer?

  2. Is there a way to force “OnRep_functions” to execute in Standalone games?

Thanks! :slight_smile:

  1. You can add ?listen to the advanced settings for PIE and it should run as a listen server. I believe the value is LocalMapOptions

  2. See your other thread

thanks for the quick response. I’m having difficulty finding that option.

I have tried to put “?listen” under the “Multiplayer Options->Server Game Options” and I have tried to put it under the “Play in Standalone Game->Additional Launch Parameter”.

However, both do not start the ListenServer. I have looked for the “LocalMapOptions” but i’m not seeing that category or keyword.

You can add it to your DefaultEngine.ini

[/Script/EngineSettings.GameMapsSettings]
LocalMapOptions=

Or it should be under the “map settings” or “world settings” in the editor. Sorry I forget which off hand.

Hi Josh, Thank you for your continued support. I’m still having issues with making the editor start as ListenServer even after trying your suggestions. Let me recap on what I’ve done thus far:

I have put the “?listen” command in the following places besides the before mentioned places.

  1. ProjectSettings->Maps&Modes->DefaultMaps->Local Map Options

  2. DefaultEngine.ini → “LocalMapOptions=?listen”

  3. BaseEngine.ini → “LocalMapOptions=?listen”

  4. Engine.ini → “LocalMapOptions=?listen”

In the code I’m running the following:

GetNetMode() which returns : “NM_Standalone”

Thanks again. I wanted to double check everything to make sure I wasn’t newb’ing it up. :wink:

I’m looking into it. I know the ini setting will work when you launch your project outside the editor. Let me see what’s going on in the editor.

Looks like 1 client forces into standalone by design when launching in editor. If your main problem was OnRep, I think we’ve solved that in the other thread.

I’ll see about adding a “force listen server” option, but it may be low priority because running listen server with only 1 instance doesn’t seem to be that common. You either run dedicated + client or 2 clients (1 as listen).

Thanks for verifying that I wasn’t loosing my mind :slight_smile: It would be a nice feature to have when you guys get the more important features done :slight_smile:

The other thread fixed my main problem that spurred me into this issue :slight_smile: I found a temporary workaround. I run a single client from the editor and then just “open map?listen” after it starts. It then restarts the map for me so I can debug the listenserver state.

I appreciate the patience and support!