Page 1 of 1
Converting Raw to Array in Unity API?
Posted: 17 Jun 2009, 00:11
by xMoMx
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

Posted: 17 Jun 2009, 05:52
by ThomasLund
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
}
}
Posted: 17 Jun 2009, 14:56
by xMoMx
That's such a stupid question.
Thx a bunch
Posted: 17 Jun 2009, 19:50
by ThomasLund
No stupid questions exist - so you are more than welcome and good luck
