Code: Select all
private void SaveSessionInfo(ISession session,String... info)
{
ISFSObject userdata = new SFSObject();
trace("info0:" + info[0]);
trace("info1:" + info[1]);
trace("info2:" + info[2]);
userdata.putUtfString("openid", info[0]);
userdata.putUtfString("nickname", info[1]);
userdata.putUtfString("headurl", info[2]);
session.setProperty("userdata", userdata);
}
Error messages on console
Code: Select all
17:31:51,028 INFO [SFSWorker:Ext:4] Extensions - {LobbyExtension}: info0:null
17:31:51,028 INFO [SFSWorker:Ext:4] Extensions - {LobbyExtension}: info1:null
17:31:51,028 INFO [SFSWorker:Ext:4] Extensions - {LobbyExtension}: info2:null
17:31:51,029 WARN [SFSWorker:Ext:4] managers.SFSExtensionManager - java.lang.IllegalArgumentException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.IllegalArgumentException
Message: SFSObject requires a non-null value! If you need to add a null use the putNull() method.
Description: Error during event handling: java.lang.IllegalArgumentException: SFSObject requires a non-null value! If you need to add a null use the putNull() method., Listener: { Ext: LobbyExtension, Type: JAVA, Lev: ZONE, { Zone: Mazing }, {} }
+--- --- ---+
Stack Trace:
+--- --- ---+
com.smartfoxserver.v2.entities.data.SFSObject.putObj(SFSObject.java:701)
com.smartfoxserver.v2.entities.data.SFSObject.putUtfString(SFSObject.java:656)
com.mazingtec.lobbyextension.OnLogin.SaveSessionInfo(OnLogin.java:314)
com.mazingtec.lobbyextension.OnLogin.handleServerEvent(OnLogin.java:64)
com.smartfoxserver.v2.extensions.SFSExtension.handleServerEvent(SFSExtension.java:259)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.dispatchEvent(SFSExtensionManager.java:768)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.dispatchZoneLevelEvent(SFSExtensionManager.java:689)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.handleServerEvent(SFSExtensionManager.java:887)
com.smartfoxserver.v2.core.SFSEventManager$SFSEventRunner.run(SFSEventManager.java:65)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
17:31:51,619 INFO [SFSWorker:Ext:2] Extensions - {LobbyExtension}: info0:oVH8Gv1J_Dc34JGRO15IBeXSKnFA
17:31:51,620 INFO [SFSWorker:Ext:2] Extensions - {LobbyExtension}: info1:Jason
17:31:51,620 INFO [SFSWorker:Ext:2] Extensions - {LobbyExtension}: info2:http://wx.qlogo.cn/mmopen/ajNVdqHZLLDnao37NWN3sOwm1YE0snqjgzqfX4qE5T8ZIicA8IveB0escgibOQ9GBMa2BupowPWe4QDmeBwWtQ0A/0
As you can see, the 1st time, there was no data at all, but the 2nd time was right, but I only called SaveSessionInfo once