Advanced Sessions Plugin

I’m using the Advanced Vehicle Template as a playground for a lobby system I’m working on, however I’m running into some issues. When I play in the editor it works fine, I can create sessions and I can join them - but when I package the game I am unable to find any sessions. Here’s how I create my advanced session*(screenshots are linked)*;
http://i.imgur.com/9yirZevm.png

Neither strings are being output, so it doesn’t seem like it’s failing. Here’s how I search for sessions;
http://i.imgur.com/3tKxIGzm.png

Again, string isn’t being output. But the refreshing is done very fast, much faster than it’s done in the editor. Whether this is supposed to be or points towards something being wrong - I don’t know.

Target.cs;


Type = TargetType.Game;
bUsesSteam = true;

Build.cs;


PublicDependencyModuleNames.AddRange(new string] {
         "OnlineSubsystem",
        "OnlineSubsystemUtils"
});

DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");

DefaultEngine.ini;


[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
 
[OnlineSubsystem]
DefaultPlatformService=Steam
PollingIntervalInMs=20
bHasVoiceEnabled=true
 
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
GameServerQueryPort=27015
bRelaunchInSteam=false
GameVersion=1.0.0.0
bVACEnabled=1
bAllowP2PPacketRelay=true
P2PConnectionTimeout=90

[Voice] 
bEnabled=true
 
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="/Script/OnlineSubsystemSteam.SteamNetConnection"

If you can spot some error on my end or have any ideas as to what may be wrong - I’d greatly appreciate it!

Edit:

I just noticed this when packaging the game;


MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: Execution of commandlet took:  20.58 seconds
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.05.05-21.15.14:040]  0]LogOnline:Display: NULL: FOnlineSubsystemNull::Shutdown()
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.05.05-21.15.14:040]  0]LogOnline:Display: Unloading online subsystem: STEAM
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.05.05-21.15.14:040]  0]LogOnline:Display: Unloading online subsystem: NULL
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 26,5209299s to run UE4Editor-Cmd.exe, ExitCode=0

Is that normal or…? :rolleyes:

1 Like

That is normal it means that steam loaded and then was shut down, make sure that your build.cs also has included “AdvancedSessions” as loaded module as well with c++ projects.

1 Like

[QUOTE=;525256]
That is normal it means that steam loaded and then was shut down, make sure that your build.cs also has included “AdvancedSessions” as loaded module as well with c++ projects.

Alright, I’ll give it a try. If you don’t mind, could you briefly explain what Use Presence and Use Stats mean? I’ve searched this thread but wasn’t able to find any info :slight_smile:

Edit:

Adding “AdvancedSessions” to the module list in Build.cs and also using Use Presence(and stats?) seem to work. I’ve still got to figure out what’s the best way to try this stuff since I can’t use ServerTravel when testing via the editor.

Edit2:

I’ve tried it with 3 of my friends, 2 of them are from US and one is from the UK. I could play with my British friend just fine, however it seems like sessions do not show up if hosted in the US*(I live in Sweden)*. We tried using TeamViewer VPN as well but that didn’t help.

Any ideas?

1 Like

Hi, how am I supposed to have a dedicated server create a session? In which blueprint do I do this in? Game Instance?

Thank you

1 Like

Hi,

I used your plugin to create my multiplayer. It worked pretty fine, but I cant package and cook my game.
I get multiple errors called


error LNK2001: unresolved external symbol "wchar_t * GInternalGameName" (?GInternalGameName@@3PA_WA)

If you need the full log: http://www.file-upload.net/download-11562384/Billiard-backup-2016.05.10-00.28.31.log.html

Maybe you know this error. I did a lot to fix it but without success.

I hope you can help me :slight_smile:

Greetings
Shmann

1 Like

[QUOTE=;525270]
Alright, I’ll give it a try. If you don’t mind, could you briefly explain what Use Presence and Use Stats mean? I’ve searched this thread but wasn’t able to find any info :slight_smile:

Edit:

Adding “AdvancedSessions” to the module list in Build.cs and also using Use Presence(and stats?) seem to work. I’ve still got to figure out what’s the best way to try this stuff since I can’t use ServerTravel when testing via the editor.

Edit2:

