Download

[BLOG] C++ Session Create/Find/Join/Destroy

Thanks for the reply eXi.

u.project right click switch unreal engine version 4.7 and open

LgvVZj.png

yes clicked the button

j1ggpW.png

log error


Log file open, 12/07/15 23:44:40
LogInit:Display: Running engine for game: NetworkSessionTest
LogInit:Warning: Incompatible or missing module: UE4Editor-NetworkSessionTest.dll
Running C:/Program Files/Epic Games/4.7/Engine/Binaries/DotNET/UnrealBuildTool.exe NetworkSessionTest Development Win64 -project="C:/Users/Tuncer/Desktop/NetworkSessionTest/NetworkSessionTest.uproject" -rocket -editorrecompile -progress
Performing 2 actions (4 in parallel)
[1/2] Resource NetworkSessionTest.rc

C:\Users\Tuncer\Desktop\NetworkSessionTest\Source\NetworkSessionTest\Resources\Windows\NetworkSessionTest.rc(68) : error RC2135 : file not found: ../../../../Build/Windows/Application.ico

-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: C:\Users\Tuncer\Desktop\NetworkSessionTest\Binaries\Win64\UE4Editor-NetworkSessionTest.dll
Cumulative action seconds (8 processors): 0.00 building projects, 0.14 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.00 linking, 0.00 other
UBT execution time: 6.39 seconds
LogExit: Preparing to exit.
LogModuleManager: Shutting down and abandoning module DesktopPlatform (14)
LogModuleManager: Shutting down and abandoning module TextureCompressor (13)
LogModuleManager: Shutting down and abandoning module ShaderCore (12)
LogModuleManager: Shutting down and abandoning module Landscape (11)
LogModuleManager: Shutting down and abandoning module SlateRHIRenderer (10)
LogModuleManager: Shutting down and abandoning module OpenGLDrv (9)
LogModuleManager: Shutting down and abandoning module D3D11RHI (8)
LogModuleManager: Shutting down and abandoning module Renderer (7)
LogModuleManager: Shutting down and abandoning module Engine (6)
LogModuleManager: Shutting down and abandoning module CoreUObject (5)
LogModuleManager: Shutting down and abandoning module NetworkFile (4)
LogModuleManager: Shutting down and abandoning module StreamingFile (3)
LogModuleManager: Shutting down and abandoning module SandboxFile (2)
LogModuleManager: Shutting down and abandoning module PakFile (1)
LogExit: Exiting.
Log file closed, 12/07/15 23:45:15


Why do you switch the engine version to 4.7? The Project already is in 4.7. Just open the sln file, build the project and open the uproject file.

It is definitely working in 4.7, since this was the original version i created it in.

open sln file visual studio development_editör x64 but
I get the same error

Ok so. Regarding your error, i tried doing that myself and it worked, but as i read you error, you might need the Application.ico file in the Build/Windows Folder.

Don’t ask me why this was working for all the whole time and now it’s broken (i did not touch the link since then).

Anyway, i reuploaded the files with the build folder now. Make sure to rightclick the uproject file and hit “Generate Visual Studio project files” to generate the Intermediate folder etc.

Then open the sln and try building again. If it throws warnings about the JoinSession functions etc, ignore them. It’s just a naming thing.

Thank you very much for the new file.succeeded open project :slight_smile:

You’re welcome (:

What is the server to management users/networking ? mysql ? php ?

The Server to management? You mean how you would go about saving user data in a database, out of reach for the clients?

Correct, exacly a game popular “League of Legends,HearthStone,WorldOfWarcraft…” save data (DATABASE) / SESSIONS (control flux ping and Range about disconnect : example 40-1.000 ping) / Control chat with others user, etc… Any guide ?

Thanks for this wiki.

Have you understand how the Matchmaking functions are working in the onlinesubsystem? This can be the next step once the session is created.

thanks,

Sadly no. This wiki entry happened because i was interested in Sessions and had time to fiddle with it.
Currently i have no project/time that would allow me to dig into the Matchmaking system ):

Unfortunately I can’t make it work, I keep getting:

Unrecognized type 'const' - type must be a UCLASS, USTRUCT or UENUM

At:

bool JoinSession(TSharedPtr<const FUniqueNetId> UserId, FName SessionName, const FOnlineSessionSearchResult& SearchResult);

My build.cs:


PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "OnlineSubsystemUtils", "UMG", "PhysX", "APEX", "RHI", "MoviePlayer" });
PrivateDependencyModuleNames.AddRange(new string] { "Slate", "SlateCore", "UMG", "MoviePlayer", "AIModule" });
		
DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");

My header includes and forward declaration:


#include "Engine/GameInstance.h"
#include "UnrealNetwork.h"
#include "Online.h"
#include "OnlineSubsystemUtils.h"
#include "Runtime/Online/OnlineSubsystem/Public/OnlineSubsystemTypes.h"
#include "Runtime/Online/OnlineSubsystem/Public/OnlineSessionSettings.h"
#include "Misc/TypesLibrary.h"
#include "NetGameInstance.generated.h"

class FOnlineSessionSearchResult;

Any ideas what is going on? :stuck_out_tongue:
Thanks.

Hi eXi.

Thanks for the time dedicated.
I’m making (sorry, trying to make) a multiplayer game.
It’d amazing to have a dedicated server but for now I settle of player-hosted sessions.

I have a Widget Blueprint for the menu with two buttons: **Host **and Join

How I call the Create session function you gave us from the Button_Click_Event of the Widget Blueprint?

Thanks!

Hey, in the wiki post, there is a section at the bottom dedicated to Blueprint Callable Functions. Create them in the GameInstance class, like all the other stuff
and in the Widget, you will just do “GetGameInstance”, Cast it to your custom GameInstance Class and then you should be able to call the BP Function.

Thanks.

I’ve been facing a lot of issues setting up the multiplayer for my game for a very long time.
This tutorial is gold, but I need to get more into that and figure out how to make it work properly.

I’m a C++ programmer in a one-team-based person (yuppi!), Can I count on you? I’ll be posting in this section of the forum for my issues.

For problems that are not related to this tutorial, please create new threads in the C++ Sub Forum. You can Tag me and if i have time, i will try to help.

I was looking at the tutorial on the Wiki (great work by the way!), and I wanted to download the source files, but the Google Drive link at the end seems to be broken. Do you still have the files?

Think this needs an update :0

The example project is no longer a valid link. Can we get a newer version up? :0

Anyone else who can get this to work in a example project want to take a stab for an example of the implemented code files?