"User cannot invoke room extension..." - After a while?

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

Moderators: Lapo, Bax

Sinkist
Posts: 9
Joined: 02 May 2017, 12:56

"User cannot invoke room extension..." - After a while?

Postby Sinkist » 02 May 2017, 13:31

Hey there!

Im using Windows 10 and Unity as Client.
And Windows 8 as Server with Smartfox (2.11.1) and an Physics-Client made with Unity connected to it as normal User over 127.0.0.1.

My normal game-client sends an extensionRequest to the server, when-ever the player moves to update the position. This code can only run after OnRoomJoin(BaseEvent evt) has been called. like:

Code: Select all

SFSObject test = new SFSObject();
test.PutFloat("x", coords.x);
test.PutFloat("y", coords.y);
test.PutFloat("z", coords.z);

ExtensionRequest request = new ExtensionRequest("sendTransform", test, sfs.LastJoinedRoom, true);
sfs.Send(request);


Server handles this and sends the position to the "physics-client". like:

Code: Select all

      public void handleClientRequest(User user, ISFSObject data) {

      User gamemaster = getApi().getUserByName("PhysicsClient");
      
      if (gamemaster != null) {
         trace("---------- MovePlayerRequest ----------");
         trace("---------- Sendername: " + user.getName() + "----------");
         trace("---------- Gamemaster: " + gamemaster.getName() + "----------");

         data.putUtfString("id", user.getName());
         this.send("MoveRemotePlayer", data, gamemaster, true);
      } else {
         trace("Physics-Client not connected!");
      }


And this works fine! But just for a while....

After this while the following error occurs(sry for image, i cant copy it):
Image

I know what this means! But i invested hours and i can say, the player "Dex" is 100% joined to that room. There is no code for leaving that room and at the beginning it works?

Pleas tell me why i can do this a while and after that it shows my player isnt joined that room but he is!
Any idea? Something with MMORooms i dont know? Im desperately.

If needed, pleas ask for more information.

So many thanks for helping and sorry for bad english.
regards
User avatar
Lapo
Site Admin
Posts: 20219
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: "User cannot invoke room extension..." - After a while?

Postby Lapo » 02 May 2017, 13:58

Hi,
I am not able to read the whole stack trace. Do me a favor: open the server logs (SFS2X/logs/smartfox.log) and copy/paste the full stack trace here.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Sinkist
Posts: 9
Joined: 02 May 2017, 12:56

Re: "User cannot invoke room extension..." - After a while?

Postby Sinkist » 02 May 2017, 14:10

I do what ever u want!

https://pastebin.com/raw/JBV5HVy2

regards.
User avatar
Lapo
Site Admin
Posts: 20219
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: "User cannot invoke room extension..." - After a while?

Postby Lapo » 02 May 2017, 14:27

Can you verify that user "Dex" is really joined in the Room?
You can check via the AdminTool > Zone Monitor

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Sinkist
Posts: 9
Joined: 02 May 2017, 12:56

Re: "User cannot invoke room extension..." - After a while?

Postby Sinkist » 02 May 2017, 15:18

Ok. The bug must be there. In the zone monitor i can see it is really random when someone is joined in the room or not. Sometimes he is joined for a while and it works good. But then he magically leaves the room.

But how could this be? Im doing my stuff in Unity3D. The code i posted on top is called in my "World" - Scene. And this World-Scene is only loaded after room join. look:
https://pastebin.com/yEjxsAkH

It starts at ButtonLogin(). And ends in OnRoomJoin(BaseEvent evt).

And after that is the code in my first post executed. And there is no piece of code that tells to leave a room.

Here is the complete source of the code that is called after OnRoomJoin()
https://pastebin.com/tY5DeSZb
(no leave room at all)

SendMoveRequest(Vector3 coords) is the request that is making the errors.

Pleas help.
regards
User avatar
Lapo
Site Admin
Posts: 20219
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: "User cannot invoke room extension..." - After a while?

Postby Lapo » 02 May 2017, 15:31

Sinkist wrote:Ok. The bug must be there. In the zone monitor i can see it is really random when someone is joined in the room or not. Sometimes he is joined for a while and it works good. But then he magically leaves the room.

Not magically.
MMORooms require any joined user to set their position in the 2D/3D space immediately after joining. Otherwise the system cannot figure out where they are located and therefore no updates are available.

By default every MMORoom has a 50 second tolerance before it kicks out users that haven't set their position via SetUserPosition. Maybe this is the problem. This is controlled by the userMaxLimboSeconds parameter.

Make sure to review the documentation here:
http://docs2x.smartfoxserver.com/Advanc ... /mmo-rooms

hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
Sinkist
Posts: 9
Joined: 02 May 2017, 12:56

Re: "User cannot invoke room extension..." - After a while?

Postby Sinkist » 02 May 2017, 15:37

Lapo, that helped! Sorry for my noobnes. I thank you so much.

At this point i will thank you even more! I had read so many posts from you around google on this page and you taught me so much.
Your a great supporter!

regards
User avatar
Lapo
Site Admin
Posts: 20219
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: "User cannot invoke room extension..." - After a while?

Postby Lapo » 02 May 2017, 18:36

NOTE: I have moved this topic in the proper section (SFS2X Question) as it was posted in the wrong category.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot], hoangdoanh and 10 guests