-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathgenerator.php
60 lines (43 loc) · 1.69 KB
/
generator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* @fileoverview generator.php, display what the fuck you want !
* @author Vincent Thibault (alias KeyWorld - Twitter: @robrowser)
* @version 1.0.0
*/
// Avoid direct access
defined("__ROOT__") OR die();
// Include Render class
require_once( __ROOT__ . 'render/class.CharacterRender.php' );
class Generator_Controller extends Controller {
/**
* Process entry
*/
public function process($sex, $jobid, $clothes_color, $hair, $hair_color, $doridori, $head_top, $head_mid, $head_bottom, $weapon, $shield, $robe, $option, $direction, $action, $animation )
{
header('Content-type:image/png');
header('Cache-Control: max-age=30000, public');
// Load Class and set parameters
// intval() is needed because parameters are received as
// string but compared with "===" to int (which result to false: "5" === 5 -> false).
$chargen = new CharacterRender();
$chargen->action = intval($action);
$chargen->direction = intval($direction);
$chargen->body_animation = intval($animation);
$chargen->sex = $sex;
$chargen->class = intval($jobid);
$chargen->clothes_color = intval($clothes_color);
$chargen->hair = intval($hair);
$chargen->hair_color = intval($hair_color);
$chargen->doridori = intval($doridori);
$chargen->head_top = intval($head_top);
$chargen->head_mid = intval($head_mid);
$chargen->head_bottom = intval($head_bottom);
$chargen->weapon = intval($weapon);
$chargen->shield = intval($shield);
$chargen->robe = intval($robe);
$chargen->option = intval($option);
// Generate Image
$img = $chargen->render();
imagepng($img);
}
}