I’ve tried it with 3 of my friends, 2 of them are from US and one is from the UK. I could play with my British friend just fine, however it seems like sessions do not show up if hosted in the US*(I live in Sweden)*. We tried using TeamViewer VPN as well but that didn’t help.

Any ideas?

Hmm edits don’t show as new posts to my feed so I missed this.

If you are using steam then the default 480 app ID is region locked so you’ll run into issues testing across borders in some cases. If you aren’t then I don’t know why they couldn’t connect.

Presence is how the server advertises itself, you’ll want it turned on unless it is a dedicated server.

[QUOTE=vanlacke;527412]
Hi, how am I supposed to have a dedicated server create a session? In which blueprint do I do this in? Game Instance?

Thank you

Game instance should work, that being said dedicated hosting is a tad untested since my last changes right now. Someone was trying to test it but I think their implementation might have been wrong. I have not had the time yet to build my own dedicated server yet to test myself.

[QUOTE=Shmann;527506]
Hi,

I used your plugin to create my multiplayer. It worked pretty fine, but I cant package and cook my game.
I get multiple errors called


error LNK2001: unresolved external symbol "wchar_t * GInternalGameName" (?GInternalGameName@@3PA_WA)

If you need the full log: File-Upload.net - Datei nicht gefunden

Maybe you know this error. I did a lot to fix it but without success.

I hope you can help me :slight_smile:

Greetings
Shmann

I looked at your log file, none of the unresolved externals have anything to do with my plugin. GInternalGameName comes from CoreGlobals.h and is set in Core.cpp, make sure that your build.cs has Core as a dependant module and if that doesn’t work then you’ll need to take it to answerhub as something is messed up with your UBT.

1 Like

[QUOTE=;527572]
Hmm edits don’t show as new posts to my feed so I missed this.

If you are using steam then the default 480 app ID is region locked so you’ll run into issues testing across borders in some cases. If you aren’t then I don’t know why they couldn’t connect.

Presence is how the server advertises itself, you’ll want it turned on unless it is a dedicated server.

Game instance should work, that being said dedicated hosting is a tad untested since my last changes right now. Someone was trying to test it but I think their implementation might have been wrong. I have not had the time yet to build my own dedicated server yet to test myself.

I looked at your log file, none of the unresolved externals have anything to do with my plugin. GInternalGameName comes from CoreGlobals.h and is set in Core.cpp, make sure that your build.cs has Core as a dependant module and if that doesn’t work then you’ll need to take it to answerhub as something is messed up with your UBT.

Thanks for your quick reply. Sry if this problem was not from your plugin. I checked if Core is a module in my build.cs and it´s true. The module is called there. So I download UE4 on a second pc and test my project there. Maybe this helps.

1 Like

[QUOTE=;527572]
Hmm edits don’t show as new posts to my feed so I missed this.

If you are using steam then the default 480 app ID is region locked so you’ll run into issues testing across borders in some cases. If you aren’t then I don’t know why they couldn’t connect.

Presence is how the server advertises itself, you’ll want it turned on unless it is a dedicated server.

No worries! Aye, I am indeed using the test app. Seems rather odd that they’d have it region locked when it’s using for testing…? :rolleyes: At least that answers some things, I was scratching my head about this, thinking maybe the plugin had some built-in ping filter that was on by default.

1 Like

[QUOTE=;527572]
Hmm edits don’t show as new posts to my feed so I missed this.

If you are using steam then the default 480 app ID is region locked so you’ll run into issues testing across borders in some cases. If you aren’t then I don’t know why they couldn’t connect.

Presence is how the server advertises itself, you’ll want it turned on unless it is a dedicated server.

Game instance should work, that being said dedicated hosting is a tad untested since my last changes right now. Someone was trying to test it but I think their implementation might have been wrong. I have not had the time yet to build my own dedicated server yet to test myself.

I looked at your log file, none of the unresolved externals have anything to do with my plugin. GInternalGameName comes from CoreGlobals.h and is set in Core.cpp, make sure that your build.cs has Core as a dependant module and if that doesn’t work then you’ll need to take it to answerhub as something is messed up with your UBT.

