Signup-Assistent no error codes on client side

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

zentralalex
Posts: 1
Joined: 06 May 2014, 15:16

Signup-Assistent no error codes on client side

Postby zentralalex » 23 May 2014, 09:27

Hi together,

i use the SignUp-Assistent like described in the examples. No i want to check which error occurred on the client-side. But the response from the server does only contain the error message. In the code on the bottom sfso contains _only_ the message as string as far as i can say. A enum or something should be there also or not, cause don`t really like to test against this string.. ? Could be similar to this:
viewtopic.php?f=21&t=17160

Also when i use the SignUp-Assistent like in the second block at the bottom, the user can sign-up/log-in and after the next login on the client-side if i check the users privilege level it is 1 like it should be. But during the connection during which the user signs-up the promotion to privilege level STANDARD is never reflected to the client-side, it will stay at 0 there till the next login. This is not totally bad, but it would be nice if that disconnect/reconnect would not be necessary.

Code: Select all

- (void) onExtensionResponse:(SFSEvent *) event {
    NSString *cmd = [event.params objectForKey: @"cmd"];
    SFSObject *sfso = [event.params objectForKey: @"params"];
   
    if ([cmd isEqualToString:ZSF_CMD_SIGNUP_SUBMIT]) {
        if ([sfso containsKey: @"errorMessage"]) {
            NSLog(@"error:%@", [sfso getUtfString: @"errorMessage"]);
        } else {
            _user.registered = YES;
            [self saveUser: _user];
           
            _stateClient = ZFS_CLIENT_STATE_SIGNUP_COMPLETE;
            [_sfs2xClient disconnect];
        }
    }
}


public class ZNMMOServer extends SFSExtension {

private SignUpAssistantComponent suac;
private LoginAssistantComponent lac;

@Override
public void init() {
trace("Hello, this is my first SFS2X Extension!");

suac = new SignUpAssistantComponent();

suac.getConfig().passwordMode = PasswordMode.PLAIN_TEXT;
suac.getConfig().signUpTable = "znmmo_users";
suac.getConfig().usernameField = "user_name";
suac.getConfig().passwordField = "user_password";
suac.getConfig().emailField = "user_email";
suac.getConfig().minUserNameLength = 4;
suac.getConfig().maxUserNameLength = 30;
suac.getConfig().minPasswordLength = 30;
suac.getConfig().checkForDuplicateEmails = false;
suac.getConfig().maxPasswordLength = 45;

addRequestHandler(SignUpAssistantComponent.COMMAND_PREFIX, suac);

lac = new LoginAssistantComponent(this);

lac.getConfig().loginTable = "znmmo_users";
lac.getConfig().userNameField = "user_name";
lac.getConfig().passwordField = "user_password";


lac.getConfig().postProcessPlugin = new ILoginAssistantPlugin()
{
@Override
public void execute(LoginData loginData ) {
loginData.session.setProperty("$permission", DefaultPermissionProfile.STANDARD);
}
};
}
}


Thanks alot,
alex
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Signup-Assistent no error codes on client side

Postby Lapo » 26 May 2014, 08:06

Hi,
Yes I think it is the same problem. We'll have a new release out in the next 10-15 days which adds the missing error code.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Signup-Assistent no error codes on client side

Postby Lapo » 13 Jun 2014, 09:50

A new update has been released:
viewtopic.php?f=21&t=17216
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 24 guests