If you want change your TFS to TFS 1.0 you must change many things in database (add missing fields in tables etc.) and you must move current skills of players from `player_skills` to fields in `players` (like skill_sword, skill_sword_tries, ...). I made that script for friend who had problem with that.
Paste it in new .php file, edit config of database and then open that file in web browser:
Paste it in new .php file, edit config of database and then open that file in web browser:
PHP:
<?php
// EDIT: theforgottenserver (and maybe 127.0.0.1)
$dsn = 'mysql:dbname=theforgottenserver;host=127.0.0.1';
// EDIT database username and password
$user = 'databaseUsername';
$password = 'databasePassword';
try
{
$SQL = new PDO($dsn, $user, $password);
}
catch (PDOException $e)
{
echo 'Connection failed: ' . $e->getMessage();
exit;
}
$skillNames = array('fist', 'club', 'sword', 'axe', 'dist', 'shielding', 'fishing');
$player_skills = $SQL->query('SELECT * FROM `player_skills`')->fetchAll();
foreach($player_skills as $skill)
{
$SQL->query('UPDATE `players` SET `skill_' . $skillNames[$skill['skillid']] . '` = ' . $skill['value'] . ', `skill_' . $skillNames[$skill['skillid']] . '_tries` = ' . $skill['count'] . ' WHERE `id` = ' . $skill['player_id']);
}
echo 'Moved ' . count($player_skills) . ' skills from `player_skills` to `players`';