Roman M. Parparov > Empire-0.121 > Empire



Annotate this POD

View/Report Bugs
Module Version: 0.121   Source  


Empire - an interface for the Empire game


  use Empire;
  my $empire = Empire(-full=>1, # or 0
  if ($empire->{SOCKET}) {
      my ($status,$data) = $empire->empreadline();


This is a module that provides a connection interface to the Wolfpack Empire server. The constructor reads the server and the login data and creates a socket to the server. Then the following main methods become available:


new Empire(%args).

The arguments as shown in synopsis are quite self-explainable. The -full argument indicates that the additional utility modules (Ship, Sector, Plane etc. - which are not fully ready yet) should also be loaded.



This one just sends a command to the server



This reads lines from the server until a prompt or a connection close protocol response is received. The inform, flash and data responses are consumed into three different variables to be manipulated correctly by the implementing program. A special treatment for notifying telegrams and announcements also exists.

coun pass user empkill killit play

$empire->coun($coun) et al.

These are methods used by the login procedure including killing the connection.


%empstatus = $empire->empstatus();

This method returns a hash containing the field EMPSTATUS which is the last protocol response the server sent and the textual string accompanying it.



This method is implemented for future use to serve as an information exchange buffer.

host port country player name

$empire->host() et al.

These methods serve the clients to find out information about the current connection in the $empire object.

minutes btu



These methods provide information about the BTU (Bureaucratic Time Units) and the time used in the game by the player as presented in the main game prompt.

hasflash hasinform hastele hasanno clearflash clearinform cleartele clearanno

$empire->hasflash() et al.

These methods manipulate the received flash, inform, telexes and announcements as read by the empreadline method.



Obvoious. =back


The protocol numbers of the Empire server are being exported.


The Wolfpack Empire site

The Wolfpack Empire Server project

Programs based on this module:


Roman M. Parparov, <>


Copyright (C) 2004 by Roman M. Parparov

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

syntax highlighting: