<commit_before>use v6;
use PerlStore::FileStore;
use JSON::RPC::Client;

#! Data provided by this class are required by anything in this  game 
class Empire;

my $path = make_path('login.pl');

constant $EMPIRE = '/empire';
my %status;
my %login;
my $session_id;


sub lacuna_url(Str $url){
    'http://us1.lacunaexpanse.com'~ $url
}

sub rpc(Str $name --> JSON::RPC::Client) is cached is export {
    JSON::RPC::Client.new( url => lacuna_url($name))
}

submethod create_session {
    find_credentials unless %login;
    my %logged = rpc($EMPIRE).login(|%login);
    %status = %logged<status>;
    $session_id = %logged<session_id><commit_msg>added ubut<commit_after>use v6;
use PerlStore::FileStore;
use JSON::RPC::Client;

#! Data provided by this class are required by anything in this  game 
class Empire;

my $path = INIT make_path('login.pl');

constant $EMPIRE = '/empire';
my %status;
my %login;
my $session_id;


sub lacuna_url(Str $url){
    'http://us1.lacunaexpanse.com'~ $url
}

sub rpc(Str $name --> JSON::RPC::Client) is cached is export {
    JSON::RPC::Client.new( url => lacuna_url($name))
}

submethod create_session {
    find_credentials unless %login;
    my %logged = rpc($EMPIRE).login(|%login);
    %status = %logged<status>;
    $session_id = %logged<session_id>
{'fraction_non_alphanumeric': 0.15217391304347827, 'fraction_numerical': 0.003105590062111801, 'mean_word_length': 4.58008658008658, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1987596', 'n_tokens_mistral': 472, 'n_tokens_neox': 465, 'n_words': 121}