-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...1-管理服务器-Manage-Server/03-维护服务器-Server-DevOps/07-数据库备份-Database-Backup/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
AWS RDS MySQL (其他数据库同理) 有两种备份方式. 一种是基于磁盘全盘备份的 Snapshot, 它记录了某个时刻数据库的全部磁盘的状态. 一种是基于 binlog 的全部历史日志, 可以从 0 恢复数据库. | ||
|
||
基于 Snapshot 的方法 | ||
|
||
优势: | ||
|
||
1. AWS 负责自动每天备份和管理 | ||
2. 一键从 Snapshot 恢复数据 | ||
3. 无需登录, 备份过程容易被自动化 | ||
|
||
缺点: | ||
|
||
1. 收费 | ||
2. 如果你的 AWS Account 不用了, 导出比较复杂, 需要分享 KMS key | ||
|
||
基于 MySQL Dump 的方法 | ||
|
||
优势: | ||
|
||
1. 备份的内容是数据库中的数据文件, 你有更多的控制 | ||
|
||
缺点: | ||
|
||
1. 需要手动执行, 不容易被自动化 | ||
|
||
|
||
基于 Snapshot 的备份和恢复 | ||
------------------------------------------------------------------------------ | ||
**备份** | ||
|
||
|
||
|
||
基于 MySQL Dump 的备份和恢复 | ||
------------------------------------------------------------------------------ | ||
|
||
参考资料: | ||
|
||
- Backup and Recovery Using MySQL Dump: https://dev.mysql.com/doc/mysql-backup-excerpt/5.7/en/using-mysqldump.html |
4 changes: 4 additions & 0 deletions
4
...urce/01-管理服务器-Manage-Server/04-客户端知识-WoW-Client-Knowledge/05-DBC-File/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DBC File | ||
============================================================================== | ||
- 在线查看 DBC 数据内容的工具: https://wow.tools/dbc/ | ||
- WOTLK 版本 DBC 文件的结构: https://wowdev.wiki/Category:DBC_WotLK |
10 changes: 10 additions & 0 deletions
10
docs/source/01-管理服务器-Manage-Server/04-客户端知识-WoW-Client-Knowledge/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _wow-client-knowledge: | ||
|
||
客户端知识 (WoW Client Knowledge) | ||
============================================================================== | ||
这部分介绍了魔兽世界客户端程序是如何工作的. | ||
|
||
目录 | ||
------------------------------------------------------------------------------ | ||
.. autotoctree:: | ||
:maxdepth: 1 |
19 changes: 19 additions & 0 deletions
19
docs/source/01-管理服务器-Manage-Server/05-数据库知识-Database-Knowledge/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
数据库知识 Database Knowledge | ||
============================================================================== | ||
|
||
|
||
以物易物的商人 | ||
------------------------------------------------------------------------------ | ||
游戏中很多商人出售物品的时候都不是直接用金币买的, 而是以物易物. 如果作为 GM 能够自定义各种以物易物的规则, 那么完全可以实现一套自定义的经济体系, 用特定的物品作为货币, 而购买特定的商品都需要用这个特定货币来交换. 我们下面来分析一下这种机制是如何实现的. | ||
|
||
我们以达拉然的附魔训练师为例. 这个附魔训练师要求你用 梦境碎片 来换取高阶的附魔配方. | ||
|
||
首先在 ``creature_template`` 表中搜索 ``entry = 32514`` 就能找到这个 NPC 的 ID. 她的 ``npcflag = 128``, 根据 `数据库文档 <https://www.azerothcore.org/wiki/creature_template#npcflag>`_ 这个 flag 表示的是她是一个 Vendor. | ||
|
||
然后在 ``npc_vendor`` 搜索 ``entry == 32514`` 列出这个 NPC 出售的物品清单. 这个表有一列叫做 ``ExtendedCost`` (详细文档请看 https://www.azerothcore.org/wiki/npc_vendor#extendedcost) 如果这个是 0 则表示该物品是一个普通的用金币购买的物品, 反之则是以物换物. 而这个 ``ExtendedCost`` 对应的是一个规则的 ID. 这个规则就定义了你需要什么物品, 可以是普通物品, 竞技场点数, 荣誉点数等. 我们以 ``item = 37339`` 为例, 这是一个 附魔武器 - 巨人杀手 的配方, 需要 10 个梦境碎片, 对应的 ``ExtendedCost = 2554``. | ||
|
||
在游戏客户端中的 ``.MPQ`` 数据包中用工具解压后能看到很多 ``.dbc`` 文件. 这些文件是游戏的数据文件, 客户端有一份, 服务端也有一份. 一些计算都发生在客户端, 不过服务端会跟客户端用 MD5 指纹进行验证, 确保这个文件没有被窜改. 而 `ItemExtendedCost.dbc <https://wowdev.wiki/DB/ItemExtendedCost>`_ 文件就储存了这些信息. 你自己解压一下, 找到 ID = 2554 的一栏, 就能看到它需要 10 个 梦境碎片 (ItemId = 34052) 了. | ||
|
||
AC 中有一个特殊的表 ``itemextendedcost_dbc`` 官方文档里没有提, 但是存在于数据库中. 目测是用来在不修改游戏 .dbc 文件的情况下定义额外的 ExtendedCost 而设计的. 2022-09-08 的时候我实验了, 自己定义了一条记录, 但是没有效果. **结论就是现在做不到用数据库的方式自定义以物换物, 用 Lua 应该是可以的** | ||
|
||
AC 还有一篇文档 https://www.azerothcore.org/wiki/how-to-import-dbc-data-in-db 介绍了如何修改 DBC 文件并将数据导入到数据库, 但我还没有尝试. |