I fixed my problem “unresolved symbol” as I put in “IMPLEMENT_PRIMARY_GAME_MODULE(FDefaultGameModuleImpl, <ModuleName>, “<GameName>”);” into advanced sessions .cpp files.
Now I get some others errors from the plugin. Do you know these? Or is it possible to set a pimary game module into your plugin?

Here´s my log with the plugin errors:

I hope you can help me. That would help me a lot to fix my hole problems :frowning:

Greetings

1 Like

[QUOTE=Shmann;527874]
I fixed my problem “unresolved symbol” as I put in “IMPLEMENT_PRIMARY_GAME_MODULE(FDefaultGameModuleImpl, <ModuleName>, “<GameName>”);” into advanced sessions .cpp files.
Now I get some others errors from the plugin. Do you know these? Or is it possible to set a pimary game module into your plugin?

Here´s my log with the plugin errors:

I hope you can help me. That would help me a lot to fix my hole problems :frowning:

Greetings

You didn’t fix it, you redefined it inside of the classes, that is why it is complaining about it and not throwing the other errors, it hasn’t gotten to them yet as you created new ones.

Says that you should pick one of your modules and set it to the primary like you attempted to do, however you do this in YOUR project, not in the plugin. I am assuming that you created additional code modules or erased the original line as by default UE4 generates that line for you. Something is messed up with your project, the plugin packages fine.

1 Like

Thanks Mord got dedicated server hosted, broadcasting, and successfully found through steam.

Glad I didn’t have to do it all through c++ like on my last project, great plugin!

I still need to have someone outside of my network test finding/joining (and other tests), but looks good so far.

1 Like

[QUOTE=vanlacke;527976]
Thanks Mord got dedicated server hosted, broadcasting, and successfully found through steam.

Glad I didn’t have to do it all through c++ like on my last project, great plugin!

I still need to have someone outside of my network test finding/joining (and other tests), but looks good so far.

Did you do anything special? Not having built a dedicated server myself yet I haven’t been able to help a couple of guys in here but I get the feeling that their dedicated setup may be incorrect. I didn’t see any logical reason why it wouldn’t work after my last update.

1 Like

Hi ,
Sorry to ask again a new question, but i’ve some problems with Register/Unregister player functions.

If i want that a player dont hear and speak with me, i’ve to unregister him. But how ?
I use a server call which know both BPUnique Net ID (mine and the other player) - it call a Unregister remote player using the other player Net ID. But nothing…
What is the best way to implement that ?

Another question: is there a way to clear audio buffer if there is too much lag ?

1 Like

[QUOTE=benicourt;528769]
Hi ,
Sorry to ask again a new question, but i’ve some problems with Register/Unregister player functions.

If i want that a player dont hear and speak with me, i’ve to unregister him. But how ?
I use a server call which know both BPUnique Net ID (mine and the other player) - it call a Unregister remote player using the other player Net ID. But nothing…
What is the best way to implement that ?

Another question: is there a way to clear audio buffer if there is too much lag ?

Don’t unregister on the server, unregister on the client, each client has its own voice registration and there isn’t any code replicating the registration to the owning player from the server in their interface as far as I can tell.

The audio buffer isn’t directly accessible no, there might be a way to get access to it somehow but I wouldn’t know it off the top of my head.

1 Like

Thanks ,
So i have to use unregister remote talker on client. But, Unique Net ID is accessible only on server, no ? I can store it into String, but there is no function to reverse (String To BPUniqueID). And if i store it into a variable BPuniqueID, it seems to use directly the client ID, not the one that i’ve stored.

Edit: ok, i can’t store this value, but i can obtain it from clients using playerstates.
I only have to use unregister remote talker from my character (for example) with the good Unique Net ID and i won’t heard and be able to speak this player ?

1 Like

That’s what i do:

In player Character: get all actors of class “Character”,
For each elt:
…if elt.team == my.team
…if elt != my then register remote talker (elt.netId)
…else unregister remote talker (elt.netId)

But it’s not functionning… my can speak with elt !
There is another config to do (push to talk? implement an interface?)

1 Like

[QUOTE=benicourt;528849]
That’s what i do:

In player Character: get all actors of class “Character”,
For each elt:
…if elt.team == my.team
…if elt != my then register remote talker (elt.netId)
…else unregister remote talker (elt.netId)

