@@ -1,27 +1,27 @@ |
||
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 | /** |
16 | 16 | * @param string $data |
17 | 17 | */ |
18 | 18 | function Archive($data,$filehandle=null) { |
19 | - if(is_resource($filehandle)) { |
|
20 | - return false; |
|
21 | - } |
|
22 | - $data = gzcompress($data); |
|
23 | - $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data; |
|
24 | - return $data; |
|
19 | + if(is_resource($filehandle)) { |
|
20 | + return false; |
|
21 | + } |
|
22 | + $data = gzcompress($data); |
|
23 | + $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data; |
|
24 | + return $data; |
|
25 | 25 | |
26 | 26 | } |
27 | 27 | ?> |
28 | 28 | \ No newline at end of file |
@@ -1,22 +1,22 @@ |
||
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); |
|
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 | 6 | $data = gzuncompress($data); |
7 | 7 | return $data; |
8 | 8 | } |
9 | 9 | die('Couldn\'t dearchive -- Probably invalid file'); |
10 | 10 | return false; |
11 | - } else if(is_resource($data)) { |
|
11 | + } else if (is_resource($data)) { |
|
12 | 12 | return false; //coming soon |
13 | 13 | } |
14 | 14 | } |
15 | 15 | /** |
16 | 16 | * @param string $data |
17 | 17 | */ |
18 | -function Archive($data,$filehandle=null) { |
|
19 | - if(is_resource($filehandle)) { |
|
18 | +function Archive($data, $filehandle = null) { |
|
19 | + if (is_resource($filehandle)) { |
|
20 | 20 | return false; |
21 | 21 | } |
22 | 22 | $data = gzcompress($data); |
@@ -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); |
@@ -168,14 +168,14 @@ discard block |
||
168 | 168 | } |
169 | 169 | /// @brief Sets the install script |
170 | 170 | /** |
171 | - * @param $installScript the text of the script to add |
|
171 | + * @param string $installScript the text of the script to add |
|
172 | 172 | */ |
173 | 173 | public function SetInstallScript($installScript) { |
174 | 174 | $this->installScript = $installScript; |
175 | 175 | } |
176 | 176 | /// @brief Sets the remover script |
177 | 177 | /** |
178 | - * @param $removeScript The text of the script to add |
|
178 | + * @param string $removeScript The text of the script to add |
|
179 | 179 | */ |
180 | 180 | public function SetRemoveScript($removeScript) { |
181 | 181 | $this->removeScript = $removeScript; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | /// @brief Sets the date this agent will expire |
202 | 202 | /** |
203 | - * @param $time The date this agent will expire as a UNIX timestamp |
|
203 | + * @param integer $time The date this agent will expire as a UNIX timestamp |
|
204 | 204 | */ |
205 | 205 | public function SetExpiryDate($time) { |
206 | 206 | $this->expiryDate = $time; |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | |
391 | 391 | /// @brief Creates a new COBDependency |
392 | 392 | /** @param string $type The type of dependency ('sprite' or 'sound'). |
393 | - * @param $name The name of the dependency (four characters, no file extension) |
|
393 | + * @param string $name The name of the dependency (four characters, no file extension) |
|
394 | 394 | */ |
395 | 395 | public function COBDependency($type, $name) { |
396 | 396 | $this->type = $type; |