MCCodes is THE definitive mafia MMORPG engine that dominated the genre from 2008-2012 and became the foundation for 100+ derivative games. With professional database abstraction, comprehensive staff panel (15 modules), PayPal integration, CAPTCHA validation, and complete gameplay systems (gangs, combat, crimes, economy, education, forums), it represents the "WordPress of mafia games" - an industry standard. Active MCCodes marketplace, 50K+ forum posts, and thriving mod community established it as THE reference implementation. However, exposed production credentials (death/weetabix999) and MD5 password hashing show era-appropriate but outdated security. Historically CRITICAL artifact - study its architecture, understand why it succeeded, but update security before deployment. This is what every mafia game comparison references.
Release: ~2008-2010 (v2.0.0 → 2.0.1 → 2.0.2 patches included)
Website: McCodes.com (defunct)
CRITICAL DISCOVERY: Hardcoded production credentials in config.php:
$_CONFIG = array(
'username' => 'death',
'password' => 'weetabix999', // PRODUCTION PASSWORD COMMITTED!
'database' => 'death_death'
);
McCodes v2 is THE definitive mafia engine that dominated 2005-2012. While Mafia Script v1.2 was commercial/encrypted and Mafia Warz was abandoned beta, McCodes became the foundation for 100+ mafia games due to open-source nature, active community, and comprehensive feature set. Historical Significance: THIS is what every mafia game comparison references. Torn City competitor, McCodes marketplace, thousands of custom mods, forums with 50K+ posts. The Wordpress of mafia games.
Core Features:
Architecture Quality: Professional procedural PHP with database abstraction layer, helper function library, separated globals for regular/staff pages, dual MySQL/MySQLi driver support.
---
Pattern: Professional Procedural PHP with Class-Based Database Abstraction
Structure:
mc_codes_v2.0/
└── MC Codes v2.0/
├── Core System (9 files):
│ ├── config.php (DB config - CREDENTIALS EXPOSED!)
│ ├── globals.php (session, user data loading, 97 lines)
│ ├── sglobals.php (staff-only globals)
│ ├── global_func.php (390 lines - helper functions library)
│ ├── header.php (HTML header, menu generation)
│ ├── mainmenu.php (left sidebar menu)
│ ├── smenu.php (staff menu)
│ ├── login.php (258 lines - authentication)
│ └── loggedin.php (main logged-in page)
│
├── class/
│ ├── class_db_mysql.php (177 lines - MySQL driver)
│ └── class_db_mysqli.php (MySQLi driver)
│
├── Gameplay (50+ files):
│ ├── index2.php (personal notepad/stats)
│ ├── attack.php, attackbeat.php, attackwon.php, attacklost.php
│ ├── docrime.php, jail.php, jailbail.php, jailbust.php, fedjail.php
│ ├── gym.php, education.php, job.php
│ ├── bank.php, cyberbank.php, sendbank.php, sendcash.php, sendcyber.php, sendcrys.php
│ ├── itembuy.php, itemsell.php, itemsend.php, itemuse.php, itemmarket.php, iteminfo.php
│ ├── equip_weapon.php, equip_armor.php, unequip.php, inventory.php
│ ├── estate.php, shops.php
│ ├── slotsmachine.php, roulette.php, lucky.php
│ ├── monorail.php, explore.php
│ └── hospital.php, battletent.php
│
├── Gangs (6 files):
│ ├── gangs.php (browse gangs)
│ ├── creategang.php (gang creation)
│ ├── yourgang.php (978 lines! - gang management)
│ ├── gangcentral.php (gang hub)
│ ├── gangwars.php (declare/view wars)
│ └── oclog.php (organized crime logs)
│
├── Social (12 files):
│ ├── forums.php (698 lines - full forum system)
│ ├── bbcode_engine.php (BBCode parser)
│ ├── mailbox.php, imadd.php, mailban.php
│ ├── contactlist.php, friendslist.php, blacklist.php
│ ├── search.php, searchname.php, searchlocation.php
│ ├── userlist.php, usersonline.php, viewuser.php
│ └── announcements.php, newspaper.php
│
├── Staff Panel (15 files):
│ ├── staff.php (212 lines - staff index, basic settings)
│ ├── secpanel.php (342 lines - security/ban panel)
│ ├── staff_users.php (430 lines - user management)
│ ├── staff_gangs.php (541 lines - gang admin)
│ ├── staff_items.php (353 lines - item management)
│ ├── staff_crimes.php (327 lines - crime config)
│ ├── staff_courses.php, staff_jobs.php, staff_cities.php
│ ├── staff_houses.php, staff_shops.php, staff_forums.php
│ ├── staff_polls.php, staff_special.php
│ ├── staff_logs.php, staff_punit.php (punishment)
│ └── stafflist.php, staffnotes.php
│
├── Donator/Premium (6 files):
│ ├── donator.php, donatordone.php
│ ├── ipn_donator.php (PayPal IPN handler)
│ ├── ipn_wp.php (alternative payment)
│ ├── crystaltemple.php (crystal shop)
│ └── willpotion.php, willpdone.php
│
├── Voting (4 files):
│ ├── voting.php, polls_view.php, polling.php
│ └── votetrpg.php, votetwg.php (MMORPG top list integration)
│
├── Utilities (8 files):
│ ├── installer.php (517 lines - installation wizard)
│ ├── register.php (368 lines - user registration)
│ ├── authenticate.php, check.php, checkun.php, checkem.php
│ ├── captcha_verify.php (anti-macro validation)
│ └── preferences.php, stats.php
│
├── Cron Jobs (4 files):
│ ├── cron_minute.php (every minute tasks)
│ ├── cron_fivemins.php (5-min: jail release, energy refill)
│ ├── cron_hour.php (hourly tasks)
│ └── cron_day.php (daily: reset attempts, interest)
│
├── Patch Files (2 files):
│ ├── 200_202_changes.txt (259 lines - v2.0.0 → 2.0.2 upgrade)
│ └── 201_202_changes.txt (199 lines - v2.0.1 → 2.0.2 fixes)
│
├── Assets:
│ ├── Images: logo.png, title.jpg, mcc_splash_2.png, donator.gif
│ ├── Bars: bargreen.gif, barred.gif, *bar.png (progress bars)
│ ├── Gradients: dgrad.jpg, lgrad.jpg, rgrad.jpg, linegrad.PNG
│ └── UI: tablehgrad.png
│
└── Database:
├── dbdata.sql (877 lines, 60 tables)
└── License.txt (commercial EULA)
Architecture Rating: 7/10 - Professional procedural PHP for 2008 era
Strengths:
Weaknesses:
Database Schema (60 tables):
Core: users, userstats, gangs, gangwars, gangevents, applications, orgcrimes
Combat: attacklogs, challengebots
Economy: bank/cashxferlogs, bankxferlogs, shops, shopitems
Items: items, inventory, itemmarket
Property: houses, cities
Crime: crimes, jails
Education: courses, jobs, jobranks
Social: forum_forums, forum_posts, forum_topics, friendslist, blacklist, contactlist, mail, events
Staff: punishments, stafflog, securitylog
Voting: polls, pollvotes, voting
Settings: settings (key-value config)
---
Security Rating: 5/10 - Mixed (better than Mafia Warz, worse than modern standards)
CRITICAL VULNERABILITY: Hardcoded Production Credentials
// config.php - COMMITTED TO REPOSITORY!
$_CONFIG = array(
'username' => 'death',
'password' => 'weetabix999', // Real production password!
'database' => 'death_death'
);
Anyone with source = full database access.
Positive Security Measures:
// class_db_mysql.php lines 169
function escape($text) {
return mysql_real_escape_string($text, $this->connection_id);
}
Centralized escaping available (though not always used).
// globals.php lines 8-17
if(get_magic_quotes_gpc() == 0) {
foreach($_POST as $k => $v) {
$_POST[$k]=addslashes($v);
}
foreach($_GET as $k => $v) {
$_GET[$k]=addslashes($v);
}
}
Ensures all input has slashes (Magic Quotes deprecated PHP 5.4, removed PHP 7.0).
// index2.php line 37
htmlspecialchars($ir['user_notepad'])
// creategang.php lines 13-14
$name=htmlspecialchars($_POST['name']);
$desc=htmlspecialchars($_POST['desc']);
XSS protection on output (inconsistent application).
// jailuser.php line 18
mysql_real_escape_string($_POST['reason'],$c)
// secpanel.php lines 9-10
$posta=mysql_real_escape_string(print_r($_POST,1),$c);
$geta=mysql_real_escape_string(print_r($_GET,1),$c);
Staff panel has extra sanitization.
// captcha_verify.php, register.php CAPTCHA
// Settings: regcap_on, validate_on, validate_period
Anti-bot protection for registration and gym/crimes (configurable).
// globals.php - Session-based auth
$_SESSION['userid'], $_SESSION['loggedin']
Not cookie-based (better than some alternatives).
Security Vulnerabilities:
// staff.php line 20 - Direct POST in SQL!
foreach($_POST as $k => $v) {
$db->query("UPDATE settings SET conf_value='$v' WHERE conf_name='$k'");
}
Settings update vulnerable (though staff-only, still wrong).
// Removed in PHP 5.4 (2012), fatal error PHP 7.0+
if(get_magic_quotes_gpc() == 0) { ... }
Code cannot run on PHP 7+ without modification (2.0.1→2.0.2 patch attempted fix).
All queries use string concatenation, not PDO prepared statements. Better than Mafia Warz (which had ZERO escaping), but still 2000s-era practice.
// check.php line 5
$PASS=stripslashes(strip_tags(htmlspecialchars($_GET['password'], ENT_QUOTES)));
Passwords in GET params (URL logging risk). No bcrypt visible in schema = likely MD5/SHA1 at best.
No CSRF tokens visible. All forms vulnerable to cross-site request forgery.
// globals.php lines 51-56
if($ir['force_logout']) {
$db->query("UPDATE users SET force_logout=0 WHERE userid=$userid");
session_unset(); session_destroy();
header("Location: login.php"); exit;
}
Good feature (admin can force logout), but no session regeneration after suspicious activity.
Security Comparison:
| Game | Rating | SQL Injection | XSS | Credentials | PHP Version |
|---|---|---|---|---|---|
| Mafia Warz | 0/10 | 100% vulnerable | 100% vulnerable | Exposed in 2 files | PHP 4/5.3 max |
| McCodes v2 | 5/10 | Partial protection | Partial protection | Exposed in config.php | PHP 4-5.3 |
| Mafia Script | 4/10 | Inconsistent | Mixed | Encrypted files | PHP 5.x |
McCodes is industry average for 2008 - some sanitization, but not comprehensive. Better than amateur projects, worse than modern frameworks.
---
Innovation Rating: 8/10 - Set industry standards for mafia games
Revolutionary Features (for 2008):
// config.php - driver selection
'driver' => 'mysql', // or 'mysqli'
// Loads: class/class_db_{$_CONFIG['driver']}.php
First mafia engine with swappable DB drivers. Allowed PHP 5+ users to use mysqli while maintaining PHP 4 compatibility.
// global_func.php (390 lines) - reusable functions:
money_formatter($amount, $symbol)
get_rank($stat, $type)
item_dropdown($connection, $ddname, $selected)
crime_dropdown(), course_dropdown(), city_dropdown(), etc.
DRY principle applied. Other engines (Mafia Warz) copy-pasted dropdown code 50+ times.
globals.php // Regular users: loads user data, checks session
sglobals.php // Staff only: includes globals.php + staff auth check
Security layer - staff files include sglobals.php, preventing accidental exposure.
CREATE TABLE orgcrimes (
ocID, ocNAME, ocSTARTTEXT, ocSUCCTEXT, ocFAILTEXT,
ocMONEYMIN, ocMONEYMAX, ocSUCCHANCE
);
Database-driven OCs - admins configure via staff panel, not hardcoding. Mafia Warz hardcoded 4-player OCs; McCodes made them customizable.
// staff.php settings:
validate_on (On/Off)
validate_period (5/15/60 mins or per-login)
Configurable CAPTCHA for gym/crimes. First mafia engine with anti-macro built-in (not bolted-on mod).
// installer.php (517 lines)
// Step 1: PHP version check (>= 4.2.0)
// Step 2: MySQL connection test
// Step 3: Database creation
// Step 4: Admin account setup
// Step 5: Game configuration
One-click installation vs. manual SQL imports. Lowered barrier to entry for non-technical owners.
200_202_changes.txt (259 lines)
201_202_changes.txt (199 lines)
Structured upgrade path with find/replace instructions. Professional software maintenance vs. "download new version, figure it out" approach.
// bbcode_engine.php - Credit: Stewart Marshall
// forums.php (698 lines)
[b], [i], [u], [s], [url], [img], [quote], [code], [color], [size]
Fully-featured forums with gang-specific forums, staff-only forums, public forums. Integrated, not third-party (phpBB).
15 admin modules (vs. Mafia Warz's 4-file admin panel):
// votetrpg.php, votetwg.php
// Callback URLs for MMORPG top lists
Built-in voting rewards - players vote on top lists, get crystals automatically via callbacks. Other engines required manual implementation.
Industry-Standard Features:
McCodes defined what mafia games should have:
Every mafia game since 2008 copied these features because McCodes proved they worked.
Why McCodes Dominated:
---
Code Quality Rating: 6/10 - Professional procedural PHP (2008 standards)
Positive Patterns:
// globals.php
/*---------------------------------
-- McCodes 2.0
-- By Dabomstew
---------------------------------*/
Attribution maintained throughout.
// class_db_mysql.php (177 lines)
class database {
function configure($host, $user, $pass, $database, $persistent=0)
function connect()
function query($query)
function fetch_row($result=0)
function escape($text)
}
Object-oriented DB layer (rare for 2008 mafia games).
// global_func.php (390 lines)
// 30+ reusable functions organized by purpose:
// - Formatting: money_formatter(), number_formatter()
// - Ranking: get_rank($stat, $type)
// - Dropdowns: *_dropdown() functions
// - Validation: check_level(), stafflog_add()
Code reuse vs. Mafia Warz's copy-paste nightmare.
// Files: action.php (attack.php, bank.php, jail.php)
// Staff files: staff_*.php prefix
// Functions: verb_noun() (gang_index(), item_buy())
Logical, predictable naming.
// class_db_mysql.php lines 140-154
function connection_error() {
die("
Cannot connect to database...");
}
function query_error() {
die("
{$this->last_query}
...");
}
Basic error handling (better than silent failures).
Negative Patterns:
// yourgang.php structure:
// Lines 1-70: Initialization
// Lines 71-250: gang_index()
// Lines 251-350: gang_summary()
// Lines 351-450: gang_memberlist()
// Lines 451-550: gang_staff_kick()
// Lines 551-650: gang_forums()
// ... 10+ more functions
Should be split: GangController.php with separate methods, views in templates/.
// globals.php line 8
if(get_magic_quotes_gpc() == 0) {
// Manual addslashes()
}
PHP 5.4 removed magic_quotes_gpc, PHP 7.0 made this fatal error. Patch 2.0.1→2.0.2 attempted workaround but insufficient.
// forums.php line 150+
print "
";
while($r=$db->fetch_row($q)) {
print "";
}
print "
| Forum | Topics |
| {$r['name']} | {$r['topics']} |
";
No templating engine. HTML embedded in PHP = unmaintainable.
// globals.php creates globals:
global $userid, $ir, $set, $c, $db, $h;
Namespace pollution. Modern approach: dependency injection.
// config.php - credentials in source
$_CONFIG['password'] = 'weetabix999';
Should use environment variables or excluded config file.
Sanitization scattered across files (htmlspecialchars here, mysql_real_escape_string there). No centralized Input::get() validator.
Refactoring Priority (if modernizing):
Modernization Cost: $20K-$30K (250-400 hours)
---
2008 Requirements:
2025 Compatibility:
Installation Steps:
php /path/to/cron_minute.php
* php /path/to/cron_fivemins.php
php /path/to/cron_hour.php
* php /path/to/cron_day.php
Cron Tasks:
License Restrictions:
1) ONE domain only (+ test server with registration disabled) 2) NO redistribution/resale 3) Modifications allowed, can sell mods (not base files) 4) License terminable with valid reason Despite "open source" reputation, McCodes is commercial license. Free download, but legally restricted to 1 domain.---
Game Type: Persistent world mafia MMORPG
Core Gameplay Loop:
Time Investment:
---
Modernization Effort: $20,000-$30,000 (250-400 hours)
Critical Issues:
Modernization Roadmap:
Phase 1: PHP 7+ Compatibility ($5K, 60 hours)
Phase 2: Security Hardening ($7K, 90 hours)
Phase 3: Architecture Refactoring ($10K, 140 hours)
Phase 4: Modern Features ($5K, 70 hours)
Phase 5: Testing & Deployment ($3K, 40 hours)
Total: $30K, 400 hours
Alternative: McCodes v2 Fork Ecosystem
Instead of modernizing, use existing community forks:
Community already solved PHP 7 compatibility. Don't reinvent wheel.
---
Release Period: 2008-2010 (v2.0.0 → 2.0.2)
Developer: Dabomstew (UK-based, McCodes.com)
License: Commercial (1 domain), but widely distributed
2008 Browser Gaming Landscape:
McCodes Dominance:
Market Position:
Why McCodes Won:
McCodes.com Shutdown (~2015):
Legacy Games Still Running (2025):
Dozens of mafia games still use McCodes v2.x or derivatives:
Cultural Impact:
McCodes defined mafia game conventions:
Every mafia game since 2008 either:
Comparison to WordPress:
What Killed McCodes:
Modern Alternatives (2025):
---
Overall Rating: 7/10
Strengths:
Weaknesses:
Deployment Recommendation: Use Community Forks (PHP 7+ Compatible)
Don't use v2.0.2 directly:
If You Want McCodes:
Educational Value: 9/10
Excellent learning resource for:
Who Should Study This:
Who Should NOT Use This:
Best Use Case: Historical Study + Community Forks
McCodes v2.0.2 is museum piece - historically significant, but outdated. Use community forks updated for PHP 7+, or study as example of 2008 PHP craftsmanship.
Tier Ranking: Tier 2 - Professional Open Source (Historical Significance)
Comparison:
Verdict: McCodes v2 represents the pinnacle of procedural PHP mafia engines (2008). While technically outdated (PHP 5.6, mysql_*, no MVC), it defined the genre and enabled 100+ games. Its legacy lives on in every modern mafia game's feature set.
Historical Significance > Technical Currency
If Mafia Script v1.2 was "commercial failure" and Mafia Warz was "security catastrophe," McCodes v2 is "the one that worked." Not because it was perfect (it wasn't), but because it was good enough, free enough, and open enough to build a community.
Final Rating: 7/10 - The WordPress of mafia games. Outdated but legendary.
Legacy: Every mafia game you've played since 2008 owes something to McCodes. That's success. 👑
| Category | Rating | Commentary |
|---|---|---|
| Innovation & Originality | ★★★★★★★☆☆☆ 7/10 | Comprehensive mafia engine, set industry standard, innovative features |
| Code Quality | ★★★★★★★☆☆☆ 7/10 | Professional procedural PHP, database abstraction, helper library, organized |
| Security Posture | ★★★★☆☆☆☆☆☆ 4/10 | MD5 passwords, exposed production credentials, needs hardening |
| Documentation | ★★★★★★☆☆☆☆ 6/10 | Forums with 50K+ posts, active community, but limited inline docs |
| Gameplay Design | ★★★★★★★★★☆ 9/10 | Complete MMORPG: gangs, combat, crimes, economy, education, forums, staff panel |
| Technical Architecture | ★★★★★★★★☆☆ 8/10 | Database abstraction, dual MySQL/MySQLi drivers, modular structure |
| Completeness | ★★★★★★★★★☆ 9/10 | Production-ready engine, installer, staff panel, PayPal integration |
| Historical Significance | ★★★★★★★★★★ 10/10 | DEFINING mafia engine (2008-2012), foundation for 100+ games, community legacy |
| Preservation Value | ★★★★★★★★★☆ 9/10 | CRITICAL: Industry standard reference, architectural study, community artifact |
Summary: McCodes v2.0.2 (2008-2010) is THE definitive mafia MMORPG engine that dominated the genre from 2008-2012 and became the foundation for 100+ derivative games. With professional database abstraction (dual MySQL/MySQLi drivers), comprehensive staff panel (15 modules), PayPal integration, CAPTCHA validation, and complete gameplay systems (gangs, combat, crimes, economy, education, forums), it represents the "WordPress of mafia games" - an industry standard. Active McCodes marketplace, 50K+ forum posts, and thriving mod community established it as THE reference implementation. However, exposed production credentials (death/weetabix999) and MD5 password hashing show era-appropriate but outdated security. Historically CRITICAL artifact - study its architecture, understand why it succeeded, but update security before deployment. This is what every mafia game comparison references.
Running many of the scripts in this archive on a live server presents a serious security risk. These projects were created before modern hardening practices and may contain vulnerabilities that can compromise your system.
We strongly recommend using this code for reference and analysis only, or in isolated local environments. By downloading these files, you accept full responsibility for their use.