Hi
I just made a small test example, and I dont have any issues in this regards.
In Unity:
Code: Select all
smartFox.SendXtMessage("testExt", "testMethod", null, SmartFoxClient.XTMSG_TYPE_XML);
smartFox.SendXtMessage("testExt", "testMethod", null, SmartFoxClient.XTMSG_TYPE_JSON);
smartFox.SendXtMessage("testExt", "testMethod", null, SmartFoxClient.XTMSG_TYPE_STR);
And then I made a small java extension based on the template. Here is the code.
Code: Select all
import it.gotoandplay.smartfoxserver.data.*;
import it.gotoandplay.smartfoxserver.extensions.*;
import it.gotoandplay.smartfoxserver.lib.ActionscriptObject;
import it.gotoandplay.smartfoxserver.events.InternalEventObject;
import org.json.JSONObject;
public class testExt extends AbstractExtension
{
public void init()
{
trace("Extension initialized");
}
public void destroy()
{
trace("Extension destroyed");
}
public void handleRequest(String cmd, ActionscriptObject ao, User u, int fromRoom)
{
trace("XML extension called");
}
public void handleRequest(String cmd, JSONObject jso, User u, int fromRoom)
{
trace("JSON extension called");
}
public void handleRequest(String cmd, String params[], User u, int fromRoom)
{
trace("String extension called");
}
public void handleInternalEvent(InternalEventObject ieo)
{
// Your code here, handles server events
}
}
On the server console comes up:
Code: Select all
[ testExt ]: XML extension called
[ testExt ]: JSON extension called
[ testExt ]: String extension called
So I'll need more info from you to be able to help
/Thomas