GithubHelp home page GithubHelp logo

games-lacuna-client's Introduction

NAME
    Games::Lacuna::Client - An RPC client for the Lacuna Expanse

SYNOPSIS
      use Games::Lacuna::Client;
      my $client = Games::Lacuna::Client->new(cfg_file => 'path/to/myempire.yml');
  
      # or manually:
      my $client = Games::Lacuna::Client->new(
        uri      => 'https://path/to/server',
        api_key  => 'your api key here',
        name     => 'empire name',
        password => 'sekrit',
        #session_peristent => 1, # only makes sense with cfg_file set!
        #debug    => 1,
      );
  
      my $res = $client->alliance->find("The Understanding");
      my $id = $res->{alliances}->[0]->{id};
  
      use Data::Dumper;
      print Dumper $client->alliance->view_profile( $res->{alliances}->[0]->{id} );

DESCRIPTION
    This module implements the Lacuna Expanse API as of 10.10.2010.

    You will need to have a basic familiarity with the Lacuna RPC API
    itself, so check out <http://gameserver.lacunaexpanse.com/api/> where
    "gameserver" is the server you intend to use it on. As of this writing,
    the only server is "us1".

    The different API *modules* are available by calling the respective
    module name as a method on the client object. The returned object then
    implements the various methods.

    The return values of the methods are (currently) just exactly "result"
    portion of the deflated JSON responses. This is subject to change!

    On failure, the methods "croak" with a simple to parse message. Example:

      RPC Error (1002): Empire does not exist. at ...

    The number is the error code number (see API docs). The text after the
    colon is the human-readable error message from the server.

    You do not need to login explicitly. The client will do this on demand.
    It will also handle session-timeouts and logging out for you. (Log out
    happens in the destructor.)

    All methods that take a session id as first argument in the JSON-RPC API
    DO NOT REQUIRE that you pass the session_id manually. This is handled
    internally and the client will automatically log in for you as
    necessary.

Methods
  new
      Games::Lacuna::Client->new(
        name      => 'My empire',                # empire_name in config file
        password  => 'password of the empire',   # empire_password in config file
        uri       => 'https://us1.lacunaexpanse.com/',   # server_uri in config file
        api_key   => 'public api key',
      );

CONFIGURATION FILE
    Some of the parameters of the constructor can also be supplied in a
    configuration file in YAML format. You can find a template in the
    examples subdirectory.

      empire_name: The name of my Empire
      empire_password: The password
      server_uri: https://us1.lacunaexpanse.com/

      uri:        will overwrite the server_uri key (might be a bug)
      api_key:

      session_start:
      session_id:
      session_persistent:

SEE ALSO
    API docs at <http://us1.lacunaexpanse.com/api>.

    A few ready-to-use tools of varying quality live in the examples
    subdirectory.

AUTHOR
    Steffen Mueller, <[email protected]>

COPYRIGHT AND LICENSE
    Copyright (C) 2010 by Steffen Mueller

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself, either Perl version 5.10.0 or, at
    your option, any later version of Perl 5 you may have available.

games-lacuna-client's People

Contributors

fireartist avatar b2gills avatar halkeye avatar tsee avatar lemming552 avatar dekimsey avatar mrmuskrat avatar chorny avatar tyggerjai avatar szabgab avatar cxreg avatar polettix avatar sendai avatar benss avatar alabamapaul avatar mjharwood avatar ysth avatar haarg avatar jmazon avatar tochtli avatar

Stargazers

Gun.io Robot avatar

Watchers

Gun.io Robot avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.