Here's my server side code:
Code: Select all
IDBManager dbManager = getParentExtension().getParentZone().getDBManager();
String sql = "SELECT NAME AS FROM USERS WHERE ID = 2";
ISFSObject response = new SFSObject();
ISFSArray res = dbManager.executeQuery(sql, new Object[]{});
// Populate the response parameters
response.putSFSArray("name", res);
// Send it back to requester
send("ReturnScore", response, user);
In Unity3D i'm trying to get at the data that resides in the SFSOBJECT. Here's my non-functioning code:
Code: Select all
void OnExtensionResponse(BaseEvent e)
{
string cmd = (string) e.Params["cmd"];
ISFSObject objIn = (SFSObject)e.Params["params"];
if (cmd == "name")
{
Debug.Log(objIn.GetHexDump());
IList str = objIn.GetUtfStringArray("name");
string str2 = str.ToString();
Debug.Log(str2);
}
}
I tried using an ICollection already. The above code tries to use the Ilist. The .GetHexDump() function was very helpful to assist me in troubleshooting the actual db connection and query to ensure that everything was working as desired.
All that's left to do is actually 'access' the data that's been sent!
Thanks in advance! It's 12:25am and after many hours of scratching my head (and using my good pal Google) I can say I'm stumped.
MaxHammer