What about modifying the register command to also log the player in, so the serial and ip get set. 
	Something like:
 
if ( #getAccountsBySerial(getPlayerSerial(thePlayer)) == 0 )
    logOut( thePlayer )
    local account = addAccount( username, password )
    logIn( thePlayer, account, password )
    logOut( thePlayer )
end