Net::Minecraft::Login - Basic implementation of the Minecraft Login Protocol.
version 0.001000
This is a basic implementation of the Minecraft Login protocol as described at http://wiki.vg/Session#Login
use Net::Minecraft::Login; my $ua = Net::Minecraft::Login->new(); my $result = $ua->login( user => 'Bob', password => 'secret', ); if( $result->isa('Net::Minecraft::LoginFailure') ){ die $result; } say "Login for user " . $result->user . " succeeded";
Note, it presently does no explict session stuff, only performs the basic HTTP Request and returns the response as an object.
This second describes arguments that may be optionally passed to ->new(), but as of the time of this writing, none are explicitly required, and are offered only to give leverage to strange usecases ( and tests )
->new()
my $instance = Net::Minecraft::Login->new( user_agent => ... , http_headers => { ... }, http_engine => HTTP::Tiny->new(), login_server => 'https://somewhere.else.org/' version => 14, # IN THE FUTURE! );
The User Agent to self-describe over HTTP
type : String default : "Net::Minecraft::Login/" . VERSION
Standard Headers that will be injected in each request
type : Hash[ string => string ] default : { 'Content-Type' => 'application/x-www-form-urlencoded' }
Low-Level HTTP Transfer Agent.
type : Object[ =~ HTTP::Tiny ] default : An HTTP::Tiny instance.
HTTP Address to authenticate with.
type : String default : https://login.minecraft.net/
"Client" version.
type : String default : 13
This field indicates the version of the "Launcher". Minecraft may at some future time produce an updated launcher, and indicate that this specified version is out of date.
Mojang Minecraft Launchers will be required to download a newer version, and users of Net::Minecraft::Login will either
version =>
signature: { user => String , password => String, version? => String } return : Any( Net::Minecraft::LoginResult , Net::Minecraft::LoginFailure ) my $result = $nmcl->login( user => 'notch', password => 'jellybean', ); if( $result->isa('Net::Minecraft::LoginFailure') ){ say "$result"; } else { say "Logged in!"; }
See ::LoginFailure and ::LoginResult
::LoginFailure
::LoginResult
signature : ( String $base_uri, Hash[ String => String ] $parameters , Hash[ String => Any ] $config ) return : Hash[ String => String ]
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2013 by Kent Fredric <kentnl@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Net::Minecraft::Login, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Minecraft::Login
CPAN shell
perl -MCPAN -e shell install Net::Minecraft::Login
For more information on module installation, please visit the detailed CPAN module installation guide.