当前位置:   article > 正文

魔兽世界60级1.12私服搭建架设教程_魔兽世界数据库1.12

魔兽世界数据库1.12

一、背景

60 魔兽经典旧世是最经典的版本,遗憾的是 60 年代时还在大学读书,穷得很,买不起点卡,后来工作了,大概 70 年代开始玩的。

多年以前,玩游戏时,一直非常期望能够自己控制角色的属性级别,得到各种装备。

多年以后,在这款纯粹的开源服务器问世后,终于如愿以偿。

直到如今,都 2020 年,魔兽世界游戏的服务端源码项目在开源界依然非常活跃。

让我们重温经典吧。

二、demo

客户端下载wow-1.12.3版本,只需要修改一处配置文件 realmlist.wtf

SET realmlist wow.whyalive.org

指向上面的服务器地址即可。

测试帐号:
test1/123
wow/123

如果你懒得 DIY 自行编译安装,可以用上面给的 demo 账号和环境,下载客户端,修改配置文件,就可以登录游戏了。

三、服务器端

下面的编译安装过程比较多,但我已经尽可能完整的整理出来。基本上没有疏漏。

1、编译服务端有版本要求

 

2、升级 cmake

  1. mkdir -p /usr/local/src/wow/
  2. cd /usr/local/src/wow/
  3. wget --no-check-certificate \
  4. https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz
  5. tar -zxvf cmake-3.5.2.tar.gz
  6. cd cmake-3.5.2
  7. ./configure --prefix=/usr/local/cmake-3.5.2
  8. make -j16
  9. make install

3、升级 GCC

  1. yum -y install glibc-devel.i686
  2. tar -jxvf gcc-4.8.2.tar.bz2
  3. cd gcc-4.8.2
  4. ./contrib/download_prerequisites
  5. mkdir build
  6. cd build
  7. ../configure --prefix=/usr/local/gcc-4.8.2
  8. make -j16
  9. make install

4、安装 boost

在 centos6.5 上用 yum 安装的 boost 版本太低,必须重新编译安装。

最好直接安装在默认路径。

  1. wget http://netcologne.dl.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2
  2. tar -jxvf boost_1_60_0.tar.bz2
  3. cd boost_1_60_0
  4. ./bootstrap.sh
  5. ./b2
  6. ./b2 install

5、编译安装

