Hello,
I was just wondering what the best approach to creating a session on a dedicated server would be? As it currently stands I have the ability to create sessions through the game client as a PlayerController can be assigned. However with dedicated servers I’m not sure where to start, or if they are even able to create a session.
That worked so far for me for testing in LAN on Linux Server. Be aware that tools like Virtual Box can block you from finding a session on your server.
Edit: You can then find the sessions on your dedicated server like you would find them in the ShooterGame or Multiplayer Shootout example. It is not necessary anymore with this to make a bp node or code to create session manually on server.
I think you have to change this afterwards when displaying the server in a widget and assign a string to it. Either in blueprint or code of your project.
Yeah I think I know what u mean. U can also try modifying something about FUniqueNetId or add another argument which is passed along from the created to every found session.
Still I think its possible afterwards. Look at the MultiplayerShootout. The first client (which should maybe be the admin) who gets a found session assigns a customized unique server name to the 24digits. Then this customized server name is assigned to the 24 digits during the duration the server stays up.
You then just save this correlation between 24 digits and your customized unique servername somewhere outside on a webserver. So when the 2nd client finds a session, it checks the webserver for any given correlation and the given 24 digits can only resolve to your customized server name.
The solution with a webserver will work, I already have a non-steam method setup like that. I’m just trying to see if there’s an in-engine method I could use to eliminate the need for a webserver. Thanks for you replies dude!
I am having an issue linking to OnlineSessionSettings.h
On build it through linker errors for this. I attempted to #include the .h but with no luck. Has anyone else encountered this?
Hey… I’m having the same problem as Retro11231…the issue with linker errors in GameSession.cpp… I have tried adding the OnlineSessionSettings.h but it does not resolve the FOnlineSessionSettings problem…Here is the error:
Module.Engine.5_of_30.cpp.obj : error LNK2019: unresolved external symbol “public: void __cdecl FVariantData::Empty(void)” (?Empty@FVariantData@@QEAAXXZ) referenced in function “public: __cdecl TPair::~TPair(void)” (??1?$TPair@VFName@@UFOnlineSessionSetting@@@@QEAA@XZ)
K-bob, you should not be editing the parent files in the engine. I think that is what you are doing maybe. You should create your own GameSession class and then override the RegisterServer function (which is a virtual function).
I will explain a bit more if you like.
cheers
Podge