i tried to realise the following SignUp tutorial for unity: http://docs2x.smartfoxserver.com/Develo ... ant-basics
Unfortunetaly i went in an error, which i dont understand.
Code: Select all
com.smartfoxserver.v2.exceptions.SFSExtensionException: Extension Request refused. Sender is not a User: { Id: 3, Type: DEFAULT, Logged: No, IP: XXX.XXX.XXX.XXX:XXXXX }
com.smartfoxserver.v2.controllers.v290.ExtensionReqController.processRequest(ExtensionReqController.java:93)
com.smartfoxserver.v2.controllers.v290.ExtensionReqController$1.run(ExtensionReqController.java:68)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
I inserted the following server-side code to my extension:
Code: Select all
private SignUpAssistantComponent suac;
@Override
public void init()
{
suac = new SignUpAssistantComponent();
suac.getConfig().signUpTable = "playesdata";
suac.getConfig().usernameField = "playername";
suac.getConfig().passwordField = "playerpasswort";
suac.getConfig().emailField = "email";
suac.getConfig().checkForDuplicateEmails = false;
addRequestHandler(SignUpAssistantComponent.COMMAND_PREFIX, suac);
}
and the following to my unity project:
Code: Select all
Debug.Log("connected");
string CMD_SUBMIT = "$SignUp.Submit";
SFSObject sfso = new SFSObject();
sfso.PutUtfString("playername", "NAMEHERE");
sfso.PutUtfString("playerpasswort", "PWHERE");
sfso.PutUtfString("email", "EMAIL@ADRESSE.COM");
sfs.Send(new ExtensionRequest(CMD_SUBMIT, sfso));
This code will execude if the connection was successfully established. With zone etc.
This code for server-response:
Code: Select all
private void OnExtensionResponse(BaseEvent evt)
{
Debug.Log("test");
string cmd = (string)evt.Params["cmd"];
SFSObject dataObject = (SFSObject)evt.Params["params"];
if (cmd == "$SignUp.Submit")
{
if (dataObject.GetBool("success"))
Debug.Log("Success, thanks for registering");
else
Debug.Log("SignUp Error:" + (string)evt.Params["errorMessage"]);
}
else
{
Debug.Log("test");
Debug.Log("SignUp Error:" + (string)evt.Params["errorMessage"]);
}
}
I dont understand, whats wrong.
I hope you can help me.
Have a nice eve!
Best regards swonson