Page 1 of 1

[SFS - ERROR] Error handling data

Posted: 11 Sep 2013, 08:33
by tomblack
Hi,

I am use SmartFox client for WP8 (Silver light / C#).

When I handle UserVariable response from server, there is an error

Code: Select all

[SFS - ERROR] Error handling data: Error dispatching event userVariablesUpdate: Object reference not set to an instance of an object.    at WP8Game.SFSControl.HandleUserVariableUpdate(BaseEvent evt)
   at Sfs2X.Core.EventDispatcher.DispatchEvent(BaseEvent evt)    at Sfs2X.Core.EventDispatcher.DispatchEvent(BaseEvent evt)
   at Sfs2X.SmartFox.DispatchEvent(BaseEvent evt)
   at Sfs2X.Controllers.SystemController.FnSetUserVariables(IMessage msg)
   at Sfs2X.Controllers.SystemController.HandleMessage(IMessage message)
   at Sfs2X.Core.SFSProtocolCodec.DispatchRequest(ISFSObject requestObject)
   at Sfs2X.Core.SFSProtocolCodec.OnPacketRead(ByteArray packet)
   at Sfs2X.Core.SFSIOHandler.HandlePacketData(ByteArray data)
My SFSControl is a singleton to register event, request and handle response from server

Code: Select all

SFSControl()
        {
            initSmartFox();
            addEventHandler();
        }

        public static SFSControl Instance
        {
            get
            {
                lock (padLock)
                {
                    if (instance == null)
                    {
                        instance = new SFSControl();
                    }
                    return instance;
                }
            }
        }

        public void initSmartFox()
        {
            sfsClient = new SmartFox();
            sfsClient.Debug = true;
            sfsClient.ThreadSafeMode = false;
            sfsClient.Logger.LoggingLevel = Sfs2X.Logging.LogLevel.INFO;
        }

        private void addEventHandler()
        {
            //System.Windows.MessageBox.Show("event added");
            sfsClient.AddEventListener(SFSEvent.CONNECTION, OnConnection);
            sfsClient.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost);
            sfsClient.AddEventListener(SFSEvent.LOGIN, OnLogin);
........
            sfsClient.AddEventListener(SFSEvent.ROOM_VARIABLES_UPDATE, HandleRoomVariableUpdate);
            sfsClient.AddEventListener(SFSEvent.USER_VARIABLES_UPDATE, HandleUserVariableUpdate);

Code: Select all

 public void HandleRoomVariableUpdate(BaseEvent evt)
        {
            List<string> rvs = (List<string>)evt.Params["changedVars"];
            for (int i = 0; i < rvs.Count; i++)
            {
                string cmd = rvs.ElementAt(i);
                handleRoomVariableUpdate(cmd);
            }
        }

Re: [SFS - ERROR] Error handling data: Error dispatching eve

Posted: 11 Sep 2013, 09:00
by Lapo
Hi,
when you say WP8, you mean the beta you requested via email?
I have to ask because there seem to be a bit of confusion between people using the regular Unity API and exporting to WP8 and those building native WP8 apps. In addition to that we're finalizing the the "official" WP8 APIs and we have already given away a few copies to test :D

What is the version number returned by SmartFox.Version?

Thanks

Re: [SFS - ERROR] Error handling data: Error dispatching eve

Posted: 11 Sep 2013, 09:11
by tomblack
I am using SmartFox client for WP8 requested via email, this package named "SmartFoxWin8_Incomplete"

/// SmartFoxServer 2X
/// Unity Client API
/// API version 1.0.3 -- Release Candidate
/// http://www.smartfoxserver.com
/// (c) 2009-2012 gotoAndPlay()

Do you have an update for this version please give me. I will be a contributor for your project.
Thanks for quick response.

Re: [SFS - ERROR] Error handling data

Posted: 11 Sep 2013, 09:42
by Bax
Please contact us by email.