Not able to get Event/Custom Commands in Unity

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

nik0990
Posts: 76
Joined: 23 Dec 2016, 10:48
Location: India

Not able to get Event/Custom Commands in Unity

Postby nik0990 » 07 Feb 2019, 11:30

Hi,

I am using SFS 2.13.0 Server for Unity WebGL Client(new API).

I am facing issue in Multi-Platform logging. In this,
While Same User moving from one platform to other, We have functionality to remove old instance(working from last 4 years) and create new instance(We make player disconnect from old instance using custom command so that new login request get fulfilled successfully ). This is working properly for non unity client. But we have below issue with unity client.

One user is logged in at one Platform(Unity-WebGL) and same Player tries to log-in from another platform(Android-Build in Unity), But in this case old instance not disconnected(Client not receiving custom command/Event sent from Server ) and shows already logged-in at new instance.
Also for already logged -in user its throwing below error
"
In web we are getting this response [SFS - ERROR] [WebSocketLayer] Communication error: Disconnected. b14b32a200649d0650c1a6ff3db39cf4.js:1:8002

On connection lostreason -------> unknown
"

Please help.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Not able to get Event/Custom Commands in Unity

Postby Lapo » 07 Feb 2019, 14:24

Hello,
nik0990 wrote:Hi,
While Same User moving from one platform to other, We have functionality to remove old instance(working from last 4 years) and create new instance(We make player disconnect from old instance using custom command so that new login request get fulfilled successfully ). This is working properly for non unity client. But we have below issue with unity client.

It looks like you have re-implemented the force-logout mechanism that is already built in SFS2X.

One user is logged in at one Platform(Unity-WebGL) and same Player tries to log-in from another platform(Android-Build in Unity), But in this case old instance not disconnected(Client not receiving custom command/Event sent from Server ) and shows already logged-in at new instance.

Also for already logged -in user its throwing below error...

This is a little bit confusing, because if you use the force-logout option (by configuring your Zone) you don't need to send custom commands or add any other logic. When the same User logs in from another device the previous connection is closed down, so the new session can be started.

Without knowing the details of your custom disconnection system it's quite difficult to imagine what might be the problem.

Thanks.
Lapo
--
gotoAndPlay()
...addicted to flash games
nik0990
Posts: 76
Joined: 23 Dec 2016, 10:48
Location: India

Re: Not able to get Event/Custom Commands in Unity

Postby nik0990 » 08 Feb 2019, 07:44

Hi lapo,
Thanks for your reply.

We are using force-logout-option (configure on zone), which is making old user instance disconnected (disconnection reason comes unknown on client side)but this trigger re-connection process from client and eventually another instance of same user gets message that You are already logged-in the zone with login -error event at client side.

I also tried to use user.disconnect(ClientDisconnectionReason.KICK) method in my custom extension so that at client side if Connection_Lost event trigger with KICK reason they can stop re-connection process.
In android build (made on unity platform) client is receiving KICK reason for connection _lost but on webGL build its not receiving KICK reason instead it coming unknown.
How can I stop re-connection process in this scenario?
nik0990
Posts: 76
Joined: 23 Dec 2016, 10:48
Location: India

Re: Not able to get Event/Custom Commands in Unity

Postby nik0990 » 26 Feb 2019, 10:24

Can you please help?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Not able to get Event/Custom Commands in Unity

Postby Lapo » 26 Feb 2019, 10:50

Hi,
sorry for the delay. It looks like I did not get a notification for your last reply. :?

I can't reproduce the problem with your settings, even by activating the reconnecting and the "Force Logout" the clients are working as expected. It's true that the client that is kicked out will attempt to reconnect but it will fail, so the last login always wins.

In android build (made on unity platform) client is receiving KICK reason for connection _lost but on webGL build its not receiving KICK reason instead it coming unknown.

Seems weird. What version of the Unity API are you using?
Also what version of SFS2X are you using?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
DrPsyche
Posts: 8
Joined: 09 Jan 2019, 11:47

Re: Not able to get Event/Custom Commands in Unity

Postby DrPsyche » 22 Mar 2019, 09:15

Hi lapo,
Thanks for your reply.

We are using force-logout-option (configure on zone), which is making old user instance disconnected (disconnection reason comes unknown on client side)but this trigger re-connection process from client and eventually another instance of same user gets message that You are already logged-in the essay service zone with login -error event at client side.
I also tried to use user.disconnect(ClientDisconnectionReason.KICK) method in my custom extension so that at client side if Connection_Lost event trigger with KICK reason they can stop re-connection process.
In android build (made on unity platform) client is receiving KICK reason for connection _lost but on webGL build its not receiving KICK reason instead it coming unknown.
How can I stop re-connection process in this scenario?


Hi there,

Have you managed to find the solution? My client has the same issue, as it seems. He says it happened after upgrading to the latest versions (both the Unity Client API and SFS2X). What could be the reason?

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 27 guests