魔兽世界60级1.12私服搭建架设教程

服务器 0

一、背景

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

mkdir -p /usr/local/src/wow/cd /usr/local/src/wow/wget --no-check-certificate /https://cmake.org/files/v3.5/cmake-3.5.2.tar.gztar -zxvf cmake-3.5.2.tar.gzcd cmake-3.5.2./configure --prefix=/usr/local/cmake-3.5.2make -j16make install

3、升级 GCC

yum -y install glibc-devel.i686tar -jxvf gcc-4.8.2.tar.bz2cd gcc-4.8.2./contrib/download_prerequisitesmkdir buildcd build../configure --prefix=/usr/local/gcc-4.8.2make -j16make install

4、安装 boost

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

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

wget http://netcologne.dl.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2tar -jxvf boost_1_60_0.tar.bz2cd boost_1_60_0./bootstrap.sh./b2./b2 install

5、编译安装

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

cd /usr/local/src/wow/git clone https://github.com/geektcp/elf-wow.gitexport LD_LIBRARY_PATH=/usr/local/gcc-4.9.3/lib64/export BASE_DIR=/usr/local/wow_mangos_bot_2017.10.2mkdir -p /usr/local/src/wow/ClassicWOW/build/  &&rm -rf /usr/local/src/wow/ClassicWOW/build/*  &&cd /usr/local/src/wow/ClassicWOW/build &&/usr/local/cmake-3.5.2/bin/cmake ../ /-DCMAKE_INSTALL_PREFIX=$BASE_DIR  /-DCONF_DIR=$BASE_DIR/etc /-DPCH=1 /-DDEBUG=0 /-DCMAKE_C_COMPILER=/usr/local/gcc-4.9.3/bin/gcc /-DCMAKE_CXX_COMPILER=/usr/local/gcc-4.9.3/bin/g++ &&time make -j16 &&make install &&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 数据库:

CREATE DATABASE `mangos` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;CREATE DATABASE `characters` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;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 的关键配置项如下:

# 监听端口WorldServerPort = 8085# 监听网卡IPBindIP = "0.0.0.0"# 是否启用控制台Console.Enable = 0# 日志级别LogLevel = 1

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

LoginDatabaseInfo     = "10.10.10.10;3310;mangos;mangos;realmd"WorldDatabaseInfo     = "10.10.10.10;3310;mangos;mangos;mangos"CharacterDatabaseInfo = "10.10.10.10;3310;mangos;mangos;characters"

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

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

