Skip to content

Commit

Permalink
v 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alerinos committed May 29, 2020
1 parent 9bc5683 commit be69858
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Remember to set the character encoding
May two databases have to have the same file structures
keep account, player and other tables in one database
Make a copy of the data, do not operate live. It's best to create two new bases and upload two servers there. The script says "secondBase" so be careful. MAKE A BACKUP COPY
Remember to increase the maximum number of characters in the tables player.name account.login guild.name and wherever there are names.
Use characters that are not available in the game, e.g. "-", "_", "+"

Support for
```
Expand Down Expand Up @@ -48,22 +50,8 @@ $migration->player('player', 'id', 'account', ['name', 'job', 'kingdom', 'voice'
$migration->firstBase('localhost', 'user', 'pass', 'migration_1');
$migration->secondBase('localhost', 'user', 'pass', 'migration_2');
// List of tables to migrate
// The account and player table is automatically added
$migration->add('affect', 'dwPID', ['bType', 'bApplyOn', 'lApplyValue', 'dwFlag', 'lDuration', 'lSPCost']);
$migration->add('guild', 'master', ['name', 'sp', 'master', 'level', 'exp', 'skill_point', 'skill', 'win', 'draw', 'loss', 'ladder_point', 'gold', 'dungeon_ch', 'dungeon_map', 'dungeon_cooldown', 'dungeon_start']);
$migration->add('item', 'owner_id', ['window', 'pos', 'count', 'vnum', 'bind', 'socket0', 'socket1', 'socket2', 'socket3', 'socket4', 'socket5', 'attrtype0', 'attrvalue0', 'attrtype1', 'attrvalue1', 'attrtype2', 'attrvalue2', 'attrtype3', 'attrvalue3', 'attrtype4', 'attrvalue4', 'attrtype5', 'attrvalue5', 'attrtype6', 'attrvalue6']);
$migration->add('player_gift', 'owner_id', ['date_add', 'date_get', 'status', 'from', 'reason', 'vnum', 'count', 'socket0', 'socket1', 'socket2', 'socket3', 'socket4', 'socket5', 'attrtype0', 'attrvalue0', 'attrtype1', 'attrvalue1', 'attrtype2', 'attrvalue2', 'attrtype3', 'attrvalue3', 'attrtype4', 'attrvalue4', 'attrtype5', 'attrvalue5', 'attrtype6', 'attrvalue6', 'applytype0', 'applyvalue0', 'applytype1', 'applyvalue1', 'applytype2', 'applyvalue2', 'applytype3', 'applyvalue3', 'applytype4', 'applyvalue4', 'applytype5', 'applyvalue5', 'applytype6', 'applyvalue6', 'applytype7', 'applyvalue7']);
$migration->add('player_shop', 'player_id', ['shop_vid', 'item_count', 'name', 'status', 'map_index', 'x', 'y', 'z', 'date', 'date_close', 'ip', 'gold', 'cash', 'channel', 'npc', 'npc_decoration']);
$migration->add('quest', 'dwPID', ['szName', 'szState', 'lValue']);
// Migration Process
$migration->start();
```

Add table
```
$migration->add('table name', 'player index', ['array column table'], 'OPTION raw WHERE, varable :player and :account');
```
The system does have a positive side effect. Cleans inanimate objects. (If the user deletes the character, the game engine does not delete these items)
6 changes: 2 additions & 4 deletions cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* May two databases have to have the same file structures
* keep account, player and other tables in one database
* Make a copy of the data, do not operate live. It's best to create two new bases and upload two servers there. The script says "secondBase" so be careful. MAKE A BACKUP COPY
* Remember to increase the maximum number of characters in the tables player.name account.login guild.name and wherever there are names.
* Use characters that are not available in the game, e.g. "-", "_", "+"
*/

$migration = new Migration;
Expand All @@ -20,10 +22,6 @@
$migration->charset = 'gb2312_chinese_ci';
$migration->duplicat = '_';

// Table settings
$migration->account('account', 'id', 'login', ['password', 'social_id', 'email', 'status', 'availDt', 'create_time', 'last_play', 'gold_expire', 'silver_expire', 'safebox_expire', 'autoloot_expire', 'fish_mind_expire', 'marriage_fast_expire', 'money_drop_rate_expire', 'real_name', 'coins', 'game_coins', 'web_admin', 'register_ip', 'last_ip', 'action_token', 'action_type', 'action_time', 'action_text', 'drs', 'enabled_time', 'cash']);
$migration->player('player', 'id', 'account_id', ['name', 'job', 'voice', 'dir', 'x', 'y', 'z', 'map_index', 'exit_x', 'exit_y', 'exit_map_index', 'hp', 'mp', 'stamina', 'random_hp', 'random_sp', 'playtime', 'level', 'level_step', 'st', 'ht', 'dx', 'iq', 'exp', 'gold', 'stat_point', 'skill_point', 'quickslot', 'ip', 'part_main', 'part_base', 'part_hair', 'part_sash', 'skill_group', 'skill_level', 'alignment', 'last_play', 'change_name', 'mobile', 'sub_skill_point', 'stat_reset_count', 'horse_hp', 'horse_stamina', 'horse_level', 'horse_hp_droptime', 'horse_riding', 'horse_skill_point', 'imageid', 'combat_zone_rank', 'combat_zone_points', 'extend_inven', 'gaya', 'bead', 'pz']);

// Database connection settings
$migration->firstBase('localhost', 'migration', 'migration', 'migration_1');
$migration->secondBase('localhost', 'migration', 'migration', 'migration_2');
Expand Down

0 comments on commit be69858

Please sign in to comment.