mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 17:59:22 +02:00
Fix when server uses another items serializer
This commit is contained in:
parent
3a6102900f
commit
7569536d56
@ -251,11 +251,13 @@ class CreateCharacter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db->hasTable('player_items') && $db->hasColumn('player_items', 'pid') && $db->hasColumn('player_items', 'sid') && $db->hasColumn('player_items', 'itemtype')) {
|
||||||
$loaded_items_to_copy = $db->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
|
$loaded_items_to_copy = $db->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
|
||||||
foreach($loaded_items_to_copy as $save_item) {
|
foreach($loaded_items_to_copy as $save_item) {
|
||||||
$blob = $db->quote($save_item['attributes']);
|
$blob = $db->quote($save_item['attributes']);
|
||||||
$db->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', $blob);");
|
$db->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', $blob);");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
global $twig;
|
global $twig;
|
||||||
$twig->display('success.html.twig', array(
|
$twig->display('success.html.twig', array(
|
||||||
|
@ -201,8 +201,7 @@ if($player->isLoaded() && !$player->isDeleted())
|
|||||||
unset($storage);
|
unset($storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config['characters']['equipment']) {
|
if($config['characters']['equipment'] && $db->hasTable('player_items') && $db->hasColumn('player_items', 'pid') && $db->hasColumn('player_items', 'sid') && $db->hasColumn('player_items', 'itemtype')) {
|
||||||
global $db;
|
|
||||||
$eq_sql = $db->query('SELECT `pid`, `itemtype` FROM player_items WHERE player_id = '.$player->getId().' AND (`pid` >= 1 and `pid` <= 10)');
|
$eq_sql = $db->query('SELECT `pid`, `itemtype` FROM player_items WHERE player_id = '.$player->getId().' AND (`pid` >= 1 and `pid` <= 10)');
|
||||||
$equipment = array();
|
$equipment = array();
|
||||||
foreach($eq_sql as $eq)
|
foreach($eq_sql as $eq)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user