Joining MMORoom & Room causing mmoItems to disappear

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Joining MMORoom & Room causing mmoItems to disappear

Postby genar » 25 Jul 2018, 18:26

Hey there !

Once my player logs in he will be transfered into two different rooms... first into the "Game" room ( MMORoom ) and after that into the "GlobalChat" room ( Just a normal room )...

Code: Select all

   getApi().joinRoom(user , getParentExtension().getParentZone().getRoomByName(Rooms.Game), null, false, null);
      getApi().joinRoom(user , getParentExtension().getParentZone().getRoomByName(Rooms.GlobalChat), null, false, null);


Well i noticed that once the player joins the GlobalChat ( normal room ) he wont receive any mmoItems and other proximity related stuff anymore... no exceptions... no warning or error logs... the player just dont receive any mmoRoom specific events anymore... no mmoItem updates for example...

When i change the join order ... the player doesnt even interact with the mmoRoom anymore...

Once the player only stays in the mmoRoom everything is fine. Is this normal ? Anyway to prevent this ?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby Lapo » 26 Jul 2018, 07:00

Hi,
what SFS2X version are you running please?

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby genar » 26 Jul 2018, 07:56

Lapo wrote:Hi,
what SFS2X version are you running please?

Cheers


Im running 2.13 ... didn't updated in a long time.
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby genar » 26 Jul 2018, 15:21

If someone could tell me where exactly i can see what client and server api i am using, i could give more informations... but i can confirm that the smartfoxserver is 2.13.0
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby genar » 30 Jul 2018, 08:24

Lapo wrote:Hi,
what SFS2X version are you running please?

Cheers


Any ideas ? Its honestly very important...
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby Lapo » 30 Jul 2018, 10:06

Hi,
sorry for the delay. I've tried reproducing the problem with no success.

1) Join USER A in MMORoom
2) Set USER A position in MMORoom
3) Join USER A in Chat Room

4) Join USER B in MMORoom
5) Set USER B position in MMORoom
6) Join USER B in Chat Room

at this point both USER A and B receive the relative updates about each other. So there's nothing out of order here.

Are you sure you're using the same flow? Also are you sure there aren't any server side errors? Have you checked the logs?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby Lapo » 30 Jul 2018, 10:14

Additional questions: what client type are you testing with? What version?
Also if it's Unity what build target are you using?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby genar » 30 Jul 2018, 11:25

Lapo wrote:Additional questions: what client type are you testing with? What version?
Also if it's Unity what build target are you using?

Thanks



Thanks for your answer ! :)

Well probably not the same flow.. When my user logs in, I move make him join both rooms server side, first the mmoRoom, than the normal one ( Code in my last post ) ... The mmoRoom position is set by the client after the joining of both rooms via a request, that could probably be the iusse...

Otherwise my build target is android :) and im using Unity 2017.01 and im testing it via the editor.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby Lapo » 30 Jul 2018, 14:02

Hi,
can you show me the code used to set the user's position on the client side?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby Bax » 30 Jul 2018, 16:12

I just tested this "multi-room-join" scenario using the MMORoom Demo project available in the Unity examples.
After joining the MMO Room, I joined a non-mmo lobby Room. Everything works as expected, the position of all objects is updated and view behaves accordingly.
So I believe something else is going on here...
Paolo Bax
The SmartFoxServer Team
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: Joining MMORoom & Room causing mmoItems to disappear

Postby genar » 30 Jul 2018, 17:50

Bax wrote:I just tested this "multi-room-join" scenario using the MMORoom Demo project available in the Unity examples.
After joining the MMO Room, I joined a non-mmo lobby Room. Everything works as expected, the position of all objects is updated and view behaves accordingly.
So I believe something else is going on here...



Thanks a lot for your support ! The last posts about setting the position solved this ridiculous riddle...

For all with the same problem... when joining multiple rooms... dont set the position client side like this :

Code: Select all

 
 sfs.Send(new SetUserPositionRequest(new Vec3D(latLngPos.x, latLngPos.y, 0));


This will send the Request to the last joined room... in my case to the chat room which cant process this request...
Do it like this instead :

Code: Select all

 
sfs.Send(new SetUserPositionRequest(new Vec3D(latLngPos.x, latLngPos.y, 0), sfs.RoomManager.GetJoinedRooms()[0]));


This will send the request to the first joined room... in my case the mmoRoom => Proximity Updates get called !
Attachments
Unbenannt.PNG
(6.26 KiB) Not downloaded yet

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 43 guests