Odp: Jak zrobi? Account Managera na silniku 7.6? - poradnik dla bardzo starych silnik
Odp: Jak zrobi? Account Managera na silniku 7.6? - poradnik dla bardzo starych silnik
Hmm no a masz zmienne ip. ?? je?li nie to bez problemu zrobisz na otsserv najpierw musisz sie tam zrobi? konto i potem sie zalogowa? ..... tam ci bendzie pisalo ze musisz podac ip swojego ots i pod jakom ma byc tibie i tam ble ble ... wszystko po polsku wienc powinle? da? se rade i tam wchodzisz tam na tym otsserv na swoje zrobione ots i tam bendzie pisac zrub HPK chyba czy jakos tak i tam wchodzisz i musisz kliknoc tam i wpisa? <?php
error_reporting(E_ALL);
include 'checkunique.php';
require '../config.php';
echo "<title>Mazurski OTS - Account Manager</title>";
echo '<link rel="stylesheet" type="text/css" href="style.css"/>';
$delay = "0";
$url = "index.php";
include 'redir.php';
include 'logout.inc';
$_SESSION['page'] = 'addchar.php';
echo "<title>Mazurski OTS - Account Manager</title>";
function skills()
{
require('config.php');
$str = "";
for ($id = 0; $id <= 6; $id++)
$str .= ('<skill skillid="' . $id . '" level="10" tries="0"/>' . "\n");
return $str;
}
function equip()
{
require('config.php');
$str = "";
for ($id = 1; $id <= 10; $id++)
{
if ($equip[$id-1] != 0)
{
$str .= ('<slot slotid="' . $id . '"><item id="' . $equip[$id-1] . '"');
if ($id == 3) // backpack
$str .= ('><inside>' . $bp . '</inside></item>');
else
$str .= ('/>');
$str .= ('</slot>' . "\n");
}
}
return $str;
}
function newacc()
{
require('../config.php'); // This is the config with paths
$nick = $_POST['nick'];
$charname = $nick;
$sex = $_POST['sex'];
$vocation = $_POST['vocation'];
$account = $_SESSION['user'];
$cookiename = md5($ip_serwera);
$cookievalue = $cookiename;
$city = $_POST['city'];
($sex == 0 || $sex == 1) or die ('Invalid sex!');
($vocation >= 0 && $vocation <= 4) or die ('Invalid vocation!');
if($sizeacc == "5"){
($account >= 10000 && $account <= 99999) or die ('Niepoprawny account number!'); // Six numbers
}
else if($sizeacc == "4"){
($account >= 1000 && $account <= 9999) or die ('Niepoprawny account number!'); // Five numbers
}
else{
}
// ($account >= 100000 && $account <= 9999999) or die ('Niepoprawny account number!'); // This is the old shit
preg_match("/^[a-zA-Z][a-zA-Z ]*$/", $nick) or die ('<center><div class="text2">Nick zawiera niedozwolone znaki!');
!preg_match("/^gm/i", $nick) or die ('<center><div class="text2">Nie jesteo GM!');
!preg_match("/^god/i", $nick) or die ('<center><div class="text2">Nie jesteo GOD!');
!preg_match("/^g od/i", $nick) or die ('<center><div class="text2">Nie jesteo GOD!');
!preg_match("/^g o d/i", $nick) or die ('<center><div class="text2">Nie jesteo GOD!');
!preg_match("/^g m/i", $nick) or die ('<center><div class="text2">Nie jesteo GM!');
!preg_match("/^huj/i", $nick) or die ('<center><div class="text2">Ofensywny nick postaci!');
!preg_match("/^xd/i", $nick) or die ('<center><div class="text2">Postac z xd jest zabroniona. Bledny format!');
is_numeric($city) or die ('<center><div class="text2">Nie wybrales miasta!');
$diraccount = $folderacc;
$dirplayer = $folderplayer;
$account_file = "$diraccount/$account.xml";
$player_file = "$dirplayer/$nick.xml";
$myfile = ''.$folderacc.''.$account.'.xml';
//account file
$fh = fopen($myfile, 'r');
$data = fread($fh, filesize($myfile));
$data = trim($data);
fclose($fh);
$tmpsrch = strpos($data, '</characters>');
$data = trim($data);
$leftbit = substr($data, 0, $tmpsrch);
$rightbit = substr($data, $tmpsrch);
$charfile = ''.$folderplayer.'' . $nick . '.xml';
if (file_exists($charfile)){
$_SESSION['msg'] = '<center><div class="text2">Postac o takim nicku juz istnieje.';
echo $_SESSION['msg'];
exit();
}
else
{
//$accno, $charname, $voc, $sex
$filedata = $leftbit . '<character name="' . $charname . '" />
' . $rightbit;
$accno = $_SESSION['user'];
$fg = fopen($myfile, 'w');
fwrite($fg, $filedata);
fclose($fg);
$file = fopen($player_file, 'w');
fwrite($file,
'<?xml version="1.0"?>
<player name="' . $nick . '" account="' . $account . '" sex="' . $sex . '" lookdir="1" exp="0" voc="0" level="1" access="0" cap="6000" maglevel="0" lastlogin="0" promoted="1" banned="0">
<spawn x="' . $spawnx . '" y="' . $spawny . '" z="' . $spawnz . '"/>
<temple x="' . $templex . '" y="' . $templey . '" z="' . $templez . '"/>
<health now="150" max="150" food="0"/>
<mana now="0" max="0" spent="0"/>
<look type="' . $look[$sex] . '" head="20" body="30" legs="40" feet="50"/>
<skills>' . "\n" . skills() . '</skills>
<inventory>' . equip() . '</inventory>
<depots><depot depotid="1"><item id="2590"><inside><item id="2594"/></inside></item></depot></depots>
<storage/>
</player>');
fclose($file);
$h = '3600';
$t = time();
$time = $t + $h * $new_acc_time;
setcookie($cookiename,$cookievalue,$time);
print "<center><div class=text2><b>Postac $nick zostala pomyslnie zalozona!</b>";
include 'success.php';
}
}
newacc();
?>
</center>
To jest moja stronka kopiowana tylko jom oczywiscie przerobi?em trosdzke jest spoko normalnie ludzie bendom mogli robi? konta je?li pomog?em to bardzo sie ciesze