Player registration

Most of the code its generated by gii and needs some work.