common::sense;
use SDL;
use SDL::Surface;
use SDL::Video;
use SDL::TTF;
use OpenGL qw(:all);
use JSON;
use Games::Construder::Vector;
use Games::Construder;
use File::ShareDir::PAR;
use Games::Constr
ntries} = [];
if ($gui_desc && $gui_desc->{layout}) {
$self->{layout} = decode_json (encode_json ($gui_desc->{layout}));
}
my $layout = $self->{layout};
$self->{active_elements
/licenses/>.
#
package Games::Construder::Server::Resources;
use common::sense;
use AnyEvent;
use JSON;
use Digest::MD5 qw/md5_base64/;
use Games::Construder::Server::Objects;
use File::ShareDir::PAR;
} =
JSON->new->relaxed->utf8->decode (my $f = _get_shared_file ("content.json"));
my $stypes = $self->{content}->{sector_types}
or die "No sector types defined in content.json!\n";
f
ry {
my ($self) = @_;
my $shpdb = $self->{txt_db}->{ship};
#d#print "TEXT TREE FROM: " . JSON->new->pretty->encode ($shpdb) . "\n";
my %nodes;
for (keys %$shpdb) {
my $con = del
Role::FileGatherer';
with 'Dist::Zilla::Role::FileMunger';
use Dist::Zilla::File::FromCode;
use JSON 2;
use Path::Class;
use Capture::Tiny qw/capture/;
has 'npm_root' => (
isa => 'Str',
most {} brackets
$components =~ m/(\{.*\})/s;
$components = $1;
my $deploys = decode_json $components;
foreach my $deploy (keys(%$deploys)) {
$self->concatenate_for_task($dep
a simple JavaScript assignment (to allow inclusion via <script> tag) of the JSON structure.
First level entries of the JSON structure defines a bundles. Each bundle is an array of entries.
Entry, s
scape) to escape data for HTML script sections (Japanese)
L<RFC4627> - The application/json Media Type for JSON
=head1 LICENSE
This library is free software; you can redistribute it and/or modify
i
see <http://www.gnu.org/licenses/>.
#
package Games::Construder::Protocol;
use common::sense;
use JSON;
require Exporter;
use POSIX qw/floor/;
our @ISA = qw/Exporter/;
our @EXPORT = qw/
packet2dat
Games::Construder::Protocol - Client-Server Protocol Utility Functions
=over 4
=cut
my $JS = JSON->new;
sub packet2data {
my ($header, $body) = @_;
my $hdr_data = $JS->encode ($header);
struder::Server;
use common::sense;
use AnyEvent;
use AnyEvent::Handle;
use AnyEvent::Socket;
use JSON;
use Games::Construder::Protocol;
use Games::Construder::Server::Resources;
use Games::Construde
with this program. If not, see <http://www.gnu.org/licenses/>.
#
package Games::Construder;
use JSON;
use common::sense;
use Time::HiRes qw/time/;
use Games::Construder::Logging;
require Exporter;
# show_region_sectors
my %sectors;
my $wg = JSON->new->relaxed->decode (_get_file ("res/world_gen.json"));
for my $type (keys %{$wg->{sector_types}}) {
ion_sector <sector type>
my ($type) = @arg;
my $wg = JSON->new->relaxed->decode (_get_file ("res/world_gen.json"));
my $s = $wg->{sector_types}->{$type};
my $r = $s
RACT: Generate the `package.json` file, suitable for `npm` package manager
use Moose;
with 'Dist::Zilla::Role::FileGatherer';
use Dist::Zilla::File::FromCode;
use JSON 2;
use Path::Class;
use Fi
$self->add_file(Dist::Zilla::File::FromCode->new({
name => file('package.json') . '',
code => sub {
my $package = {};
ackage->{ bin } = $self->bin if $self->bin;
return JSON->new->utf8(1)->pretty(1)->encode($package)
}
}));
# backward compat with np
r;
use Time::HiRes qw/time/;
use Carp qw/confess/;
use Compress::LZF qw/decompress compress/;
use JSON;
use Storable qw/dclone/;
use Games::Construder::Logging;
require Exporter;
our @ISA = qw/Export
n bytes, but only got ".length ($data)."!");
return -1;
}
my $meta = eval { JSON->new->relaxed->utf8->decode ($metadata) };
if ($@) {
ctr_log (error => "map sector
->{tmp} = {}; # don't store entity temporary data (might contain objects)
}
my $meta_data = JSON->new->utf8->pretty->encode ($meta || {});
my $data = join "", @chunks;
my $filedata = comp
construder"
: File::Spec->tmpdir . "/construder";
our $CLCONFIG = "construder_client.json";
sub new {
my $this = shift;
my $class = ref ($this) || $this;
my $self = { @_ };
sub load_config {
my ($self) = @_;
if (-e "$VARDIR/$CLCONFIG") {
$self->{config} = JSON->new->pretty->utf8->decode (_get_file ("$VARDIR/$CLCONFIG"));
} else {
$self->{config}
ambient_light => 0.2,
};
}
}
sub save_config {
my ($self) = @_;
my $cfg = JSON->new->pretty->utf8->encode ($self->{config} ||= {});
my $file = $VARDIR . "/" . $CLCONFIG;
e App::locket;
BEGIN {
$App::locket::VERSION = '0.0022';
}
# ABSTRACT: Copy secrets from a YAML/JSON cipherstore into the clipboard (pbcopy, xsel, xclip)
use strict;
use warnings;
BEGIN {
# Sa
n';
}
use Term::ReadKey;
END {
ReadMode 0;
}
use File::HomeDir;
use Path::Class;
use JSON; my $JSON = JSON->new->pretty;
use YAML::XS();
use File::Temp;
use Term::EditorEdit;
use Try::Tiny;
use S
;
return join '', <$pipe>;
}
1;
=pod
=head1 NAME
App::locket - Copy secrets from a YAML/JSON cipherstore into the clipboard (pbcopy, xsel, xclip)
=head1 VERSION
version 0.0022
=head1 SYNO
om qw/ makerandom_octet /;
use Digest::SHA qw/ sha256 sha256_hex /;
use MIME::Base64;
use JSON; my $JSON = JSON->new->pretty;
use File::HomeDir;
use Path::Class;
use Term::ReadKey;
use YAML::XS();
use
phrase ) {
my $ciphercfg = $self->pickle( $self->generate_keylet, $passphrase, $plaincfg, json => 1 );
$cfg_file->openw->print( $ciphercfg );
}
else {
$cfg_file->openw-
ore;
my $store;
try {
if ( $plainstore =~ m/^\s*\{/ )
{ $store = $JSON->decode( $plainstore ) }
else { $store = YAML::XS::Load( $plainstore ) }
};
di
shRef[Str]|Undef', required => 0 );
# JSON boolean values, coerced into 1|0 (Not Required)
has [qw/ zone_exists zone_hosted /]
=> ( is => 'ro', isa => 'json_bool', required => 0, coerce => 1 );
is => 'rw', isa => 'Str', required => 0 );
# JSON boolean values, coerced into 1|0 (Not Required)
has [qw/ zone_deleted /]
=> ( is => 'ro', isa => 'json_bool', coerce => 1, required => 0 );
1;
package App::Donburi::Web::C::JSONRPC;
use strict;
use warnings;
use parent 'App::Donburi::Web::C';
use JSON;
use App::Donburi::Util;
sub do_call {
my $self = shift;
my $method = $self->re
q->param('method');
my $params = JSON->new->utf8->decode($self->req->param('params') || {});
my $text = $params->{text};
my $channel = $params->{channel};
unless (
$method eq
error?
return [
500,
[ 'Content-Type' => 'application/json' ],
[ JSON->new->utf8->encode({ message => 'internal server error', code => 000 }) ]
];
package Plack::Middleware::SocketIO::Base;
use strict;
use warnings;
use JSON ();
use Encode ();
use Try::Tiny;
use Scalar::Util qw(weaken);
use Plack::Request;
use Plack::Middleware::SocketIO::H
er = Router::Simple->new();
$router->connect('/', { controller => 'JSONRPC', action => 'call' }, {on_match => \&is_called_json_rpc});
$router->connect('/', { controller => 'Root', action => 'i
->{action}, $res);
} else {
return [ 404, [], ['not found'] ];
}
}
sub is_called_json_rpc {
my ($env, $match) = @_;
my $req = App::Donburi::Web::Request->new($env);
return
has [qw/ zones /]
=> ( is => 'rw', isa => 'ArrayRef[Str]|Undef', required => 0 );
has [qw/ user_exists user_authed /]
=> ( is => 'rw', isa => 'json_bool', required => 1, coerce => 1 );
1;
age App::SD::Server::Static;
use Any::Moose;
extends 'App::SD::Server';
use Params::Validate;
use JSON;
sub log_request { }
sub send_content {
my $self = shift;
my %args = validate( @_, { co
=> 0, static => 0 } );
if ( $args{'encode_as'} && $args{'encode_as'} eq 'json' ) {
$args{'content'} = to_json( $args{'content'} );
}
return $args{'content'};
}
sub _send_redirec
Any setting, including multiple settings, may be set this way.
Setting values must be valid JSON.
Settings are not the same as local configuration variables. For
more information on local confi