But it’s not functionning… my can speak with elt !
There is another config to do (push to talk? implement an interface?)

You don’t have to register, they are already registered, you only have to register them if they were unregistered at some point.

Are you getting any log errors when unregistering?

1 Like

Unregister remote function return FALSE, but no error message

I don’t think so… here is a log example (server side):
“[2016.05.12-09.39.45:887][902]LogInit: WinSock: Socket queue 131072 / 131072
[2016.05.12-09.39.45:888][902]LogNet: GameNetDriver IpNetDriver_1 IpNetDriver listening on port 7777
[2016.05.12-09.39.45:889][902]LogWorld: Bringing World /Game/TheGame/Maps/Level1.Level1 up for play (tick rate 0) at 2016.05.12-11.39.45
[2016.05.12-09.39.45:889][902]LogWorld: Bringing up level for play took: 0.001034
[2016.05.12-09.39.45:891][902]LogOnline:Warning: NULL: Can’t start an online session (Game) in state InProgress
[2016.05.12-09.39.45:919][904]LogRenderTargetPool:Warning: r.RenderTargetPoolMin exceeded 417/400 MB (ok in editor, bad on fixed memory platform)
[2016.05.12-09.39.46:050][904]LogNet: NotifyAcceptingConnection: Server Level1 accept
[2016.05.12-09.39.46:051][904]LogNet: NotifyAcceptedConnection: Name: Level1, TimeStamp: 05/12/16 11:39:46, [UNetConnection] RemoteAddr: 192.168.1.13:59564, Name: IpConnection_1, Driver: GameNetDriver IpNetDriver_1, IsServer: YES, PC: NULL, Owner: NULL
[2016.05.12-09.39.46:051][904]LogNet: AddClientConnection: Added client connection: [UNetConnection] RemoteAddr: 192.168.1.13:59564, Name: IpConnection_1, Driver: GameNetDriver IpNetDriver_1, IsServer: YES, PC: NULL, Owner: NULL
[2016.05.12-09.39.46:051][904]LogNetTraffic:Warning: High single frame packet loss. PacketsLost: 19 [UNetConnection] RemoteAddr: 192.168.1.13:59564, Name: IpConnection_1, Driver: GameNetDriver IpNetDriver_1, IsServer: YES, PC: NULL, Owner: NULL
[2016.05.12-09.39.46:083][906]LogNet: NotifyAcceptingChannel Control 0 server World /Game/TheGame/Maps/Level1.Level1: Accepted
[2016.05.12-09.39.46:083][906]LogNet: Remote platform little endian=1
[2016.05.12-09.39.46:083][906]LogNet: This platform little endian=1
[2016.05.12-09.39.46:083][906]LogNet: GetLocalNetworkVersion: GEngineNetVersion: 2946394, ProjectName: lobbyproject, ProjectVersion: 1.0.0.0, InternalProtocolVersion: 9, LocalNetworkVersion: 2979613088
[2016.05.12-09.39.46:115][908]LogNet: Login request: /Game/TheGame/Maps/Level1?game=/Game/Lobby/LobbyGameMode.LobbyGameMode_C?Name=CYTELLE2-DEA33D80400702517BAFF392C6F92DB1 userId: CYTELLE2-DEA33D80400702517BAFF392C6F92DB1
[2016.05.12-09.39.46:148][910]LogNet: Client netspeed is 10000
[2016.05.12-09.39.46:293][919]LogNet: Join request: /Game/TheGame/Maps/Level1?game=/Game/Lobby/LobbyGameMode.LobbyGameMode_C?Name=CYTELLE2-DEA33D80400702517BAFF392C6F92DB1?SplitscreenCount=1
[2016.05.12-09.39.46:296][919]LogNet: Join succeeded: CYTELLE2-DEA33D80400
[2016.05.12-09.39.46:326][921]LogNet:Warning: Network saturated
[2016.05.12-09.39.46:326][921]LogNet:Warning: Dropped 1 packets due to congestion in the voicechannel
[2016.05.12-09.39.46:520][934]LogVoiceDecode:Display: DecoderVersion: libopus 1.1-beta
[2016.05.12-09.39.53:926][392]LogBlueprintUserMessages: [MyCharacters_C_0] CYTELLE-FB0C42A749DCB6499123BE8BE5AD287C - Team 1 register: CYTELLE-FB0C42A749DCB6499123BE8BE5AD287C - Team 1
[2016.05.12-09.39.53:926][392]LogBlueprintUserMessages: [MyCharacters_C_0] CYTELLE-FB0C42A749DCB6499123BE8BE5AD287CTeam 1 unregister: CYTELLE2-DEA33D80400702517BAFF392C6F92DB1 - Team 2
[2016.05.12-09.39.53:926][392]LogBlueprintUserMessages: [MyCharacters_C_0] TEAM MODE
[2016.05.12-09.39.54:089][403]LogVoiceDecode:Display: DecoderVersion: libopus 1.1-beta
[2016.05.12-09.40.09:402][351]LogBlueprintUserMessages: [MyCharacters_C_1] CYTELLE2-DEA33D80400702517BAFF392C6F92DB1Team 2 unregister: CYTELLE-FB0C42A749DCB6499123BE8BE5AD287C - Team 1
[2016.05.12-09.40.09:402][351]LogBlueprintUserMessages: [MyCharacters_C_1] CYTELLE2-DEA33D80400702517BAFF392C6F92DB1 - Team 2 register: CYTELLE2-DEA33D80400702517BAFF392C6F92DB1 - Team 2
[2016.05.12-09.40.49:881][839]LogWindowsTextInputMethodSystem:Display: IME system now deactivated.
[2016.05.12-09.40.49:889][839]LogEngine: All Windows Closed
[2016.05.12-09.40.49:890][839]LogWindows: FPlatformMisc::RequestExit(0)
[2016.05.12-09.40.50:486][840]LogNet: World NetDriver shutdown IpNetDriver_1 [GameNetDriver]
[2016.05.12-09.40.50:486][840]LogNet: DestroyNamedNetDriver IpNetDriver_1 [GameNetDriver]
[2016.05.12-09.40.50:487][840]LogNet: UNetConnection::Cleanup: Closing open connection. [UNetConnection] RemoteAddr: 192.168.1.13:59564, Name: IpConnection_1, Driver: GameNetDriver IpNetDriver_1, IsServer: YES, PC: PlayerController_1, Owner: PlayerController_1
[2016.05.12-09.40.50:487][840]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 192.168.1.13:59564, Name: IpConnection_1, Driver: GameNetDriver IpNetDriver_1, IsServer: YES, PC: PlayerController_1, Owner: PlayerController_1, Channels: 9, Time: 2016.05.12-09.40.50
[2016.05.12-09.40.50:487][840]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 192.168.1.13:59564, Name: IpConnection_1, Driver: GameNetDriver IpNetDriver_1, IsServer: YES, PC: PlayerController_1, Owner: PlayerController_1
[2016.05.12-09.40.50:488][840]LogExit: GameNetDriver IpNetDriver_1 shut down
[2016.05.12-09.40.50:614][840]LogExit: Preparing to exit.
[2016.05.12-09.40.50:720][840]LogExit: Game engine shut down”

1 Like

ok, after more tests:
The first time i call Unregister Remote Talker, it says true (but no effect) and the second time False. It’s seems to be normal (except it’s not functionning)

I’ve tested with Remove All Remote Talkers… no error… no effect :frowning:

To clear the buffer: FOnlineVoiceImpl::ClearVoicePackets() i think - i have to implement it in your plugin

Any idea?

1 Like

Well I found the problem…


    virtual uint32 RegisterRemoteTalker(const FUniqueNetId& UniqueId) override
	{
		// Not needed in Steam
		return S_OK;
	}

    virtual uint32 UnregisterRemoteTalker(const FUniqueNetId& UniqueId) override
	{
		// Not needed in Steam
		return S_OK;
	}

The steam subsystem doesn’t implement the registering functions.

So instead use the mute functions I provided instead, its not as nice as being able to unregister the other team, but it will do the same thing.


bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId)

bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)

bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)

ClearVoicePackets() clears the local players queued voice packets, is that what you actually want?

1 Like