forked from yi12345/TravianT4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
38 lines (33 loc) · 1.47 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
include_once ("GameEngine/Database.php");
include_once ("GameEngine/Generator.php");
function addVillage($wid, $uid, $username, $capital) {
$vname = $name." Village";
$time = time();
$q = "INSERT into " . TB_PREFIX . "vdata (wref, owner, name, capital, pop, cp, celebration, wood, clay, iron, maxstore, crop, maxcrop, lastupdate, created) values
('$wid', '$uid', '$vname', '$capital', ".rand(2,10000).", 1, 0, 780, 780, 780, 800, 780, 800, '$time', '$time')";
return mysql_query($q) or die(mysql_error());
}
for($i=6;$i<=100;$i++){
$name = "test".$i;
$pw = "1234";
$email = "test".$i."@mail.com";
$kid = rand(1,4);
$act = $generator->generateRandStr(10);
$uid = $database->register($name,md5($pw),$email,rand(1,3),$kid,$act);
$frandom0 = rand(0,3);$frandom1 = rand(0,3);$frandom2 = rand(0,4);$frandom3 = rand(0,3);
$database->addHeroFace($uid,$frandom0,$frandom1,$frandom2,$frandom3,$frandom3,$frandom2,$frandom1,$frandom0,$frandom2);
$database->addHero($uid);
$database->addHeroinventory($uid);
$wid = $database->generateBase($kid);
$database->modifyHero2('wref', $wid, $uid, 0);
$database->setFieldTaken($wid);
addVillage($wid, $uid, $name, 1);
$database->addResourceFields($wid,$database->getVillageType($wid));
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$database->updateUserField($uid,"access",USER,1);
$database->updateUserField($uid,"location","",1);
}
?>