[SFS - ERROR] Error handling data

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

Moderators: Lapo, Bax

tomblack
Posts: 2
Joined: 11 Sep 2013, 05:13

[SFS - ERROR] Error handling data

Postby tomblack » 11 Sep 2013, 08:33

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);
            }
        }
Last edited by tomblack on 11 Sep 2013, 09:12, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

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

Postby Lapo » 11 Sep 2013, 09:00

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
Lapo
--
gotoAndPlay()
...addicted to flash games
tomblack
Posts: 2
Joined: 11 Sep 2013, 05:13

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

Postby tomblack » 11 Sep 2013, 09:11

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.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: [SFS - ERROR] Error handling data

Postby Bax » 11 Sep 2013, 09:42

Please contact us by email.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 50 guests