1. Requirements
  2. Installation
  3. Functions
  4. Usage
  5. Examples
  6. MediaWiki Extension

Requirements

All that is required to use the DRCSL is a normal PHP 5 installation. This installation needs to have cURL turned on to do the fetching. Also, the current version uses UNIXy paths so until that's changed Windows servers may not work.

Top

Installation

Installation of DRCSL is rather easy. Download the latest release, unzip it inside the folder you want your character viewer in (bearing in mind that the zip doesnt' contain an internal folder) and do a simple include() or require_once() of drcsl.php.
The result of unzipping will give you the class files (such as Character.php) inside your working directory, the config/include file (drcsl.php), as well as an example viewer (character_example.php) that you can edit however you want. drcsl.php is the file to edit for any configuration changes (in the future), and to include since it includes all required classes.

Top

Functions

System Functions

"Setter" Functions

"Getter" Functions

  • get_char_attribute($attr)
  • get_char_bonus($attr)
  • get_char_defense()
  • get_char_info($type)
  • get_char_item($slot)
  • get_char_resist($attr)
  • get_char_skill($slot)
  • get_char_weapon($hand)

"Cheat" Functions

  • get_char_skills()
  • get_char_items()
  • get_char_bonuses()
  • get_char_resistances()
Top

Usage

Basic usage involves including drcsl.php, creating a new Character, then displaying information from it. No cleanup is required.

<?php
    include("drcsl.php");
    $billy = new Character("Segfault");
    echo $billy->get_char_info('Name');
?>
                

Top

Examples

Basic usage example, as shown above.

<?php
    include("drcsl.php");
    $billy = new Character("Segfault");
    echo $billy->get_char_info('Name');
?>
                
Output:
Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 171: parser error : Entity 'nbsp' not defined in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: &nbsp; in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 217: parser error : Entity 'copy' not defined in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: <p class="copyright">&copy; 2009 NCsoft Corporation. All Rights Reserved. NCso in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 218: parser error : Opening and ending tag mismatch: p line 170 and div in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </div> in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 239: parser error : Opening and ending tag mismatch: div line 59 and body in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </body> in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 240: parser error : Opening and ending tag mismatch: body line 58 and html in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </html> in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 242: parser error : Premature end of data in tag html line 2 in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php:510 Stack trace: #0 /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php(510): SimpleXMLElement->__construct('<!DOCTYPE html ...') #1 /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php(466): Character->fetch_character_curl('Segfault') #2 /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php(37): Character->fetch_character('Segfault') #3 /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/documentation.php(196): Character->__construct('Segfault') #4 {main} thrown in /home/.empire/snarky/threeplanetssoftware.com/software/php_dr_library/Character.php on line 510