I here are the 2 php's you will need when using a different WorldServer...
ChangeWS(acc) -> changes the WS line to the one disired
P.S: Files attached!
Code: Select all
<html>
<head>
<title>-= [ Change WS (acc) ] =-</title>
</head>
<body bgcolor="#EFECE2" text="#000000">
<?php
Error_reporting(0);
/*--------------Server Path----------------*/
$dir = 'C:\\HB-Server2\\';
$dir = ($dir==''?'':$dir.'\\');
/*--------------Server Path----------------*/
if(!$_POST)
{
echo '<form action="'.$_SERVER['PHP_SELF'].'" method=post>
<center><h2><u>Change WL Server</u></h2>
Admin Character: <input type="text" name=admin><br>
Admin Password: <input type="password" name=pass><br><br>
Click here to Change WS - <input type=submit value=Submit>
<hr>
Current WL: <input type="txt" name=c_wls> (i.e account-character-WS1)<br>
Change WL: <input type="txt" name=n_wls> (i.e account-character-WS2)<br><br>
</form>';
}
else{
if(!$_POST['admin'] | !$_POST['pass'])
die('Please fill all the fields');
$adm_name = $_POST['admin'];
$adm_pass = $_POST['pass'];
$c_wls = $_POST['c_wls'];
$n_wls = $_POST['n_wls'];
$ord = ord($adm_name);
$adm_path = $dir.'Character\\AscII'.$ord.'\\'.$adm_name.'.txt';
if(!file_exists($adm_path))
die('Character <b>'.$adm_name.'</b> isn\'t exists');
$file = file($adm_path);
for($i=0; $i<count($file); $i++)
{
if(preg_match('/account-name =/', $file[$i]))
$acc_l = $i;
elseif(preg_match('/admin-user-level =/', $file[$i]))
$adm_l = $i;
}
$acc_l = str_replace('account-name =', '', $file[$acc_l]);
$acc_l = trim($acc_l);
$ac_ord = ord($acc_l);
$adm_l = str_replace('admin-user-level =', '', $file[$adm_l]);
$adm_l = trim($adm_l);
if($adm_l != '4')
die('The character <b>'.$adm_name.'</b> isn\'t a level 4 admin.');
$ac_file = file($dir.'Account\\AscII'.$ac_ord.'\\'.$acc_l.'.txt');
for($i=0; $i<count($ac_file); $i++)
{
if(preg_match('/account-password =/', $ac_file[$i]))
$pass_l = $i;
}
$pass_l = str_replace('account-password =', '', $ac_file[$pass_l]);
$pass_l = trim($pass_l);
if($pass_l != $adm_pass)
die('Wrong password');
$glob = glob($dir.'Account\\AscII*\\*.txt');
for($a=0; $a<count($glob); $a++)
{
//-----------------------------------------------------------
// 1st Character [CHANGE]
//-----------------------------------------------------------
$file = file($glob[$a]);
for($i=0; $i<count($file); $i++)
{
if(preg_match('/'.$c_wls.'/', $file[$i]))
$line = $i;
}
$wl_line = trim($file[$line]);
$wl_line = str_replace($_POST[c_wls], $_POST[n_wls], $wl_line);
$file[$line] = $wl_line."\r\n";
$file = join('', $file);
$fopen = fopen($glob[$a], 'w');
fwrite($fopen, $file);
fclose($fopen);
//-----------------------------------------------------------
// 2nd Character [CHANGE]
//-----------------------------------------------------------
$file = file($glob[$a]);
for($i=0; $i<count($file); $i++)
{
if(preg_match('/'.$c_wls.'/', $file[$i]))
$line = $i;
}
$wl_line = trim($file[$line]);
$wl_line = str_replace($_POST[c_wls], $_POST[n_wls], $wl_line);
$file[$line] = $wl_line."\r\n";
$file = join('', $file);
$fopen = fopen($glob[$a], 'w');
fwrite($fopen, $file);
fclose($fopen);
//-----------------------------------------------------------
// 3rd Character [CHANGE]
//-----------------------------------------------------------
$file = file($glob[$a]);
for($i=0; $i<count($file); $i++)
{
if(preg_match('/'.$c_wls.'/', $file[$i]))
$line = $i;
}
$wl_line = trim($file[$line]);
$wl_line = str_replace($_POST[c_wls], $_POST[n_wls], $wl_line);
$file[$line] = $wl_line."\r\n";
$file = join('', $file);
$fopen = fopen($glob[$a], 'w');
fwrite($fopen, $file);
fclose($fopen);
//-----------------------------------------------------------
// 4th Character [CHANGE]
//-----------------------------------------------------------
$file = file($glob[$a]);
for($i=0; $i<count($file); $i++)
{
if(preg_match('/'.$c_wls.'/', $file[$i]))
$line = $i;
}
$wl_line = trim($file[$line]);
$wl_line = str_replace($_POST[c_wls], $_POST[n_wls], $wl_line);
$file[$line] = $wl_line."\r\n";
$file = join('', $file);
$fopen = fopen($glob[$a], 'w');
fwrite($fopen, $file);
fclose($fopen);
}
echo 'All the WLserver of <b>'.count($glob).'</b> accounts have been switched.';
}
?>
</body>
</html>