Hello, is possible to make via parsed .txt a copy of the Account and/or character?
Example:
I have a Blood Elf paladin with 3k achievement points, full epic gear, 50 mounts etc… I want this character on my server too! So i go sniff on retail or any other server, parse the sniff and via sql make the copy of the character…
Upgrade of the software:
It could also update an existing character
I don’t know if a software like that already exist, but I think it’s a great idea!
[ol][li]Take a look at AskMrRobot addon (especially the part where they get the current equipped gear, talents, etc)[/li]
[li]How to import (via PHP website)[/li]
Insert Character Entry (characters table)
[li]Insert Inventory Entries with ID of inserted character[/li]
[li]Do same (as in part 2.2) for all others tables[/li]
[/ol]
[li]So you are basically done with importing, if you've successfully completed steps in [B]Part 2[/B][/li]
And a bit of pseudo code (PHP) how you can implement such thing:
<?php
require_once ('../vendor/autoloader.php');
use /Classes/Entities/Character as Character;
use /Classes/Entities/Inventory as Inventory;
use /Classes/Entities/Talent as Talent;
use /Classes/Core/Database as Database;
$database = new Database('127.0.0.1', 'username', 'password');
$charactersTable = $database->useCharactersTable();
try {
$fileHandler = fopen('path/to/the/character/dump.txt');
$character = new Character($fileHandler);
$parsedCharacter = $character->parse();
$talents = new Talent($parsedCharacter->getTalents());
$gear = new Inventory($parsedCharacter->getGear());
$characterID = $charactersTable->createEntry($character->getCharacterData());
$charactersTable->insertTalents($characterID, $talents);
$charactersTable->insertGear($characterID, $gear);
// Do other inserting stuff.....
fclose($fileHandler);
unlink('path/to/the/character/dump.txt');
} catch (Exception $e) {
echo "Encountered error while tried to process character dump";
}