Cannot find any User for Session

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

Moderators: Lapo, Bax

silsin
Posts: 5
Joined: 02 Sep 2016, 06:36

Cannot find any User for Session

Postby silsin » 09 Sep 2016, 18:03

hi
i try to create a new room in server side
in server extention , I use this code :

Code: Select all

void OnMatchMatchMaking(User user,ISFSObject params){
       
         PaperExt parentExtension = (PaperExt)getParentExtension();
        ISFSObject objOut = SFSObject.newInstance();
        CreateRoomSettings str = new CreateRoomSettings();
          str.setAutoRemoveMode(SFSRoomRemoveMode.WHEN_EMPTY);
       str.setName(user.getName() + ":game");
          str.setMaxUsers(2);
          str.setGame(true);
          try {
           getApi().createRoom(user.getZone(),str, user);
        } catch (SFSCreateRoomException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
        }finally{
           parentExtension.send("MatchMaking", objOut,user);
        }
      }
     


And for calling this code in c#

Code: Select all

   var ISObject = new SFSObject();
        ISObject.PutUtfString("__[[REQUEST_ID]]__", "MatchMaking");
        sfs.Send(new Sfs2X.Requests.ExtensionRequest("NewRoom", ISObject));


But nothing will happen on the server side
server log :

Code: Select all

java.lang.NullPointerException
   com.smartfoxserver.v2.controllers.system.ManualDisconnection.execute(ManualDisconnection.java:29)
   com.smartfoxserver.v2.controllers.v290.SystemReqController.processRequest(SystemReqController.java:157)
   com.smartfoxserver.v2.controllers.v290.SystemReqController.enqueueRequest(SystemReqController.java:114)
   com.smartfoxserver.bitswarm.io.protocols.AbstractProtocolCodec.dispatchRequestToController(AbstractProtocolCodec.java:39)
   com.smartfoxserver.v2.protocol.SFSProtocolCodec.dispatchRequest(SFSProtocolCodec.java:125)
   com.smartfoxserver.v2.protocol.SFSProtocolCodec.onPacketRead(SFSProtocolCodec.java:90)
   com.smartfoxserver.v2.protocol.binary.BinaryIoHandler$1.run(BinaryIoHandler.java:525)
   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)

Code: Select all

com.smartfoxserver.v2.exceptions.SFSRuntimeException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: com.smartfoxserver.v2.exceptions.SFSRuntimeException
Message: -Unexpected- Cannot find any User for Session: { Id: 241, Type: DEFAULT, Logged: No, IP: 5.161.111.58:25101 }
+--- --- ---+
Stack Trace:
+--- --- ---+
com.smartfoxserver.v2.SmartFoxServer.onSessionReconnectionTry(SmartFoxServer.java:977)
com.smartfoxserver.v2.SmartFoxServer.access$5(SmartFoxServer.java:972)
com.smartfoxserver.v2.SmartFoxServer$EventDelegate.run(SmartFoxServer.java:1070)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Cannot find any User for Session

Postby Lapo » 10 Sep 2016, 08:22

Hi,
the log you've attached show a call to a "manual disconnection", meaning that the client has called the disconnect() method in the API.
I am not sure how the two things could be connected here: the request for creating a room and the disconnection.

I would recommend testing your room creation call locally, with a single user connected so that you can see what is happening in the server side logs without being "distracted" by other logs that are not relevant.

Thanks

p.s. = always specify the SFS2X version and Client side API version.
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 22 guests