当前位置:首页>>魔兽单机>>正文
Trinity-Core单机中锁定账号,踢玩家,等世界公告
2013-05-03 12:37:33 作者:网络 来源: 浏览次数:0
摘要:Trinity-Core单机中锁定账号,踢玩家,等世界公告
下面是适合用在T端的代码。这里介绍一下说明

代码分成3个部分。分别对应锁定账号,踢玩家下线,沉默 这几个功能。。

你把代码替换到你的内核中就可以使用了

src/server/scripts/Commands/cs_ban.cpp  |  12 ++++++------
src/server/scripts/Commands/cs_misc.cpp |  26 +++++++++++++-------------
2 files changed, 19 insertions(+), 19 deletions(-)
 
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
index 1c0ffd4..1c152dd 100644
--- a/src/server/scripts/Commands/cs_ban.cpp
+++ b/src/server/scripts/Commands/cs_ban.cpp
@@ -221,15 +221,15 @@ class ban_commandscript : public CommandScript
          else if (mode == BAN_IP)
                        announce = "The IP '";
                    else
-                    announce = "Account '";
+                    announce = "Account ";  //第一部是
                      announce += nameOrIP.c_str();
-                    announce += "' was banned for ";
+                    announce += " was banned for ";
                      announce += durationStr;
-                    announce += " by the character '";
-                    announce += m_session->GetPlayerName();
-                    announce += "'. The reason is: ";
+                    announce += " by the character ";
+                    announce +=  handler->GetSession()->GetPlayerName();
+                    announce += ". The reason is: ";
                      announce += reasonStr;
-          HandleAnnounceCommand(announce.c_str());
+                    sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());//这里进行世界公告
        }
 
        return true;
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 2082db1..76f208f 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -932,12 +932,12 @@ class misc_commandscript : public CommandScript
 
        if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
        {
-          announce = "The character '";
+          announce = "The character ";   //这里是踢玩家下线进行世界公告的
            announce += playerName.c_str();
-          announce += "' was kicked by the character '";
-          announce += m_session->GetPlayerName();
-          announce += "'.";
-          HandleAnnounceCommand(announce.c_str());
+          announce += " was kicked by the character ";
+          announce += handler->GetSession()->GetPlayerName();
+          announce += ".";
+          sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());//这里进行世界公告
        }
 
        return true;
@@ -1794,8 +1794,8 @@ class misc_commandscript : public CommandScript
 
        if(!muteReason)
        {
-            PSendSysMessage("You must enter a reason of mute");
-            SetSentErrorMessage(true);
+            handler->PSendSysMessage("You must enter a reason of mute");
+            handler->SetSentErrorMessage(true);
            return false;
        }
 
@@ -1843,15 +1843,15 @@ class misc_commandscript : public CommandScript
 
        if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD))
        {
-            announce = "The character '";
+            announce = "The character ";
            announce += nameLink.c_str();
-            announce += "' was muted for ";
+            announce += " was muted for ";
            announce += notSpeakTime;
-            announce += " minutes by the character '";
-            announce += m_session->GetPlayerName();
-            announce += "'. The reason is: ";
+            announce += " minutes by the character ";
+            announce += handler->GetSession()->GetPlayerName();
+            announce += ". The reason is: ";
            announce += muteReasonStr.c_str();
-            HandleAnnounceCommand(announce.c_str());
+            sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());
        }
 
        return true;
 



相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 资源下载 | 魔兽图片 | 单机文档 | 技术攻略 | 玩家视频
备案号:蜀ICP备2024062380号-1
免责声明:本网站为热爱怀旧WOW的玩家们建立的魔兽世界资料网站,仅供交流和学习使用,非盈利和商用.如有侵权之处,请联系我们,我们会在24小时内确认删除侵权内容,谢谢合作。
Copyright © 2024 - 2024 WOWAII.COM Corporation, All Rights Reserved

机器人国度