Planetarion Database Dump: Difference between revisions

From Planetarion Wiki
Jump to navigationJump to search
No edit summary
Line 38: Line 38:
         $planet[3], '$planet [4]', '$planets[5]', '$planet[6]', $planet[7], $planet[8] )" );  
         $planet[3], '$planet [4]', '$planets[5]', '$planet[6]', $planet[7], $planet[8] )" );  
  }
  }
  ?>
  ?>
And here is the MySQL table structure to go with it:
CREATE TABLE `planets` (
  `x` int(10) unsigned NOT NULL default '0',
  `y` int(10) unsigned NOT NULL default '0',
  `z` int(10) unsigned NOT NULL default '0',
  `planet` varchar(70) NOT NULL default '',
  `ruler` varchar(70) NOT NULL default '',
  `race` varchar(15) NOT NULL default '',
  `roids` bigint(20) unsigned NOT NULL default '0',
  `score` bigint(20) NOT NULL default '0',
  PRIMARY KEY  (`planet`)
) TYPE=MyISAM;


[[Category:Terminology]]
[[Category:Terminology]]

Revision as of 03:24, 3 January 2005

Description

The Planetarion Database Dumps are files with ingame information from Planetarion. They show planet, galaxy and alliance information, such as score, size and value.

These dump file(s) are usually used in Arbiter's and the various.

The dumpfiles are available at:

http://jpaweb01.planetarion.com/botfiles/planet_listing.txt

http://jpaweb01.planetarion.com/botfiles/galaxy_listing.txt

http://jpaweb01.planetarion.com/botfiles/alliance_listing.txt

Tools

Many alliances write their own tools using these dumpfiles, and sites such as sandmans and pilkara also utilize them.

Here are some basic php code examples on how to use em:

<?

mysql_connect( "host", "user", "pass" );
mysql_select_db( "database" ); 

$planetList = file_get_contents( "http://jpaweb01.planetarion.com/botfiles/planet_listing.txt" );

preg_match_all( "/(\d+)\t(\d+)\t(\d+)\t\"(.+)\"\t\"(.+)\"\t(.+)\t(\d+)\t(\d+)/i", 
$planetList,  $planetArray, PREG_SET_ORDER );
	
		
mysql_query( "TRUNCATE TABLE planets" );

foreach ( $planetArray as $planet )
{
	mysql_query( "INSERT INTO planets VALUES ( $planet[1], $planet[2], 
       $planet[3], '$planet [4]', '$planets[5]', '$planet[6]', $planet[7], $planet[8] )" ); 
}

?>

And here is the MySQL table structure to go with it:

CREATE TABLE `planets` (
 `x` int(10) unsigned NOT NULL default '0',
 `y` int(10) unsigned NOT NULL default '0',
 `z` int(10) unsigned NOT NULL default '0',
 `planet` varchar(70) NOT NULL default ,
 `ruler` varchar(70) NOT NULL default ,
 `race` varchar(15) NOT NULL default ,
 `roids` bigint(20) unsigned NOT NULL default '0',
 `score` bigint(20) NOT NULL default '0',
 PRIMARY KEY  (`planet`)
) TYPE=MyISAM;