Converting Raw to Array in Unity API?

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

xMoMx
Posts: 36
Joined: 13 Jun 2009, 06:11

Converting Raw to Array in Unity API?

Postby xMoMx » 17 Jun 2009, 00:11

Sorry for noobie q...

Just wondering about how to convert Raw Data into Array with Unity API.
Seem like data type i got from OnExtensionResponse is an SFS object even if it's just a string.

Can't do (Array) resObj to convert it either. I'm so confused
:oops:
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 17 Jun 2009, 05:52

From the documentation of OnExtensionResponse - direct cut'n'paste:

Code: Select all

SFSEvent.onExtensionResponse += OnExtensionResponse;

public void OnExtensionResponse(object data, string type)
{
    // Handle XML responses
    if (type == SmartFoxClient.XTMSG_TYPE_XML)
    {
        SFSObject responseData = (SFSObject)data;
        // TODO: check command and perform required actions
    }

    // Handle RAW responses
    else if (type == SmartFoxClient.XTMSG_TYPE_STR)
    {
        string responseData = (string)data;
        // TODO: check command and perform required actions
    }

    // Handle JSON responses
    else if (type == SmartFoxClient.XTMSG_TYPE_JSON)
    {
        JsonData responseData = (JsonData)data;
        // TODO: check command and perform required actions
    }
}
xMoMx
Posts: 36
Joined: 13 Jun 2009, 06:11

Postby xMoMx » 17 Jun 2009, 14:56

That's such a stupid question.

Thx a bunch
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 17 Jun 2009, 19:50

No stupid questions exist - so you are more than welcome and good luck ;-)

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 2 guests