@@ -1,24 +1,24 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | function DeArchive($data) { |
| 3 | - if(is_string($data)) { |
|
| 4 | - if(substr($data,0,55) == "Creatures Evolution Engine - Archived information file.") { |
|
| 5 | - $data = substr($data,strpos($data,chr(0x1A).chr(0x04))+2); |
|
| 6 | - $data = gzuncompress($data); |
|
| 7 | - return $data; |
|
| 8 | - } |
|
| 9 | - die('Couldn\'t dearchive -- Probably invalid file'); |
|
| 10 | - return false; |
|
| 11 | - } else if(is_resource($data)) { |
|
| 12 | - return false; //coming soon |
|
| 13 | - } |
|
| 3 | + if(is_string($data)) { |
|
| 4 | + if(substr($data,0,55) == "Creatures Evolution Engine - Archived information file.") { |
|
| 5 | + $data = substr($data,strpos($data,chr(0x1A).chr(0x04))+2); |
|
| 6 | + $data = gzuncompress($data); |
|
| 7 | + return $data; |
|
| 8 | + } |
|
| 9 | + die('Couldn\'t dearchive -- Probably invalid file'); |
|
| 10 | + return false; |
|
| 11 | + } else if(is_resource($data)) { |
|
| 12 | + return false; //coming soon |
|
| 13 | + } |
|
| 14 | 14 | } |
| 15 | 15 | function Archive($data,$filehandle=null) { |
| 16 | - if(is_resource($filehandle)) { |
|
| 17 | - return false; |
|
| 18 | - } |
|
| 19 | - $data = gzcompress($data); |
|
| 20 | - $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data; |
|
| 21 | - return $data; |
|
| 16 | + if(is_resource($filehandle)) { |
|
| 17 | + return false; |
|
| 18 | + } |
|
| 19 | + $data = gzcompress($data); |
|
| 20 | + $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data; |
|
| 21 | + return $data; |
|
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | ?> |
| 25 | 25 | \ No newline at end of file |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | /** As defaults can be made for everything else these are the only non-optional |
| 52 | 52 | * parts of a COB file in my opinion. Even then they could just be '' if you |
| 53 | 53 | * really felt like it. |
| 54 | - * @param $agentName The name of the agent (as displayed in the C2 injector) |
|
| 55 | - * @param $agentDescription The description of the agent (as displayed in the C2 injector) |
|
| 54 | + * @param string|false $agentName The name of the agent (as displayed in the C2 injector) |
|
| 55 | + * @param string $agentDescription The description of the agent (as displayed in the C2 injector) |
|
| 56 | 56 | */ |
| 57 | 57 | public function COBAgentBlock($agentName, $agentDescription) { |
| 58 | 58 | parent::COBBlock(COB_BLOCK_AGENT); |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | |
| 382 | 382 | /// @brief Creates a new COBDependency |
| 383 | 383 | /** @param string $type The type of dependency ('sprite' or 'sound'). |
| 384 | - * @param $name The name of the dependency (four characters, no file extension) |
|
| 384 | + * @param string $name The name of the dependency (four characters, no file extension) |
|
| 385 | 385 | */ |
| 386 | 386 | public function COBDependency($type, $name) { |
| 387 | 387 | $this->type = $type; |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | * (number of seconds passed since 1st Jan, 1970) |
| 120 | 120 | * @param $lifestage The lifestage this creature had achieved at |
| 121 | 121 | * the time of this event. |
| 122 | - * @param $moniker1 The first moniker associated with this event. |
|
| 123 | - * @param $moniker2 The second moniker associated with this event. |
|
| 124 | - * @param $usertext The user text assosciated with this event. |
|
| 125 | - * @param $photograph The photograph associated with this event. |
|
| 126 | - * @param $worldname The name of the world the creature was inhabiting at the time of this event |
|
| 127 | - * @param $worldUID The UID of the world the creature was inhabiting at the the time of this event |
|
| 122 | + * @param false|string $moniker1 The first moniker associated with this event. |
|
| 123 | + * @param false|string $moniker2 The second moniker associated with this event. |
|
| 124 | + * @param false|string $usertext The user text assosciated with this event. |
|
| 125 | + * @param false|string $photograph The photograph associated with this event. |
|
| 126 | + * @param false|string $worldname The name of the world the creature was inhabiting at the time of this event |
|
| 127 | + * @param false|string $worldUID The UID of the world the creature was inhabiting at the the time of this event |
|
| 128 | 128 | */ |
| 129 | 129 | public function CreatureHistoryEvent($eventtype, $worldtime, $creatureage, $timestamp, $lifestage, $moniker1, $moniker2, $usertext, $photograph, $worldname, $worldUID) { |
| 130 | 130 | $this->eventtype = $eventtype; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | /// @brief Add DS-specific information to the CreatureHistoryEvent |
| 144 | 144 | /** |
| 145 | - * @param $DSUserID The UID of the Docking Station user whose world the creature was in at the time of the event |
|
| 145 | + * @param false|string $DSUserID The UID of the Docking Station user whose world the creature was in at the time of the event |
|
| 146 | 146 | * @param $unknown1 I don't know! But it comes right after the DSUID in the GLST format. |
| 147 | 147 | * @param $unknown2 I don't know! But it comes right after unknown1. |
| 148 | 148 | */ |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * will be read from the PRAYFile. |
| 14 | 14 | * @param PRAYFile $prayfile The PRAYFile associated with this AGNT block. |
| 15 | 15 | * It is allowed to be null. |
| 16 | - * @param $name The name of this block. |
|
| 16 | + * @param string $name The name of this block. |
|
| 17 | 17 | * @param $content This block's content. |
| 18 | 18 | * @param $flags Any flags this block may have. I think this is a |
| 19 | 19 | * single byte. Check http://www.creatureswiki.net/wiki/PRAY |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * Sometimes this ends in .agnt or .dsag, because some people |
| 28 | 28 | * don't do their PRAYING properly. |
| 29 | - * @return The agent name |
|
| 29 | + * @return string agent name |
|
| 30 | 30 | */ |
| 31 | 31 | public function GetAgentName() { |
| 32 | 32 | return $this->GetName(); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | /// @brief Instantiates a new CreaturesArchiveBlock |
| 13 | 13 | /** |
| 14 | - * @param $prayfile The PRAYFile this CreaturesArchive belongs to. May be null. |
|
| 14 | + * @param PRAYFile $prayfile The PRAYFile this CreaturesArchive belongs to. May be null. |
|
| 15 | 15 | * @param $name The name of this block |
| 16 | 16 | * @param $content This block's binary data. |
| 17 | 17 | * @param $flags the flags of this block |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * will be read from the PRAYFile. |
| 15 | 15 | * @param PRAYFile $prayfile The PRAYFile associated with this AGNT block. |
| 16 | 16 | * It is allowed to be null. |
| 17 | - * @param $name The name of this block. |
|
| 17 | + * @param string $name The name of this block. |
|
| 18 | 18 | * @param $content This block's content. |
| 19 | 19 | * @param $flags Any flags this block may have. I think this is a |
| 20 | 20 | * single byte. Check http://www.creatureswiki.net/wiki/PRAY |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * will be read from the PRAYFile. |
| 20 | 20 | * @param PRAYFile $prayfile The PRAYFile this FILEBlock belongs to. Can |
| 21 | 21 | * be null. |
| 22 | - * @param $name The name of this file block (also the file's |
|
| 22 | + * @param string $name The name of this file block (also the file's |
|
| 23 | 23 | * name) |
| 24 | 24 | * @param $content The binary data of this file block. |
| 25 | 25 | * @param $flags The block's flags. See PrayBlock. |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | * If $prayfile is not null, all the data for this block |
| 16 | 16 | * will be read from the PRAYFile. |
| 17 | 17 | * @param PRAYFile $prayfile The PRAYFile object this block belongs to. Can be null. |
| 18 | - * @param $name The block's name. This is a creature's moniker with .genetics appended. |
|
| 18 | + * @param string $name The block's name. This is a creature's moniker with .genetics appended. |
|
| 19 | 19 | * @param $content The block's binary data. Used when constructing from a PrayFile |
| 20 | 20 | * @param $flags The block's flags, which apply to the binary data as-is. |
| 21 | 21 | */ |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * will be read from the PRAYFile. |
| 34 | 34 | * @param PRAYFile $object The PRAYFile this FILEBlock belongs to, or the |
| 35 | 35 | * CreatureHistory object to store. <b>Cannot</b> be null. |
| 36 | - * @param $name The name of this block. I think it's usually the |
|
| 36 | + * @param string $name The name of this block. I think it's usually the |
|
| 37 | 37 | * creature's moniker with .GLST appended. |
| 38 | 38 | * @param $content The binary data of this file block. |
| 39 | 39 | * @param $flags The block's flags. See PrayBlock. |