├── .gitignore
├── LICENSE
├── MCCodes2_Manual.htm
├── README.md
├── ad_filler.png
├── announcements.php
├── attack.php
├── attackbeat.php
├── attacklost.php
├── attacktake.php
├── attackwon.php
├── authenticate.php
├── bank.php
├── bargreen.gif
├── barred.gif
├── battletent.php
├── blacklist.php
├── bluebar.png
├── captcha_verify.php
├── check.php
├── checkem.php
├── checkun.php
├── class
├── bbcode_engine.php
├── class_bbcode.php
├── class_db_mysqli.php
└── index.html
├── cmarket.php
├── contactlist.php
├── creategang.php
├── criminal.php
├── crons
├── CronHandler.php
├── classes
│ ├── CronFiveMinute.php
│ ├── CronOneDay.php
│ ├── CronOneHour.php
│ └── CronOneMinute.php
└── cronless_crons.php
├── crystaltemple.php
├── css
├── game.css
├── index.html
├── installer.css
├── login.css
└── register.css
├── cyberbank.php
├── dbdata.sql
├── dgrad.jpg
├── dgradl.jpg
├── dgradr.jpg
├── dlarchive.php
├── docker-compose.yml
├── docrime.php
├── donator.gif
├── donator.php
├── donatordone.php
├── education.php
├── equip_armor.php
├── equip_weapon.php
├── estate.php
├── events.php
├── explore.php
├── fedjail.php
├── forums.php
├── friendslist.php
├── gamerules.php
├── gangcentral.php
├── gangs.php
├── gangwars.php
├── global_func.php
├── globals.php
├── globals_nonauth.php
├── greenbar.png
├── gym.php
├── halloffame.php
├── header.php
├── helptutorial.php
├── hospital.php
├── imadd.php
├── index.php
├── installer.php
├── installer_foot.php
├── installer_head.php
├── inventory.php
├── ipn_donator.php
├── ipn_wp.php
├── itembuy.php
├── iteminfo.php
├── itemmarket.php
├── itemsell.php
├── itemsend.php
├── itemuse.php
├── jail.php
├── jailbail.php
├── jailbust.php
├── jailuser.php
├── job.php
├── js
├── index.html
├── jquery-1.7.1.min.js
├── login.js
└── register.js
├── lgrad.jpg
├── lib
├── basic_error_handler.php
├── index.html
└── installer_error_handler.php
├── linegrad.PNG
├── loggedin.php
├── login.php
├── logo.png
├── logout.php
├── lucky.php
├── macro1.php
├── macro2.php
├── mailban.php
├── mailbox.php
├── mainmenu.php
├── mcc_splash_2.png
├── monorail.php
├── newspaper.php
├── oclog.php
├── polling.php
├── polls_view.php
├── preferences.php
├── preport.php
├── redbar.png
├── register.php
├── rgrad.jpg
├── roulette.php
├── search.php
├── searchlocation.php
├── searchname.php
├── sendbank.php
├── sendcash.php
├── sendcrys.php
├── sendcyber.php
├── sglobals.php
├── shops.php
├── slotsmachine.php
├── smenu.php
├── staff.php
├── staff_api.php
├── staff_battletent.php
├── staff_cities.php
├── staff_courses.php
├── staff_crimes.php
├── staff_forums.php
├── staff_gangs.php
├── staff_houses.php
├── staff_items.php
├── staff_jobs.php
├── staff_logs.php
├── staff_polls.php
├── staff_punit.php
├── staff_roles.php
├── staff_shops.php
├── staff_special.php
├── staff_users.php
├── stafflist.php
├── staffnotes.php
├── stats.php
├── tablehgrad.png
├── title.jpg
├── unequip.php
├── userlist.php
├── usersonline.php
├── views
├── assets
│ ├── css
│ │ └── staff.css
│ └── js
│ │ └── staff.js
└── staff-roles
│ ├── index.html
│ ├── role-grant.html
│ ├── role-index-entry.html
│ ├── role-index.html
│ ├── role-remove.html
│ ├── role-revoke.html
│ ├── role-selection-menu.html
│ └── role-upsert.html
├── viewuser.php
├── willpdone.php
├── willpotion.php
├── yellowbar.png
└── yourgang.php
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/*
2 | .DS_Store
3 | config.php
4 | vendor
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Dave Macaulay & MCCodes
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/ad_filler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/ad_filler.png
--------------------------------------------------------------------------------
/announcements.php:
--------------------------------------------------------------------------------
1 | query(
14 | 'SELECT `a_text`, `a_time` FROM `announcements` '
15 | . 'ORDER BY `a_time` DESC');
16 | echo '
17 |
18 |
19 | Time
20 | Announcement
21 |
22 | ';
23 | while ($r = $db->fetch_row($q))
24 | {
25 | if ($ac > 0)
26 | {
27 | $ac--;
28 | $new = 'New! ';
29 | }
30 | else
31 | {
32 | $new = '';
33 | }
34 | $r['a_text'] = nl2br($r['a_text']);
35 | echo '
36 |
37 | ' . date('F j Y, g:i:s a', (int)$r['a_time']) . $new
38 | . '
39 | ' . $r['a_text'] . '
40 |
41 | ';
42 | }
43 | $db->free_result($q);
44 | echo '
';
45 | if ($ir['new_announcements'] > 0)
46 | {
47 | $db->query(
48 | 'UPDATE `users` ' . 'SET `new_announcements` = 0 '
49 | . "WHERE `userid` = '{$userid}'");
50 | }
51 | $h->endpage();
52 |
--------------------------------------------------------------------------------
/attacklost.php:
--------------------------------------------------------------------------------
1 | query(
21 | "SELECT `username`, `level`, `gang` FROM `users` WHERE `userid` = {$_GET['ID']}");
22 | if ($db->num_rows($od) > 0)
23 | {
24 | $r = $db->fetch_row($od);
25 | $db->free_result($od);
26 | echo "You lost to {$r['username']}";
27 | $expgain = abs(($ir['level'] - $r['level']) ^ 3);
28 | $expgainp = $expgain / $ir['exp_needed'] * 100;
29 | echo " and lost $expgainp% EXP!";
30 | // Figure out their EXP, 0 or decreased?
31 | $newexp = max($ir['exp'] - $expgain, 0);
32 | $db->query(
33 | "UPDATE `users` SET `exp` = {$newexp}, `attacking` = 0 WHERE `userid` = $userid");
34 | event_add($r['userid'],
35 | "{$ir['username']} attacked you and lost.");
36 | $atklog = $db->escape($_SESSION['attacklog']);
37 | $db->query(
38 | "INSERT INTO `attacklogs` VALUES(NULL, $userid, {$_GET['ID']},
39 | 'lost', " . time() . ", 0, '$atklog')");
40 | if ($ir['gang'] > 0 && $r['gang'] > 0)
41 | {
42 | $warq =
43 | $db->query(
44 | "SELECT * FROM `gangwars`
45 | WHERE (`warDECLARER` = {$ir['gang']} AND `warDECLARED` = {$r['gang']})
46 | OR (`warDECLARED` = {$ir['gang']} AND `warDECLARER` = {$r['gang']})");
47 | if ($db->num_rows($warq) > 0)
48 | {
49 | $war = $db->fetch_row($warq);
50 | $db->query(
51 | "UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` + 1 WHERE `gangID` = {$r['gang']}");
52 | $db->query(
53 | "UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` - 1 WHERE `gangID` = {$ir['gang']}");
54 | echo ' You lost 1 respect for your gang!';
55 | }
56 | $db->free_result($warq);
57 | }
58 | }
59 | else
60 | {
61 | $db->free_result($od);
62 | echo 'You lost to Mr. Non-existent! =O';
63 | }
64 | $h->endpage();
65 |
--------------------------------------------------------------------------------
/authenticate.php:
--------------------------------------------------------------------------------
1 | {$set['game_name']} Error
18 | Your request has expired for security reasons! Please try again.
19 | > Back ");
20 | }
21 | // Check username and password input
22 | $username =
23 | (array_key_exists('username', $_POST) && is_string($_POST['username']))
24 | ? $_POST['username'] : '';
25 | $password =
26 | (array_key_exists('password', $_POST) && is_string($_POST['password']))
27 | ? $_POST['password'] : '';
28 | if (empty($username) || empty($password))
29 | {
30 | die(
31 | "{$set['game_name']} Error
32 | You did not fill in the login form!
33 | > Back ");
34 | }
35 | $form_username = $db->escape(stripslashes($username));
36 | $raw_password = stripslashes($password);
37 | $uq =
38 | $db->query(
39 | "SELECT `userid`, `userpass`, `pass_salt`
40 | FROM `users`
41 | WHERE `login_name` = '$form_username'");
42 | if ($db->num_rows($uq) == 0)
43 | {
44 | $db->free_result($uq);
45 | die(
46 | "{$set['game_name']} Error
47 | Invalid username or password!
48 | > Back ");
49 | }
50 | else
51 | {
52 | $mem = $db->fetch_row($uq);
53 | $db->free_result($uq);
54 | $login_failed = false;
55 | // Pass Salt generation: autofix
56 | if (empty($mem['pass_salt']))
57 | {
58 | if (md5($raw_password) != $mem['userpass'])
59 | {
60 | $login_failed = true;
61 | }
62 | $salt = generate_pass_salt();
63 | $enc_psw = encode_password($mem['userpass'], $salt, true);
64 | $e_salt = $db->escape($salt); // in case of changed salt function
65 | $e_encpsw = $db->escape($enc_psw); // ditto for password encoder
66 | $db->query(
67 | "UPDATE `users`
68 | SET `pass_salt` = '{$e_salt}', `userpass` = '{$e_encpsw}'
69 | WHERE `userid` = {$mem['userid']}");
70 | }
71 | else
72 | {
73 | $login_failed =
74 | !(verify_user_password($raw_password, $mem['pass_salt'],
75 | $mem['userpass']));
76 | }
77 | if ($login_failed)
78 | {
79 | die(
80 | "{$set['game_name']} Error
81 | Invalid username or password!
82 | > Back ");
83 | }
84 | session_regenerate_id();
85 | $_SESSION['loggedin'] = 1;
86 | $_SESSION['userid'] = $mem['userid'];
87 | $IP = $db->escape($_SERVER['REMOTE_ADDR']);
88 | $db->query(
89 | "UPDATE `users`
90 | SET `lastip_login` = '$IP', `last_login` = "
91 | . $_SERVER['REQUEST_TIME']
92 | . "
93 | WHERE `userid` = {$mem['userid']}");
94 | if ($set['validate_period'] == 'login' && $set['validate_on'])
95 | {
96 | $db->query(
97 | "UPDATE `users`
98 | SET `verified` = 0
99 | WHERE `userid` = {$mem['userid']}");
100 | }
101 | $loggedin_url = 'https://' . determine_game_urlbase() . '/loggedin.php';
102 | header("Location: {$loggedin_url}");
103 | exit;
104 | }
105 |
--------------------------------------------------------------------------------
/bargreen.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/bargreen.gif
--------------------------------------------------------------------------------
/barred.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/barred.gif
--------------------------------------------------------------------------------
/battletent.php:
--------------------------------------------------------------------------------
1 | Battle Tent
13 | Welcome to the battle tent! Here you can challenge NPCs for money.
14 |
15 |
16 | Bot Name
17 | Level
18 | Times Owned
19 | Ready To Be Challenged?
20 | Location
21 | Money Won
22 | Challenge
23 | ";
24 | $q =
25 | $db->query(
26 | "SELECT `cb`.`cb_money`, `c`.`npcid`, `cy`.`cityname`,
27 | `u`.`userid`, `username`, `level`, `hp`, `maxhp`, `location`, `hospital`, `jail`
28 | FROM `challengebots` AS `cb`
29 | LEFT JOIN `users` AS `u` ON `cb`.`cb_npcid` = `u`.`userid`
30 | LEFT JOIN `challengesbeaten` AS `c` ON `c`.`npcid` = `u`.`userid` AND `c`.`userid` = $userid
31 | LEFT JOIN `cities` AS `cy` ON `u`.`location` = `cy`.`cityid`");
32 | while ($r = $db->fetch_row($q))
33 | {
34 | $earn = $r['cb_money'];
35 | $v = $r['userid'];
36 | $countq =
37 | $db->query(
38 | "SELECT COUNT(`npcid`) FROM `challengesbeaten` WHERE `npcid` = $v");
39 | $times = $db->fetch_single($countq);
40 | $db->free_result($countq);
41 | echo "{$r['username']} {$r['level']} $times ";
42 | if ($r['hp'] >= $r['maxhp'] / 2 && $r['location'] == $ir['location']
43 | && !$ir['hospital'] && !$ir['jail'] && !$r['hospital']
44 | && !$r['jail'])
45 | {
46 | echo 'Yes ';
47 | }
48 | else
49 | {
50 | echo 'No ';
51 | }
52 | echo " {$r['cityname']} $earn ";
53 | if ($r['npcid'])
54 | {
55 | echo 'Already ';
56 | }
57 | else
58 | {
59 | echo "Challenge ";
60 | }
61 | echo ' ';
62 | }
63 | $db->free_result($q);
64 | echo '
';
65 | $h->endpage();
66 |
--------------------------------------------------------------------------------
/bluebar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/bluebar.png
--------------------------------------------------------------------------------
/captcha_verify.php:
--------------------------------------------------------------------------------
1 | [10, $f_x - 10], 1 => [5, $f_y - 5],
69 | 2 => [10, $f_x - 10], 3 => [5, $f_y - 5],
70 | 4 => [10, $f_x - 10], 5 => [5, $f_y - 5],
71 | 6 => [10, $f_x - 10], 7 => [5, $f_y - 5],
72 | 8 => [10, $f_x - 10], 9 => [5, $f_y - 5],];
73 | imagefilledpolygon($first, $points, $red);
74 | }
75 | imagestring($first, 4, rand(0, (int)($f_x / 3)), rand(0, (int)($f_y / 2.5)),
76 | $_SESSION['captcha'], $black);
77 | imagecopyresized($second, $first, 0, 0, 0, 0, $s_x, $s_y, $f_x, $f_y);
78 | imagedestroy($first);
79 | $red = imagecolorallocate($second, 255, 0, 0);
80 | $green = imagecolorallocate($second, 0, 128, 0);
81 | $blue = imagecolorallocate($second, 0, 0, 255);
82 | $RandomPixels = ceil($s_x * $s_y / 100);
83 | for ($i = 0; $i < $RandomPixels; $i++)
84 | {
85 | $locx = rand(0, $s_x - 1);
86 | $locy = rand(0, $s_y - 1);
87 | imagesetpixel($second, $locx, $locy, $red);
88 | }
89 | for ($i = 0; $i < $RandomPixels; $i++)
90 | {
91 | $locx = rand(0, $s_x - 1);
92 | $locy = rand(0, $s_y - 1);
93 | imagesetpixel($second, $locx, $locy, $green);
94 | }
95 | for ($i = 0; $i < $RandomPixels; $i++)
96 | {
97 | $locx = rand(0, $s_x - 1);
98 | $locy = rand(0, $s_y - 1);
99 | imagesetpixel($second, $locx, $locy, $blue);
100 | }
101 | $randcolor =
102 | imagecolorallocate($second, rand(100, 255), rand(100, 255),
103 | rand(100, 255));
104 | for ($i = 0; $i < 5; $i++)
105 | {
106 | imageline($second, rand(0, $s_x), rand(0, $s_y), rand(0, $s_x),
107 | rand(0, $s_y), $randcolor);
108 | $randcolor =
109 | imagecolorallocate($second, rand(100, 255), rand(100, 255),
110 | rand(100, 255));
111 | }
112 | @header('Content-Type: image/png');
113 | $finished =
114 | imagerotate($second, rand(0, 15) - 7.5,
115 | $bgcolor[2] * 65536 + $bgcolor[1] * 256 + $bgcolor[0]);
116 | imagedestroy($second);
117 | imagepng($finished);
118 | imagedestroy($finished);
119 |
--------------------------------------------------------------------------------
/checkem.php:
--------------------------------------------------------------------------------
1 | Invalid - Blank");
41 | }
42 | if (!valid_email($email))
43 | {
44 | die("Invalid - Bad Format ");
45 | }
46 | $e_email = $db->escape($email);
47 | $q =
48 | $db->query(
49 | "SELECT COUNT(`userid`) FROM users WHERE `email` = '{$e_email}'");
50 | if ($db->fetch_single($q) != 0)
51 | {
52 | echo 'Invalid - Already In Use ';
53 | }
54 | else
55 | {
56 | echo 'Valid ';
57 | }
58 | $db->free_result($q);
59 |
--------------------------------------------------------------------------------
/checkun.php:
--------------------------------------------------------------------------------
1 | Invalid - Blank");
32 | }
33 | if ((strlen($username) < 3))
34 | {
35 | die("Invalid - Too Short ");
36 | }
37 | if ((strlen($username) > 31))
38 | {
39 | die("Invalid - Too Long ");
40 | }
41 | $e_username = $db->escape($username);
42 | $q =
43 | $db->query(
44 | "SELECT COUNT(`userid`) FROM users WHERE login_name = '{$e_username}' OR username = '{$e_username}'");
45 | if ($db->fetch_single($q))
46 | {
47 | echo 'Invalid - Taken ';
48 | }
49 | else
50 | {
51 | echo 'Valid ';
52 | }
53 | $db->free_result($q);
54 |
--------------------------------------------------------------------------------
/class/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Forbidden
6 |
7 |
8 | Access Forbidden
9 | This folder is not designed to be accessed directly.
10 |
11 |
12 |
--------------------------------------------------------------------------------
/creategang.php:
--------------------------------------------------------------------------------
1 | endpage();
17 | exit;
18 | }
19 | if ($ir['gang'])
20 | {
21 | echo "You're already in a gang!";
22 | $h->endpage();
23 | exit;
24 | }
25 | if (isset($_POST['submit']) && isset($_POST['desc'])
26 | && !empty($_POST['name']))
27 | {
28 | if (!isset($_POST['verf'])
29 | || !verify_csrf_code('creategang', stripslashes($_POST['verf'])))
30 | {
31 | echo 'Error
32 | This transaction has been blocked for your security.
33 | Please create your gang quickly after you open the form - do not leave it open in tabs.
34 | > Try Again ';
35 | $h->endpage();
36 | exit;
37 | }
38 | $name =
39 | $db->escape(
40 | htmlentities(stripslashes($_POST['name']), ENT_QUOTES,
41 | 'ISO-8859-1'));
42 | $desc =
43 | $db->escape(
44 | htmlentities(stripslashes($_POST['desc']), ENT_QUOTES,
45 | 'ISO-8859-1'));
46 | $db->query(
47 | "INSERT INTO `gangs`
48 | (`gangNAME`, `gangDESC`, `gangRESPECT`, `gangPRESIDENT`, `gangVICEPRES`, `gangCAPACITY`)
49 | VALUES('$name', '$desc', 100, $userid, $userid, 5)");
50 | $i = $db->insert_id();
51 | $db->query(
52 | "UPDATE `users` SET `gang` = $i, `money` = `money` - {$cg_price} WHERE `userid` = $userid");
53 | echo 'Gang created!';
54 | }
55 | else
56 | {
57 | $code = request_csrf_code('creategang');
58 | echo " Create A Gang
59 | ";
69 | }
70 | $h->endpage();
71 |
--------------------------------------------------------------------------------
/criminal.php:
--------------------------------------------------------------------------------
1 | query(
20 | 'SELECT `crimeGROUP`, `crimeNAME`, `crimeBRAVE`, `crimeID`
21 | FROM `crimes`
22 | ORDER BY `crimeBRAVE` ASC');
23 | while ($r2 = $db->fetch_row($q2))
24 | {
25 | $crimes[] = $r2;
26 | }
27 | $db->free_result($q2);
28 | $q =
29 | $db->query(
30 | 'SELECT `cgID`, `cgNAME` FROM `crimegroups` ORDER BY `cgORDER` ASC');
31 | echo "Criminal Centre
32 | Crime Cost Do ";
33 | while ($r = $db->fetch_row($q))
34 | {
35 | echo "{$r['cgNAME']} ";
36 | foreach ($crimes as $v)
37 | {
38 | if ($v['crimeGROUP'] == $r['cgID'])
39 | {
40 | echo "{$v['crimeNAME']} {$v['crimeBRAVE']} Brave Do ";
41 | }
42 | }
43 | }
44 | $db->free_result($q);
45 | echo '
';
46 | $h->endpage();
47 |
--------------------------------------------------------------------------------
/crons/classes/CronFiveMinute.php:
--------------------------------------------------------------------------------
1 | pendingIncrements)) {
41 | $this->pendingIncrements = $increments;
42 | }
43 | parent::doFullRunActual([
44 | 'updateUserStatBars',
45 | ], $this);
46 | }
47 |
48 | /**
49 | * @return void
50 | */
51 | public function updateUserStatBars(): void
52 | {
53 | $this->db->query(
54 | 'UPDATE users SET
55 | brave = LEAST(brave + (((maxbrave / 10) + 0.5) * ' . $this->pendingIncrements . '), maxbrave),
56 | hp = LEAST(hp + ((maxhp / 3) * ' . $this->pendingIncrements . '), maxhp),
57 | will = LEAST(will + (10 * ' . $this->pendingIncrements . '), maxwill),
58 | energy = IF(donatordays > 0,
59 | LEAST(energy + ((maxenergy / 6) * ' . $this->pendingIncrements . '), maxenergy),
60 | LEAST(energy + ((maxenergy / 12.5) * ' . $this->pendingIncrements . '), maxenergy)
61 | ),
62 | verified = 0'
63 | );
64 |
65 | $this->updateAffectedRowCnt();
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/crons/classes/CronOneMinute.php:
--------------------------------------------------------------------------------
1 | pendingIncrements)) {
41 | $this->pendingIncrements = $increments;
42 | }
43 | parent::doFullRunActual([
44 | 'updateJailHospitalTimes',
45 | ], $this);
46 | }
47 |
48 | /**
49 | * @return void
50 | * @throws Throwable
51 | */
52 | public function updateJailHospitalTimes(): void
53 | {
54 | $this->db->query(
55 | 'UPDATE users SET hospital = GREATEST(hospital - ' . $this->pendingIncrements . ', 0), jail = GREATEST(jail - ' . $this->pendingIncrements . ', 0) WHERE jail > 0 OR hospital > 0'
56 | );
57 | $this->updateAffectedRowCnt();
58 | $get_counts = $this->db->query(
59 | 'SELECT
60 | SUM(IF(hospital > 0, 1, 0)) AS hc,
61 | SUM(IF(jail > 0, 1, 0)) AS jc
62 | FROM users'
63 | );
64 | $counts = $this->db->fetch_row($get_counts);
65 | $this->db->query(
66 | 'UPDATE settings SET conf_value = IF(conf_name = \'hospital_count\', ' . $counts['hc'] . ', conf_value), conf_value = IF(conf_name = \'jail_count\', ' . $counts['jc'] . ', conf_value) WHERE conf_name IN (\'hospital_count\', \'jail_count\')'
67 | );
68 | $this->updateAffectedRowCnt();
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/crons/cronless_crons.php:
--------------------------------------------------------------------------------
1 | query(
10 | 'SELECT * FROM cron_times',
11 | );
12 | /**
13 | * @var $crons
14 | * Holds the key-value paired data of crons and when they last ran
15 | * cron-name -> last runtime
16 | * (ex: minute-1 -> 2024-06-21 03:25:16)
17 | */
18 | $crons = [];
19 | while ($row = $db->fetch_row($get_crons)) {
20 | $crons[$row['name']] = $row['last_run'];
21 | }
22 | $db->free_result($get_crons);
23 |
24 | /**
25 | * @param string $cron the "last_run" timestamp of a cron
26 | * @throws Exception
27 | */
28 | function get_time_diff(string $cron): int
29 | {
30 | // Get current time
31 | $now = new DateTime('now');
32 | // Get last run time
33 | $then = new DateTime($cron);
34 | // Return the difference in seconds
35 | return (int)($now->format('U') - $then->format('U'));
36 | }
37 |
38 | $diffs = [
39 | 'minute-1' => [
40 | 'cron' => $crons['minute-1'],
41 | 'diff' => 60,
42 | ],
43 | 'minute-5' => [
44 | 'cron' => $crons['minute-5'],
45 | 'diff' => 300,
46 | ],
47 | 'hour-1' => [
48 | 'cron' => $crons['hour-1'],
49 | 'diff' => 3600,
50 | ],
51 | 'day-1' => [
52 | 'cron' => $crons['day-1'],
53 | 'diff' => 86400,
54 | ],
55 | ];
56 | foreach ($diffs as $name => $conf) {
57 | $diff = get_time_diff($crons[$name]);
58 | if ($diff >= $conf['diff']) {
59 | $times = floor($diff / $conf['diff']);
60 | (CronHandler::getInstance($db))->run($name, (int)$times);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/css/game.css:
--------------------------------------------------------------------------------
1 | @CHARSET "ISO-8859-1";
2 | /**
3 | * MCCodes Version 2.0.5b
4 | * Copyright (C) 2005-2012 Dabomstew
5 | * All rights reserved.
6 | *
7 | * Redistribution of this code in any form is prohibited, except in
8 | * the specific cases set out in the MCCodes Customer License.
9 | *
10 | * This code license may be used to run one (1) game.
11 | * A game is defined as the set of users and other game database data,
12 | * so you are permitted to create alternative clients for your game.
13 | *
14 | * If you did not obtain this code from MCCodes.com, you are in all likelihood
15 | * using it illegally. Please contact MCCodes to discuss licensing options
16 | * in this case.
17 | *
18 | * File: css/game.css
19 | * Signature: cbae5999fc5ee7f66abb1dfeb0c0db49
20 | * Date: Fri, 20 Apr 12 08:50:30 +0000
21 | */
22 |
23 | body {
24 | background-color: #DEDEDE;
25 | margin-top: 0;
26 | margin-bottom: 0;
27 | font-family: calibri, helvetica, arial, geneva, sans-serif;
28 | font-size: 12px;
29 | color: black;
30 | scrollbar-base-color: #005B70;
31 | scrollbar-arrow-color: #F3960B;
32 | scrollbar-DarkShadow-Color: #000000;
33 | }
34 |
35 | a:visited,a:active,a:hover,a:link {
36 | color: black;
37 | text-decoration: none;
38 | }
39 |
40 | table,tr,td {
41 | font-family: helvetica, arial, geneva, sans-serif;
42 | font-size: 12px;
43 | }
44 |
45 | img {
46 | border: none;
47 | }
48 |
49 | textarea {
50 | font-family: helvetica, arial, geneva, sans-serif;
51 | font-size: 12px;
52 | color: black;
53 | }
54 |
55 | .table2 {
56 |
57 | }
58 |
59 | .lgrad {
60 | background-image: url("../lgrad.jpg");
61 | background-repeat: repeat-y;
62 | width: 19px;
63 | }
64 |
65 | .linegrad {
66 | background-image: url(../linegrad.PNG);
67 | background-repeat: repeat-y;
68 | background-position: center;
69 | width: 2px;
70 | }
71 |
72 | .rgrad {
73 | background-image: url(../rgrad.jpg);
74 | background-repeat: repeat-y;
75 | width: 19px;
76 | }
77 |
78 | .dgrad {
79 | background-image: url(../dgrad.jpg);
80 | background-repeat: repeat-x;
81 | height: 38px;
82 | }
83 |
84 | .dgradl {
85 | background-image: url(../dgradl.jpg);
86 | background-repeat: no-repeat;
87 | height: 38px;
88 | width: 38px;
89 | }
90 |
91 | .dgradr {
92 | background-image: url(../dgradr.jpg);
93 | background-repeat: no-repeat;
94 | height: 38px;
95 | width: 38px;
96 | }
97 |
98 | .center {
99 | width: 932px;
100 | background-color: #FFFFFF;
101 | vertical-align: top;
102 | text-align: center;
103 | }
104 |
105 | .table {
106 | background-color: #000000;
107 | }
108 |
109 | .table td {
110 | background-color: #DEDEDE;
111 | height: 22px;
112 | }
113 |
114 | .table3 td {
115 | background-color: #CCCCCC;
116 | }
117 |
118 | td .alt {
119 | background-color: #EEEEEE;
120 | height: 22px;
121 | }
122 |
123 | td .h {
124 | background-image: url(../tablehgrad.png);
125 | background-repeat: repeat-x;
126 | font-weight: bold;
127 | background-color: #D6D6D6;
128 | }
129 |
130 | .table th {
131 | background-image: url(../tablehgrad.png);
132 | background-repeat: repeat-x;
133 | font-weight: bold;
134 | background-color: #D6D6D6;
135 | }
136 |
--------------------------------------------------------------------------------
/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Forbidden
6 |
7 |
8 | Access Forbidden
9 | This folder is not designed to be accessed directly.
10 |
11 |
12 |
--------------------------------------------------------------------------------
/css/installer.css:
--------------------------------------------------------------------------------
1 | @CHARSET "ISO-8859-1";
2 | /**
3 | * MCCodes Version 2.0.5b
4 | * Copyright (C) 2005-2012 Dabomstew
5 | * All rights reserved.
6 | *
7 | * Redistribution of this code in any form is prohibited, except in
8 | * the specific cases set out in the MCCodes Customer License.
9 | *
10 | * This code license may be used to run one (1) game.
11 | * A game is defined as the set of users and other game database data,
12 | * so you are permitted to create alternative clients for your game.
13 | *
14 | * If you did not obtain this code from MCCodes.com, you are in all likelihood
15 | * using it illegally. Please contact MCCodes to discuss licensing options
16 | * in this case.
17 | *
18 | * File: css/installer.css
19 | * Signature: cbae5999fc5ee7f66abb1dfeb0c0db49
20 | * Date: Fri, 20 Apr 12 08:50:30 +0000
21 | */
22 |
23 | body {
24 | background-color: #DEDEDE;
25 | margin-top: 0;
26 | margin-bottom: 0;
27 | font-family: calibri, helvetica, arial, geneva, sans-serif;
28 | font-size: 12px;
29 | color: black;
30 | scrollbar-base-color: #005B70;
31 | scrollbar-arrow-color: #F3960B;
32 | scrollbar-DarkShadow-Color: #000000;
33 | }
34 |
35 | a:visited,a:active,a:hover,a:link {
36 | color: black;
37 | text-decoration: none;
38 | }
39 |
40 | table,tr,td {
41 | font-family: helvetica, arial, geneva, sans-serif;
42 | font-size: 12px;
43 | }
44 |
45 | img {
46 | border: none;
47 | }
48 |
49 | textarea {
50 | font-family: helvetica, arial, geneva, sans-serif;
51 | font-size: 12px;
52 | color: black;
53 | }
54 |
55 | .table2 {
56 |
57 | }
58 |
59 | .lgrad {
60 | background-image: url("../lgrad.jpg");
61 | background-repeat: repeat-y;
62 | width: 19px;
63 | }
64 |
65 | .linegrad {
66 | background-image: url(../linegrad.PNG);
67 | background-repeat: repeat-y;
68 | background-position: center;
69 | width: 2px;
70 | }
71 |
72 | .rgrad {
73 | background-image: url(../rgrad.jpg);
74 | background-repeat: repeat-y;
75 | width: 19px;
76 | }
77 |
78 | .dgrad {
79 | background-image: url(../dgrad.jpg);
80 | background-repeat: repeat-x;
81 | height: 38px;
82 | }
83 |
84 | .dgradl {
85 | background-image: url(../dgradl.jpg);
86 | background-repeat: no-repeat;
87 | height: 38px;
88 | width: 38px;
89 | }
90 |
91 | .dgradr {
92 | background-image: url(../dgradr.jpg);
93 | background-repeat: no-repeat;
94 | height: 38px;
95 | width: 38px;
96 | }
97 |
98 | .center {
99 | width: 932px;
100 | background-color: #FFFFFF;
101 | vertical-align: top;
102 | text-align: center;
103 | }
104 |
105 | .table {
106 | background-color: #000000;
107 | }
108 |
109 | .table td {
110 | background-color: #DEDEDE;
111 | height: 22px;
112 | }
113 |
114 | .table3 td {
115 | background-color: #CCCCCC;
116 | }
117 |
118 | td .alt {
119 | background-color: #EEEEEE;
120 | height: 22px;
121 | }
122 |
123 | td .h {
124 | background-image: url(../tablehgrad.png);
125 | background-repeat: repeat-x;
126 | font-weight: bold;
127 | background-color: #D6D6D6;
128 | }
129 |
130 | .table th {
131 | background-image: url(../tablehgrad.png);
132 | background-repeat: repeat-x;
133 | font-weight: bold;
134 | background-color: #D6D6D6;
135 | }
136 |
--------------------------------------------------------------------------------
/css/login.css:
--------------------------------------------------------------------------------
1 | @CHARSET "ISO-8859-1";
2 | /**
3 | * MCCodes Version 2.0.5b
4 | * Copyright (C) 2005-2012 Dabomstew
5 | * All rights reserved.
6 | *
7 | * Redistribution of this code in any form is prohibited, except in
8 | * the specific cases set out in the MCCodes Customer License.
9 | *
10 | * This code license may be used to run one (1) game.
11 | * A game is defined as the set of users and other game database data,
12 | * so you are permitted to create alternative clients for your game.
13 | *
14 | * If you did not obtain this code from MCCodes.com, you are in all likelihood
15 | * using it illegally. Please contact MCCodes to discuss licensing options
16 | * in this case.
17 | *
18 | * File: css/login.css
19 | * Signature: cbae5999fc5ee7f66abb1dfeb0c0db49
20 | * Date: Fri, 20 Apr 12 08:50:30 +0000
21 | */
22 |
23 | body {
24 | background-color: #DEDEDE;
25 | margin-top: 0;
26 | margin-bottom: 0;
27 | font-family: calibri, helvetica, arial, geneva, sans-serif;
28 | font-size: 12px;
29 | color: black;
30 | scrollbar-base-color: #005B70;
31 | scrollbar-arrow-color: #F3960B;
32 | scrollbar-DarkShadow-Color: #000000;
33 | }
34 |
35 | a:visited,a:active,a:hover,a:link {
36 | color: black;
37 | text-decoration: none;
38 | }
39 |
40 | table,tr,td {
41 | font-family: helvetica, arial, geneva, sans-serif;
42 | font-size: 12px;
43 | }
44 |
45 | img {
46 | border: none;
47 | }
48 |
49 | textarea {
50 | font-family: helvetica, arial, geneva, sans-serif;
51 | font-size: 12px;
52 | color: black;
53 | }
54 |
55 | .table2 {
56 |
57 | }
58 |
59 | .lgrad {
60 | background-image: url("../lgrad.jpg");
61 | background-repeat: repeat-y;
62 | width: 19px;
63 | }
64 |
65 | .linegrad {
66 | background-image: url(../linegrad.PNG);
67 | background-repeat: repeat-y;
68 | background-position: center;
69 | width: 2px;
70 | }
71 |
72 | .rgrad {
73 | background-image: url(../rgrad.jpg);
74 | background-repeat: repeat-y;
75 | width: 19px;
76 | }
77 |
78 | .dgrad {
79 | background-image: url(../dgrad.jpg);
80 | background-repeat: repeat-x;
81 | height: 38px;
82 | }
83 |
84 | .dgradl {
85 | background-image: url(../dgradl.jpg);
86 | background-repeat: no-repeat;
87 | height: 38px;
88 | width: 38px;
89 | }
90 |
91 | .dgradr {
92 | background-image: url(../dgradr.jpg);
93 | background-repeat: no-repeat;
94 | height: 38px;
95 | width: 38px;
96 | }
97 |
98 | .center {
99 | width: 932px;
100 | background-color: #FFFFFF;
101 | vertical-align: top;
102 | text-align: center;
103 | }
104 |
105 | .table {
106 | background-color: #000000;
107 | }
108 |
109 | .table td {
110 | background-color: #DEDEDE;
111 | height: 22px;
112 | }
113 |
114 | .table3 td {
115 | background-color: #CCCCCC;
116 | }
117 |
118 | td .alt {
119 | background-color: #EEEEEE;
120 | height: 22px;
121 | }
122 |
123 | td .h {
124 | background-image: url(../tablehgrad.png);
125 | background-repeat: repeat-x;
126 | font-weight: bold;
127 | background-color: #D6D6D6;
128 | }
129 |
130 | .table th {
131 | background-image: url(../tablehgrad.png);
132 | background-repeat: repeat-x;
133 | font-weight: bold;
134 | background-color: #D6D6D6;
135 | }
136 |
--------------------------------------------------------------------------------
/css/register.css:
--------------------------------------------------------------------------------
1 | @CHARSET "ISO-8859-1";
2 | /**
3 | * MCCodes Version 2.0.5b
4 | * Copyright (C) 2005-2012 Dabomstew
5 | * All rights reserved.
6 | *
7 | * Redistribution of this code in any form is prohibited, except in
8 | * the specific cases set out in the MCCodes Customer License.
9 | *
10 | * This code license may be used to run one (1) game.
11 | * A game is defined as the set of users and other game database data,
12 | * so you are permitted to create alternative clients for your game.
13 | *
14 | * If you did not obtain this code from MCCodes.com, you are in all likelihood
15 | * using it illegally. Please contact MCCodes to discuss licensing options
16 | * in this case.
17 | *
18 | * File: css/register.css
19 | * Signature: ee13a1eed2e4bf7902ac57305a6820a8
20 | * Date: Fri, 20 Apr 12 08:50:30 +0000
21 | */
22 |
23 | body {
24 | background-color: #DEDEDE;
25 | margin-top: 0;
26 | margin-bottom: 0;
27 | font-family: Verdana, Arial, Helvetica, sans-serif;
28 | font-size: 12px;
29 | }
30 |
31 | .lgrad {
32 | background-image: url("../lgrad.jpg");
33 | background-repeat: repeat-y;
34 | width: 19px;
35 | }
36 |
37 | .linegrad {
38 | background-image: url(../linegrad.PNG);
39 | background-repeat: repeat-y;
40 | background-position: center;
41 | width: 2px;
42 | }
43 |
44 | .rgrad {
45 | background-image: url(../rgrad.jpg);
46 | background-repeat: repeat-y;
47 | width: 19px;
48 | }
49 |
50 | .dgrad {
51 | background-image: url(../dgrad.jpg);
52 | background-repeat: repeat-x;
53 | height: 38px;
54 | }
55 |
56 | .dgradl {
57 | background-image: url(../dgradl.jpg);
58 | background-repeat: no-repeat;
59 | height: 38px;
60 | width: 38px;
61 | }
62 |
63 | .dgradr {
64 | background-image: url(../dgradr.jpg);
65 | background-repeat: no-repeat;
66 | height: 38px;
67 | width: 38px;
68 | }
69 |
70 | .center {
71 | width: 932px;
72 | background-color: #FFFFFF;
73 | vertical-align: top;
74 | text-align: center;
75 | }
76 |
77 | .table {
78 | background-color: #000000;
79 | }
80 |
81 | .table td {
82 | background-color: #DEDEDE;
83 | height: 22px;
84 | }
85 |
86 | .table3 td {
87 | background-color: #CCCCCC;
88 | }
89 |
90 | td .alt {
91 | background-color: #EEEEEE;
92 | height: 22px;
93 | }
94 |
95 | td .h {
96 | background-image: url(../tablehgrad.png);
97 | background-repeat: repeat-x;
98 | font-weight: bold;
99 | background-color: #D6D6D6;
100 | }
101 |
102 | .table th {
103 | background-image: url(../tablehgrad.png);
104 | background-repeat: repeat-x;
105 | font-weight: bold;
106 | background-color: #D6D6D6;
107 | }
108 |
--------------------------------------------------------------------------------
/dgrad.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/dgrad.jpg
--------------------------------------------------------------------------------
/dgradl.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/dgradl.jpg
--------------------------------------------------------------------------------
/dgradr.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/dgradr.jpg
--------------------------------------------------------------------------------
/dlarchive.php:
--------------------------------------------------------------------------------
1 |
24 |
25 | From
26 | Subject/Message
27 | ";
28 | $q =
29 | $db->query(
30 | "SELECT `mail_time`, `mail_subject`, `mail_text`,
31 | `userid`, `username`
32 | FROM `mail` AS `m`
33 | LEFT JOIN `users` AS `u` ON `m`.`mail_from` = `u`.`userid`
34 | WHERE `m`.`mail_to` = $userid
35 | ORDER BY `mail_time` DESC");
36 | while ($r = $db->fetch_row($q))
37 | {
38 | $sent = date('F j, Y, g:i:s a', (int)$r['mail_time']);
39 | echo '
40 | ';
41 | if ($r['userid'])
42 | {
43 | echo "{$r['username']} [{$r['userid']}]";
44 | }
45 | else
46 | {
47 | echo 'SYSTEM';
48 | }
49 | echo "
50 | {$r['mail_subject']}
51 |
52 |
53 | Sent at: $sent
54 | {$r['mail_text']}
55 | ";
56 | }
57 | $db->free_result($q);
58 | echo '';
59 | }
60 | elseif ($_GET['a'] == 'outbox')
61 | {
62 | header('Content-type: text/html');
63 | header(
64 | 'Content-Disposition: attachment; ' . 'filename="outbox_archive_'
65 | . $userid . '_' . time() . '.htm"');
66 | echo "
67 |
68 | To
69 | Subject/Message
70 | ";
71 | $q =
72 | $db->query(
73 | "SELECT `mail_time`, `mail_subject`, `mail_text`,
74 | `userid`, `username`
75 | FROM `mail` AS `m`
76 | LEFT JOIN `users` AS `u` ON `m`.`mail_to` = `u`.`userid`
77 | WHERE `m`.`mail_from` = $userid
78 | ORDER BY `mail_time` DESC");
79 | while ($r = $db->fetch_row($q))
80 | {
81 | $sent = date('F j, Y, g:i:s a', (int)$r['mail_time']);
82 | echo "
83 | {$r['username']} [{$r['userid']}]
84 | {$r['mail_subject']}
85 |
86 |
87 | Sent at: $sent
88 | {$r['mail_text']}
89 | ";
90 | }
91 | $db->free_result($q);
92 | echo '
';
93 | }
94 | else
95 | {
96 | header('HTTP/1.1 400 Bad Request');
97 | exit;
98 | }
99 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | web:
3 | image: php:8.3-apache
4 | ports:
5 | - "4567:80"
6 | - "4568:443"
7 | depends_on:
8 | - db
9 | volumes:
10 | - .:/var/www/html/.
11 | restart: "no"
12 | db:
13 | image: mysql
14 | ports:
15 | - "3306:3306"
16 | environment:
17 | MYSQL_ROOT_PASSWORD: rootpass1
18 | MYSQL_DATABASE: mccv2
19 | phpmyadmin:
20 | image: phpmyadmin/phpmyadmin
21 | ports:
22 | - "4569:8080"
23 | depends_on:
24 | - db
25 | links:
26 | - web
27 | environment:
28 | PMA_HOST: db
29 |
30 | # Note:
31 | # If you encounter either mysqli not being found or captcha images not loading, chances are that the docker image was updated and those modules are no longer part of it
32 | # A new image will be built for this so that the dependencies are there and ready for immediate development
33 | # For now, log into the running container's shell - assuming default config, it'll be named something like "mccodesv2-php-web-1"
34 | # Execute the following command:
35 | # apt install libpng-dev -y && docker-php-ext-install mysqli gd
36 | # Optionally, you can also install a couple of useful PHP packages
37 | # docker-php-ext-install mbstring pdo pdo_mysql sockets sodium xsl
38 |
39 | # After installation, the extensions should automatically be enabled (where applicable). If not, you can enable them manually.
40 | # docker-php-ext-enable mysqli gd
41 |
42 | # Note (cont.)
43 | # Be sure to restart the Apache container to apply your changes!
44 |
--------------------------------------------------------------------------------
/docrime.php:
--------------------------------------------------------------------------------
1 | 0 || $ir['hospital'] > 0)
20 | {
21 | die('This page cannot be accessed while in jail or hospital.');
22 | }
23 | if ($_GET['c'] <= 0)
24 | {
25 | echo 'Invalid crime';
26 | }
27 | else
28 | {
29 | $q =
30 | $db->query(
31 | "SELECT *
32 | FROM `crimes`
33 | WHERE `crimeID` = {$_GET['c']}
34 | LIMIT 1");
35 | if ($db->num_rows($q) == 0)
36 | {
37 | echo 'Invalid crime.';
38 | $h->endpage();
39 | exit;
40 | }
41 | $r = $db->fetch_row($q);
42 | $db->free_result($q);
43 | if ($ir['brave'] < $r['crimeBRAVE'])
44 | {
45 | echo 'You do not have enough Brave to perform this crime.';
46 | }
47 | else
48 | {
49 | $ec =
50 | '$sucrate='
51 | . str_replace(
52 | ['LEVEL', 'CRIMEXP', 'EXP', 'WILL', 'IQ'],
53 | [$ir['level'], $ir['crimexp'],
54 | $ir['exp'], $ir['will'], $ir['IQ']],
55 | $r['crimePERCFORM']) . ';';
56 | eval($ec);
57 | print $r['crimeITEXT'];
58 | $ir['brave'] -= $r['crimeBRAVE'];
59 | $db->query(
60 | "UPDATE `users`
61 | SET `brave` = {$ir['brave']}
62 | WHERE `userid` = $userid");
63 | if (rand(1, 100) <= $sucrate)
64 | {
65 | print
66 | str_replace('{money}', $r['crimeSUCCESSMUNY'],
67 | $r['crimeSTEXT']);
68 | $ir['money'] += $r['crimeSUCCESSMUNY'];
69 | $ir['crystals'] += $r['crimeSUCCESSCRYS'];
70 | $ir['exp'] += (int) ($r['crimeSUCCESSMUNY'] / 8);
71 | $db->query(
72 | "UPDATE `users`
73 | SET `money` = {$ir['money']},
74 | `crystals` = {$ir['crystals']}, `exp` = {$ir['exp']},
75 | `crimexp` = `crimexp` + {$r['crimeXP']}
76 | WHERE `userid` = $userid");
77 | if ($r['crimeSUCCESSITEM'])
78 | {
79 | item_add($userid, $r['crimeSUCCESSITEM'], 1);
80 | }
81 | } elseif (rand(1, 2) == 1) {
82 | print $r['crimeFTEXT'];
83 | } else {
84 | print $r['crimeJTEXT'];
85 | $db->query(
86 | "UPDATE `users`
87 | SET `jail` = '{$r['crimeJAILTIME']}',
88 | `jail_reason` = '{$r['crimeJREASON']}'
89 | WHERE `userid` = $userid");
90 | }
91 |
92 | echo "Try Again
93 | Crimes ";
94 | }
95 | }
96 |
97 | $h->endpage();
98 |
--------------------------------------------------------------------------------
/donator.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/donator.gif
--------------------------------------------------------------------------------
/donatordone.php:
--------------------------------------------------------------------------------
1 | endpage();
28 | exit;
29 | }
30 | echo 'Thank you for your payment to ' . $set['game_name']
31 | . '. Your transaction has been completed, and a receipt for
32 | your purchase has been emailed to you. You may log into your
33 | account at www.paypal.com
34 | to view details of this transaction.
35 | Your donator pack should be credited within a few minutes,
36 | if not, contact an admin for assistance.';
37 | }
38 | $h->endpage();
39 |
--------------------------------------------------------------------------------
/education.php:
--------------------------------------------------------------------------------
1 | Schooling';
13 | if ($ir['course'] > 0)
14 | {
15 | $cd =
16 | $db->query(
17 | "SELECT `crNAME`
18 | FROM `courses`
19 | WHERE `crID` = {$ir['course']}");
20 | $coud = $db->fetch_row($cd);
21 | $db->free_result($cd);
22 | echo "You are currently doing the {$coud['crNAME']}, you have
23 | {$ir['cdays']} days remaining.";
24 | } elseif (isset($_GET['cstart'])) {
25 | $_GET['cstart'] = abs((int)$_GET['cstart']);
26 | //Verify.
27 | $cd =
28 | $db->query(
29 | "SELECT `crCOST`, `crDAYS`, `crNAME`
30 | FROM `courses`
31 | WHERE `crID` = {$_GET['cstart']}");
32 | if ($db->num_rows($cd) == 0) {
33 | echo 'You are trying to start a non-existent course!';
34 | } else {
35 | $coud = $db->fetch_row($cd);
36 | $db->free_result($cd);
37 | $cdo =
38 | $db->query(
39 | "SELECT COUNT(`userid`)
40 | FROM `coursesdone`
41 | WHERE `userid` = $userid
42 | AND `courseid` = {$_GET['cstart']}");
43 | if ($ir['money'] < $coud['crCOST']) {
44 | echo "You don't have enough money to start this course.";
45 | $h->endpage();
46 | exit;
47 | }
48 | if ($db->fetch_single($cdo) > 0) {
49 | $db->free_result($cdo);
50 | echo 'You have already done this course.';
51 | $h->endpage();
52 | exit;
53 | }
54 | $db->free_result($cdo);
55 | $db->query(
56 | "UPDATE `users`
57 | SET `course` = {$_GET['cstart']},
58 | `cdays` = {$coud['crDAYS']},
59 | `money` = `money` - {$coud['crCOST']}
60 | WHERE `userid` = $userid");
61 | echo "You have started the {$coud['crNAME']},
62 | it will take {$coud['crDAYS']} days to complete.";
63 | }
64 | } else {
65 | //list courses
66 | echo 'Here is a list of available courses. ';
67 | $q =
68 | $db->query(
69 | 'SELECT `crID`, `crNAME`, `crDESC`, `crCOST`
70 | FROM `courses`');
71 | echo "
72 |
73 | Course
74 | Description
75 | Cost
76 | Take
77 | ";
78 | while ($r = $db->fetch_row($q)) {
79 | $cdo =
80 | $db->query(
81 | "SELECT COUNT(`userid`)
82 | FROM `coursesdone`
83 | WHERE `userid` = $userid
84 | AND `courseid` = {$r['crID']}");
85 | if ($db->fetch_single($cdo) > 0) {
86 | $do = 'Done ';
87 | } else {
88 | $do = "Take ";
89 | }
90 | $db->free_result($cdo);
91 | echo "
92 | {$r['crNAME']}
93 | {$r['crDESC']}
94 | " . money_formatter((int)$r['crCOST'])
95 | . "
96 | $do
97 | ";
98 | }
99 | $db->free_result($q);
100 | echo '
';
101 | }
102 | $h->endpage();
103 |
--------------------------------------------------------------------------------
/equip_armor.php:
--------------------------------------------------------------------------------
1 | query(
17 | "SELECT `armor`, `itmid`, `itmname`
18 | FROM `inventory` AS `iv`
19 | LEFT JOIN `items` AS `it`
20 | ON `iv`.`inv_itemid` = `it`.`itmid`
21 | WHERE `iv`.`inv_id` = {$_GET['ID']}
22 | AND `iv`.`inv_userid` = $userid
23 | LIMIT 1");
24 | if ($db->num_rows($id) == 0)
25 | {
26 | $db->free_result($id);
27 | echo 'Invalid item ID';
28 | $h->endpage();
29 | exit;
30 | }
31 | else
32 | {
33 | $r = $db->fetch_row($id);
34 | $db->free_result($id);
35 | }
36 | if ($r['armor'] <= 0)
37 | {
38 | echo 'This item cannot be equipped to this slot.';
39 | $h->endpage();
40 | exit;
41 | }
42 | if (isset($_POST['type']))
43 | {
44 | if ($_POST['type'] !== 'equip_armor')
45 | {
46 | echo 'This slot ID is not valid.';
47 | $h->endpage();
48 | exit;
49 | }
50 | if ($ir['equip_armor'] > 0)
51 | {
52 | item_add($userid, $ir['equip_armor'], 1);
53 | }
54 | item_remove($userid, $r['itmid'], 1);
55 | $db->query(
56 | "UPDATE `users`
57 | SET `equip_armor` = {$r['itmid']}
58 | WHERE `userid` = {$userid}");
59 | echo "Item {$r['itmname']} equipped successfully.";
60 | }
61 | else
62 | {
63 | echo "Equip Armor
64 |
65 | Click Equip Armor to equip {$r['itmname']} as your armor,
66 | if you currently have any armor equipped it will be removed back
67 | to your inventory.
68 |
69 |
70 | ";
71 | }
72 | $h->endpage();
73 |
--------------------------------------------------------------------------------
/equip_weapon.php:
--------------------------------------------------------------------------------
1 | query(
17 | "SELECT `weapon`, `itmid`, `itmname`
18 | FROM `inventory` AS `iv`
19 | LEFT JOIN `items` AS `it`
20 | ON `iv`.`inv_itemid` = `it`.`itmid`
21 | WHERE `iv`.`inv_id` = {$_GET['ID']}
22 | AND `iv`.`inv_userid` = $userid
23 | LIMIT 1");
24 | if ($db->num_rows($id) == 0)
25 | {
26 | $db->free_result($id);
27 | echo 'Invalid item ID';
28 | $h->endpage();
29 | exit;
30 | }
31 | else
32 | {
33 | $r = $db->fetch_row($id);
34 | $db->free_result($id);
35 | }
36 | if (!$r['weapon'])
37 | {
38 | echo 'This item cannot be equipped to this slot.';
39 | $h->endpage();
40 | exit;
41 | }
42 | if (isset($_POST['type']))
43 | {
44 | if (!in_array($_POST['type'], ['equip_primary', 'equip_secondary'],
45 | true))
46 | {
47 | echo 'This slot ID is not valid.';
48 | $h->endpage();
49 | exit;
50 | }
51 | if ($ir[$_POST['type']] > 0)
52 | {
53 | item_add($userid, $ir[$_POST['type']], 1);
54 | }
55 | item_remove($userid, $r['itmid'], 1);
56 | $db->query(
57 | "UPDATE `users`
58 | SET `{$_POST['type']}` = {$r['itmid']}
59 | WHERE `userid` = {$userid}");
60 | echo "Item {$r['itmname']} equipped successfully.";
61 | }
62 | else
63 | {
64 | echo "Equip Weapon
65 |
66 | Please choose the slot to equip {$r['itmname']} to,
67 | if there is already a weapon in that slot,
68 | it will be removed back to your inventory.
69 |
70 | Primary
71 |
72 | Secondary
73 |
74 | ";
75 | }
76 | $h->endpage();
77 |
--------------------------------------------------------------------------------
/estate.php:
--------------------------------------------------------------------------------
1 | query(
14 | "SELECT *
15 | FROM `houses`
16 | WHERE `hWILL` = {$ir['maxwill']}
17 | LIMIT 1");
18 | $mp = $db->fetch_row($mpq);
19 | $db->free_result($mpq);
20 | if (isset($_GET['property']) && is_numeric($_GET['property']))
21 | {
22 | $_GET['property'] = abs((int) $_GET['property']);
23 | $npq =
24 | $db->query(
25 | "SELECT `hWILL`, `hPRICE`, `hNAME`
26 | FROM `houses`
27 | WHERE `hID` = {$_GET['property']}");
28 | if ($db->num_rows($npq) == 0)
29 | {
30 | $db->free_result($npq);
31 | echo "That house doesn't exist.";
32 | $h->endpage();
33 | exit;
34 | }
35 | $np = $db->fetch_row($npq);
36 | $db->free_result($npq);
37 | if ($np['hWILL'] < $mp['hWILL'])
38 | {
39 | echo 'You cannot go backwards in houses!';
40 | }
41 | elseif ($np['hPRICE'] > $ir['money'])
42 | {
43 | echo "You do not have enough money to buy the {$np['hNAME']}.";
44 | }
45 | else
46 | {
47 | $db->query(
48 | "UPDATE `users`
49 | SET `money` = `money` - {$np['hPRICE']},
50 | `will` = 0, `maxwill` = {$np['hWILL']}
51 | WHERE `userid` = $userid");
52 | echo "Congrats, you bought the {$np['hNAME']} for "
53 | . money_formatter($np['hPRICE']) . '!';
54 | }
55 | }
56 | elseif (isset($_GET['sellhouse']))
57 | {
58 | if ($ir['maxwill'] == 100)
59 | {
60 | echo 'You already live in the lowest property!';
61 | }
62 | else
63 | {
64 | $db->query(
65 | "UPDATE `users`
66 | SET `money` = `money` + {$mp['hPRICE']},
67 | `will` = 0, `maxwill` = 100
68 | WHERE `userid` = $userid");
69 | echo "You sold your {$mp['hNAME']} and went back to your shed.";
70 | }
71 | }
72 | else
73 | {
74 | echo "Your current property: {$mp['hNAME']}
75 | The houses you can buy are listed below. Click a house to buy it. ";
76 | if ($ir['maxwill'] > 100)
77 | {
78 | echo "Sell Your House ";
79 | }
80 | $hq =
81 | $db->query(
82 | "SELECT *
83 | FROM `houses`
84 | WHERE `hWILL` > {$ir['maxwill']}
85 | ORDER BY `hWILL` ASC");
86 | while ($r = $db->fetch_row($hq))
87 | {
88 | echo "{$r['hNAME']} "
89 | . '   - Cost: ' . money_formatter($r['hPRICE'])
90 | . "   - Will Bar: {$r['hWILL']} ";
91 | }
92 | $db->free_result($hq);
93 | }
94 | $h->endpage();
95 |
--------------------------------------------------------------------------------
/events.php:
--------------------------------------------------------------------------------
1 | 0)
18 | {
19 | $d_c =
20 | $db->query(
21 | "SELECT COUNT(`evUSER`)
22 | FROM `events`
23 | WHERE `evID` = {$_GET['delete']}
24 | AND `evUSER` = {$userid}");
25 | if ($db->fetch_single($d_c) == 0)
26 | {
27 | echo 'Event doesn\'t exist ';
28 | }
29 | else
30 | {
31 | $db->query(
32 | "DELETE FROM `events`
33 | WHERE `evID` = {$_GET['delete']}
34 | AND `evUSER` = {$userid}");
35 | echo 'Event Deleted ';
36 | }
37 | $db->free_result($d_c);
38 | }
39 | if (isset($_GET['delall']) && $_GET['delall'])
40 | {
41 | $delall_verf = request_csrf_code('events_delall');
42 | echo "
43 | This will delete all your events.
44 | There is NO undo, so be sure.
45 | > Yes,
46 | delete all my events
47 | > No, go back
48 | ";
49 | $h->endpage();
50 | exit;
51 | }
52 | if (isset($_GET['delall2']) && $_GET['delall2'])
53 | {
54 | if (!isset($_GET['verf'])
55 | || !verify_csrf_code('events_delall', stripslashes($_GET['verf'])))
56 | {
57 | echo 'Error
58 | This action has been blocked for your security.
59 | You should submit this action fast,
60 | to ensure that it is really you doing it.
61 | > Try Again ';
62 | $h->endpage();
63 | exit;
64 | }
65 | $am =
66 | $db->fetch_single(
67 | $db->query(
68 | "SELECT COUNT(`evID`)
69 | FROM `events`
70 | WHERE `evUSER` = $userid"));
71 | if ($am == 0)
72 | {
73 | echo 'You have no events to delete.
74 | > Go Back ';
75 | $h->endpage();
76 | exit;
77 | }
78 | $db->query("DELETE FROM `events`
79 | WHERE `evUSER` = $userid");
80 | echo "
81 | All {$am} events you had were deleted.
82 | > Go Back
83 | ";
84 | $h->endpage();
85 | exit;
86 | }
87 | echo "
88 | Latest 10 events
89 |
90 | > Delete All Events
91 |
92 | ";
93 | $q =
94 | $db->query(
95 | "SELECT `evTIME`, `evREAD`, `evTEXT`, `evID`
96 | FROM `events`
97 | WHERE `evUSER` = $userid
98 | ORDER BY `evTIME` DESC
99 | LIMIT 10");
100 | echo "
101 |
102 |
103 | Time
104 | Event
105 | Links
106 |
107 | ";
108 | while ($r = $db->fetch_row($q))
109 | {
110 | echo '
111 | ' . date('F j Y, g:i:s a', (int)$r['evTIME']);
112 | if (!$r['evREAD'])
113 | {
114 | echo 'New! ';
115 | }
116 | echo "
117 | {$r['evTEXT']}
118 | Delete
119 | ";
120 | }
121 | echo '
';
122 | $db->free_result($q);
123 | if ($ir['new_events'] > 0)
124 | {
125 | $db->query(
126 | "UPDATE `events`
127 | SET `evREAD` = 1
128 | WHERE `evUSER` = $userid");
129 | $db->query(
130 | "UPDATE `users`
131 | SET `new_events` = 0
132 | WHERE `userid` = $userid");
133 | }
134 | $h->endpage();
135 |
--------------------------------------------------------------------------------
/explore.php:
--------------------------------------------------------------------------------
1 | 0 || $ir['hospital'] > 0)
14 | {
15 | die('This page cannot be accessed while in jail or hospital.');
16 | }
17 | echo "You begin exploring the area you're in,
18 | you see a bit that interests you.
19 |
70 |
71 | This is your referal link: https://{$domain}/register.php?REF={$userid}
72 | Every signup from this link earns you two valuable crystals!";
73 | $h->endpage();
74 |
--------------------------------------------------------------------------------
/fedjail.php:
--------------------------------------------------------------------------------
1 | query(
14 | 'SELECT `fed_userid`, `fed_days`, `fed_reason`, `fed_jailedby`,
15 | `u`.`username`, `u2`.`username` AS `jailer`
16 | FROM `fedjail` AS `f`
17 | LEFT JOIN `users` AS `u`
18 | ON `f`.`fed_userid` = `u`.`userid`
19 | LEFT JOIN `users` AS `u2`
20 | ON `f`.`fed_jailedby` = `u2`.`userid`
21 | ORDER BY `f`.`fed_days` ASC');
22 | echo "Federal Jail
23 | If you ever cheat the game your name will become a permanent
24 | part of this list...
25 |
26 |
27 | Who
28 | Days
29 | Reason
30 | Jailer
31 | ";
32 | while ($r = $db->fetch_row($q))
33 | {
34 | echo "
35 |
36 | {$r['username']}
37 |
38 | {$r['fed_days']}
39 | {$r['fed_reason']}
40 |
41 | {$r['jailer']}
42 |
43 | ";
44 | }
45 | $db->free_result($q);
46 | echo '
';
47 | $q =
48 | $db->query(
49 | 'SELECT `userid`, `username`, `mailban`, `mb_reason`
50 | FROM `users`
51 | WHERE `mailban` > 0
52 | ORDER BY `mailban` ASC');
53 | echo "Mail Ban
54 | If you ever swear or do other bad things with mail,
55 | your name will become a permanent part of this list...
56 |
57 |
58 | Who
59 | Days
60 | Reason
61 | ";
62 | while ($r = $db->fetch_row($q))
63 | {
64 | echo "
65 |
66 | {$r['username']}
67 | {$r['mailban']}
68 | {$r['mb_reason']}
69 | ";
70 | }
71 | $db->free_result($q);
72 | echo '
';
73 | $h->endpage();
74 |
--------------------------------------------------------------------------------
/gamerules.php:
--------------------------------------------------------------------------------
1 | {$set['game_name']} Rules and Regulations
14 |
15 | Players are only allowed to have one account, owning two or more accounts
16 | will result in all accounts being jailed, if you are on the same IP as another
17 | player, mail staff and let them know.
18 | You are responsible for whatever happens on your account, don't give out
19 | your password to anyone.
20 | Children play this game, so keep it PG-13. Mild swearing will be
21 | permitted, but F-bombing, sexual vulgarities or excessive swearing will result
22 | in some time in Fed until you clean up your act.
23 | Profile images with nudity, profanity, or otherwise offensive images will
24 | be removed, and may result in jail time.
25 | We understand that you play other games, but do not advertise them here.
26 | You get 1 warning, afterwards its Fed time.
27 | Do not spam the staff's mailbox, if you have a problem, message one of us
28 | once. They will deal with your problem in a timely manner, but do not mail
29 | them repeatedly, or mail multiple staff members.
30 | Do not harrass other players, use common sense on this one, if you don't
31 | know when your crossing the line from fantasy into harrassment, assume that
32 | you are harrassing the other player. This will not be tolerated and will
33 | result in a stiff punishment.
34 | Scamming will not be tolerated in any manner. Any attempt to scam anyone
35 | will result in being jailed for a long long time.
36 | If a member of staff is bothering you for any unfair or just plain, weird
37 | reason, mail an administrator.
38 | Common sense rules are not posted here, if you can't determine the
39 | difference between what is ok, and what is not, you should consider not
40 | interacting with other people until you do understand.
41 | These rules are subject to change without notice, check them from time
42 | to time, as ignorance will not be accepted as an excuse.
43 |
44 | EOF;
45 | $h->endpage();
46 |
--------------------------------------------------------------------------------
/gangcentral.php:
--------------------------------------------------------------------------------
1 | Gang Central
13 | > Create A Gang Here
14 | Gang Listings
15 |
16 |
17 | Gang
18 | Members
19 | President
20 | Respect Level
21 | ";
22 | $gq =
23 | $db->query(
24 | 'SELECT `gangID`, `gangNAME`, `gangRESPECT`,
25 | `userid`, `username`
26 | FROM `gangs` AS `g`
27 | LEFT JOIN `users` AS `u` ON `g`.`gangPRESIDENT` = `u`.`userid`
28 | ORDER BY `g`.`gangID` ASC');
29 | while ($gangdata = $db->fetch_row($gq))
30 | {
31 | echo "
32 | {$gangdata['gangNAME']}
33 | ";
34 | $cnt =
35 | $db->query(
36 | "SELECT COUNT(`userid`)
37 | FROM `users`
38 | WHERE `gang` = {$gangdata['gangID']}");
39 | print
40 | $db->fetch_single($cnt)
41 | . "
42 | {$gangdata['username']}
43 | {$gangdata['gangRESPECT']}
44 | ";
45 | $db->free_result($cnt);
46 | }
47 | $db->free_result($gq);
48 | echo '
';
49 | $h->endpage();
50 |
--------------------------------------------------------------------------------
/gangwars.php:
--------------------------------------------------------------------------------
1 | Gang Wars
13 | ";
14 | $q =
15 | $db->query(
16 | "SELECT `w`.*, `g1`.`gangNAME` AS `declarer`,
17 | `g1`.`gangRESPECT` AS `drespect`,
18 | `g2`.`gangNAME` AS `defender`,
19 | `g2`.`gangRESPECT` AS `frespect`
20 | FROM `gangwars` AS `w`
21 | INNER JOIN `gangs` AS `g1`
22 | ON `w`.`warDECLARER` = `g1`.`gangID`
23 | INNER JOIN `gangs` AS `g2`
24 | ON `w`.`warDECLARED` = `g2`.`gangID`
25 | WHERE `g1`.`gangNAME` != ''
26 | AND `g2`.`gangNAME` != ''");
27 | if ($db->num_rows($q) > 0)
28 | {
29 | while ($r = $db->fetch_row($q))
30 | {
31 | echo "
32 |
33 |
34 | {$r['declarer']}
35 | [{$r['drespect']} respect]
36 |
37 | vs.
38 |
39 |
40 | {$r['defender']}
41 | [{$r['frespect']} respect]
42 |
43 | ";
44 | }
45 | echo '
';
46 | }
47 | else
48 | {
49 | echo 'There are currently no gang wars in progress.';
50 | }
51 | $db->free_result($q);
52 | $h->endpage();
53 |
--------------------------------------------------------------------------------
/globals.php:
--------------------------------------------------------------------------------
1 | configure($_CONFIG['hostname'], $_CONFIG['username'],
41 | $_CONFIG['password'], $_CONFIG['database']);
42 | $db->connect();
43 | $c = $db->connection_id;
44 | $set = get_site_settings();
45 | if ($set['use_timestamps_over_crons']) {
46 | define('SILENT_CRONS', true);
47 | try {
48 | require_once __DIR__ . '/crons/cronless_crons.php';
49 | } catch (Exception $e) {
50 | echo 'An error occurred' . (defined('DEBUG') && DEBUG ? ': '.$e->getMessage() : '');
51 | exit;
52 | }
53 | }
54 | global $jobquery, $housequery;
55 | if (isset($jobquery) && $jobquery)
56 | {
57 | $is =
58 | $db->query(
59 | "SELECT `u`.*, `us`.*, `j`.*, `jr`.*
60 | FROM `users` AS `u`
61 | INNER JOIN `userstats` AS `us`
62 | ON `u`.`userid`=`us`.`userid`
63 | LEFT JOIN `jobs` AS `j` ON `j`.`jID` = `u`.`job`
64 | LEFT JOIN `jobranks` AS `jr`
65 | ON `jr`.`jrID` = `u`.`jobrank`
66 | WHERE `u`.`userid` = {$userid}
67 | LIMIT 1");
68 | }
69 | elseif (isset($housequery) && $housequery)
70 | {
71 | $is =
72 | $db->query(
73 | "SELECT `u`.*, `us`.*, `h`.*
74 | FROM `users` AS `u`
75 | INNER JOIN `userstats` AS `us`
76 | ON `u`.`userid`=`us`.`userid`
77 | LEFT JOIN `houses` AS `h` ON `h`.`hWILL` = `u`.`maxwill`
78 | WHERE `u`.`userid` = {$userid}
79 | LIMIT 1");
80 | }
81 | else
82 | {
83 | $is =
84 | $db->query(
85 | "SELECT `u`.*, `us`.*
86 | FROM `users` AS `u`
87 | INNER JOIN `userstats` AS `us`
88 | ON `u`.`userid`=`us`.`userid`
89 | WHERE `u`.`userid` = {$userid}
90 | LIMIT 1");
91 | }
92 | $ir = $db->fetch_row($is);
93 | set_userdata_data_types($ir);
94 | if ($ir['force_logout'] > 0)
95 | {
96 | $db->query(
97 | "UPDATE `users`
98 | SET `force_logout` = 0
99 | WHERE `userid` = {$userid}");
100 | session_unset();
101 | session_destroy();
102 | $login_url = "https://{$domain}/login.php";
103 | header("Location: {$login_url}");
104 | exit;
105 | }
106 | global $macropage;
107 | if ($macropage && !$ir['verified'] && $set['validate_on'] == 1)
108 | {
109 | $macro_url = "https://{$domain}/macro1.php?refer=$macropage";
110 | header("Location: {$macro_url}");
111 | exit;
112 | }
113 | check_level();
114 | $h = new headers();
115 | if (!isset($nohdr) || !$nohdr)
116 | {
117 | $h->startheaders();
118 | $fm = money_formatter($ir['money']);
119 | $cm = money_formatter($ir['crystals'], '');
120 | $lv = date('F j, Y, g:i a', $ir['laston']);
121 | global $atkpage;
122 | if ($atkpage)
123 | {
124 | $h->userdata($ir, $lv, $fm, $cm, 0);
125 | }
126 | else
127 | {
128 | $h->userdata($ir, $lv, $fm, $cm);
129 | }
130 | global $menuhide;
131 | if (!$menuhide)
132 | {
133 | $h->menuarea();
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/globals_nonauth.php:
--------------------------------------------------------------------------------
1 | configure($_CONFIG['hostname'], $_CONFIG['username'],
31 | $_CONFIG['password'], $_CONFIG['database']);
32 | $db->connect();
33 | $c = $db->connection_id;
34 | $set = [];
35 | $settq = $db->query('SELECT *
36 | FROM `settings`');
37 | while ($r = $db->fetch_row($settq))
38 | {
39 | $set[$r['conf_name']] = $r['conf_value'];
40 | }
41 |
--------------------------------------------------------------------------------
/greenbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davemacaulay/mccodesv2/c3b7957de05a684a9003c5e0d40694b3a7d633ef/greenbar.png
--------------------------------------------------------------------------------
/gym.php:
--------------------------------------------------------------------------------
1 | 'strength', 'Agility' => 'agility',
19 | 'Guard' => 'guard', 'Labour' => 'labour'];
20 | if (!isset($_POST['amnt']))
21 | {
22 | $_POST['amnt'] = 0;
23 | }
24 | $_POST['amnt'] = abs((int) $_POST['amnt']);
25 | if ($ir['jail'] <= 0)
26 | {
27 | echo 'Gym ';
28 | }
29 | else
30 | {
31 | echo 'Jail Gym ';
32 | }
33 | if (isset($_POST['stat']) && $_POST['amnt'])
34 | {
35 | if (!isset($statnames[$_POST['stat']]))
36 | {
37 | die('This stat cannot be trained.');
38 | }
39 | $stat = $statnames[$_POST['stat']];
40 | if ($_POST['amnt'] > $ir['energy'])
41 | {
42 | print('You do not have enough energy to train that much. ');
43 | }
44 | else
45 | {
46 | $gain = 0;
47 | for ($i = 0; $i < $_POST['amnt']; $i++)
48 | {
49 | $gain +=
50 | rand(1, 3) / rand(800, 1000) * rand(800, 1000)
51 | * (($ir['will'] + 20) / 150);
52 | $ir['will'] -= rand(1, 3);
53 | if ($ir['will'] < 0)
54 | {
55 | $ir['will'] = 0;
56 | }
57 | }
58 | if ($ir['jail'] > 0)
59 | {
60 | $gain /= 2;
61 | }
62 | $db->query(
63 | "UPDATE `userstats`
64 | SET `{$stat}` = `{$stat}` + $gain
65 | WHERE `userid` = $userid");
66 | $db->query(
67 | "UPDATE `users`
68 | SET `will` = {$ir['will']},
69 | `energy` = `energy` - {$_POST['amnt']}
70 | WHERE `userid` = $userid");
71 | $inc = $ir[$stat] + $gain;
72 | $inc2 = $ir['energy'] - $_POST['amnt'];
73 | if ($stat == 'strength')
74 | {
75 | echo "You begin lifting some weights.
76 | You have gained {$gain} strength by doing {$_POST['amnt']} sets of weights.
77 | You now have {$inc} strength and {$inc2} energy left.";
78 | }
79 | elseif ($stat == 'agility')
80 | {
81 | echo "You begin running on a treadmill.
82 | You have gained {$gain} agility by doing {$_POST['amnt']} minutes of running.
83 | You now have {$inc} agility and {$inc2} energy left.";
84 | }
85 | elseif ($stat == 'guard')
86 | {
87 | echo "You jump into the pool and begin swimming.
88 | You have gained {$gain} guard by doing {$_POST['amnt']} minutes of swimming.
89 | You now have {$inc} guard and {$inc2} energy left.";
90 | }
91 | elseif ($stat == 'labour')
92 | {
93 | echo "You walk over to some boxes filled with gym equipment and start moving them.
94 | You have gained {$gain} labour by moving {$_POST['amnt']} boxes.
95 | You now have {$inc} labour and {$inc2} energy left.";
96 | }
97 | echo ' ';
98 | $ir['energy'] -= $_POST['amnt'];
99 | $ir[$stat] += $gain;
100 | }
101 | }
102 | $ir['strank'] = get_rank($ir['strength'], 'strength');
103 | $ir['agirank'] = get_rank($ir['agility'], 'agility');
104 | $ir['guarank'] = get_rank($ir['guard'], 'guard');
105 | $ir['labrank'] = get_rank($ir['labour'], 'labour');
106 | echo "Choose the stat you want to train and the times you want to train it.
107 | You can train up to {$ir['energy']} times.
108 |
109 | Stat:
110 | Strength (Have {$ir['strength']}, Ranked {$ir['strank']})
111 | Agility (Have {$ir['agility']}, Ranked {$ir['agirank']})
112 | Guard (Have {$ir['guard']}, Ranked {$ir['guarank']})
113 | Labour (Have {$ir['labour']}, Ranked {$ir['labrank']})
114 |
115 | Times to train:
116 | ";
117 | $h->endpage();
118 |
--------------------------------------------------------------------------------
/hospital.php:
--------------------------------------------------------------------------------
1 | Hospital
14 |
15 |
16 | Name
17 | Level
18 | Time
19 | Reason
20 |
21 | ";
22 | $q =
23 | $db->query(
24 | 'SELECT `userid`, `username`, `hospital`, `level`,
25 | `hospreason`, `gangPREF`
26 | FROM `users` AS `u`
27 | LEFT JOIN `gangs` AS `g`
28 | ON `u`.`gang` = `g`.`gangID`
29 | WHERE `u`.`hospital` > 0
30 | ORDER BY `u`.`hospital` DESC');
31 | while ($r = $db->fetch_row($q))
32 | {
33 | echo "
34 |
35 | {$r['gangPREF']} {$r['username']} [{$r['userid']}]
36 | {$r['level']}
37 | {$r['hospital']} minutes
38 | {$r['hospreason']}
39 |
40 | ";
41 | }
42 | $db->free_result($q);
43 | echo '
';
44 | $h->endpage();
45 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | General Info:';
14 | $exp = (int) ($ir['exp'] / $ir['exp_needed'] * 100);
15 | echo "Name: {$ir['username']}Crystals: {$cm}
16 | Level: {$ir['level']}
17 | Exp: {$exp}%
18 | Money: $fm
19 | HP: {$ir['hp']}/{$ir['maxhp']}
20 | Property: {$ir['hNAME']}
";
21 | echo 'Stats Info: ';
22 | $ts =
23 | $ir['strength'] + $ir['agility'] + $ir['guard'] + $ir['labour']
24 | + $ir['IQ'];
25 | $ir['strank'] = get_rank($ir['strength'], 'strength');
26 | $ir['agirank'] = get_rank($ir['agility'], 'agility');
27 | $ir['guarank'] = get_rank($ir['guard'], 'guard');
28 | $ir['labrank'] = get_rank($ir['labour'], 'labour');
29 | $ir['IQrank'] = get_rank($ir['IQ'], 'IQ');
30 | $tsrank = get_rank($ts, 'strength+agility+guard+labour+IQ');
31 | $ir['strength'] = number_format($ir['strength']);
32 | $ir['agility'] = number_format($ir['agility']);
33 | $ir['guard'] = number_format($ir['guard']);
34 | $ir['labour'] = number_format($ir['labour']);
35 | $ir['IQ'] = number_format($ir['IQ']);
36 | $ts = number_format($ts);
37 |
38 | echo "
39 |
40 |
41 | Strength: {$ir['strength']} [Ranked: {$ir['strank']}]
42 | Agility: {$ir['agility']} [Ranked: {$ir['agirank']}]
43 |
44 | Guard: {$ir['guard']} [Ranked: {$ir['guarank']}]Labour: {$ir['labour']} [Ranked: {$ir['labrank']}]
45 | IQ: {$ir['IQ']} [Ranked: {$ir['IQrank']}]Total stats: {$ts} [Ranked: $tsrank]
";
46 | $_POST['pn_update'] =
47 | (isset($_POST['pn_update']))
48 | ? strip_tags(stripslashes($_POST['pn_update'])) : '';
49 | if (!empty($_POST['pn_update']))
50 | {
51 | if (strlen($_POST['pn_update']) > 500)
52 | {
53 | echo 'You may only enter 500 or less characters here. ';
54 | }
55 | else
56 | {
57 | $pn_update_db = $db->escape($_POST['pn_update']);
58 | $db->query(
59 | "UPDATE `users`
60 | SET `user_notepad` = '{$pn_update_db}'
61 | WHERE `userid` = {$userid}");
62 | $ir['user_notepad'] = $_POST['pn_update'];
63 | echo 'Personal Notepad Updated! ';
64 | }
65 | }
66 | echo " Your Personal Notepad:
67 | "
68 | . htmlentities($ir['user_notepad'], ENT_QUOTES, 'ISO-8859-1')
69 | . "
70 | ";
71 | $h->endpage();
72 |
--------------------------------------------------------------------------------
/installer_foot.php:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |