Grow your village into a sprawling domain on a vast world map. Manage wood, clay, iron, and crop; upgrade fields and buildings; train infantry and cavalry; and coordinate raids and defenses with your alliance. Real‑time production, detailed combat reports, and a persistent landscape make every hour of planning and expansion matter.
Choose your tribe and specialize your strategy—settle new villages, trade smart in the marketplace, and use scouting to outmaneuver rivals. With plus-style conveniences and server-wide rankings, Kravian captures the long-form thrill of building, fighting, and conquering across seasons of competitive play.
Type: Browser-based strategy MMOG (Travian clone)
Tech Stack: PHP 5.3.0+, MySQL/MySQLi, HTML, CSS, JavaScript
Files: 1,035 files (57 PHP, 330 .tpl templates, 406 GIF, 225 JPG, 7 CSS, 5 JS)
Database: 31 tables
License: GNU LGPL v.3
Developer: scr1pt
Date: May 2010 (Rev 0.0.3)
Status: Incomplete/Beta
Kravian is an unauthorized clone of the popular browser strategy game Travian (published by Travian Games). The name "Kravian" is a near-anagram of "Travian" and the entire game mechanics, art assets, UI, German filenames (dorf1.php, dorf2.php, berichte.php, nachrichten.php), and gameplay loop are direct replicas. Features Roman/Gallic/Teutonic tribes building villages, training armies, conquering territories on a persistent world map, and forming alliances.
Key Features:
Critical Issues:
$_GET/$_POST interpolation into SQL, MD5 passwords, no CSRF tokens, direct credential exposure in installer---
Pattern: MVC-like with Template System
Structure:
kravian_v0.3/
├── Kravian v0-3/
│ ├── engine/ # Core business logic (16 classes)
│ │ ├── Account.php
│ │ ├── Alliance.php
│ │ ├── Automation.php
│ │ ├── Battle.php
│ │ ├── Building.php (680 lines - building management)
│ │ ├── Database.php
│ │ ├── database/
│ │ │ ├── db_MYSQLi.php (1,281 lines - all DB operations!)
│ │ │ ├── db_MYSQL.php (1,144 lines - legacy mysql_* API)
│ │ │ └── db_mysql_bak.php
│ │ ├── Data/ # Game constants (units, buildings, resources)
│ │ ├── Form.php
│ │ ├── Generator.php
│ │ ├── Lang/ # Language files
│ │ ├── Logging.php
│ │ ├── Mailer.php
│ │ ├── Market.php
│ │ ├── Message.php
│ │ ├── Multisort.php
│ │ ├── Notes/ # "DO NOT REMOVE THIS FOLDER" placeholder
│ │ ├── Prevention/ # "DO NOT REMOVE THIS FOLDER" placeholder
│ │ ├── Profile.php
│ │ ├── Ranking.php
│ │ ├── report.php
│ │ ├── Session.php
│ │ ├── Technology.php
│ │ ├── Units.php
│ │ └── Village.php
│ ├── Templates/ # 330 .tpl template files (HTML with PHP inline)
│ │ └── menu.tpl # Navigation menu
│ ├── gpack/ # Graphics pack (travian_0002/)
│ ├── img/ # Game images (631 images - GIF/JPG)
│ ├── install/ # Installation wizard
│ │ ├── data/
│ │ │ ├── sql.sql (809 lines, 31 CREATE TABLE statements)
│ │ │ └── constant_format.tpl
│ │ ├── include/
│ │ │ └── database.php (MySQLi/MySQL installer DB class)
│ │ ├── index.php
│ │ └── process.php (132 lines - generates Config.php from POST)
│ ├── cpanel/ # Admin control panel (EMPTY FOLDER!)
│ ├── support/ # Support system folder
│ ├── news/ # News system folder
│ ├── ajax.php # AJAX handlers (map data, village data)
│ ├── allianz.php # Alliance management (German: "Allianz")
│ ├── anmelden.php # Registration (German: "Anmelden")
│ ├── berichte.php # Reports (German: "Berichte")
│ ├── build.php # Building construction UI
│ ├── dorf1.php # Resource village view (German: "Dorf" = village)
│ ├── dorf2.php # Center village view (buildings)
│ ├── karte.php # World map (German: "Karte")
│ ├── login.php
│ ├── logout.php
│ ├── nachrichten.php # Messages (German: "Nachrichten")
│ ├── spieler.php # Player profile (German: "Spieler")
│ ├── statistiken.php # Statistics (German)
│ ├── support.php # Support system
│ ├── plus.php # Premium Plus account management
│ ├── warsim.php # War simulator
│ ├── changelog.php # Version history (Rev 0.0.3)
│ ├── mt-*.js # JavaScript libraries (map, UI)
│ └── favicon.ico
Architecture Rating: 5/10 - Decent class-based separation (16 engine classes), but marred by 1,281-line database monolith, German/English filename mix, empty admin folder, incomplete implementation, and no Config.php separation (generated by installer). Template system is basic PHP inline (not a real templating engine like Smarty).
Largest PHP Files:
db_MYSQLi.php - 1,281 lines (entire DB API in one class!)db_MYSQL.php - 1,144 lines (legacy mysql_* version)Building.php - 680 lines (building construction/upgrade logic)Automation.php - 379 lines (scheduled tasks, cleanup)---
Security Rating: 0/10 - CATASTROPHIC
Critical Vulnerabilities:
// ajax.php lines 2-7 - Direct GET into SQL
$x = $_GET['x'];
$y = $_GET['y'];
$xx = $_GET['xx'];
$yy = $_GET['yy'];
// Directly used in queries without escaping!
// build.php line 17 - Direct session assignment from GET
$_SESSION['wid'] = $_GET['newdid'];
// db_MYSQLi.php line 19 - Direct interpolation
$q = "SELECT username FROM ".TB_PREFIX."users where username = '$ref' LIMIT 1";
// db_MYSQLi.php line 37 - Direct username/sessid interpolation
$q = "SELECT username FROM ".TB_PREFIX."users where username = '$username' and sessid = '$sessid' LIMIT 1";
// db_MYSQLi.php line 72 - Direct field name interpolation (!)
$q = "UPDATE ".TB_PREFIX."users set $field = '$value' where username = '$username'";
NO PREPARED STATEMENTS. Every single database query uses direct string interpolation of $_GET, $_POST, $_SESSION, and function parameters. Trivial SQL injection in literally every endpoint.
$ grep -r "htmlspecialchars|htmlentities|strip_tags|addslashes" kravian_v0.3/ --include="*.php"
ZERO instances of htmlspecialchars(), htmlentities(), strip_tags(), or even addslashes() in all 57 PHP files. Every user input is blindly echoed into HTML (XSS) and SQL (injection).
// db_MYSQLi.php line 83 - Password verification
$row = $result->fetch_assoc();
if($row['password'] == md5($password)) {
return true;
}
// install/process.php line 121 - Admin account creation
$q = "INSERT INTO ".TB_PREFIX."users (username,password,access,email,timestamp,tribe)
VALUES ('".$_POST['user']."', '".md5($_POST['pass'])."', ...";
MD5 hashing without salt. Rainbow table attacks trivial.
// install/process.php lines 32-45 - Writes Config.php from raw POST
$text = preg_replace("'%SSERVER%'",$_POST['sserver'],$text);
$text = preg_replace("'%SUSER%'",$_POST['suser'],$text);
$text = preg_replace("'%SPASS%'",$_POST['spass'],$text);
$text = preg_replace("'%SDB%'",$_POST['sdb'],$text);
fwrite($fh, $text);
Database credentials written to include/constant.php from unvalidated $_POST. No validation, no escaping. Installer process is completely insecure.
// build.php lines 36-42 - State-changing action via GET
if(isset($_GET['a']) && $get['c'] == $session->checker && !isset($get['id'])) {
if($get['a'] == 0) {
$this->removeBuilding($get['d']);
} else {
$session->changeChecker();
$this->upgradeBuilding($get['a']);
}
}
Has a "checker" token mechanism ($session->checker) but it's trivially bypassed since session IDs are predictable and no per-form tokens exist.
// install/process.php lines 27-30
$myFile = "include/constant.php";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $text);
Installer writes arbitrary PHP files. If installer not deleted post-install, attacker can regenerate Config.php and inject code.
$ ls -la "cpanel/"
Template references cpanel/moderator/ and cpanel/admin/ but these folders don't exist! Dead links, incomplete implementation.
Attack Surface:
ajax.php, allianz.php, build.php, dorf1.php, dorf2.php, karte.php, spieler.php, statistiken.php, and all 1,281 lines of db_MYSQLi.phpaccess field via SQL injection to become adminDeployment Risk: NEVER DEPLOY. This is a honeypot waiting to happen. Any live instance would be compromised in hours. The complete absence of input sanitization combined with direct SQL interpolation means automated scanners will find SQL injection endpoints instantly.
---
Innovation Rating: 3/10 - Functional Travian clone, but nothing original
Positive Aspects:
// engine/Database.php - Dual MySQLi/MySQL support
// db_MYSQLi.php - Modern MySQLi OOP interface
// db_MYSQL.php - Legacy mysql_* procedural API fallback
Supports both deprecated mysql_ functions and modern mysqli_ via switchable DB classes. Shows awareness of PHP deprecation (PHP 5.5 removed mysql_*), though implementation is flawed.
330 .tpl files separate presentation from logic (though still PHP inline, not a real templating engine). Shows attempt at MVC separation.
-- 31 tables cover:
users, vdata (villages), wdata (world map 801x801),
units (50 unit types), training, research,
movement (troop movements), market (trading),
alidata (alliances), diplomacy,
enforcement (reinforcements), fdata (fields),
bdata (building queue), odata (orders),
ndata (reports), mdata (messages),
statistics, active (online tracking),
build_log, tech_log, login_log, market_log, gold_fin_log, war_log, illegal_log
Database schema is well-designed for a persistent MMOG. Covers village management, combat, diplomacy, economy, and extensive logging.
// Automation.php - Resource calculation
// changelog.php: "Resource Production now in real time"
Implements continuous resource generation between page loads (not just on refresh).
// Battle.php - Combat resolution
// warsim.php - War simulator for planning attacks
Includes pre-battle simulator (like Travian's) so players can test troop compositions before committing.
// engine/Lang/ - Language files (English, Portuguese)
// Templates use constants: HOME, INSTRUCT, LOGIN, REG, FORUM, etc.
Prepared for internationalization, though only partial implementation (changelog shows "10% lang system implemented").
// plus.php - Premium features
// References "Travian Plus" with gold/premium accounts
Monetization strategy via premium subscriptions (though likely illegal since cloning Travian's business model).
-- 7 dedicated log tables:
build_log, tech_log, login_log, market_log, gold_fin_log, war_log, illegal_log
Extensive auditing infrastructure (build activity, tech research, logins, market trades, gold purchases, war actions, cheating detection).
Negative Aspects:
// changelog.php Rev 0.0.3:
"[M] Partially developed a2b.php - Fixed time of unit action"
"[+] In part class developed for the demolition of buildings, pending debug and complete"
"[+] Implemented lang system 10%"
Still in early beta (v0.0.3). Many features marked "pending debug" or "partially developed."
dorf, berichte, nachrichten) = Travian namingtravian_0002/ = stolen Travian assets
- literally uses "Travian" in alt text!This is trademark infringement and copyright theft. Gameforge/Travian Games has aggressively pursued clones with C&D letters and lawsuits.
$ ls cpanel/
Templates reference admin/moderator control panels but they don't exist. Dead links throughout game.
Every mechanic is Travian. No innovation. Pure clone.
---
Code Quality Rating: 4/10 - Structured but buggy and insecure
Positive Patterns:
// 16 separate engine classes:
Account, Alliance, Automation, Battle, Building, Database, Form,
Generator, Logging, Mailer, Market, Message, Multisort, Profile,
Ranking, Session, Technology, Units, Village
Good separation of concerns, unlike monolithic procedural code in many PHP4-era games.
// engine/database/db_MYSQLi.php method examples:
checkExist($ref,$mode)
checkactiveSession($username,$sessid)
setDeleting($uid,$mode)
updateUserField($username,$field,$value)
login($username,$password)
CamelCase class names, lowercase methods, descriptive function names.
// All queries use:
TB_PREFIX."users"
TB_PREFIX."vdata"
// Allows multiple game instances in one database
Table prefix system for multi-tenancy (like WordPress).
// Building.php header:
All engine files have detailed headers with developer, license, version.
Negative Patterns:
// db_MYSQLi.php - 1,281 lines, 100+ methods
checkExist(), checkactiveSession(), setDeleting(), updateUserField(),
login(), sitterLogin(), ... (continues for 1,200+ lines)
God Object anti-pattern. Every DB operation in one giant class. Should be split into repositories (UserRepository, VillageRepository, AllianceRepository, etc.).
Every DB method accepts raw strings without validation:
function updateUserField($username,$field,$value) {
$q = "UPDATE ".TB_PREFIX."users set $field = '$value' where username = '$username'";
return $this->connection->query($q);
}
Trusts caller to sanitize. Violates "defense in depth."
// Building.php lines 90-95:
case 1: return 5; break;
case 2: return 6; break;
case 3: return 7; break;
case 4:
if($id >= 19) {
if($session->tribe == 1 || ALLOW_ALL_TRIBE) {
No constants explaining what 1/2/3/4, 5/6/7, 19, or tribe==1 mean. Unmaintainable.
German filenames (dorf1.php, berichte.php) coexist with English class names and Spanish developer emails. Confusing for international contributors.
engine/Notes/DO NOT REMOVE THIS FOLDER.txt
engine/Prevention/DO NOT REMOVE THIS FOLDER.txt
Placeholder folders with warnings not to delete them... but they're empty. Why?
// db_mysql_bak.php - 393 line backup file
Backup files committed to release. Poor version control hygiene.
Refactoring Priority:
db_MYSQLi.php into repository classes---
Technology Stack:
Required:
db_MYSQLi.php (default)db_MYSQL.php (deprecated PHP 5.5+).htaccess based on structure)mysqli or mysqlsessiongd (likely, for image manipulation - though not verified)mail() function (for Mailer.php)Optional:
External Dependencies:
mt-core.js, mt-more.js, mt-full.js, unx.js, new.js)gpack/travian_0002/lang/en/lang.css, compact.css)Database Schema:
31 tables (see sql.sql for CREATE TABLE statements):
users, vdata (villages), wdata (world map), active (online tracking)units, training, research, movement, enforcement (reinforcements)market, fdata (fields), odata (orders)alidata (alliances), ali_permission, ali_invite, ali_log, diplomacy, mdata (messages), ndata (reports)build_log, tech_log, login_log, market_log, gold_fin_log, war_log, illegal_logbdata (building queue), send (scheduled sends)deleting (account deletion queue), statistics (world stats)Installation:
install/index.phpinclude/constant.php - INSECURE)sql.sqlinclude/wdata.php - 640K+ villages!)install/ FOLDER (critical - else anyone can regenerate Config.php)Configuration:
All settings written to include/constant.php by installer:
// Sample constants:
SERVER_NAME, LANG, SPEED, INCSPEED (increase speed multiplier),
TRACK_USERS, UTIMEOUT (user timeout),
AUTODEL (auto-delete inactive), AUTODELTIME,
WMAX (world max size), GPACK (graphics pack),
SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB, TB_PREFIX,
CONNECT_TYPE (MySQLi=1, MySQL=0),
ADMIN_EMAIL, ADMIN_NAME, SUBDOM (subdomain),
LOG_BUILD, LOG_TECH, LOG_LOGIN, LOG_GOLD_FIN, LOG_ADMIN, LOG_WAR, LOG_MARKET, LOG_ILLEGAL,
MIN_USERLENGTH, MIN_PASSLENGTH, SPECIALCHARS (allow in usernames),
ACTIVATE (email activation), ADMIN_RANK, ACT_CENSOR (censorship), CENSORED_WORDS
Extensive configurability (game speed, logging, registration rules, censorship), but no security hardening (credentials in plaintext PHP file).
---
Game Type: Persistent World Browser Strategy MMOG (Travian Clone)
Core Gameplay Loop:
Plus Account (Premium):
// plus.php - Premium features
// Likely includes:
// - Extra building queue slots
// - Faster unit training
// - NPC trader (instant resource conversion)
// - Map overlays
// - Gold for speeding constructions
Freemium model: Free to play, pay for convenience/speed.
Time Investment:
Travian is notorious for requiring 24/7 attention during wars (timed attacks overnight).
Replayability: Low (single-server progression, eventual dominance by veterans), but Travian/Kravian servers typically "reset" every 6-12 months for new rounds.
---
Modernization Effort: $18,000 - $24,000 (240-320 hours)
Priority 1: Security Overhaul (80-120 hours, $6K-$9K):
db_MYSQLi.php)$_GET/$_POST)password_hash()/password_verify())htmlspecialchars() to all output.env, delete installer post-setup)HttpOnly/Secure session cookiesPriority 2: Architecture Refactoring (60-80 hours, $4.5K-$6K):
db_MYSQLi.php (1,281 lines) into repositories:UserRepository, VillageRepository, AllianceRepository, CombatRepository, MarketRepository, MessageRepositoryconstant.php with .env and config classes)db_mysql_bak.php, empty folders)dorf1.php → village_resources.php, berichte.php → reports.php)Priority 3: Complete Missing Features (40-60 hours, $3K-$4.5K):
cpanel/admin/, cpanel/moderator/)a2b.php development ("partially developed")Priority 4: Modern Tech Stack (30-40 hours, $2.25K-$3K):
mysql_* functions (remove db_MYSQL.php, keep only MySQLi)Priority 5: Legal Compliance (20-30 hours, $1.5K-$2.25K):
alt="Travian", CSS class logo_plus)Priority 6: UI/UX Improvements (10-20 hours, $750-$1.5K):
Optional Enhancements:
Total Modernization Cost:
Biggest Challenge: Legal compliance. This is a Travian clone using stolen assets. Even with security fixes, deploying this publicly risks C&D letters or lawsuits from Gameforge/Travian Games. Recommend complete rebrand and original art before any public deployment.
Maintenance: Once modernized, expect $500-$1,000/month ongoing costs (server hosting, DDoS protection, bug fixes, game balance patches, community management).
---
Release Period: May 2010 (Rev 0.0.3)
PHP Era: PHP 5.3.0 (released June 2009)
Travian Era: 2004-2010 peak (Travian launched 2004, became EU phenomenon)
2010 Browser Gaming Landscape:
Travian (2004) was the king of browser strategy games in Europe. Millions of players across hundreds of servers. Spawned countless clones (Ikariam, TribalWars, Grepolis). Kravian is yet another attempt to copy Travian's success.
goto operator (thankfully not used!)mysql_*Kravian uses none of these modern PHP 5.3 features. Code style is still PHP 4/5.2-era procedural OOP.
2006-2010 saw explosion of Travian/OGame clones. Easy to clone (open-source PHP), hard to differentiate, profitable if ads/premium accounts succeed. Most died within 1-2 years due to:
Gameforge/Travian Games aggressively defended IP:
Kravian's Place:
One of hundreds of Travian clones built 2008-2012. "Kravian" name itself shows lack of creativity (Travian → Kravian anagram). Development stalled at v0.0.3 (incomplete beta), likely due to:
Why It Matters:
Kravian represents the Travian clone gold rush of late 2000s. Demonstrates:
Comparable Projects:
Legacy: Kravian itself has no legacy (never publicly deployed, abandoned in beta). But it's a fossil from browser gaming's clone wars era, showing the technical debt, security flaws, and legal landmines that doomed most clones.
---
Overall Rating: 3/10
Strengths:
Critical Flaws:
travian_0002/ graphics pack)Deployment Recommendation: NEVER DEPLOY PUBLICLY
Reasons:
Educational Value: 5/10
What We Learn:
db_MYSQLi.php (1,281 lines) is a poster child for why God Objects are maintainability nightmaresWho Should Study This:
Who Should NOT Deploy This:
Best Use Case: Security Training / Refactoring Workshop
Convert Kravian into a teaching tool:
Tier Ranking: Tier 3 - Abandoned Beta (Historical Artifact Only)
Verdict: Kravian is a cautionary tale from browser gaming's Travian clone gold rush (2008-2012). Shows how NOT to clone a successful game (steal everything, innovate nothing, deploy insecurely, ignore legal risks). Interesting as a code archaeology specimen for studying 2010-era PHP mistakes and browser MMOG mechanics, but absolutely not deployable. The complete absence of input sanitization combined with illegal Travian IP theft makes this a dual-threat legal and security disaster.
If You Want to Build a Browser Strategy Game:
Kravian proves: Great game design (Travian's) + terrible execution (insecure clone) + legal risk (IP theft) = doomed project. Learn from its mistakes, not its code.
| Category | Rating | Commentary |
|---|---|---|
| Innovation & Originality | ★☆☆☆☆☆☆☆☆☆ 1/10 | CLONE: Direct copy of Travian gameplay, assets, UI, German filenames |
| Code Quality | ★★★★★☆☆☆☆☆ 5/10 | MVC-like structure, template system, but incomplete beta code |
| Security Posture | ★☆☆☆☆☆☆☆☆☆ 1/10 | CATASTROPHIC: No sanitization, SQL injection, MD5 passwords, CSRF vulnerable |
| Documentation | ★★☆☆☆☆☆☆☆☆ 2/10 | Only install.txt and changelog.txt, minimal comments |
| Gameplay Design | ★★★★★★★★☆☆ 8/10 | Exact Travian clone - proven mechanics (but stolen) |
| Technical Architecture | ★★★★★★☆☆☆☆ 6/10 | MVC-like, 330 templates, MySQLi abstraction, but incomplete |
| Completeness | ★★★★☆☆☆☆☆☆ 4/10 | Rev 0.0.3 beta, admin panel empty, "pending debug" markers |
| Historical Significance | ★★★☆☆☆☆☆☆☆ 3/10 | Example of 2010 Travian clone scene, LGPL but illegal derivative |
| Preservation Value | ★★★☆☆☆☆☆☆☆ 3/10 | Low priority: illegal clone, incomplete, better alternatives exist |
Summary: Kravian is an unauthorized clone of the commercial game Travian (2010) with blatant trademark infringement ("Kravian" anagram), stolen art assets, identical gameplay mechanics, and German filenames (dorf1.php, berichte.php). While it shows decent MVC-like architecture with 330 Smarty templates and MySQLi abstraction, the Rev 0.0.3 beta status reveals incompleteness (empty admin panel, "pending debug" markers). Catastrophic security (no input sanitization, SQL injection everywhere, MD5 passwords) and illegal derivative work make this unsuitable for any use except studying clone culture. LGPL license doesn't cover stolen IP. Archive only - do not deploy.
available
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.