当前位置:首页>>魔兽单机>>正文
M端2.4.3tbc版本封锁账号的世界公告C++代码
2013-03-29 22:28:47 作者:fiver 来源: 浏览次数:0
摘要:M端2.4.3tbc版本封锁账号的世界公告C++代码
 diff -Nuar oregoncore-current/src/game/Level2.cpp oregoncore-pq/src/game/Level2.cpp
--- oregoncore-current/src/game/Level2.cpp 2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/Level2.cpp 2011-01-01 10:10:04.000000000 -0500
@@ -59,6 +59,10 @@
 //mute player for some times
 bool ChatHandler::HandleMuteCommand(const char* args)
 {
+
+    std::string announce;
+    std::string mutesecname;
+
     if (!*args)
         return false;
 
@@ -75,7 +79,7 @@
     char *mutereason = strtok(NULL, "");
     std::string mutereasonstr;
     if (!mutereason)
-        mutereasonstr = "No reason.";
+        mutereasonstr = "TOS Infraction";
     else
         mutereasonstr = mutereason;
 
@@ -132,6 +136,28 @@
 
     PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime, mutereasonstr.c_str());
 
+    if (sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
+    {
+        if ( m_session->GetSecurity() == 1 )
+            mutesecname = "GameMaster";
+        if ( m_session->GetSecurity() == 2 )
+            mutesecname = "Moderator";
+        if ( m_session->GetSecurity() == 3 )
+            mutesecname = "Administrator";
+        if ( m_session->GetSecurity() == 4 )
+            mutesecname = "System";
+
+        announce = "The character '";
+        announce += charname;
+        announce += "' was muted for ";
+        announce += timetonotspeak;
+        announce += " minutes by the ";
+        announce += mutesecname;
+        announce += ". The reason is: ";
+        announce += mutereason;
+        HandleAnnounceCommand(announce.c_str());
+    }
+
     return true;
 }
 
@@ -1859,10 +1885,14 @@
 //kick player
 bool ChatHandler::HandleKickPlayerCommand(const char *args)
 {
+
+    std::string announce;
+    std::string kicksecname;
+
     const char* kickName = strtok((char*)args, " ");
     char* kickReason = strtok(NULL, " ");
-    std::string reason = "No Reason";
-    std::string kicker = "Console";
+    std::string reason = "TOS Infraction";
+    std::string kicker = "System";
     if (kickReason)
         reason = kickReason;
     if (m_session)
@@ -1887,7 +1917,21 @@
 
         if (sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
         {
-            sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str());
+            if ( m_session->GetSecurity() == 1 )
+                kicksecname = "GameMaster";
+            if ( m_session->GetSecurity() == 2 )
+                kicksecname = "Moderator";
+            if ( m_session->GetSecurity() == 3 )
+                kicksecname = "Administrator";   
+            if ( m_session->GetSecurity() == 4 )
+                kicksecname = "System";
+
+            announce = "The character '";
+            announce += player->GetName();
+            announce += "' was kicked by the ";
+            announce += kicksecname;
+            announce += ".";
+            HandleAnnounceCommand(announce.c_str());
         }
         else
         {
@@ -1932,8 +1976,20 @@
         {
             if (sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
             {
-
-                sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str());
+                if ( m_session->GetSecurity() == 1 )
+                    kicksecname = "GameMaster";
+                if ( m_session->GetSecurity() == 2 )
+                    kicksecname = "Moderator";
+                if ( m_session->GetSecurity() == 3 )
+                    kicksecname = "Administrator";
+                if ( m_session->GetSecurity() == 4 )
+                    kicksecname = "System";
+                announce = "The character '";
+                announce += player->GetName();
+                announce += "' was kicked by the ";
+                announce += kicksecname;
+                announce += ".";            
+                HandleAnnounceCommand(announce.c_str());
             }
             else
             {
diff -Nuar oregoncore-current/src/game/Level3.cpp oregoncore-pq/src/game/Level3.cpp
--- oregoncore-current/src/game/Level3.cpp 2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/Level3.cpp 2011-01-01 10:10:04.000000000 -0500
@@ -5562,6 +5562,9 @@
     if (!*args)
         return false;
 
+    std::string announce;
+    std::string bansecname;
+
     char* cnameOrIP = strtok ((char*)args, " ");
     if (!cnameOrIP)
         return false;
@@ -5627,6 +5630,33 @@
             return false;
     }
 
+    if (sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
+    {
+        if ( m_session->GetSecurity() == 1 )
+            bansecname = "GameMaster";
+        if ( m_session->GetSecurity() == 2 )
+            bansecname = "Moderator";
+        if ( m_session->GetSecurity() == 3 )
+            bansecname = "Administrator";
+        if ( m_session->GetSecurity() == 4 )
+            bansecname = "System";
+
+        if (mode == BAN_CHARACTER)
+            announce = "The character '";
+        else if (mode == BAN_IP)
+            announce = "The IP '";
+        else
+            announce = "Account '";
+        announce += nameOrIP.c_str();
+        announce += "' was banned for ";
+        announce += duration;
+        announce += " by the ";
+        announce += bansecname;
+        announce += ". The reason is: ";
+        announce += reason;
+        HandleAnnounceCommand(announce.c_str());
+    }
+
     return true;
 }
 


相关报道:

[关闭] [返回顶部]


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

机器人国度