NAME
Net::Mogade - Perl Wrapper for the mogade.com leaderboard/scores service
VERSION
version 0.001
SYNOPSIS
my $obj = Net::Mogade->new(
key => '4edd1d4cd1798f5d86000003',
secret => 'Yl=>yBmUNS6FuNUy[]NnBu8',
);
warn Dumper $obj->scoreGet(lid=>'4edd31e9d1798f1639000001', scope=>Net::Mogade::SCOPE_YESTERDAY);
NAME
Net::Mogade - Perl wrapper for the mogade.com leaderboard/scores service
CONSTANTS
SCOPE_DAILY
Constant for daily scores. Mostly for scoresGet and ranks.
SCOPE_WEEKLY
Constant for weekly scores. Mostly for scoresGet and ranks.
SCOPE_OVERALL
Constant for overall scores. Mostly for scoresGet and ranks.
SCOPE_YESTERDAY
Constant for yesterday scores. Mostly for scoresGet and ranks.
METHODS
new(key=>'key', secret=>'secret', [base=>'http://other/location'])
Creates a new Net::Mogade object. Options:
key
Key provided by mogade
secret
Secret provided by mogade - Keep secret
base
(optional)Base url to mogade api. Default is mogade.com's api servers
ranks(lid=>'', userkey=>'', username=>'', [scope=>SCOPE_DAILY])
Get a player's current rank by providing a leaderboard(lid
) username
and userkey
. Optionally provide scopes. Will return all scopes unless one is specified.
scoreSave(lid => '', points => '', userkey => '', username => '', [data => ''])
Updates a users score for a given leaderboard(lid
), username
and userkey
. data is an optional 50 character string that will be stored and returned when scores are retrieved.
scoreGet(lid => '', [userkey => '', username=>''], [scope=>SCOPE_DAILY], [page => 0], [record => 20])
Retrieves scores for a given leaderboard (lid
). If username
and userkey
is provided, it will try to return the data (by page
) surrounding the user. record
controls how many are returned. page
controls which page offset gets returned. Most can be mixed and matched.
achievementGrant(aid=>'', username=>'', userkey=>'')
Gives a username
and userkey
pair an achievement(aid
)
achievementGet(username=>'', userkey=>'')
Retrieves achievements for a given username
and userkey
logError(subject=>'', [details=>''])
Logs an error to the mogade servers. subject
is the string that gets shown, details
is optional amount of extra data that can be provided
logStart(userkey=>'')
Records a game startup for a given userkey
AUTHORS
Gavin Mogan <halkeye@cpan.org>
SEE ALSO
AUTHOR
Gavin Mogan <gavin@kodekoan.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Gavin Mogan.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.