I've been working tirelessly night to morning trying to get several java errors to go away I've gotten all but one to go away this one I don't see listed on the Forums anywhere so here it goes; I have an Extension using the Login Assistant Component, I've combined several methods from the docs to ensure safety and moderation capabilities for my game, however I keep getting an error similar to this:
Code: Select all
Exception: com.smartfoxserver.v2.exceptions.SFSException
Message: Extension creation failure: loginExtension - Extension does not implement ISFSExtension interface: loginExtension
Description: There were startup errors during the Zone Setup
Please connect via the AdminTool and correct the problem
I have no idea what it's telling me in the logs.
Here's my code from the Extension:
Code: Select all
import java.util.Arrays;
import com.smartfoxserver.v2.components.login.ILoginAssistantPlugin;
import com.smartfoxserver.v2.components.login.LoginAssistantComponent;
import com.smartfoxserver.v2.components.login.LoginData;
import com.smartfoxserver.v2.components.login.PasswordCheckException;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.extensions.ISFSExtension;
import com.smartfoxserver.v2.security.DefaultPermissionProfile;
public abstract class LoginExtension implements ISFSExtension {
private LoginAssistantComponent lac;
public void init()
{
lac = new LoginAssistantComponent(this);
//Configure The Component.
lac.getConfig().loginTable = "users";
lac.getConfig().userNameField = "userName";
lac.getConfig().passwordField = "passWord";
lac.getConfig().useCaseSensitiveNameChecks = true;
lac.getConfig().extraFields = Arrays.asList("avatar", "isMod");
lac.getConfig().customPasswordCheck = true;
}
public void execute(LoginData loginData) {
ISFSObject fields = loginData.extraFields;
String avatarPic = fields.getUtfString("avatar");
boolean isMod = fields.getUtfString("isMod").equalsIgnoreCase("Y");
loginData.session.setProperty("avatar", avatarPic);
if (isMod)
loginData.session.setProperty("$permission", DefaultPermissionProfile.MODERATOR);
}
}
class LoginPreProcess implements ILoginAssistantPlugin
{
@Override
public void execute(LoginData ld)
{
String clientPass = ld.clientIncomingData.getUtfString("passwd");
// Let's see if the password from the DB matches that of the user
if (!ld.password.equals(clientPass))
throw new PasswordCheckException();
// Success!
}
}