-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
81 lines (48 loc) · 2.14 KB
/
index.php
File metadata and controls
81 lines (48 loc) · 2.14 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
// Kickstart the framework
$f3=require('lib/base.php');
$f3->config('config.ini');
// Database connection
$f3->set('conn',$db=new DB\SQL('mysql:host=localhost;port=3306;dbname=ryszardDB','root',''));
session_start();
if(!empty($_SESSION['char_id'])){
$f3->set('newcurrency', $db->exec('SELECT currency FROM characters WHERE char_id=?', $_SESSION['char_id'])[0]['currency']);
}
include('php/functions.php');
include('php/Items.php');
include('php/Settings.php');
include('php/fight.php');
$f3->route('GET @home: /','home->gethome');
$f3->route('GET /fight','fight->fight_kurwa');
$f3->route('GET @outbox: /outbox','mail->getoutbox');
$f3->route('GET @inbox: /inbox','mail->getinbox');
$f3->route('GET @mail: /mail','mail->getmail');
$f3->route('POST /mail','mail->postmail');
$f3->route('GET @login: /login','login->getlogin');
$f3->route('GET @missions: /missions','home->missions');
$f3->route('GET @profile: /profile', 'home->profile');
$f3->route('GET @armoryShop: /armory', 'items->armoryShop');
$f3->route('GET @accessoryShop: /accessories', 'items->accessoryShop');
$f3->route('POST /itemShop/sellItem/@type', 'items->item_sell');
$f3->route('POST /itemShop/buyItem/@type', 'items->item_buy');
$f3->route('POST /itemShop/reroll/@type', 'items->reroll');
$f3->route('POST /itemShop/equipitem', 'items->equip');
$f3->route('POST /itemShop/unequipitem', 'items->unequip');
$f3->route('POST /choosemission','home->choosemission');
$f3->route('POST /register','register->inserting_data');
$f3->route('GET @login: /login','login->getlogin');
$f3->route('POST /login','login->postlogin');
$f3->route('GET /register',
function($f3) {
echo \Template::instance()->render('register.html');
}
);
$f3->route('GET @createchar: /createchar','register->createchar');
$f3->route('POST /createchar','register->postcreatechar');
$f3->route('GET /getCharacterIcons', 'register->getCharacterIcons');
$f3->route('POST @logintoserver: /logintoserver','login->logintoserver');
$f3->route('POST /logout','login->logout');
// Settings related
$f3->route('GET /settings','settings->page');
$f3->route('POST /changePassword','settings->change_password');
$f3->run();