Resource icon

Minecraft UUID/Name Change Handler 0.1.0

No permission to download
I'm pretty sure me and @jflory7 are having the same issue, we're both using XenRegister but this add-on breaks the registration. http://www.spigotmc.org/resources/xenregister.536/

Yeah. I'll look into it right now :)
How does it break the registration exactly? I looked through the modifications for XenRegister and I can't see why it should break. Any kind of errors, or does the UUID simply not get set in the database, or something else?

Could you possibly check for 'minecraft_uuid' in the users Personal Details instead of xf_users?

I could customize it, but why would you need to?
 
Just a question, you allow users to enter their new username. Wouldn't it be easier just to add a REFRESH button that queries Mojangs API system to get the new username based on whatever their UUID is?
 
Yeah. I'll look into it right now :)
How does it break the registration exactly? I looked through the modifications for XenRegister and I can't see why it should break. Any kind of errors, or does the UUID simply not get set in the database, or something else?



I could customize it, but why would you need to?

The registration breaks because xenAPI doesn't know what to do when there's a UUID field in the database that is empty.
 
The registration breaks because xenAPI doesn't know what to do when there's a UUID field in the database that is empty.
Yeah it's because you have the `uuid` field not defaulting to anything. Set it to DEFAULT NULL and run a query to update any empty fields to NULL. Problem fixed :D
 
Just a question, you allow users to enter their new username. Wouldn't it be easier just to add a REFRESH button that queries Mojangs API system to get the new username based on whatever their UUID is?
When I made the add-on there was no reliable way to get a username from a UUID. You are right, I could change it, and I probably will, but I don't have too much time at the moment.

The registration breaks because xenAPI doesn't know what to do when there's a UUID field in the database that is empty.
Yeah it's because you have the `uuid` field not defaulting to anything. Set it to DEFAULT NULL and run a query to update any empty fields to NULL. Problem fixed :D

I've figured out the problem. XenAPI does use the DataWriter, but for some reason the class proxy system is not being used so my code to set the UUID on _preSave is not working. DEFAULT NULL would work, but I'd rather get to the bottom of this problem and figure it out, as I don't particularly want blank UUIDs in the database :p
Now to fix it!
 
Okay, I've found a fix, but you have to modify api.php.
Open it up and search for 'autoloader' (on line 2041).
You should see something like this:
PHP:
require_once($this->xfDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($this->xfDir. '/library');
XenForo_Application::initialize($this->xfDir . '/library', $this->xfDir);
XenForo_Application::set('page_start_time', microtime(TRUE));

// Disable XenForo's PHP 
XenForo_Application::disablePhpErrorHandler();

Change it so it looks like this:
PHP:
require_once($this->xfDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($this->xfDir. '/library');
XenForo_Application::initialize($this->xfDir . '/library', $this->xfDir);
XenForo_Application::set('page_start_time', microtime(TRUE));

$deps = new XenForo_Dependencies_Public();
$deps->preLoadData();

// Disable XenForo's PHP 
XenForo_Application::disablePhpErrorHandler();

This should ensure that all the classes get loaded using the class proxy system. I'll contact the XenAPI developer, but meanwhile, this will do!
 
I can't stress this enough:

PLEASE make sure any columns you add to default XF tables have a default value.

There is a bug in this add-on which would prevent registration completely if the add-on was installed but disabled. Please update and include this fix:

PHP:
ALTER TABLE `xf_user` CHANGE COLUMN `uuid` `uuid` CHAR(32) DEFAULT NULL ;
 
I can't stress this enough:

PLEASE make sure any columns you add to default XF tables have a default value.

There is a bug in this add-on which would prevent registration completely if the add-on was installed but disabled. Please update and include this fix:

PHP:
ALTER TABLE `xf_user` CHANGE COLUMN `uuid` `uuid` CHAR(32) DEFAULT NULL ;
You have a very good point.
I looked at it now, and it looked like on my test database set-up I had set the column to default, but I missed this when writing the installer.
I'll update it now and include a default value.
 
Cool :)

Another wise suggestion: maybe change the column name to be unique like koolkrafter_uuid or something similar.

If XF were to add a uuid column (unlikely I know) then there might be issues.
 
Cool :)

Another wise suggestion: maybe change the column name to be unique like koolkrafter_uuid or something similar.

If XF were to add a uuid column (unlikely I know) then there might be issues.
Yeah that's probably a good idea, I'll implement it! Maybe mcUUID_uuid or something like that? :)
Thanks for the suggestion!
 
Had some issues generating the UUID column for our Xenforo forum. We have ~16,000 registered users, so maybe that's why.

I kept getting an error from the UUID rebuild tool:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /webserver/www/library/mcUUID/Model/UUID.php on line 36
Fixed it by setting the memory limit to unlimited "ini_set('memory_limit', '-1');"
Then, the script timed out so I just made the max execution time to 5 minutes, "ini_set('max_execution_time', 300);"
Probably not the most ideal patch, but I got it to generate all the UUIDs in the end.

59 of our users seem to have no UUID even though they have to register in-game.
Their accounts seem not to exist when looking them up with other UUID finders. Dang Mojang!

And it seems like username label was changed:
RjbyYp8.png

No big deal, just looks a tad odd.

Thanks for creating the addon, saved us a fair amount of work.
 
Had some issues generating the UUID column for our Xenforo forum. We have ~16,000 registered users, so maybe that's why.

I kept getting an error from the UUID rebuild tool:

Fixed it by setting the memory limit to unlimited "ini_set('memory_limit', '-1');"
Then, the script timed out so I just made the max execution time to 5 minutes, "ini_set('max_execution_time', 300);"
Probably not the most ideal patch, but I got it to generate all the UUIDs in the end.

59 of our users seem to have no UUID even though they have to register in-game.
Their accounts seem not to exist when looking them up with other UUID finders. Dang Mojang!

And it seems like username label was changed:
RjbyYp8.png

No big deal, just looks a tad odd.

Thanks for creating the addon, saved us a fair amount of work.
I could fix your problem by making it do 100 users at a time - XenForo does a similar thing with the cache rebuild tool. I can't sort it out now, as I'm on holiday, but when I get back I'll sort that and the username thing out. Also I do agree that mojang's uuid lookup thing can be derpy at times :P
I'm glad the addon helped you! :)
 
Top Bottom