博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
T端带数据库查询的假人系统
阅读量:5229 次
发布时间:2019-06-14

本文共 5867 字,大约阅读时间需要 19 分钟。

commit 87f8ac21ca6d2d086984dfc39b1869dc51ecd36fAuthor: Vitasic 
Date: Tue Jun 26 15:43:38 2012 +0400 Add Fake Playersdiff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cppindex 966eae5..3f4e3fb 100755--- a/src/server/game/Handlers/ChatHandler.cpp+++ b/src/server/game/Handlers/ChatHandler.cpp@@ -274,8 +274,17 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) bool receiverIsPlayer = AccountMgr::IsPlayerAccount(receiver ? receiver->GetSession()->GetSecurity() : SEC_PLAYER); if (!receiver || (senderIsPlayer && !receiverIsPlayer && !receiver->isAcceptWhispers() && !receiver->IsInWhisperWhiteList(sender->GetGUID()))) {+ // If Fake WHO List system on then show player DND + if (sWorld->getBoolConfig(CONFIG_FAKE_WHO_LIST)) + { + sWorld->SendWorldText(LANG_NOT_WHISPER); + return; + } + else + { SendPlayerNotFoundNotice(to); return;+ } } if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && senderIsPlayer && receiverIsPlayer)diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cppindex 11f0857..dfc4b6a 100755--- a/src/server/game/Handlers/MiscHandler.cpp+++ b/src/server/game/Handlers/MiscHandler.cpp@@ -356,8 +356,40 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) ++displaycount; }-- data.put(0, displaycount); // insert right count, count displayed+ + if (sWorld->getBoolConfig(CONFIG_FAKE_WHO_LIST) && displaycount < 49) + { + // Fake players on WHO LIST 0, 1, 2, 3, 4, 5 6 + QueryResult result = CharacterDatabase.Query("SELECT guid,name,race,class,level,zone,gender FROM characters WHERE online>1 AND level > 3"); + if (result) + { + do + { + Field *fields = result->Fetch(); + + std::string pname = fields[1].GetString(); // player name + std::string gname; // guild name + uint32 lvl = fields[4].GetUInt32(); // player level + uint32 class_ = fields[3].GetUInt32(); // player class + uint32 race = fields[2].GetUInt32(); // player race + uint32 pzoneid = fields[5].GetUInt32(); // player zone id + uint8 gender = fields[6].GetUInt8(); // player gender + + data << pname; // player name + data << gname; // guild name + data << uint32(lvl); // player level + data << uint32(class_); // player class + data << uint32(race); // player race + data << uint8(gender); // player gender + data << uint32(pzoneid); // player zone id + + if ((++matchcount) == 49) + break; + } while (result->NextRow()); + } + } + + data.put(0, matchcount); // insert right count, count displayed data.put(4, matchcount); // insert right count, count of matches SendPacket(&data);diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cppindex 8a6b4cd..518effd 100755--- a/src/server/game/World/World.cpp+++ b/src/server/game/World/World.cpp@@ -667,6 +667,7 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = ConfigMgr::GetBoolDefault("AllowTwoSide.WhoList", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = ConfigMgr::GetBoolDefault("AllowTwoSide.AddFriend", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = ConfigMgr::GetBoolDefault("AllowTwoSide.trade", false);+ m_bool_configs[CONFIG_FAKE_WHO_LIST] = ConfigMgr::GetBoolDefault("Fake.WHO.List", false); m_int_configs[CONFIG_STRICT_PLAYER_NAMES] = ConfigMgr::GetIntDefault ("StrictPlayerNames", 0); m_int_configs[CONFIG_STRICT_CHARTER_NAMES] = ConfigMgr::GetIntDefault ("StrictCharterNames", 0); m_int_configs[CONFIG_STRICT_PET_NAMES] = ConfigMgr::GetIntDefault ("StrictPetNames", 0);diff --git a/src/server/game/World/World.h b/src/server/game/World/World.hindex f566ece..0d430bf 100755--- a/src/server/game/World/World.h+++ b/src/server/game/World/World.h@@ -100,6 +100,7 @@ enum WorldBoolConfigs CONFIG_ALLOW_TWO_SIDE_WHO_LIST, CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND, CONFIG_ALLOW_TWO_SIDE_TRADE,+ CONFIG_FAKE_WHO_LIST, CONFIG_ALL_TAXI_PATHS, CONFIG_INSTANT_TAXI, CONFIG_INSTANCE_IGNORE_LEVEL,diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.distindex 9f0ad53..40a04a1 100644--- a/src/server/worldserver/worldserver.conf.dist+++ b/src/server/worldserver/worldserver.conf.dist@@ -1601,6 +1601,14 @@ AllowTwoSide.Trade = 0 TalentsInspecting = 1 +# Fake.WHO.List +# Add fake players to fill in WHO LIST (who is online list, "O" button) if there is less then +# 49 real players online (need to set online=2 in character database in order to work) +# Default: 0 (disabled) +# 1 (enabled) ++Fake.Who.List = 0 + # ###################################################################################################

 

转载于:https://www.cnblogs.com/needly/p/3753134.html

你可能感兴趣的文章
Django 相关
查看>>
git init
查看>>
训练记录
查看>>
IList和DataSet性能差别 转自 http://blog.csdn.net/ilovemsdn/article/details/2954335
查看>>
Hive教程(1)
查看>>
第16周总结
查看>>
C#编程时应注意的性能处理
查看>>
Fragment
查看>>
比较安全的获取站点更目录
查看>>
苹果开发者账号那些事儿(二)
查看>>
使用C#交互快速生成代码!
查看>>
UVA11374 Airport Express
查看>>
P1373 小a和uim之大逃离 四维dp,维护差值
查看>>
NOIP2015 运输计划 树上差分+树剖
查看>>
P3950 部落冲突 树链剖分
查看>>
读书_2019年
查看>>
读书汇总贴
查看>>
微信小程序 movable-view组件应用:可拖动悬浮框_返回首页
查看>>
MPT树详解
查看>>
空间分析开源库GEOS
查看>>