Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hmmm..... the entire point of this exercise was to make the distinction be as invisible as possible so this is not something I've ever thought about. But now that the question is raised, I DO use WordPress's own code to actually create the accounts and everything BUT I do so inside a function I created as part of the plugin. All you would have to do is just open up the unity_functions.php and find the loginRegisterAccount() (or something similar) function, read through the code till you get to the part where I have verified the login and say everything is now fine then just add this:

      update_user_meta($current_user->ID, "unity_registration", 1);

Now, inside Unity you can check to see if the account was created via the website or not by adding "unity_registration" into the meta fields array and after login just check for either:

if (results[1].Int("unity_registration") > 0) or if (results[1].Bool("unity_registration"));

On your website, though, I don't have access to any of your plugins, obviously, but since you just added a simple usermeta field during a registration made via Unity you just need to update whatever scripts you are writing to just check if that usermeta field exists and if it's 1.

if (get_user_meta($current_users->ID, "unity_registration", true) == 1) echo "WoHoo! Unity detected!";

I think that should do the trick, no?