先拿到源码,
然后开始编译并安装 (必须要指定环境变量 LD_LIBRARY_PATH 为新版本 g++ 的库):

  1. cd /usr/local/src/wow/
  2. git clone https://github.com/geektcp/elf-wow.git
  3. export LD_LIBRARY_PATH=/usr/local/gcc-4.9.3/lib64/
  4. export BASE_DIR=/usr/local/wow_mangos_bot_2017.10.2
  5. mkdir -p /usr/local/src/wow/ClassicWOW/build/ &&
  6. rm -rf /usr/local/src/wow/ClassicWOW/build/* &&
  7. cd /usr/local/src/wow/ClassicWOW/build &&
  8. /usr/local/cmake-3.5.2/bin/cmake ../ \
  9. -DCMAKE_INSTALL_PREFIX=$BASE_DIR \
  10. -DCONF_DIR=$BASE_DIR/etc \
  11. -DPCH=1 \
  12. -DDEBUG=0 \
  13. -DCMAKE_C_COMPILER=/usr/local/gcc-4.9.3/bin/gcc \
  14. -DCMAKE_CXX_COMPILER=/usr/local/gcc-4.9.3/bin/g++ &&
  15. time make -j16 &&
  16. make install &&
  17. chown -R wow.wow -R $BASE_DIR

6、地图文件生成

map 文件包括 maps,mmaps,vmaps,dbc 四个部分。,每个文件夹下面有大量地图文件。

这些地图文件是从哪里来的呢?

是从客户端的安装文件里面的抽取出来的。

抽取方式,先从服务器端的源码里面找到如下目录:

ls /usr/local/src/wow/mangos-classic/contrib/extractor_binary

ad.exe

ExtractResources.sh

MoveMapGen.exe

MoveMapGen.sh

offmesh.txt

README.txt

vmap_assembler.exe

vmapExtractor.exe

将上米娜的 exe 文件都拷贝 windows 环境的 wow 客户端下,跟 wow.exe 同一级目录

然后依次直接按如下步骤运行:

1、生成 dbc 和 maps 文件

ad.exe

2、创建 vmaps 空文件夹并生成文件

md vmaps

vmap_assembler.exe Buildings vmaps

3、创建 mmpas 文件夹并生成文件,这一步可能要很久,一两个小时。

md mmaps

MoveMapGen.exe

 最后,如过不想一步一步完成,可以使用批处理 (写入到 generateMap.bat 文件中)

ad.exe

md vmaps

vmap_assembler.exe Buildings vmaps

md mmaps

MoveMapGen.exe

7、数据库初始化

wow mangos classic 经典版本的数据库数据来源于:

/usr/local/src/wow/mangos-classic/sql

另一部分存在于源码目录下:

git clone git://github.com/cmangos/classic-db.git

创建数据库账号:

grant all on *.* to mangos@'%' IDENTIFIED by 'mangos';

创建 wow 数据库:

  1. CREATE DATABASE `mangos` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  2. CREATE DATABASE `characters` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  3. CREATE DATABASE `realmd` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

然后进入源码目录下的 sql 目录:

导入对应的 sql 到对应的数据库:

git clone  

ls cmangos/mangos-classic/tree/master/sql/base

characters.sql  mangos.sql  realmd.sql

8、配置文件

mangosd.conf 的关键配置项如下:

  1. # 监听端口
  2. WorldServerPort = 8085
  3. # 监听网卡IP
  4. BindIP = "0.0.0.0"
  5. # 是否启用控制台
  6. Console.Enable = 0
  7. # 日志级别
  8. LogLevel = 1

另外还有数据库连接方式的参数:

  1. LoginDatabaseInfo = "10.10.10.10;3310;mangos;mangos;realmd"
  2. WorldDatabaseInfo = "10.10.10.10;3310;mangos;mangos;mangos"
  3. CharacterDatabaseInfo = "10.10.10.10;3310;mangos;mangos;characters"

标准可用的配置文件如下:

cat /usr/local/wow_mangos/etc/mangosd.conf |grep -v ^# |grep -v ^$ 

  1. [MangosdConf]
  2. ConfVersion=2015090801
  3. RealmID = 1
  4. DataDir = "/usr/local/wow_mangos/data/"
  5. LogsDir = "/usr/local/wow_mangos/logs/"
  6. LoginDatabaseInfo = "10.10.10.10;3310;mangos;mangos;realmd"
  7. WorldDatabaseInfo = "10.10.10.10;3310;mangos;mangos;mangos"
  8. CharacterDatabaseInfo = "10.10.10.10;3310;mangos;mangos;characters"
  9. LoginDatabaseConnections = 1
  10. WorldDatabaseConnections = 1
  11. CharacterDatabaseConnections = 1
  12. MaxPingTime = 30
  13. WorldServerPort = 8085
  14. BindIP = "0.0.0.0"
  15. SD2ErrorLogFile = "SD2Errors.log"
  16. UseProcessors = 0
  17. ProcessPriority = 1
  18. Compression = 1
  19. PlayerLimit = 100
  20. SaveRespawnTimeImmediately = 1
  21. MaxOverspeedPings = 2
  22. GridUnload = 1
  23. LoadAllGridsOnMaps = ""
  24. GridCleanUpDelay = 300000
  25. MapUpdateInterval = 100
  26. ChangeWeatherInterval = 600000
  27. PlayerSave.Interval = 900000
  28. PlayerSave.Stats.MinLevel = 0
  29. PlayerSave.Stats.SaveOnlyOnLogout = 1
  30. vmap.enableLOS = 1
  31. vmap.enableHeight = 1
  32. vmap.ignoreSpellIds = "7720"
  33. vmap.enableIndoorCheck = 1
  34. DetectPosCollision = 1
  35. TargetPosRecalculateRange = 1.5
  36. mmap.enabled = 1
  37. mmap.ignoreMapIds = ""
  38. UpdateUptimeInterval = 10
  39. MaxCoreStuckTime = 0
  40. AddonChannel = 1
  41. CleanCharacterDB = 1
  42. LogSQL = 1
  43. PidFile = ""
  44. LogLevel = 1
  45. LogTime = 0
  46. LogFile = "Server.log"
  47. LogTimestamp = 0
  48. LogFileLevel = 0
  49. LogFilter_TransportMoves = 1
  50. LogFilter_CreatureMoves = 1
  51. LogFilter_VisibilityChanges = 1
  52. LogFilter_Weather = 1
  53. LogFilter_DbStrictedCheck = 1
  54. LogFilter_Pathfinding = 1
  55. LogFilter_MapsLoading = 1
  56. LogFilter_EventAiDev = 1
  57. LogFilter_PeriodicAffects = 0
  58. LogFilter_PlayerMoves = 1
  59. LogFilter_SQLText = 1
  60. LogFilter_AIAndMovegens = 0
  61. LogFilter_PlayerStats = 0
  62. LogFilter_Damage = 0
  63. LogFilter_Combat = 0
  64. LogFilter_SpellCast = 0
  65. WorldLogFile = ""
  66. WorldLogTimestamp = 0
  67. DBErrorLogFile = "DBErrors.log"
  68. EventAIErrorLogFile = "EventAIErrors.log"
  69. CharLogFile = "Char.log"
  70. CharLogTimestamp = 0
  71. CharLogDump = 0
  72. GmLogFile = ""
  73. GmLogTimestamp = 0
  74. GmLogPerAccount = 0
  75. RaLogFile = ""
  76. LogColors = ""
  77. GameType = 1
  78. RealmZone = 1
  79. DBC.Locale = 255
  80. DeclinedNames = 0
  81. StrictPlayerNames = 0
  82. StrictCharterNames = 0
  83. StrictPetNames = 0
  84. MinPlayerName = 2
  85. MinCharterName = 2
  86. MinPetName = 2
  87. CharactersCreatingDisabled = 0
  88. CharactersPerAccount = 50
  89. CharactersPerRealm = 10
  90. SkipCinematics = 0
  91. MaxPlayerLevel = 60
  92. StartPlayerLevel = 1
  93. StartPlayerMoney = 0
  94. MaxHonorPoints = 75000
  95. StartHonorPoints = 0
  96. MinHonorKills = 15
  97. MaintenanceDay = 3
  98. InstantLogout = 1
  99. AllFlightPaths = 0
  100. AlwaysMaxSkillForLevel = 0
  101. ActivateWeather = 1
  102. CastUnstuck = 1
  103. MaxSpellCastsInChain = 20
  104. RabbitDay = 0
  105. Instance.IgnoreLevel = 0
  106. Instance.IgnoreRaid = 0
  107. Instance.ResetTimeHour = 4
  108. Instance.UnloadDelay = 1800000
  109. Quests.LowLevelHideDiff = 4
  110. Quests.HighLevelHideDiff = 7
  111. Quests.IgnoreRaid = 0
  112. Guild.EventLogRecordsCount = 100
  113. TimerBar.Fatigue.GMLevel = 4
  114. TimerBar.Fatigue.Max = 60
  115. TimerBar.Breath.GMLevel = 4
  116. TimerBar.Breath.Max = 60
  117. TimerBar.Fire.GMLevel = 4
  118. TimerBar.Fire.Max = 1
  119. MaxPrimaryTradeSkill = 2
  120. TradeSkill.GMIgnore.MaxPrimarySkillsCount = 4
  121. TradeSkill.GMIgnore.Level = 4
  122. TradeSkill.GMIgnore.Skill = 4
  123. MinPetitionSigns = 9
  124. MaxGroupXPDistance = 74
  125. MailDeliveryDelay = 3600
  126. MassMailer.SendPerTick = 10
  127. PetUnsummonAtMount = 0
  128. Event.Announce = 0
  129. BeepAtStart = 1
  130. ShowProgressBars = 0
  131. WaitAtStartupError = 0
  132. Motd = "Welcome to the Continued Massive Network Game Object Server."
  133. PlayerCommands = 1
  134. AllowTwoSide.Accounts = 0
  135. AllowTwoSide.Interaction.Chat = 0
  136. AllowTwoSide.Interaction.Channel = 0
  137. AllowTwoSide.Interaction.Group = 0
  138. AllowTwoSide.Interaction.Guild = 0
  139. AllowTwoSide.Interaction.Trade = 0
  140. AllowTwoSide.Interaction.Auction = 0
  141. AllowTwoSide.Interaction.Mail = 0
  142. AllowTwoSide.WhoList = 0
  143. AllowTwoSide.AddFriend = 0
  144. TalentsInspecting = 1
  145. ThreatRadius = 100
  146. Rate.Creature.Aggro = 1
  147. CreatureRespawnAggroDelay = 5000
  148. CreatureFamilyFleeAssistanceRadius = 30
  149. CreatureFamilyAssistanceRadius = 10
  150. CreatureFamilyAssistanceDelay = 1500
  151. CreatureFamilyFleeDelay = 7000
  152. WorldBossLevelDiff = 3
  153. Corpse.EmptyLootShow = 1
  154. Corpse.Decay.NORMAL = 300
  155. Corpse.Decay.RARE = 900
  156. Corpse.Decay.ELITE = 600
  157. Corpse.Decay.RAREELITE = 1200
  158. Corpse.Decay.WORLDBOSS = 3600
  159. Rate.Corpse.Decay.Looted = 0.0
  160. Rate.Creature.Normal.Damage = 1
  161. Rate.Creature.Elite.Elite.Damage = 1
  162. Rate.Creature.Elite.RAREELITE.Damage = 1
  163. Rate.Creature.Elite.WORLDBOSS.Damage = 1
  164. Rate.Creature.Elite.RARE.Damage = 1
  165. Rate.Creature.Normal.SpellDamage = 1
  166. Rate.Creature.Elite.Elite.SpellDamage = 1
  167. Rate.Creature.Elite.RAREELITE.SpellDamage = 1
  168. Rate.Creature.Elite.WORLDBOSS.SpellDamage = 1
  169. Rate.Creature.Elite.RARE.SpellDamage = 1
  170. Rate.Creature.Normal.HP = 1
  171. Rate.Creature.Elite.Elite.HP = 1
  172. Rate.Creature.Elite.RAREELITE.HP = 1
  173. Rate.Creature.Elite.WORLDBOSS.HP = 1
  174. Rate.Creature.Elite.RARE.HP = 1
  175. ListenRange.Say = 40
  176. ListenRange.TextEmote = 40
  177. ListenRange.Yell = 300
  178. GuidReserveSize.Creature = 100
  179. GuidReserveSize.GameObject = 100
  180. ChatFakeMessagePreventing = 0
  181. ChatStrictLinkChecking.Severity = 0
  182. ChatStrictLinkChecking.Kick = 0
  183. ChatFlood.MessageCount = 10
  184. ChatFlood.MessageDelay = 1
  185. ChatFlood.MuteTime = 10
  186. Channel.SilentlyGMJoin = 0
  187. GM.LoginState = 2
  188. GM.Visible = 2
  189. GM.AcceptTickets = 2
  190. GM.Chat = 2
  191. GM.WhisperingTo = 2
  192. GM.InGMList.Level = 3
  193. GM.InWhoList.Level = 3
  194. GM.LogTrade = 1
  195. GM.StartLevel = 1
  196. GM.LowerSecurity = 0
  197. GM.InvisibleAura = 31748
  198. Visibility.GroupMode = 0
  199. Visibility.Distance.Continents = 90
  200. Visibility.Distance.Instances = 120
  201. Visibility.Distance.BG = 180
  202. Visibility.Distance.InFlight = 100
  203. Visibility.Distance.Grey.Unit = 1
  204. Visibility.Distance.Grey.Object = 10
  205. Visibility.RelocationLowerLimit = 10
  206. Visibility.AIRelocationNotifyDelay = 1000
  207. Rate.Health = 1
  208. Rate.Mana = 1
  209. Rate.Rage.Income = 1
  210. Rate.Rage.Loss = 1
  211. Rate.Focus = 1
  212. Rate.Loyalty = 1
  213. Rate.Energy = 1
  214. Rate.Skill.Discovery = 1
  215. Rate.Drop.Item.Poor = 1
  216. Rate.Drop.Item.Normal = 1
  217. Rate.Drop.Item.Uncommon = 1
  218. Rate.Drop.Item.Rare = 1
  219. Rate.Drop.Item.Epic = 1
  220. Rate.Drop.Item.Legendary = 1
  221. Rate.Drop.Item.Artifact = 1
  222. Rate.Drop.Item.Referenced = 1
  223. Rate.Drop.Money = 1
  224. Rate.XP.Kill = 1
  225. Rate.XP.Quest = 1
  226. Rate.XP.Explore = 1
  227. Rate.Rest.InGame = 1
  228. Rate.Rest.Offline.InTavernOrCity = 1
  229. Rate.Rest.Offline.InWilderness = 1
  230. Rate.Damage.Fall = 1
  231. Rate.Auction.Time = 1
  232. Rate.Auction.Deposit = 1
  233. Rate.Auction.Cut = 1
  234. Auction.Deposit.Min = 0
  235. Rate.Honor = 1
  236. Rate.Mining.Amount = 1
  237. Rate.Mining.Next = 1
  238. Rate.Talent = 1
  239. Rate.Reputation.Gain = 1
  240. Rate.Reputation.LowLevel.Kill = 0.2
  241. Rate.Reputation.LowLevel.Quest = 1
  242. Rate.InstanceResetTime = 1
  243. SkillGain.Crafting = 1
  244. SkillGain.Defense = 1
  245. SkillGain.Gathering = 1
  246. SkillGain.Weapon = 1
  247. SkillChance.Orange = 100
  248. SkillChance.Yellow = 75
  249. SkillChance.Green = 25
  250. SkillChance.Grey = 0
  251. SkillChance.MiningSteps = 0
  252. SkillChance.SkinningSteps = 0
  253. SkillFail.Loot.Fishing = 0
  254. SkillFail.Gain.Fishing = 0
  255. SkillFail.Possible.FishingPool = 1
  256. DurabilityLossChance.Damage = 0.5
  257. DurabilityLossChance.Absorb = 0.5
  258. DurabilityLossChance.Parry = 0.05
  259. DurabilityLossChance.Block = 0.05
  260. Death.SicknessLevel = 11
  261. Death.CorpseReclaimDelay.PvP = 1
  262. Death.CorpseReclaimDelay.PvE = 1
  263. Death.Bones.World = 1
  264. Death.Bones.Battleground = 1
  265. Death.Ghost.RunSpeed.World = 1.0
  266. Death.Ghost.RunSpeed.Battleground = 1.0
  267. Battleground.CastDeserter = 1
  268. Battleground.QueueAnnouncer.Join = 0
  269. Battleground.QueueAnnouncer.Start = 0
  270. Battleground.ScoreStatistics = 0
  271. Battleground.InvitationType = 0
  272. BattleGround.PrematureFinishTimer = 300000
  273. BattleGround.PremadeGroupWaitForMatch = 0
  274. OutdoorPvp.SIEnabled = 1
  275. OutdoorPvp.EPEnabled = 1
  276. Network.Threads = 1
  277. Network.OutKBuff = -1
  278. Network.OutUBuff = 65536
  279. Network.TcpNodelay = 1
  280. Network.KickOnBadPacket = 0
  281. Console.Enable = 0
  282. Ra.Enable = 0
  283. Ra.IP = 0.0.0.0
  284. Ra.Port = 3443
  285. Ra.MinLevel = 3
  286. Ra.Secure = 1
  287. Ra.Stricted = 1
  288. SOAP.Enabled = 0
  289. SOAP.IP = 10.10.10.10
  290. SOAP.Port = 7878
  291. CharDelete.Method = 0
  292. CharDelete.MinLevel = 0
  293. CharDelete.KeepDays = 30
  294. cat /usr/local/wow_mangos/etc/realmd.conf |grep -v ^# |grep -v ^$
  295. [RealmdConf]
  296. ConfVersion=2010062001
  297. LoginDatabaseInfo = "10.10.10.10;3310;mangos;mangos;realmd"
  298. LogsDir = ""
  299. MaxPingTime = 30
  300. RealmServerPort = 3724
  301. BindIP = "0.0.0.0"
  302. PidFile = ""
  303. LogLevel = 0
  304. LogTime = 0
  305. LogFile = "Realmd.log"
  306. LogTimestamp = 0
  307. LogFileLevel = 0
  308. LogColors = ""
  309. UseProcessors = 0
  310. ProcessPriority = 1
  311. WaitAtStartupError = 0
  312. RealmsStateUpdateDelay = 20
  313. WrongPass.MaxCount = 0
  314. WrongPass.BanTime = 600
  315. WrongPass.BanType = 0

9、启动服务器

cat /usr/local/wow_mangos/bin/startup.sh

启动脚本内容如下:

  1. #!/bin/sh
  2. # usage : sh shutdown.sh
  3. # author : nagle
  4. # date : Sat Jan 21 16:10:11 CST 2017
  5. # website: https://github.com/geektcp
  6. base_dir=`dirname $0`/..
  7. cd $base_dir/bin/
  8. export LD_LIBRARY_PATH=/usr/local/gcc-4.9.3/lib64/:$base_dir/lib
  9. nohup $base_dir/bin/realmd 2>&1 >> $base_dir/logs/nohup_realmd.out &
  10. $base_dir/bin/mangosd

cat /usr/local/wow_mangos/bin/shutdown.sh

关闭脚本内容:

  1. #!/bin/sh
  2. # usage : sh shutdown.sh
  3. # author : nagle
  4. # date : Sat Jan 21 16:10:11 CST 2017
  5. # website: https://github.com/geektcp
  6. ps -ef |grep wow_mangos |grep wow|grep -v grep |grep -v local|awk '{print $2}' |xargs -t -i kill -9 {}

alais 环境变量 (方便启动,可以忽略):

cat ~/.bash_profile

  1. alias startmangos='screen -S thy -X screen su - wow -c /usr/local/wow_mangos/bin/startup.sh'
  2. alias stopmanos='screen -S thy -X screen su - wow -c /usr/local/wow_mangos/bin/shutdown.sh'

10、创建账号

如果启动 mangosd 服务端时,配置文件指定了启用控制台,那么可以在控制台输入命令:

account create nagle 123

即可创建一个帐号为 nagle,密码为 123 的帐号了。

另外通过数据库也可以创建账号,对应的 sql 语句是:

  1. SET
  2. @username = "test1",
  3. @password = "123",
  4. @email = "test@163.com",
  5. @expansion = 0, -- 0表示经典旧时, 1表示70年代,一次类推
  6. @gmlevel = 0, -- 0 = player, 1=GM, 2=Moderator, 3=Admin, 4=Console
  7. @realmid = 1;
  8. INSERT INTO account
  9. (username, sha_pass_hash, gmlevel, email, expansion, active_realm_id)
  10. VALUES (
  11. UPPER(@username),
  12. (SHA1(CONCAT(UPPER(@username),
  13. ':', UPPER (@password))) ),
  14. @gmlevel,
  15. @email,
  16. @expansion,
  17. @realmid
  18. );
  19. INSERT INTO `realmd`.`realmcharacters` (`realmid`, `acctid`) VALUES ('1', '5');

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/164747
推荐阅读
相关标签
  

闽ICP备14008679号