Accessing "Session" data on client.
Posted: 21 Nov 2020, 18:14
Hi guys. I've just followed the tutorial for the login assistant component. I've replaced the logic to set an "avatar" with a simple double called "money". "money" is the name of the column in the database.
How do I access this value on the client? For reference I am using unity.
Code: Select all
lac = new LoginAssistantComponent(this);
// Configure the component
lac.getConfig().loginTable = "users";
lac.getConfig().userNameField = "email";
lac.getConfig().passwordField = "password";
lac.getConfig().nickNameField = "username";
lac.getConfig().useCaseSensitiveNameChecks = true;
lac.getConfig().extraFields = Arrays.asList("money");
lac.getConfig().postProcessPlugin = new ILoginAssistantPlugin ()
{
public void execute(LoginData loginData)
{
ISFSObject fields = loginData.extraFields;
double money = fields.getDouble("money");
// Store avatar in session object
loginData.session.setProperty("money", money);
}
};
How do I access this value on the client? For reference I am using unity.