[MangosdConf]ConfVersion=2015090801RealmID = 1DataDir = "/usr/local/wow_mangos/data/"LogsDir = "/usr/local/wow_mangos/logs/"LoginDatabaseInfo     = "10.10.10.10;3310;mangos;mangos;realmd"WorldDatabaseInfo     = "10.10.10.10;3310;mangos;mangos;mangos"CharacterDatabaseInfo = "10.10.10.10;3310;mangos;mangos;characters"LoginDatabaseConnections = 1WorldDatabaseConnections = 1CharacterDatabaseConnections = 1MaxPingTime = 30WorldServerPort = 8085BindIP = "0.0.0.0"SD2ErrorLogFile = "SD2Errors.log"UseProcessors = 0ProcessPriority = 1Compression = 1PlayerLimit = 100SaveRespawnTimeImmediately = 1MaxOverspeedPings = 2GridUnload = 1LoadAllGridsOnMaps = ""GridCleanUpDelay = 300000MapUpdateInterval = 100ChangeWeatherInterval = 600000PlayerSave.Interval = 900000PlayerSave.Stats.MinLevel = 0PlayerSave.Stats.SaveOnlyOnLogout = 1vmap.enableLOS = 1vmap.enableHeight = 1vmap.ignoreSpellIds = "7720"vmap.enableIndoorCheck = 1DetectPosCollision = 1TargetPosRecalculateRange = 1.5mmap.enabled = 1mmap.ignoreMapIds = ""UpdateUptimeInterval = 10MaxCoreStuckTime = 0AddonChannel = 1CleanCharacterDB = 1LogSQL = 1PidFile = ""LogLevel = 1LogTime = 0LogFile = "Server.log"LogTimestamp = 0LogFileLevel = 0LogFilter_TransportMoves = 1LogFilter_CreatureMoves = 1LogFilter_VisibilityChanges = 1LogFilter_Weather = 1LogFilter_DbStrictedCheck = 1LogFilter_Pathfinding = 1LogFilter_MapsLoading = 1LogFilter_EventAiDev = 1LogFilter_PeriodicAffects = 0LogFilter_PlayerMoves = 1LogFilter_SQLText = 1LogFilter_AIAndMovegens = 0LogFilter_PlayerStats = 0LogFilter_Damage = 0LogFilter_Combat = 0LogFilter_SpellCast = 0WorldLogFile = ""WorldLogTimestamp = 0DBErrorLogFile = "DBErrors.log"EventAIErrorLogFile = "EventAIErrors.log"CharLogFile = "Char.log"CharLogTimestamp = 0CharLogDump = 0GmLogFile = ""GmLogTimestamp = 0GmLogPerAccount = 0RaLogFile = ""LogColors = ""GameType = 1RealmZone = 1DBC.Locale = 255DeclinedNames = 0StrictPlayerNames = 0StrictCharterNames = 0StrictPetNames = 0MinPlayerName = 2MinCharterName = 2MinPetName = 2CharactersCreatingDisabled = 0CharactersPerAccount = 50CharactersPerRealm = 10SkipCinematics = 0MaxPlayerLevel = 60StartPlayerLevel = 1StartPlayerMoney = 0MaxHonorPoints = 75000StartHonorPoints = 0MinHonorKills = 15MaintenanceDay = 3InstantLogout = 1AllFlightPaths = 0AlwaysMaxSkillForLevel = 0ActivateWeather = 1CastUnstuck = 1MaxSpellCastsInChain = 20RabbitDay = 0Instance.IgnoreLevel = 0Instance.IgnoreRaid = 0Instance.ResetTimeHour = 4Instance.UnloadDelay = 1800000Quests.LowLevelHideDiff = 4Quests.HighLevelHideDiff = 7Quests.IgnoreRaid = 0Guild.EventLogRecordsCount = 100TimerBar.Fatigue.GMLevel = 4TimerBar.Fatigue.Max = 60TimerBar.Breath.GMLevel = 4TimerBar.Breath.Max = 60TimerBar.Fire.GMLevel = 4TimerBar.Fire.Max = 1MaxPrimaryTradeSkill = 2TradeSkill.GMIgnore.MaxPrimarySkillsCount = 4TradeSkill.GMIgnore.Level = 4TradeSkill.GMIgnore.Skill = 4MinPetitionSigns = 9MaxGroupXPDistance = 74MailDeliveryDelay = 3600MassMailer.SendPerTick = 10PetUnsummonAtMount = 0Event.Announce = 0BeepAtStart = 1ShowProgressBars = 0WaitAtStartupError = 0Motd = "Welcome to the Continued Massive Network Game Object Server."PlayerCommands = 1AllowTwoSide.Accounts = 0AllowTwoSide.Interaction.Chat = 0AllowTwoSide.Interaction.Channel = 0AllowTwoSide.Interaction.Group = 0AllowTwoSide.Interaction.Guild = 0AllowTwoSide.Interaction.Trade = 0AllowTwoSide.Interaction.Auction = 0AllowTwoSide.Interaction.Mail = 0AllowTwoSide.WhoList = 0AllowTwoSide.AddFriend = 0TalentsInspecting = 1ThreatRadius = 100Rate.Creature.Aggro = 1CreatureRespawnAggroDelay = 5000CreatureFamilyFleeAssistanceRadius = 30CreatureFamilyAssistanceRadius = 10CreatureFamilyAssistanceDelay = 1500CreatureFamilyFleeDelay = 7000WorldBossLevelDiff = 3Corpse.EmptyLootShow = 1Corpse.Decay.NORMAL = 300Corpse.Decay.RARE = 900Corpse.Decay.ELITE = 600Corpse.Decay.RAREELITE = 1200Corpse.Decay.WORLDBOSS = 3600Rate.Corpse.Decay.Looted = 0.0Rate.Creature.Normal.Damage = 1Rate.Creature.Elite.Elite.Damage = 1Rate.Creature.Elite.RAREELITE.Damage = 1Rate.Creature.Elite.WORLDBOSS.Damage = 1Rate.Creature.Elite.RARE.Damage = 1Rate.Creature.Normal.SpellDamage = 1Rate.Creature.Elite.Elite.SpellDamage = 1Rate.Creature.Elite.RAREELITE.SpellDamage = 1Rate.Creature.Elite.WORLDBOSS.SpellDamage = 1Rate.Creature.Elite.RARE.SpellDamage = 1Rate.Creature.Normal.HP = 1Rate.Creature.Elite.Elite.HP = 1Rate.Creature.Elite.RAREELITE.HP = 1Rate.Creature.Elite.WORLDBOSS.HP = 1Rate.Creature.Elite.RARE.HP = 1ListenRange.Say = 40ListenRange.TextEmote = 40ListenRange.Yell = 300GuidReserveSize.Creature = 100GuidReserveSize.GameObject = 100ChatFakeMessagePreventing = 0ChatStrictLinkChecking.Severity = 0ChatStrictLinkChecking.Kick = 0ChatFlood.MessageCount = 10ChatFlood.MessageDelay = 1ChatFlood.MuteTime = 10Channel.SilentlyGMJoin = 0GM.LoginState            = 2GM.Visible               = 2GM.AcceptTickets         = 2GM.Chat                  = 2GM.WhisperingTo          = 2GM.InGMList.Level        = 3GM.InWhoList.Level       = 3GM.LogTrade              = 1GM.StartLevel            = 1GM.LowerSecurity         = 0GM.InvisibleAura         = 31748Visibility.GroupMode = 0Visibility.Distance.Continents    = 90Visibility.Distance.Instances     = 120Visibility.Distance.BG            = 180Visibility.Distance.InFlight      = 100Visibility.Distance.Grey.Unit   = 1Visibility.Distance.Grey.Object = 10Visibility.RelocationLowerLimit    = 10Visibility.AIRelocationNotifyDelay = 1000Rate.Health = 1Rate.Mana = 1Rate.Rage.Income = 1Rate.Rage.Loss = 1Rate.Focus = 1Rate.Loyalty = 1Rate.Energy = 1Rate.Skill.Discovery = 1Rate.Drop.Item.Poor = 1Rate.Drop.Item.Normal = 1Rate.Drop.Item.Uncommon = 1Rate.Drop.Item.Rare = 1Rate.Drop.Item.Epic = 1Rate.Drop.Item.Legendary = 1Rate.Drop.Item.Artifact = 1Rate.Drop.Item.Referenced = 1Rate.Drop.Money = 1Rate.XP.Kill    = 1Rate.XP.Quest   = 1Rate.XP.Explore = 1Rate.Rest.InGame = 1Rate.Rest.Offline.InTavernOrCity = 1Rate.Rest.Offline.InWilderness = 1Rate.Damage.Fall = 1Rate.Auction.Time = 1Rate.Auction.Deposit = 1Rate.Auction.Cut = 1Auction.Deposit.Min = 0Rate.Honor = 1Rate.Mining.Amount = 1Rate.Mining.Next   = 1Rate.Talent = 1Rate.Reputation.Gain = 1Rate.Reputation.LowLevel.Kill    = 0.2Rate.Reputation.LowLevel.Quest   = 1Rate.InstanceResetTime = 1SkillGain.Crafting = 1SkillGain.Defense = 1SkillGain.Gathering = 1SkillGain.Weapon = 1SkillChance.Orange = 100SkillChance.Yellow = 75SkillChance.Green  = 25SkillChance.Grey   = 0SkillChance.MiningSteps   = 0SkillChance.SkinningSteps = 0SkillFail.Loot.Fishing = 0SkillFail.Gain.Fishing = 0SkillFail.Possible.FishingPool = 1DurabilityLossChance.Damage = 0.5DurabilityLossChance.Absorb = 0.5DurabilityLossChance.Parry  = 0.05DurabilityLossChance.Block  = 0.05Death.SicknessLevel = 11Death.CorpseReclaimDelay.PvP = 1Death.CorpseReclaimDelay.PvE = 1Death.Bones.World = 1Death.Bones.Battleground = 1Death.Ghost.RunSpeed.World = 1.0Death.Ghost.RunSpeed.Battleground = 1.0Battleground.CastDeserter = 1Battleground.QueueAnnouncer.Join = 0Battleground.QueueAnnouncer.Start = 0Battleground.ScoreStatistics = 0Battleground.InvitationType = 0BattleGround.PrematureFinishTimer = 300000BattleGround.PremadeGroupWaitForMatch = 0OutdoorPvp.SIEnabled = 1OutdoorPvp.EPEnabled = 1Network.Threads = 1Network.OutKBuff = -1Network.OutUBuff = 65536Network.TcpNodelay = 1Network.KickOnBadPacket = 0Console.Enable = 0Ra.Enable = 0Ra.IP = 0.0.0.0Ra.Port = 3443Ra.MinLevel = 3Ra.Secure = 1Ra.Stricted = 1SOAP.Enabled = 0SOAP.IP = 10.10.10.10SOAP.Port = 7878CharDelete.Method = 0CharDelete.MinLevel = 0CharDelete.KeepDays = 30  cat /usr/local/wow_mangos/etc/realmd.conf |grep -v ^# |grep -v ^$ [RealmdConf]ConfVersion=2010062001LoginDatabaseInfo = "10.10.10.10;3310;mangos;mangos;realmd"LogsDir = ""MaxPingTime = 30RealmServerPort = 3724BindIP = "0.0.0.0"PidFile = ""LogLevel = 0LogTime = 0LogFile = "Realmd.log"LogTimestamp = 0LogFileLevel = 0LogColors = ""UseProcessors = 0ProcessPriority = 1WaitAtStartupError = 0RealmsStateUpdateDelay = 20WrongPass.MaxCount = 0WrongPass.BanTime = 600WrongPass.BanType = 0

9、启动服务器

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

启动脚本内容如下:

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

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

关闭脚本内容:

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

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

cat ~/.bash_profile

alias startmangos='screen -S thy -X screen su - wow -c /usr/local/wow_mangos/bin/startup.sh'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 语句是:

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

也许您对下面的内容还感兴趣: